日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

漏洞挖掘之信息收集

發(fā)布時(shí)間:2023/12/9 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 漏洞挖掘之信息收集 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

對(duì)一個(gè)網(wǎng)站挖掘的深淺來(lái)說(shuō)就得看你收集的如何,這說(shuō)明信息收集在漏洞挖掘中是非常的重要的。

子域名收集

子域名收集是最簡(jiǎn)單的收集手法之一,有很多在線的工具可以直接套用,這里分享幾個(gè)我經(jīng)常用的。

開心的時(shí)候用用這個(gè)掃描器

為什么這么說(shuō),因?yàn)檫@是我寫的(你生氣用的話我怕我屏幕里突然冒出一個(gè)拖孩)

import requests import threading from bs4 import BeautifulSoup import re import timeurl = input( 'url(如baidu.com): ' )head={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0'}ip = 'http://site.ip138.com/{}'.format( url ) # domain_url = url.split('.') # domain_url = domain_url[1]+'.'+domain_url[2] domain_url = url domain = 'http://site.ip138.com/{}/domain.htm'.format( domain_url )t = time.strftime("%Y-%m-%d"+'_', time.localtime()) html_file = open( url+'_'+t+'.html','w' )html_file.write( '''<head><title>%s的掃描結(jié)果</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> <style>pre{margin: 0 0 0px;}</style> </head><ul id="myTab" class="nav nav-tabs navbar-fixed-top navbar navbar-default"><li class="active"><a href="#ip" data-toggle="tab">IP歷史解析</a></li><li><a href="#cms" data-toggle="tab">CMS識(shí)別</a></li><li><a href="#domain" data-toggle="tab">子域名信息</a></li> </ul> <br> <br> <br> <br> <div id="myTabContent" class="tab-content"> '''%url )class IP( threading.Thread ):def __init__(self, ip):threading.Thread.__init__(self)self.ip = ipdef run(self):r = requests.get( self.ip,headers = head )html = r.textbs = BeautifulSoup(html, "html.parser")html_file.write('<div class="tab-pane fade in active" id="ip">')for i in bs.find_all('p'):ipc = i.get_text()ip_html = '<pre>{}</pre>'.format( ipc )html_file.write( ip_html )html_file.write('</div>')class CMS( threading.Thread ):def __init__(self, cms):threading.Thread.__init__(self)self.cms = cmsdef run(self):cms = requests.post('http://whatweb.bugscaner.com/what/', data={'url': self.cms}, headers = head)text = cms.textWeb_Frameworks = re.search('"Web Frameworks": "(.*?)"]', text)Programming_Languages = re.search('"Programming Languages":(.*?)"]', text)JavaScript_Frameworks = re.search('"JavaScript Frameworks": (.*?)"]', text)CMS = re.search('"CMS": (.*?)"]', text)Web_Server = re.search('"Web Servers": (.*?)"]', text)if CMS:CMS = CMS.group(1)+'"]'if Programming_Languages:Programming_Languages = Programming_Languages.group(1)+'"]'if JavaScript_Frameworks:JavaScript_Frameworks = JavaScript_Frameworks.group(1)+'"]'if Web_Frameworks:Web_Frameworks = Web_Frameworks.group(1)+'"]'if Web_Server:Web_Server = Web_Server.group(1)+'"]'html = '''<div class="tab-pane fade" id="cms"><div class="table-responsive"><table class="table table-condensed"><tr><th>web框架</th><th>腳本版本</th><th>JavaScript框架</th><th>CMS框架</th><th>web服務(wù)器</th></tr><tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td></tr></table></div></div>'''.format(Web_Frameworks,Programming_Languages,JavaScript_Frameworks,CMS,Web_Server)html_file.write( html )class DOMAIN( threading.Thread ):def __init__(self, domain):threading.Thread.__init__(self)self.domain = domaindef run(self):r = requests.get( self.domain,headers = head )html = r.textbs = BeautifulSoup(html, "html.parser")html_file.write('<div class="tab-pane fade in active" id="domain"')num = 0for i in bs.find_all('p'):num += 1html_file.write( '<br>' )domainc = i.get_text()domain_html = '<pre>[{}]: {}</pre>'.format( num,domainc )html_file.write( domain_html )print( domain_html )html_file.write('</div>')ip_cls = IP(ip) ip_html = ip_cls.run()cms_cls = CMS(url) cms_html = cms_cls.run()domain_cls = DOMAIN( domain ) domain_html = domain_cls.run()

github上開源的子域名掃描器

https://github.com/lijiejie/subDomainsBrute
https://github.com/chuhades/dnsbrute

在線網(wǎng)站收集

1,

https://d.chinacycc.com/(非常推薦)

然后不到30秒就出結(jié)果了

2,

http://z.zcjun.com/
https://phpinfo.me/domain/

端口信息收集

掃描端口并且標(biāo)記可以爆破的服務(wù)

nmap 目標(biāo) --script=ftp-brute,imap-brute,smtp-brute,pop3-brute,mongodb-brute,redis-brute,ms-sql-brute,rlogin-brute,rsync-brute,mysql-brute,pgsql-brute,oracle-sid-brute,oracle-brute,rtsp-url-brute,snmp-brute,svn-brute,telnet-brute,vnc-brute,xmpp-brute

精確判斷漏洞并掃描端口

nmap 目標(biāo) --script=dns-zone-transfer,ftp-anon,ftp-proftpd-backdoor,ftp-vsftpd-backdoor,ftp-vuln-cve2010-4221,http-backup-finder,http-cisco-anyconnect,http-iis-short-name-brute,http-put,http-php-version,http-shellshock,http-robots.txt,http-svn-enum,http-webdav-scan,iis-buffer-overflow,iax2-version,memcached-info,mongodb-info,msrpc-enum,ms-sql-info,mysql-info,nrpe-enum,pptp-version,redis-info,rpcinfo,samba-vuln-cve-2012-1182,smb-vuln-ms08-067,smb-vuln-ms17-010,snmp-info,sshv1,xmpp-info,tftp-enum,teamspeak2-version

我喜歡這樣做
如圖1所示,掃描子域名

提取出域名/ip


然后把域名放到975.txt

2,批量掃描端口和漏洞檢測(cè)

nmap -iL 975.txt --script=auth,vuln,ftp-brute,imap-brute,smtp-brute,pop3-brute,mongodb-brute,redis-brute,ms-sql-brute,rlogin-brute,rsync-brute,mysql-brute,pgsql-brute,oracle-sid-brute,oracle-brute,rtsp-url-brute,snmp-brute,svn-brute,telnet-brute,vnc-brute,xmpp-brute > scan.txt

然后根據(jù)對(duì)應(yīng)開放的端口進(jìn)行針對(duì)性漏洞挖掘

C段信息收集

C的段我話教育一般都是使用iis put這款工具來(lái)掃描,自可以定義掃描1-255的端口并且還有報(bào)道查看服務(wù)器banner信息

自定義的端口

135,139,80,8080,15672,873,8983,7001,4848,6379,2381,8161,11211,5335,5336,7809,2181,9200,50070,50075,5984,2375,7809,16992,16993


這里只是演示下他跑起來(lái)的美

目錄信息收集

目錄收集工具有很多,但是最看重的還是目錄字典,之前我拿了很多工具的字典去重集合起來(lái)超級(jí)超級(jí)大,只不過(guò)是在之前電腦那里還原的時(shí)候忘記了備份,(說(shuō)這句話主要是想讓你們也可以這樣子做,方便自己,然后發(fā)我一份,方便你我)

這里推薦一個(gè)工具7kbstorm

https://github.com/7kbstorm/7kbscan-WebPathBrute

像403,404這種頁(yè)面千萬(wàn)不要關(guān)閉,放目錄里面掃就ok了

谷歌語(yǔ)法收集敏感文件

最常見的就是用搜索引擎?

site:ooxx.com filetype:xls

首先試試百度

試試必應(yīng)

這里主要是收集網(wǎng)站敏感文件(比如目標(biāo)的某個(gè)系統(tǒng)手冊(cè)演示的截圖中截圖到了用戶名,然后我們可以根據(jù)用戶名來(lái)爆破密碼;甚至可以看看有沒(méi)有寫系統(tǒng)默認(rèn)密碼,或者一些后臺(tái)的目錄路徑,如果有目錄就可以嘗試對(duì)其訪問(wèn),說(shuō)不定有未授權(quán)?)

還能嘗試對(duì)后臺(tái)進(jìn)行查找

site:xxx.xxx admin site:xxx.xxx login site:xxx.xxx system site:xxx.xxx 管理 site:xxx.xxx 登錄 site:xxx.xxx 內(nèi)部 site:xxx.xxx 系統(tǒng)

還可以查找郵箱,然后進(jìn)行釣魚

site:xxx.xxx 郵件 site:xxx.xxx email

可以還查找qq群等,然后假裝員工驗(yàn)證進(jìn)去看群文件泄露了什么東東(這里有個(gè)技巧,去找客服聊天處,然后對(duì)整個(gè)過(guò)程抓包也就是看歷史請(qǐng)求,如果運(yùn)氣好可能在請(qǐng)求的返回包中返回客服的姓名,如果只單純的泄露了姓如張xx,那么你加群的時(shí)候就說(shuō)你是小張工作號(hào),說(shuō)這個(gè)工作號(hào)的原因是可能小張已經(jīng)在群里了)

注意事項(xiàng):如果你是挖騰訊的話就不要看這條啦

site:xxx.xxx qq site:xxx.xxx 群 site:xxx.xxx 企鵝 site:xxx.xxx 騰訊

還可以對(duì)尋找一些公開的,危害大,普遍的漏洞的指紋,下面如搜索的jboss系統(tǒng)-

site:ooxx.com inurl:jmx-console

小技巧

比如下面一個(gè)站存在越權(quán)(但是越權(quán)的對(duì)象很難猜測(cè))

http://xxx.xxx.xxx/userinfo/?uid=2018-WOIDJWOIDJ-5201314
那么我們可以嘗試用搜索引擎來(lái)找

site:xxx.xxx inurl=uid=20
利用云網(wǎng)盤搜索工具搜集敏感文件

公司員工可能把一些內(nèi)部資料放在了公網(wǎng)網(wǎng)盤,然后被在線云網(wǎng)盤搜索的網(wǎng)站抓取了,我們就可以利用這個(gè)來(lái)對(duì)目標(biāo)系統(tǒng)進(jìn)行深入交流

我這邊主要用凌風(fēng)云搜索

https://www.lingfengyun.com/

個(gè)人喜歡直接輸入廠商名字然后搜索(比較全),然后邊看電視(最好看鬼片,鬼出來(lái)的階段想著找找找)邊搜索

利用gayhub來(lái)收集信息

1,打開gayhub


就是這里找gayhub全部開源項(xiàng)目?jī)?nèi)容中存在聯(lián)想這個(gè)關(guān)鍵字的項(xiàng)目,這樣子可以搜集到的方面更廣,如果單純只是對(duì)標(biāo)題搜索,他們那么改成了lenovo你就搜不到了

