vlambda博客
学习文章列表

github敏感信息泄露.docx

01

google语法

Github之邮件配置信息泄露
  1. site:Github.com smtp

  2. site:Github.com smtp @qq.com

  3. site:Github.com smtp @126.com

  4. site:Github.com smtp @163.com

  5. site:Github.com smtp @sina.com.cn

  6. site:Github.com smtp password

  7. site:Github.com String password smtp


Github之数据库信息泄露

  1. site:Github.com sa password

  2. site:Github.com root password

  3. site:Github.com User ID=’sa’;Password


Github之svn信息泄露

  1. site:Github.com svn

  2. site:Github.com svn username

  3. site:Github.com svn password

  4. site:Github.com svn username password


Github之数据库备份文件

    site:Github.com inurl:sql


……



02

github搜索语法研究

1.q+关键字,指定搜索方向

https://github.com/search?utf8=%E2%9C%93&q=aliyuncs&type=

q对应的正是要搜索的关键字。type指定搜索结果展示的类型,分为Repositories,Code,Commits,Issues,Marketplace,Topics,Wikis,Users,默认搜索结果是以项目名的形式展示。


2.in:file,path,在文件名和路径中搜索包含关键字信息,可以使用如下url链接:

https://github.com/search?o=desc&p=1&q=aliyuncs+in:file,path&ref=searchresults&s=indexed&type=Code&utf8=%E2%9C%93 。


3.repo:项目名,在指定项目中搜索包含敏感信息的文件,可以使用如下url:

https://github.com/search?o=desc&p=1&q=aliyuncs in:file,path repo:XXXXX &ref=searchresults &s=indexed&type=Code&utf8=%E2%9C%93。

repo:xxxx字符串用来指定在哪个项目中搜索包含关键字的信息。


4.-repo:项目名

对应的使用如下链接可以搜索除了指定项目以外的包含敏感信息的文件:

https://github.com/search?o=desc&p=1&q=hundsun in:file,path -repo:XXXXX &ref=searchresult s  &s=indexed&type=Code&utf8=%E2%9C%93。这里q参数多了-repo:xxxxx。这个用来指定排除哪些项目。





03

工具



基于以上原理,我们可以写脚本来批量爬取泄露的敏感信息。当然啦,目前也已经出现了大量工具可以供我们使用。


  • Github Monitor是由VIPKID安全中心打造的一套用于主动监控github敏感信息泄露的系统。利用该系统可主动、及时发现企业敏感数据通过github泄露的情况


  • Gitrob是一个Github潜在敏感信息泄漏扫描工具。Gitrob将属于用户或组织的存储库克隆到可配置的深度,并遍历提交历史记录/标记与潜在敏感文件的签名匹配的文件。调查结果将通过网络界面呈现,以便于浏览和分析。

    • Gitrob使用

                gitrob [参数] target [target2] ... [targetN]

                参数

                -bind-address string

                   Address to bind web server to (default "127.0.0.1")

                -commit-depth int

                   Number of repository commits to process (default 500)

                -debug

                   Print debugging information

                -github-access-token string

                   GitHub access token to use for API requests

                -load string

                   Load session file

                -no-expand-orgs

                   Don't add members to targets when processing organizations

                -port int

                   Port to run web server on (default 9393)

                -save string

                   Save session to file

                -silent

                   Suppress all output except for errors

                -threads int

                   Number of concurrent threads (default number of logical CPUs)

                -bind-address string

                   Address to bind web server to (default "127.0.0.1")

                -commit-depth int

                   Number of repository commits to process (default 500)

                -debug

                   Print debugging information

                -github-access-token string

                   GitHub access token to use for API requests

                -load string

                   Load session file

                -no-expand-orgs

                   Don't add members to targets when processing organizations

                -port int

                   Port to run web server on (default 9393)

                -save string

                   Save session to file

                -silent

                   Suppress all output except for errors

                -threads int

                   Number of concurrent threads (default number of logical CPUs)


关于github的爬虫,需要使用github access token,生成方法参考:https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line




今天就分享到这里,大家快去挖一波漏洞吧!