渗透测试手册之信息收集 information gathering

渗透测试手册之信息收集 information gathering

信息收集

Whois

站点注册人注册过的其他网站(对注册人、邮箱、电话的反查),对查到的站点的深入
https://viewdns.info/reversewhois
$ amass intel -whois -d <Domain Name Here>

是否存在CDN

Ping、多地ping、国外ping
https://github.com/wwl012345/CDNCheck
单个域名>python3 cndcheck.py -u domain
多个域名>python3 cndcheck.py -f url.txt

Bypass cdn常规方式

子域名
https://dnsdb.io/zh-cn/
Ping根域名
Nslookup
Cloudflare的真实IP寻找
  http://crimeflare.org:82/cfs.html
  https://github.com/gwen001/pentest-tools/blob/master/cloudflare-origin-ip.py
查找老域名
查找关联域名
  www.baidu.com
  www.baidu.cn
  www.baidu.org
  www.baidu.xyz等等
信息泄露/配置文件
Phpinfo
网页源码
Svn
Github
Shodan/fofa/zoomeye
SSL证书记录
https://censys.io/
网站漏洞
  Xss
  Ssrf
  命令执行
  SQL注入(某种情况loadfile读取linux的ip配置文件,hosts文件等)
DNS记录,证书记录
设置xff/x-remote-ip/x-remote-addr为127.0.0.1/或ipv6地址
RSS订阅/邮件头
APP反编译搜索/截取APP的请求信息
修改hosts文件指向

域名历史IP

https://x.threatbook.cn/

网站架构/服务器指纹/CMS识别/容器

Whatweb
网页源代码
请求头/响应头
网站底部,顶部,左上角右上角
网站报错信息
http://www.yunsee.cn/
域名/install
Firefox插件Wappalyzer
https://github.com/vincd/wappylyzer
$ python3 main.py analyze -u <URL HERE>
CMS漏洞
  定位版本对应已知漏洞检查
  CMS未知漏洞挖掘
Web容器已知漏洞(解析漏洞这种)
显示网站使用的技术
  https://builtwith.com/
中间件、组件
Weblogic、tomcat、zabbix、struts、axis等
https://github.com/FortyNorthSecurity/EyeWitness
其他工具whatweb,buildwith,Netcraft

防火墙

https://github.com/EnableSecurity/wafw00f
Wafw00f <URL HERE>
https://github.com/0xInfection/Awesome-WAF#known-bypasses

子域名

● Virus Total
● Netcraft
● DNSdumpster
● Threat crowed
● Shodan
● Cencys
● DNSdb
● Pastebin
http://chaos.projectdiscovery.io/
老站、同样架构或同源码的子站
爆破,接口查询
  https://phpinfo.me/domain/
  https://d.chinacycc.com/index.php?m=Login&a=index
  subDomainBrute、knockpy
OWA发现、dig adfs、dig mail
https://dns.bufferover.run/dns?q=baidu.com
http://api.hackertarget.com/reversedns/?q=target.com
https://github.com/OJ/gobuster
$ ./gobuster dns -d xxx.com -w subdomains.txt
https://github.com/infosec-au/altdns
$ altdns -i found_subdomains.txt -o permutation_output -w words.txt -r -s resolved_output.txt
https://github.com/OWASP/Amass
$ amass enum -passive -d <Domain Name Here>
https://github.com/guelfoweb/knock
$ knockpy.py <Domain Name Here>
使用SecurityTrails API查询子域名
去https://securitytrails.com/申请个免费的API
curl -s --request GET --url https://api.securitytrails.com/v1/domain/target.com/subdomains?apikey=API_KEY | jq '.subdomains[]' | sed 's/\"//g' >test.txt 2>/dev/null && sed "s/$/.target.com/" test.txt | sed 's/ //g' && rm test.txt
渗透测试手册之信息收集 information gathering

网站使用的CMS的官方demo站

