Github搜索语法-信息搜集指南
2019-01-31 09:00:00 Author: payloads.online(查看原文) 阅读量:161 收藏

您可以在所有公共GitHub存储库中搜索以下类型的信息,以及您有权访问的所有私有GitHub存储库:

参考:

您可以使用搜索页面或高级搜索页面搜索GitHub 。

您可以使用>>=<,和<=搜索是大于,大于或等于,小于和小于或等于另一个值的值。

搜索仓库

Query Example
>_n_ cats stars:>1000 匹配关键字”cats”且star大于1000的仓库
>=_n_ cats topics:>=5 匹配关键字”cats”且标签数量大于等于5的仓库
<_n_ cats size:<10000 匹配关键字”cats”且文件小于10KB的仓库
<=_n_ cats stars:<=50 匹配关键字”cats”且star小于等于50的仓库
_n_..* [cats stars:10..](https://github.com/search?utf8=%E2%9C%93&q=cats+stars%3A10..&type=Repositories) 匹配关键字”cats”且star大于等于10的仓库
*.._n_ [cats stars:..10](https://github.com/search?utf8=%E2%9C%93&q=cats+stars%3A%22..10%22&type=Repositories) 匹配关键字”cats”且star小于等于10的仓库
n..n cats stars:10..50 匹配关键字”cats”且star大于10且小于50的仓库
Query Example
_n_..* [cats stars:10..](https://github.com/search?utf8=%E2%9C%93&q=cats+stars%3A10..&type=Repositories) 匹配关键字”cats”且star大于等于10的仓库
*.._n_ [cats stars:..10](https://github.com/search?utf8=%E2%9C%93&q=cats+stars%3A%22..10%22&type=Repositories) 匹配关键字”cats”且star小于等于10的仓库
n..n cats stars:10..50 匹配关键字”cats”且star大于10且小于50的仓库

以下搜索语法与上面差不多,故此不贴表格了。

搜索代码

注意事项

  • 只能搜索小于384 KB的文件。
  • 只能搜索少于500,000个文件的存储库。
  • 登录的用户可以搜索所有公共存储库。
  • filename搜索外,搜索源代码时必须至少包含一个搜索词。例如,搜索language:javascript无效,而是这样:amazing language:javascript
  • 搜索结果最多可以显示来自同一文件的两个片段,但文件中可能会有更多结果。
  • 您不能将以下通配符用作搜索查询的一部分:. , : ; / \ ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [ ]。搜索将忽略这些符号。

日期条件

cats pushed:<2012-07-05 搜索在2012年07月05日前push代码,且cats作为关键字
cats pushed:2016-04-30..2016-07-04 日期区间
cats created:>=2017-04-01  创建时间

逻辑运算

AND、OR、NOT

排除运算

cats pushed:<2012-07-05 -language:java 搜索在2012年07月05日前push代码,且cats作为关键字,排除java语言仓库。

包含搜索

cats in:file 搜索文件中包含cats的代码
cats in:path 搜索路径中包含cats的代码
cats in:path,file 搜索路径、文件中包含cats的代码
console path:app/public language:javascript  搜索关键字console,且语言为javascript,在app/public下的代码

主体搜索

user:USERNAME_ _用户名搜索
org:ORGNAME 组织搜索
repo:USERNAME/REPOSITORY 指定仓库搜索

文件大小

size:>1000 搜索大小大于1KB的文件

文件名称

filename:config.php language:php 搜索文件名为config.php,且语言为php的代码

例如搜索Java项目配置文件:mail filename:.properties

image.png

扩展名

extension:EXTENSION 指定扩展名搜索

例如:extension:properties jdbc

仅供技术研究!

自动化工具

https://github.com/UnkL4b/GitMiner

image.png

python3 gitminer-v2.0.py -c cookie.txt -q 'extension:properties jdbc' -r 'password(.*)' -m passwords

image.png
image.png


文章来源: https://payloads.online/archivers/2019-01-31/2
如有侵权请联系:admin#unsafe.sh