然后說(shuō)再多,也沒(méi)這個(gè)好用

https://sec.xiaomi.com/article/37

針對(duì)網(wǎng)站性收集

1,把網(wǎng)站弄報(bào)錯(cuò),看是什么cms,或者看返回包回顯是什么中間件這些

2,的英文看linux還是window

目標(biāo)如url的英文www.onlyfree.xxx/login,改成那么www.onlyfree.xxx/Login看看能不能訪問(wèn),如果可以訪問(wèn)就可能是window,否則可能是linux

3,可以去云溪等在線識(shí)別指紋的網(wǎng)站看指紋信息

http://whatweb.bugscaner.com/look/
http://www.yunsee.cn/finger.html

如圖4所示,對(duì)waf進(jìn)行識(shí)別

這里有一款開源的識(shí)別工具,用挺好的
https://github.com/EnableSecurity/wafw00f

5,網(wǎng)站對(duì)whois查詢看注冊(cè)人,手機(jī)號(hào),郵箱等(可以收集起來(lái)放到密碼生成工具)

6,看html源代碼,在一起項(xiàng)目測(cè)試的時(shí)候,在我找html源代碼的時(shí)候發(fā)現(xiàn)一個(gè)注釋的js文件,我將其打開后,里面的備注居然是配置信息…后臺(tái)地址,管理員賬號(hào)和密碼等(我可是沒(méi)get到shell,所以你要知道這回事而不要記住這件事)