找不到demo就找源码开发者,加群什么的,结合社会工程学要个后台截图(对于一些后台目录复杂的cms),注意看网站上一些功能介绍的截图。

SSL证书信息

https://crt.sh/?q=%25.target.com
https://censys.io/certificates?q=target.com
https://github.com/cheetz/sslScrape

DNS历史解析记录

https://dnsdumpster.com/
https://censys.io/
https://securitytrails.com/
域传送漏洞检查
  Dnsenum、fierce
http://ha.ckers.org/fierce/ 
$ ./fierce.pl -dns example.com 
$ ./fierce.pl –dns example.com –wordlist myWordList.txt
>dig @ns.example.com example=.com AXFR 
>nslookup -type=ns xxx.yyy.cn #查询解析某域名的DNS服务器
>nslookup #进入nslookup交互模式
>server dns.domian.com #指定dns服务器
>ls xxx.yyy.cn #列出域信息

截屏

https://github.com/FortyNorthSecurity/EyeWitness
$ python3 EyeWitness.py -f subdomains.txt --web

同服站点情况

https://site.ip138.com/
火狐插件flagfox,配置单击指向bing查ip对应的域名

同样架构或源码的站

网站js

https://github.com/003random/getJS
https://github.com/Threezh1/JSFinder
或浏览器F12也可以看到加载的
敏感信息、可能存在漏洞的参数等信息
查看网页源代码,注释的一些信息,比如没有删掉的接口、前台没有的页面、越权、注入、js等
https://github.com/GerbenJavado/LinkFinder
$ python linkfinder.py -i <JavaScript File> -o cli
https://github.com/incogbyte/jsearch
$ python3.7 jsearch.py -u https://xxx.com -n xxx

网站使用的第三方js

云信息

Aliyun、AWS、GCP、Azure等
查找可公开访问的实例
  https://github.com/gwen001/s3-buckets-finder
  https://github.com/nccgroup/aws-inventory
  https://github.com/jordanpotti/AWSBucketDump

APP反编译

url、js、osskey、api等信息查找
搜集到接口该怎么做
  Fuzz常见参数

C段/B段信息

Banner、是否存在目标的后台或其他入口/其他业务系统

工具

recon-ng,theharvester,maltego,exiftool等
https://www.spiderfoot.net/
https://github.com/smicallef/spiderfoot

端口对外开放情况

Masscan、scanport,Nmap等
$masscan -p<Port Here> <CIDR Range Here> --exclude <Exclude IP> --banners -oX <Out File Name>
针对常见的那些端口的利用的常规方法
常见的未授权访问的服务如redis,mongodb等

nmap使用

Ping选项

-PE/-PI (ICMP Echo Request Ping)
-PN/-PD/-P0 (不Ping)
-PS (TCP SYN Ping)
-PU (UDP Ping)
-PY (SCTP Ping)
-PO (IP Protocol Ping)
-PP (ICMP Timestamp Ping)
-PM (ICMP Address Mask Ping)
-R (Require Reverse)
-n (Disable Reverse DNS)
--dns-servers (Specify DNS Servers)

OS系统探测

-O (系统指纹)
-A (更高级,更详细的识别操作系统)
--osscan-limit (限制系统扫描)
--osscan-guess, --fuzzy (更灵活的猜测)

版本探测

-sV (版本扫描)
--allports (不错过任何端口)
--version-intensity <Level> (版本扫描强度) 设置从 0 (简单) 到 9 (详细)
--version-light (简单扫描版本)
--version-all (扫描全部版本)
--version-trace (For Debugging) 显示NMAP细节

扫描技术

-sS (TCP SYN Scan) 半开扫描也是隐形扫描
-sT (TCP Connect() Scan) 
-sA (ACK Scan)
-sW (Window Scan)
-sU (UDP Scan)
-sN (Null Scan)
-sF (FIN Scan)
-sX (Xmas Tree Scan)
--scanflags <Flags> (Customize TCP Scan Flags)
-sP (Ping Scan)
-sO (IP Protocol Scan)
-sR (RPC Scan) Remote Procedure Call
-sP (Ping Scan)
-sn (Ping Scan) 不扫描端口
-sL (List Scan) 简单的列表扫描
-sI (Idle Scan) Zombie Scan
-b (FTP Bounce Attack)
-sY (SCTP Init Scan)
-sZ (Cookie-Echo Scans)

