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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Web信息搜集

發布時間:2023/12/9 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Web信息搜集 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文件是轉載原文https://www.freebuf.com/articles/web/204883.html? 如有侵權 請聯系

對一個網站挖掘的深淺來說,信息收集是非常的重要的,這篇文章主要分享本人在滲透測試信息收集階段的一些心得,如有謬誤懇請指出。

?

子域名收集

子域名收集是最簡單的收集手法之一,有很多在線的工具可以直接套用,這里分享幾個我經常用的。

?

github開源的子域名掃描器

https://github.com/lijiejie/subDomainsBrute

https://github.com/chuhades/dnsbrute

在線網站收集

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

?

2.端口信息收集

http://z.zcjun.com/

https://phpinfo.me/domain/

掃描端口并且標記可以爆破的服務

nmap 目標 --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 目標 --script=auth,vuln

精確判斷漏洞并掃描端口

nmap 目標 --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

2.批量掃描端口和漏洞檢測

?

?

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

?

然后根據對應開放的端口進行針對性漏洞挖掘。

c段信息收集

c段的話我一般都是使用iis put這款工具來掃描,可以自定義掃描1-255的端口并且還有返回服務器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

這里只是演示下他跑起來的美。

目錄信息收集

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

這里推薦一個工具:7kbstorm

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

像403、404這種頁面千萬不要關閉,放目錄里面掃就ok。

谷歌語法收集敏感文件

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

site:ooxx.com filetype:xls

首先試試百度:

?

$!@!~~WDwadawicnm

試試必應:

這里主要是收集網站敏感文件(比如目標的某個系統手冊演示的截圖中截圖到了用戶名,然后我們可以根據用戶名來爆破密碼;甚至可以看看有沒有寫系統默認密碼,或者一些后臺的目錄路徑,如果有目錄就可以嘗試對其訪問,說不定有未授權~)。

還能嘗試對后臺進行查找:

site:xxx.xxx admin

site:xxx.xxx login

site:xxx.xxx system

site:xxx.xxx 管理

site:xxx.xxx 登錄

site:xxx.xxx 內部

site:xxx.xxx 系統

還可以查找郵箱,然后進行釣魚:

site:xxx.xxx 郵件

site:xxx.xxx email

還可以查找qq群等,然后假裝員工驗證進去看群文件泄露了什么東東(這里有個技巧,去找客服聊天處,然后對整個過程抓包也就是看歷史請求,如果運氣好可能在請求的返回包中返回客服的姓名,如果只單純的泄露了姓如張xx,那么你加群的時候就說你是小張工作號,說這個工作號的原因是可能小張已經在群里了)。

注意事項:如果你是挖騰訊的話就不要看這條啦。

site:xxx.xxx qq

site:xxx.xxx 群

site:xxx.xxx 企鵝

site:xxx.xxx 騰訊

還可以對尋找一些公開的、危害大、普遍的漏洞的指紋,如下面的搜索jboss系統:

site:ooxx.com inurl:jmx-console

小技巧

比如下面一個站存在越權(但是越權的對象很難猜測):

http://xxx.xxx.xxx/userinfo/?uid=2018-WOIDJWOIDJ-5201314

那么我們可以嘗試用搜索引擎來找:

site:xxx.xxx inurl=uid=20

利用云網盤搜索工具搜集敏感文件

公司員工可能把一些內部資料放在了公網網盤,然后被在線云網盤搜索的網站抓取了,我們就可以利用這個來對目標系統進行深入交流。

我這邊主要用凌風云搜索:https://www.lingfengyun.com/

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

利用gayhub來收集信息

1.打開gayhub:

這里就是找gayhub全部開源項目內容中存在聯想這個關鍵字的項目,這樣子可以搜集到的方面更廣,如果單純只是對標題搜索,那么他們改成了lenovo你就搜不到了。

然后說再多,也沒這個好用:https://sec.xiaomi.com/article/37。

針對網站性收集

1.把網站弄報錯,看是什么cms,或者看返回包回顯是什么中間件這些;