7,真實(shí)網(wǎng)站ip識(shí)別,下面是我用的一個(gè)工具,但是我忘記哪里下載的了,我原封不漏的粘貼出來(lái)

############################################################# ### ### ▄▄▄▄ ▄▄▄ ▄▄▄▄ ? ▄ ### ? ?█ ▄ ▄ ▄▄▄▄ █ ▄? ?▄ ▄▄▄ ▄▄█▄▄ ### ▄▄▄? █▄█ █? ?█ █ █ ▄ █ █ █ ### ?█ ▄█▄ █ █ █ █ █ █ █ ### ?▄▄▄█? ▄? ?▄ ██▄█? ▄▄█▄▄ █▄▄█ ▄▄█▄▄ ?▄▄ ### █ ### ? ### ### name: xcdn.py ### function: try to get the actual ip behind cdn ### date: 2016-11-05 ### author: quanyechavshuo ### blog: http://3xp10it.cc ############################################################# # usage:python3 xcdn.py www.baidu.com import time import os os.system("pip3 install exp10it -U --no-cache-dir") from exp10it import figlet2file figlet2file("3xp10it",0,True) time.sleep(1)from exp10it import CLIOutput from exp10it import get_root_domain from exp10it import get_string_from_command from exp10it import get_http_or_https from exp10it import post_request from exp10it import get_request from exp10it import checkvpn import sys import reclass Xcdn(object):def __init__(self,domain):#必須保證連上了vpn,要在可以ping通google的條件下使用本工具,否則有些domain由于被GFW攔截?zé)o法正常訪問(wèn)會(huì)導(dǎo)致#本工具判斷錯(cuò)誤,checkvpn在可以ping通google的條件下返回1while 1:if checkvpn()==1:breakelse:time.sleep(1)print("vpn is off,connect vpn first")if domain[:4]=="http":print("domain format error,make sure domain has no http,like www.baidu.com but not \ http://www.baidu.com")sys.exit(0)#首先保證hosts文件中沒(méi)有與domain相關(guān)的項(xiàng),有則刪除相關(guān)domainPattern=domain.replace(".","\.")#下面的sed的正則中不能有\(zhòng)n,sed匹配\n比較特殊#http://stackoverflow.com/questions/1251999/how-can-i-replace-a-newline-n-using-sedcommand="sed -ri 's/.*\s+%s//' /etc/hosts" % domainPatternos.system(command)self.domain=domainself.http_or_https=get_http_or_https(self.domain)print('domain的http或https是:%s' % self.http_or_https)result=get_request(self.http_or_https+"://"+self.domain,'seleniumPhantomJS')self.domain_title=result['title']#下面調(diào)用相當(dāng)于main函數(shù)的get_actual_ip_from_domain函數(shù)actual_ip = self.get_actual_ip_from_domain()if actual_ip != 0:print("恭喜,%s的真實(shí)ip是%s" % (self.domain, actual_ip))#下面用來(lái)存放關(guān)鍵返回值self.return_value=actual_ipdef domain_has_cdn(self):# 檢測(cè)domain是否有cdn# 有cdn時(shí),返回一個(gè)字典,如果cdn是cloudflare,返回{'has_cdn':1,'is_cloud_flare':1}# 否則返回{'has_cdn':1,'is_cloud_flare':0}或{'has_cdn':0,'is_cloud_flare':0}import reCLIOutput().good_print("現(xiàn)在檢測(cè)domain:%s是否有cdn" % self.domain)has_cdn = 0# ns記錄和mx記錄一樣,都要查頂級(jí)域名,eg.dig +short www.baidu.com ns VS dig +short baidu.com nsresult = get_string_from_command("dig ns %s +short" % get_root_domain(self.domain))pattern = re.compile(r"(cloudflare)|(cdn)|(cloud)|(fast)|(incapsula)|(photon)|(cachefly)|(wppronto)|(softlayer)|(incapsula)|(jsdelivr)|(akamai)", re.I)cloudflare_pattern = re.compile(r"cloudflare", re.I)if re.search(pattern, result):if re.search(cloudflare_pattern, result):print("has_cdn=1 from ns,and cdn is cloudflare")return {'has_cdn': 1, 'is_cloud_flare': 1}else:print("has_cdn=1 from ns")return {'has_cdn': 1, 'is_cloud_flare': 0}else:# 下面通過(guò)a記錄個(gè)數(shù)來(lái)判斷,如果a記錄個(gè)數(shù)>1個(gè),認(rèn)為有cdnresult = get_string_from_command("dig a %s +short" % self.domain)find_a_record_pattern = re.findall(r"((\d{1,3}\.){3}\d{1,3})", result)if find_a_record_pattern:ip_count = 0for each in find_a_record_pattern:ip_count += 1if ip_count > 1:has_cdn = 1return {'has_cdn': 1, 'is_cloud_flare': 0}return {'has_cdn': 0, 'is_cloud_flare': 0}def get_domain_actual_ip_from_phpinfo(self):# 從phpinfo頁(yè)面嘗試獲得真實(shí)ipCLIOutput().good_print("現(xiàn)在嘗試從domain:%s可能存在的phpinfo頁(yè)面獲取真實(shí)ip" % self.domain)phpinfo_page_list = ["info.php", "phpinfo.php", "test.php", "l.php"]for each in phpinfo_page_list:url = self.http_or_https + "://" + self.domain + "/" + eachCLIOutput().good_print("現(xiàn)在訪問(wèn)%s" % url)visit = get_request(url,'seleniumPhantomJS')code = visit['code']content = visit['content']pattern = re.compile(r"remote_addr", re.I)if code == 200 and re.search(pattern, content):print(each)actual_ip = re.search(r"REMOTE_ADDR[^\.\d]+([\d\.]{7,15})[^\.\d]+", content).group(1)return actual_ip# return 0代表沒(méi)有通過(guò)phpinfo頁(yè)面得到真實(shí)ipreturn 0def flush_dns(self):# 這個(gè)函數(shù)用來(lái)刷新本地dns cache# 要刷新dns cache才能讓修改hosts文件有效CLIOutput().good_print("現(xiàn)在刷新系統(tǒng)的dns cache")command = "service network-manager restart && /etc/init.d/networking force-reload"os.system(command)import timetime.sleep(3)def modify_hosts_file_with_ip_and_domain(self,ip):# 這個(gè)函數(shù)用來(lái)修改hosts文件CLIOutput().good_print("現(xiàn)在修改hosts文件")exists_domain_line = Falsewith open("/etc/hosts", "r+") as f:file_content = f.read()if re.search(r"%s" % self.domain.replace(".", "\."), file_content):exists_domain_line = Trueif exists_domain_line == True:os.system("sed -ri 's/.*%s.*/%s %s/' %s" % (self.domain.replace(".", "\."), ip, self.domain, "/etc/hosts"))else:os.system("echo %s %s >> /etc/hosts" % (ip, self.domain))def check_if_ip_is_actual_ip_of_domain(self,ip):# 通過(guò)修改hosts文件檢測(cè)ip是否是domain對(duì)應(yīng)的真實(shí)ip# 如果是則返回True,否則返回False#CLIOutput().good_print("現(xiàn)在通過(guò)修改hosts文件并刷新dns的方法檢測(cè)ip:%s是否是domain:%s的真實(shí)ip" % (ip,self.domain))#python通過(guò)requests庫(kù)或mechanicalsoup庫(kù)或selenium_phantomjs來(lái)請(qǐng)求時(shí)不會(huì)被dns緩存影響,只會(huì)被hosts文件影響dns解析,人工用瀏覽器訪問(wèn)域名則會(huì)受dns緩存影響CLIOutput().good_print("現(xiàn)在通過(guò)修改hosts文件的方法檢測(cè)ip:%s是否是domain:%s的真實(shí)ip" % (ip,self.domain))os.system("cp /etc/hosts /etc/hosts.bak")self.modify_hosts_file_with_ip_and_domain(ip)#python通過(guò)requests庫(kù)或mechanicalsoup庫(kù)或selenium_phantomjs來(lái)請(qǐng)求時(shí)不會(huì)被dns緩存影響,只會(huì)被hosts文件影響dns解析,人工用瀏覽器訪問(wèn)域名則會(huì)受dns緩存影響#self.flush_dns()hosts_changed_domain_title= get_request(self.http_or_https + "://%s" % self.domain,'selenium_phantom_js')['title']os.system("rm /etc/hosts && mv /etc/hosts.bak /etc/hosts")#這里要用title判斷,html判斷不可以,title相同則認(rèn)為相同if self.domain_title == hosts_changed_domain_title:CLIOutput().good_print("檢測(cè)到真實(shí)ip!!!!!!",'red')return Trueelse:CLIOutput().good_print("當(dāng)前ip不是域名的真實(shí)ip",'yellow')return Falsedef get_c_80_or_443_list(self,ip):# 得到ip的整個(gè)c段的開放80端口或443端口的ip列表if "not found" in get_string_from_command("masscan"):#這里不用nmap掃描,nmap掃描結(jié)果不準(zhǔn)os.system("apt-get install masscan")if self.http_or_https=="http":scanPort=80CLIOutput().good_print("現(xiàn)在進(jìn)行%s的c段開了80端口機(jī)器的掃描" % ip)if self.http_or_https=="https":scanPort=443CLIOutput().good_print("現(xiàn)在進(jìn)行%s的c段開了443端口機(jī)器的掃描" % ip)masscan_command = "masscan -p%d %s/24 > /tmp/masscan.out" % (scanPort,ip)os.system(masscan_command)with open("/tmp/masscan.out", "r+") as f:strings = f.read()#os.system("rm /tmp/masscan.out")import reallIP=re.findall(r"((\d{1,3}\.){3}\d{1,3})",strings)ipList=[]for each in allIP:ipList.append(each[0])print(ipList)return ipListdef check_if_ip_c_machines_has_actual_ip_of_domain(self,ip):# 檢測(cè)ip的c段有沒(méi)有domain的真實(shí)ip,如果有則返回真實(shí)ip,如果沒(méi)有則返回0CLIOutput().good_print("現(xiàn)在檢測(cè)ip為%s的c段中有沒(méi)有%s的真實(shí)ip" % (ip,self.domain))target_list=self.get_c_80_or_443_list(ip)for each_ip in target_list:if True == self.check_if_ip_is_actual_ip_of_domain(each_ip):return each_ipreturn 0def get_ip_from_mx_record(self):# 從mx記錄中得到ip列表,嘗試從mx記錄中的c段中找真實(shí)ipprint("嘗試從mx記錄中找和%s頂級(jí)域名相同的mx主機(jī)" % self.domain)import socket# domain.eg:www.baidu.comfrom exp10it import get_root_domainroot_domain = get_root_domain(self.domain)from exp10it import get_string_from_commandresult = get_string_from_command("dig %s +short mx" % root_domain)sub_domains_list = re.findall(r"\d{1,} (.*\.%s)\." % root_domain.replace(".", "\."), result)ip_list = []for each in sub_domains_list:print(each)ip = socket.gethostbyname_ex(each)[2]if ip[0] not in ip_list:ip_list.append(ip[0])return ip_listdef check_if_mx_c_machines_has_actual_ip_of_domain(self):# 檢測(cè)domain的mx記錄所在ip[或ip列表]的c段中有沒(méi)有domain的真實(shí)ip# 有則返回真實(shí)ip,沒(méi)有則返回0CLIOutput().good_print("嘗試從mx記錄的c段中查找是否存在%s的真實(shí)ip" % self.domain)ip_list = self.get_ip_from_mx_record()if ip_list != []:for each_ip in ip_list:result = self.check_if_ip_c_machines_has_actual_ip_of_domain(each_ip)if result != 0:return resultelse:continuereturn 0def get_ip_value_from_online_cloudflare_interface(self):# 從在線的cloudflare查詢真實(shí)ip接口處查詢真實(shí)ip# 如果查詢到真實(shí)ip則返回ip值,如果沒(méi)有查詢到則返回0CLIOutput().good_print("現(xiàn)在從在線cloudflare類型cdn查詢真實(shí)ip接口嘗試獲取真實(shí)ip")url = "http://www.crimeflare.com/cgi-bin/cfsearch.cgi"post_data = 'cfS=%s' % self.domaincontent = post_request(url, post_data)findIp = re.search(r"((\d{1,3}\.){3}\d{1,3})", content)if findIp:return findIp.group(1)return 0def get_actual_ip_from_domain(self):# 嘗試獲得domain背后的真實(shí)ip,前提是domain有cdn# 如果找到了則返回ip,如果沒(méi)有找到返回0CLIOutput().good_print("進(jìn)入獲取真實(shí)ip函數(shù),認(rèn)為每個(gè)domain都是有cdn的情況來(lái)處理")import sockethas_cdn_value = self.domain_has_cdn()if has_cdn_value['has_cdn'] == 1:CLIOutput().good_print("檢測(cè)到domain:%s的A記錄不止一個(gè),認(rèn)為它有cdn" % self.domain)passelse:CLIOutput().good_print("Attention...!!! Domain doesn't have cdn,I will return the only one ip")true_ip = socket.gethostbyname_ex(self.domain)[2][0]return true_ip# 下面嘗試通過(guò)cloudflare在線查詢真實(shí)ip接口獲取真實(shí)ipif has_cdn_value['is_cloud_flare'] == 1:ip_value = self.get_ip_value_from_online_cloudflare_interface()if ip_value != 0:return ip_valueelse:pass# 下面嘗試通過(guò)可能存在的phpinfo頁(yè)面獲得真實(shí)ipip_from_phpinfo = self.get_domain_actual_ip_from_phpinfo()if ip_from_phpinfo == 0:passelse:return ip_from_phpinfo# 下面通過(guò)mx記錄來(lái)嘗試獲得真實(shí)ipresult = self.check_if_mx_c_machines_has_actual_ip_of_domain()if result == 0:passelse:return resultprint("很遺憾,在下認(rèn)為%s有cdn,但是目前在下的能力沒(méi)能獲取它的真實(shí)ip,當(dāng)前函數(shù)將返回0" % self.domain)return 0