机器和端口选项

--exclude (不包括某主机/网络) 
--excludefile (不包括目标文件)
-iR (随机目标)
--randomize_hosts/-rH (随机主机)
-iL (文件中读取目标) 
-Pn (视所有主机为在线状态) 
--system-dns (使用系统的 DNS解析)
--traceroute (追踪每个跃点)
-p <Port Range> (只扫描特殊端口)
-F (Fast Scan) 扫描比默认状态更少的端口,快速扫描
-r (连续扫描) 
--top-ports (扫描常见端口)
--port-ratio (扫描比常见端口更多的端口)

防火墙/ids规避和欺骗

-f/-ff (分段IP数据包)
--mtu <databytes>(最大传输单位)
--ttl <value> (存活时间)
-D <decoy1,decoy2[,ME],...> (创建诱饵掩盖目标)
-S <IP_Address> (欺骗源地址)
-e <iface> (使用指定接口)
-g/--source-port (扫描给定的端口)
--proxies <url1,[url2],...>(通过 HTTP/SOCKS4 代理中继连接)
--data-length <databytes> (Data Length) 将随机数据附加到发送的数据包
--spoof-mac <mac address/prefix/vendor name>  mac地址欺骗
--badsum (伪造数据包)  发送带有伪造 TCP/UDP/SCTP 校验和的数据包
--host-timeout <milliseconds> 主机超时时间
--initial-rtt-timeout <milliseconds> (初始化往返超时)
--min-rtt-timeout <milliseconds> (最小超时时间)
--max-rtt-timeout <milliseconds> (最大超时时间)
--max-hostgroup <number> (每次扫描的最大并行主机数)
--min-hostgroup <number> (每次扫描的最小并行主机数)
--max-parallelism <number> (最大并行端口扫描)
--min-parallelism <number> (最小并行端口扫描)
--scan-delay <milliseconds> (扫描之间的最小延迟)
--max-scan-delay <milliseconds> (探针之间的最大延迟)
--timing/-T<0|1|2|3|4|5> (扫描力度,简单 (T0)| 偷偷摸摸 (T1)| 礼貌 (T2)| 正常 (T3)| 使劲 (T4)| 疯狂 (T5))
--min-rate <number> (每秒发送数据包的速度不低于 <Number>)
--max-rate <number> (每秒发送数据包的速度不超过 <Number>)

运行时交互和报告选项

-v/--verbose/-vv (详细模式/增加详细度)
-d/--debug/-dd (调试模式/增加详细度)
--interactive (交互模式)
--noninteractive (非交互模式)
--reason (显示端口处于特定状态的原因)
--open (仅显示打开(或可能打开)的端口)
--packet-trace (数据包跟踪显示所有发送和接收的数据包)
-iflist (打印主机接口和路由(用于调试))
--log-errors (将错误/警告记录到正常格式的输出文件)
--append-output (追加输出)
--resume <logfilename> (恢复中止的扫描)
--stylesheet <path/URL> (将 XML 输出转换为 HTML)
--webxml (参考来自 Nmap.Org 的样式表以获得更可移植的 XML)
--no-stylesheet (防止 XSL 样式表与/XML 输出的关联)
-oA (一次输出三种主要格式)
-oN <logfilename> (常规模式)
-oX <logfilename> (XML Format)
-oG <logfilename> (Grepable Format)
-oS <logfilename> (Script Kiddie Format)

脚本和其他选项