2.看是linux還是window,如目標url是[[www.onlyfree.xxx/login](http://www.onlyfree.xxx/login)]([http://www.onlyfree.xxx/login](http://www.onlyfree.xxx/login)),那么改成[[www.onlyfree.xxx/Login](http://www.onlyfree.xxx/Login)]([http://www.onlyfree.xxx/Login](http://www.onlyfree.xxx/Login))看看能不能訪問,如果可以訪問就可能是window,否則可能是linux;

3.可以去云溪等在線識別指紋的網站看指紋信息:

http://whatweb.bugscaner.com/look/

http://www.yunsee.cn/finger.html

4.對waf進行識別,這里有一款開源的識別工具,挺好用的:https://github.com/EnableSecurity/wafw00f

5.對網站whois查詢看注冊人、手機號、郵箱等(可以收集起來放到密碼生成工具);

6.看html源代碼,在一起項目測試的時候,我在找html源代碼的時候發現一個注釋的js文件,我將其打開后,里面的備注居然是配置信息。。。后臺地址、管理員賬號和密碼等(可是我沒get到shell,所以你要知道這回事而不要記住這件事);

7.網站真實ip識別,下面是我用的一個工具,但是我忘記哪里下載的了,我原封不漏的粘貼出來:

############################################################# ### ### ▄▄▄▄ ▄▄▄ ▄▄▄▄ ? ▄ ### ? ?█ ▄ ▄ ▄▄▄▄ █ ▄? ?▄ ▄▄▄ ▄▄█▄▄ ### ▄▄▄? █▄█ █? ?█ █ █ ▄ █ █ █ ### ?█ ▄█▄ █ █ █ █ █ █ █ ### ?▄▄▄█? ▄? ?▄ ██▄█? ▄▄█▄▄ █▄▄█ ▄▄█▄▄ ?▄▄ ### █ ### ? ### ### 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 re class Xcdn(object): def __init__(self,domain): #必須保證連上了vpn,要在可以ping通google的條件下使用本工具,否則有些domain由于被GFW攔截無法正常訪問會導致 #本工具判斷錯誤,checkvpn在可以ping通google的條件下返回1 while 1: if checkvpn()==1: break else: 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文件中沒有與domain相關的項,有則刪除相關 domainPattern=domain.replace(".","\.") #下面的sed的正則中不能有\n,sed匹配\n比較特殊 #http://stackoverflow.com/questions/1251999/how-can-i-replace-a-newline-n-using-sed command="sed -ri 's/.*\s+%s//' /etc/hosts" % domainPattern os.system(command) self.domain=domain self.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'] #下面調用相當于main函數的get_actual_ip_from_domain函數 actual_ip = self.get_actual_ip_from_domain() if actual_ip != 0: print("恭喜,%s的真實ip是%s" % (self.domain, actual_ip)) #下面用來存放關鍵返回值 self.return_value=actual_ip def domain_has_cdn(self): # 檢測domain是否有cdn # 有cdn時,返回一個字典,如果cdn是cloudflare,返回{'has_cdn':1,'is_cloud_flare':1} # 否則返回{'has_cdn':1,'is_cloud_flare':0}或{'has_cdn':0,'is_cloud_flare':0} import re CLIOutput().good_print("現在檢測domain:%s是否有cdn" % self.domain) has_cdn = 0 # ns記錄和mx記錄一樣,都要查頂級域名,eg.dig +short www.baidu.com ns VS dig +short baidu.com ns result = 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: # 下面通過a記錄個數來判斷,如果a記錄個數>1個,認為有cdn result = 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 = 0 for each in find_a_record_pattern: ip_count += 1 if ip_count > 1: has_cdn = 1 return {'has_cdn': 1, 'is_cloud_flare': 0} return {'has_cdn': 0, 'is_cloud_flare': 0} def get_domain_actual_ip_from_phpinfo(self): # 從phpinfo頁面嘗試獲得真實ip CLIOutput().good_print("現在嘗試從domain:%s可能存在的phpinfo頁面獲取真實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 + "/" + each CLIOutput().good_print("現在訪問%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代表沒有通過phpinfo頁面得到真實ip return 0 def flush_dns(self): # 這個函數用來刷新本地dns cache # 要刷新dns cache才能讓修改hosts文件有效 CLIOutput().good_print("現在刷新系統的dns cache") command = "service network-manager restart && /etc/init.d/networking force-reload" os.system(command) import time time.sleep(3) def modify_hosts_file_with_ip_and_domain(self,ip): # 這個函數用來修改hosts文件 CLIOutput().good_print("現在修改hosts文件") exists_domain_line = False with open("/etc/hosts", "r+") as f: file_content = f.read() if re.search(r"%s" % self.domain.replace(".", "\."), file_content): exists_domain_line = True if 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): # 通過修改hosts文件檢測ip是否是domain對應的真實ip # 如果是則返回True,否則返回False #CLIOutput().good_print("現在通過修改hosts文件并刷新dns的方法檢測ip:%s是否是domain:%s的真實ip" % (ip,self.domain)) #python通過requests庫或mechanicalsoup庫或selenium_phantomjs來請求時不會被dns緩存影響,只會被hosts文件影響dns解析,人工用瀏覽器訪問域名則會受dns緩存影響 CLIOutput().good_print("現在通過修改hosts文件的方法檢測ip:%s是否是domain:%s的真實ip" % (ip,self.domain)) os.system("cp /etc/hosts /etc/hosts.bak") self.modify_hosts_file_with_ip_and_domain(ip) #python通過requests庫或mechanicalsoup庫或selenium_phantomjs來請求時不會被dns緩存影響,只會被hosts文件影響dns解析,人工用瀏覽器訪問域名則會受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相同則認為相同 if self.domain_title == hosts_changed_domain_title: CLIOutput().good_print("檢測到真實ip!!!!!!",'red') return True else: CLIOutput().good_print("當前ip不是域名的真實ip",'yellow') return False def get_c_80_or_443_list(self,ip): # 得到ip的整個c段的開放80端口或443端口的ip列表 if "not found" in get_string_from_command("masscan"): #這里不用nmap掃描,nmap掃描結果不準 os.system("apt-get install masscan") if self.http_or_https=="http": scanPort=80 CLIOutput().good_print("現在進行%s的c段開了80端口機器的掃描" % ip) if self.http_or_https=="https": scanPort=443 CLIOutput().good_print("現在進行%s的c段開了443端口機器的掃描" % 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 re allIP=re.findall(r"((\d{1,3}\.){3}\d{1,3})",strings) ipList=[] for each in allIP: ipList.append(each[0]) print(ipList) return ipList def check_if_ip_c_machines_has_actual_ip_of_domain(self,ip): # 檢測ip的c段有沒有domain的真實ip,如果有則返回真實ip,如果沒有則返回0 CLIOutput().good_print("現在檢測ip為%s的c段中有沒有%s的真實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_ip return 0 def get_ip_from_mx_record(self): # 從mx記錄中得到ip列表,嘗試從mx記錄中的c段中找真實ip print("嘗試從mx記錄中找和%s頂級域名相同的mx主機" % self.domain) import socket # domain.eg:www.baidu.com from exp10it import get_root_domain root_domain = get_root_domain(self.domain) from exp10it import get_string_from_command result = 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_list def check_if_mx_c_machines_has_actual_ip_of_domain(self): # 檢測domain的mx記錄所在ip[或ip列表]的c段中有沒有domain的真實ip # 有則返回真實ip,沒有則返回0 CLIOutput().good_print("嘗試從mx記錄的c段中查找是否存在%s的真實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 result else: continue return 0 def get_ip_value_from_online_cloudflare_interface(self): # 從在線的cloudflare查詢真實ip接口處查詢真實ip # 如果查詢到真實ip則返回ip值,如果沒有查詢到則返回0 CLIOutput().good_print("現在從在線cloudflare類型cdn查詢真實ip接口嘗試獲取真實ip") url = "http://www.crimeflare.com/cgi-bin/cfsearch.cgi" post_data = 'cfS=%s' % self.domain content = post_request(url, post_data) findIp = re.search(r"((\d{1,3}\.){3}\d{1,3})", content) if findIp: return findIp.group(1) return 0 def get_actual_ip_from_domain(self): # 嘗試獲得domain背后的真實ip,前提是domain有cdn # 如果找到了則返回ip,如果沒有找到返回0 CLIOutput().good_print("進入獲取真實ip函數,認為每個domain都是有cdn的情況來處理") import socket has_cdn_value = self.domain_has_cdn() if has_cdn_value['has_cdn'] == 1: CLIOutput().good_print("檢測到domain:%s的A記錄不止一個,認為它有cdn" % self.domain) pass else: 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 # 下面嘗試通過cloudflare在線查詢真實ip接口獲取真實ip if has_cdn_value['is_cloud_flare'] == 1: ip_value = self.get_ip_value_from_online_cloudflare_interface() if ip_value != 0: return ip_value else: pass # 下面嘗試通過可能存在的phpinfo頁面獲得真實ip ip_from_phpinfo = self.get_domain_actual_ip_from_phpinfo() if ip_from_phpinfo == 0: pass else: return ip_from_phpinfo # 下面通過mx記錄來嘗試獲得真實ip result = self.check_if_mx_c_machines_has_actual_ip_of_domain() if result == 0: pass else: return result print("很遺憾,在下認為%s有cdn,但是目前在下的能力沒能獲取它的真實ip,當前函數將返回0" % self.domain) return 0 if __name__ == '__main__': import sys domain=sys.argv[1] Xcdn(domain)

8.服務器ssh配置信息,丟工具:https://github.com/mozilla/ssh_scan

9.敏感文件爆破

?

svn

源代碼泄露使用

svn

版本控制系統時,錯誤操作將

.svn

文件存放,那么久可以看他

SVN

服務器賬號密碼等信息

  • http://xxx.xxx.xxx/.svn/entries

    ?

10.根據目標系統情況:根據目標系統情況是因為看他對應的系統是什么對應有什么漏洞,下面這個是tomcat的session泄露:

/examples/servlets/servlet/SessionExample/examples/

/examples/servlets/servlet/SessionExample

/examples/

敏感目錄泄露

WEB-INF/web.xml泄露WEB-INF是Java的WEB應用的安全目錄。如果想在頁面中直接訪問其中的文件,必須通過web.xml文件對要訪問的文件進行相應映射才能訪問:

/WEB-INF/config/jdbc.properties

/WEB-INF/web.xml

/WEB-INF/classes/

/WEB-INF/lib/

/WEB-INF/src/

/WEB-INF/database.properties

bzr泄露

通過它我們可以看項目歷史:http://xxx.xxx.xxx/.bzr/

網站源代碼泄露

不多介紹,可能管理員覺得網站不安全,需要我們審計一下:

[www.zip](http://www.zip)

[www.tar.gz](http://www.tar.gz)

[www.rar](http://www.rar)

web.zip

web.rar...

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

利用shodan、fofa等收集信息

查找標題是攜程并且語言是國語的站點:

https://[[www.shodan.io/search?query=http.title:](http://www.shodan.io/search?query=http.title:)]([http://www.shodan.io/search?query=http.title:](?http://www.shodan.io/search?query=http.title:))”攜程” country:”CN”。

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

shodan、fofa不多介紹了,有對應的手冊,見的肯定比我好。

思路擴展

思路擴展就是在a功能點中找出b功能點,以此類推。

比如一些后臺登錄是http://xxx.xxx.xxx/admin-login,我們是不是可以嘗試把login改成register來注冊。

再比如獲取用戶手機號的接口(這里不存在越權)http://xxx.xxx.xxx/user/GetPhone/?id=1,然后我們把GetPhone改成GetPasswd或者GetPwd或者GetPassword,然后id就可能可以越權,或者這里可以json劫持或者origin劫持等,我們可以誘導用戶點開來劫持賬號密碼。

或者還是看源代碼,然后搜索hidden(滑稽),我們可能可能會找到敏感操作的按鈕,然后管理員也知道敏感,將其”隱藏”了,我們可以根據這個來搜索然后訪問他,嘿嘿嘿(之前對一個小站點進行挖掘的時候我hidden找居然找到了不可描

?

文件是轉載原文https://www.freebuf.com/articles/web/204883.html? 如有侵權 請聯系

總結

以上是生活随笔為你收集整理的Web信息搜集的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。