if name == ‘main’:
import sys
domain=sys.argv[1]
Xcdn(domain)
如圖8所示,服務(wù)器的ssh配置信息

丟工具:https://github.com/mozilla/ssh_scan

9,敏感文件爆破

svn代碼源泄露使用svn版本控制系統(tǒng)-時(shí),操作錯(cuò)誤將.svn文件存放,久那么可以看他SVN服務(wù)器賬號(hào)密碼等信息

http://xxx.xxx.xxx/.svn/entries 10,根據(jù)目標(biāo)系統(tǒng)情況

根據(jù)目標(biāo)系統(tǒng)情況是因?yàn)榭此麑?duì)應(yīng)的系統(tǒng)是什么對(duì)應(yīng)有什么漏洞,這個(gè)下面的英文tomcat的session泄露

/examples/servlets/servlet/SessionExample/examples/ /examples/servlets/servlet/SessionExample /examples/


敏感目錄泄露

WEB-INF/web.xml泄露
WEB-INF的英文Java的WEB應(yīng)用的安全目錄。如果想在頁(yè)面中直接訪問(wèn)其中的文件,通過(guò)必須web.xml文件對(duì)要訪問(wèn)的文件進(jìn)行相應(yīng)映射才能訪問(wèn)

/WEB-INF/config/jdbc.properties /WEB-INF/web.xml /WEB-INF/classes/ /WEB-INF/lib/ /WEB-INF/src/ /WEB-INF/database.properties