-sC/--script <Lua Script> (使用lua脚本)
--script-args <n1=v1,[n2=v2,...]> (脚本参数)
--script-args-file=filename (参数写入文件)
--script-trace (显示所有发送和接收的数据)
--script-updatedb (升级脚本库)
--script-help <Lua Script> (显示脚本帮助细节)
-h/--help (帮助查看)
-V/--version (Nmap 版本)
--datadir <directory_name> (Data目录)
-6 (IPv6 支持)
--privileged (完整权限)

目录扫描/爬虫(慎用)

https://github.com/ghostlulzhacks/crawler/tree/master
$ python3 crawler.py -d <URL> -l <Levels Deep to Crawl>
https://web.archive.org 可过滤后缀如.zip,.config,/admin/,/api/
https://github.com/ghostlulzhacks/commoncrawl
$ python cc.py -d <Domain>
https://github.com/OJ/gobuster
$ ./gobuster dir -k -w <Wordlist> -u <URL>
cewl爬取网站关键字
$ cewl http://www.vulnweb.com -m 5 -w word.txt 爬取网站词汇列表存在word.txt -m指定最小长度
-e -n 爬取网站中的邮箱
$ cewl http://www.vulnweb.com -c 统计词出现的次数
$ cewl http://vulnweb.com -d 3 爬取深度
$ cewl http://testphp.vulnweb.com/artists.php --with-numbers  爬取带数字的词汇
--lowercase 提取词汇变小写
代理
$ cewl http://192.168.1.141 --proxy_host 192.168.1.141 --proxy_port 3128
其他工具
ffuf:https://github.com/ffuf/ffuf
gobuster:https://github.com/OJ/gobuster
wfuzz:https://github.com/xmendez/wfuzz
dirbuster

WAF情况识别

https://github.com/EnableSecurity/wafw00f
做好绕过策略的计划

随手测试

单引号
xx.jpg/.php
admin/123456
万能密码
Heartbleed漏洞

搜索引擎

Google自定义搜索引擎整合的300多个社交网站
  https://cse.google.com/cse?key=AIzaSyB2lwQuNzUsRTH-49FA7od4dB_Xvu5DCvg&cx=001794496531944888666:iyxger-cwug&q=%22%22
Google自定义搜索引擎整合的文件共享网站
  https://cse.google.com/cse/publicurl?key=AIzaSyB2lwQuNzUsRTH-49FA7od4dB_Xvu5DCvg&cx=001794496531944888666:hn5bcrszfhe&q=%22%22
领英用户提取
  https://cse.google.com/cse?cx=001394533911082033616:tm5y1wqwmme

Shodan/fofa/zoomeye

net:<"CIDR,CIDR,CIDR">
org:<"Organization Name">
ssl:<"ORGANIZATION NAME">

Google dorks

Site,filetype,intitle,inurl,intext,ext等
https://gbhackers.com/latest-google-dorks-list/
Codepad 是一个在线编译器/解释器。有时可以在此处找到硬编码凭据
site:codepad.co "Company Name" 
Scribd 以其书籍和电子书而闻名,有时可以找到员工上传的包含密码的内部文件
site:scribd.com "Company Name"
查找公司使用的 NodeJS 源代码
site:npmjs.com "Company Name"
列出软件开发项目的 Web 服务依赖关系 
site:libraries.io "Company Name" 
Coggle 用于创建思维导图。 您也许可以找到包含凭据的内部流程图
site:coggle.it "Company Name"
papaly用于保存书签和链接。 您有时可以找到内部链接、文档和凭据。
site:papaly.com "Company Name"
Trello 是一个基于网络的看板。 这通常用于查找组织的凭据和内部链接。
site:trello.com "Company Name"
prezi用于进行演示,有时可能包含内部链接和凭据。
site:prezi.com "Company Name"
NPM 和 GitHub 的 CDN
site:jsdelivr.net "Company Name"
Codepen 是一个用于创建/测试前端代码的在线工具。 您有时可以在这里找到 API 密钥和其他凭据
site:codepen.io "Company Name"
Pastebin 是一个人们上传文本文档的网站,通常用于共享。 通常可以在这里找到内部文件和凭证。 黑客还使用此站点共享数据库泄漏
site:pastebin.com "Company Name"
Repl 是一个在线编译器。 有时可以在用户脚本中找到硬编码的凭据。
site:repl.it "Company Name"
Gitter 是一个开源消息传递平台。 有时可以找到包含凭据、内部链接和其他信息的私人消息。
site:gitter.im "Company Name"
像 GitHub 的 Bitbucket 是一个存储源代码的地方。 您通常可以在这里找到硬编码的凭据和其他信息。
site:bitbucket.org "Company Name"
这个dork可以用来查找confluence、jira等可能包含敏感信息的产品
site:*.atlassian.net "Company Name"
像 GitHub 这样的 Gitlab 用于存储源代码。 您经常可以在这里找到内部源代码和其他敏感信息
Inurl:gitlab "Company Name"