bzr泄露
通過(guò)它我們可以看項(xiàng)目歷史

http://xxx.xxx.xxx/.bzr/

網(wǎng)站源代碼泄露
不多介紹,可能管理員覺(jué)得網(wǎng)站不安全,需要我們審計(jì)一下

www.zip www.tar.gz www.rar web.zip web.rar ...

這些有很多,不一一詳細(xì),后面我會(huì)將這些全部集合在一個(gè)字典里,然后我們可以放入目錄遍歷的工具里批量掃?

利用shodan,Fofa等收集信息

查找標(biāo)題是攜程并且語(yǔ)言是國(guó)語(yǔ)的站點(diǎn)

https://www.shodan.io/search?query=http.title:"攜程" country:"CN"


我們可以將其收藏為文件夾,方便下次打開,然后記錄時(shí)間,看看有沒(méi)有新上線的(這里已經(jīng)有監(jiān)控的功能,師傅各位去可以看看米斯特大佬寫的shodan監(jiān)控點(diǎn)文章,很有趣很實(shí)用)

shodan,fofa不多介紹了,有對(duì)應(yīng)的手冊(cè),見的肯定比我好

思路擴(kuò)展

擴(kuò)展思路就是在a功能點(diǎn)中找出b功能點(diǎn),以此類推