信息泄露

电话、邮箱,姓名
目录遍历
备份文件
  (www.zip,xx.com.zip,www.xx.com.zip,wwwroot.zip)
.svn/.git/sql/robots/crossdomin.xml/DS_Store等
  https://github.com/lijiejie/ds_store_exp
  https://github.com/admintony/svnExploit
若是论坛ID=1的用户名一般为管理、或查看帖子信息、生成字典
网页上客服的QQ(先判断是企业的还是个人,用处有时不太大,看怎么用,搞个鱼叉什么的)

网页缓存

http://www.cachedpages.com/

图片反查

百度识图、googleimage、tineye
原图查询坐标

社交

QQ、weibo、支付宝、脉脉、领英、咸鱼、短视频、人人、贴吧、论坛
外网信息
有些人喜欢把自己的生活传到外网
  推特、ins、fb等

手机号加入通讯录匹配各个APP用户信息

注册过的网站

https://www.reg007.com/
https://www.usersearch.org/

目标人员的兴趣

    目标人员的兴趣 注册过的小众论坛,站点
针对此类站点的深入
收集到的用户名,电话等信息生成字典

邮箱搜集

https://hunter.io/
https://github.com/killswitch-GUI/SimplyEmail

Exchange

https://github.com/dafthack/MailSniper

验证邮箱是否存在

https://tools.verifyemailaddress.io/

历史泄露过的资料等

库
https://haveibeenpwned.com/
https://github.com/kernelmachine/haveibeenpwned

Github/Gitee等代码托管平台

https://github.com/dxa4481/truffleHog
https://github.com/lijiejie/GitHack
https://github.com/MiSecurity/x-patrol
https://github.com/az0ne/Github_Nuggests
https://github.com/mazen160/GithubCloner克隆用户的github

被入侵网址列表

http://zone-h.org/archive
wooyun镜像查找目标企业曾出现的漏洞

GPS查询

https://www.opengps.cn/Default.aspx

网站URL提取

http://www.bulkdachecker.com/url-extractor/

蜜罐判断(参考一下即可)

https://honeyscore.shodan.io/

默认密码

https://default-password.info/
http://routerpasswords.com

如需注册

Sms
  https://www.materialtools.com/
  http://receivefreesms.com/
Email
  https://10minutemail.net/
  https://zh.mytrashmailer.com/
  http://24mail.chacuo.net/enus
  https://www.linshiyouxiang.net/
Fake id
  https://www.fakenamegenerator.com/
  http://www.haoweichi.com/
  https://www.fakeaddressgenerator.com/

企业信息

天眼查、企查查、企业信用信息公示系统
企业邮箱收集,企业架构画像、人员统计、人员职责、部门、WiFi、常用部门密码、人员是否泄露过密码、人员平时爱逛的站点、OA/erp/crm/sso/mail/vpn等入口、网络安全设备(waf,ips,ids,router等统计)、内部使用的代码托管平台(gitlab、daocloud等),bug管理平台、服务器域名资产统计

ASN

https://mxtoolbox.com/asn.aspx

from

转载请注明出处及链接

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注