比如一些后臺(tái)登錄是

http://xxx.xxx.xxx/admin-login

的英文我們不是可以嘗試吧login改成register來(lái)注冊(cè)

再比如獲取用戶手機(jī)號(hào)的接口(這里不存在越權(quán))

http://xxx.xxx.xxx/user/GetPhone/?id=1

我們?nèi)缓蟀袵etPhone改成GetPasswd或者GetPwd或者GetPassword然后id就可能可以越權(quán),這里或者可以json劫持或者origin劫持等,我們可以誘導(dǎo)用戶點(diǎn)開來(lái)劫持賬號(hào)密碼

或者還是看源代碼,然后搜索hidden(滑稽),我們可能可能會(huì)找到敏感操作的按鈕,然后管理員也知道敏感,將其“隱藏”了,我們可以根據(jù)這個(gè)來(lái)搜索然后訪問(wèn)他,嘿嘿嘿(之前一個(gè)對(duì)小站點(diǎn)進(jìn)行挖掘的時(shí)候我hidden找居然找到了不可描述的目錄下面放著不可描述的電影,當(dāng)時(shí)我的心情是非常拒絕的,經(jīng)過(guò)幾小時(shí)的思考我迅速的將那個(gè)目錄關(guān)閉了,畢竟我是祖國(guó)的花朵)

有這里的英文很多最adrian師傅與我分享的,然后暫時(shí)只寫那么多吧(其實(shí)還有幾個(gè),怕觸犯到權(quán)什么的就是他給你學(xué)了但不給我寫的那種,很麻煩所以就以后有機(jī)會(huì)再寫吧),如果遇到了更多我會(huì)補(bǔ)充

總結(jié)

以上是生活随笔為你收集整理的漏洞挖掘之信息收集的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。