【攻防小词条 | 攻防技巧】高效信息收集技巧与工具的利用

admin 2023年12月23日01:28:15评论62 views字数 6376阅读21分15秒阅读模式

免责声明

文章所涉及内容,仅供安全研究与教学之用,由于传播、利用本文所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,作者不为此承担任何责任。

详细内容

子域名枚举

1、在线查询

https://Virustotal.com
https://Subdomainfinder.c99.nl
https://crt.sh/?q=%25.target.com
https://securitytrails.com/list/apex_domain/target.com
https://www.shodan.io/search?query=Ssl.cert.subject.CN%3A%22target.com%22
https://hunter.how/list?searchValue=

2、工具查询

amass:深入的攻击面映射和资产发现

工具地址:https://github.com/owasp-amass/amass

用法:
amass enum -passive -norecursive -noalts -df domians.txt -o subs-list.txt

sunfinder:快速被动子域枚举工具

工具地址:https://github.com/projectdiscovery/subfinder

用法:
发现的子域通过管道传递到其他工具,例如:
echo hackerone.com | subfinder -silent | httpx -silent

使用 docker 映像运行:subfinder
docker run projectdiscovery/subfinder:latest -d hackerone.com

使用 docker 映像和本地配置文件运行:subfinder
docker run -v $CONFIG/subfinder:/root/.config/subfinder -t projectdiscovery/subfinder -d hackerone.com

dnsx:快速且多用途的 DNS 工具包,允许使用用户提供的解析器列表运行您选择的多个 DNS 查询

工具地址:https://github.com/projectdiscovery/dnsx

用法:
DNS解析:
从来源获取的被动子域列表中筛选主机名
subfinder -silent -d hackerone.com | dnsx -silent

DNS暴力破解:
给定域的 Bruteforce 子域或域列表使用 和 标志:d    w
dnsx -silent -d facebook.com -w dns_worldlist.txt

通配符过滤:
dnsx -l subdomain_list.txt -wd airbnb.com -o output.txt

chaos:收集和维护互联网资产的数据,旨在加强研究和分析围绕 DNS 的变化,以获得更好的见解

项目地址:https://chaos.projectdiscovery.io/#/

assetfinder:查找与给定域相关的域和子域

工具地址:https://github.com/tomnomnom/assetfinder

用法:
assetfinder [--subs-only] <domain>

子域名去重过滤

使用工具httpx

工具地址:https://github.com/encode/httpx

用法:
httpx -l domain.txt -timeout 13 -o domain-probe.txt

子域名爆破工具

subbrute:子域名爆力枚举

工具地址:https://github.com/TheRook/subbrute

用法:
./subbrute.py -t 列表.txt

altdns:子域名存活筛选

https://github.com/infosec-au/altdns

用法:
./altdns.py -i subdomains.txt -o data_output -w words.txt -r -s output.txt

网站监控工具:能够截图保存需要查看网站运行状态

https://github.com/RedSiege/EyeWitness

https://github.com/breenmachine/httpscreenshot

枚举后收集网站

waybackurls:获取 Wayback Machine 知道的域的URL

https://github.com/tomnomnom/waybackurls

用法:
$ cat domains.txt | waybackurls > urls

gau:通过已知公开信息库,尽可能多的搜索javascript文件

https://github.com/lc/gau

用法:
printf example.com | gau
$ cat domains.txt | gau --threads 5
$ gau example.com google.com
$ gau --o example-urls.txt example.com
$ gau --blacklist png,jpg,gif example.com

网络历史存档

https://web.archive.org/cdx/search/cdx?url=*.target.com&fl=original&collapse =urlkey

使用paramspider和gxss来检测跨站脚本攻击(XSS)

命令

$ cat params | qsreplace yogi | dalfox pipe --mining-dom --deep-domxss --mining-dict --remotepayloads=portswigger,payloadbox --remote wordlists=burp,assetnote -o xssoutput.txt

$ cat alive.txt | waybackurls | gf xss | uro | httpx -silent | qsreplace '"><svg onload=confirm(1)>' | airixss -payload "confirm(1)" | tee xssBug3.txt


使用 SQLidetector 搜索 SQL 注入攻击

SQLiDetector:BurpBouty 配置文件支持简单的 python 脚本,通过发送具有 14 个有效负载的多个请求并检查不同数据库的 152 个正则表达式模式来帮助您检测“基于错误”的 SQL 注入。

https://github.com/eslam3kl/SQLiDetector

用法:
python3 sqlidetector.py -f urls.txt -w 50 -o output.txt -t 10 


shodan搜索技巧

ssl: “target[.]com” 200 http.title: “dashboard” –unauthenticated dashboard

org:“target.com” x-jenkins 200 — unauthenticated jenkins server

ssl:“target.com” 200 proftpd port:21 — proftpd port:21 org:“target.com”

http.html:zabbix — CVE-2022-24255 Main & Admin Portals: Authentication

Bypass org:“target.com” http.title:“phpmyadmin” —-php my admin

ssl:“target.com” http.title:"BIG-IP —F5 BIG-IP using CVE-2020-5902

敏感文件和目录的模糊测试

工具地址:https: //github.com/ffuf/ffuf

使用细节:

1、GET 参数模糊测试

GET 参数名称模糊测试与目录发现非常相似,其工作原理是将关键字定义为 URL 的一部分。这还假定无效的 GET 参数名称的响应大小为 4242 字节。FUZZ

ffuf -w /path/to/paramnames.txt -u https://target/script.php?FUZZ=test_value -fs 4242

如果参数名称已知,则可以以相同的方式对值进行模糊处理。此示例假定返回 HTTP 响应代码 401 的错误参数值。ffuf -w

/path/to/values.txt -u https://target/script.php?valid_name=FUZZ -fc 401

2、POST 数据模糊测试

这是一个非常简单的操作,同样是使用 keyword。此示例仅对 POST 请求的一部分进行模糊测试。我们再次过滤掉 401 个回复。FUZZ

ffuf -w /path/to/postdata.txt -X POST -d "username=admin&password=FUZZ" -u https://target/login.php -fc 401

最长执行时间 如果您不希望 ffuf 无限期地运行,则可以使用 .这将在给定时间(以秒为单位)后停止整个过程。-maxtime

ffuf -w /path/to/wordlist -u https://target/FUZZ -maxtime 60

使用递归时,可以使用 控制每个作业的 maxtime。这将在给定时间(以秒为单位)后停止当前作业,并继续执行下一个作业。当递归功能检测到子目录时,将创建新作业。-maxtime-job

ffuf -w /path/to/wordlist -u https://target/FUZZ -maxtime-job 60 -recursion -recursion-depth 2

查找源/备份文件

例如:

y0gi.hacklido.com
y0gi.hacklido.com /y0gi.zip - hacklido.zip – admin.zip – backup.zip
y0gi.hacklido.com/y0gi/y0gi.zip - hacklido.zip – admin.zip – backup.zip
y0gi.hacklido.com/hacklido/y0gi.zip - hacklido.zip – admin.zip – backup.zip
y0gi.hacklido.com/admin/y0gi.zip - hacklido.zip – admin.zip – backup.zip

fuzzuli:通过创建基于域的动态单词列表来查找关键备份文件

工具地址:https://github.com/musana/fuzzuli

用法:
指定排除域,最小域长度
cat domains.txt

指定扩展名、输入文件等
fuzzuli -f domains.txt -w 32 -ex .rar,.zip -p

谷歌和GitHub收集

通过Google语法查找云存储中的敏感数据:

site:http://s3.amazonaws.com “target[.]com”
site:http://blob.core.windows.net “target[.]com”
site:http://googleapis.com “target[.]com”
site:http://drive.google.com “target[.]com”

收集AWS、Jira、Okta 等的 Github 泄漏:

Org:“target” pwd/pass/passwd/password
“target.atlassian” pwd/pass/passwd/password
“target.okta” pwd/pass/passwd/password
“Jira.target” pwd/pass/passwd/password

js文件收集:httpx

httpx -content-type | grep 'application/javascript'

使用nuclei扫描

nuclei -t /root/nuclei-templates/exposures/

JS接口测试小技巧:从 Js 文件中收集所有端点并从中创建一个词表,使用任何参数自动构造 POST 请求对敏感目录进行模糊测试。

可用工具
Jsminer (Burp插件)
https://github.com/KathanP19/JSFScan.sh
https://github.com/trufflesecurity/trufflehog

其他自动化框架

Sudomy:一个子域枚举工具,用于收集子域和分析域,执行自动侦察 (recon) 以进行错误搜寻/渗透测试

工具地址:https://github.com/Screetsec/Sudomy

 用法:
 $ sudomy -d hackerone.com
 $ sudomy -s shodan,dnsdumpster,webarchive -d hackerone.com
 $ sudomy -d hackerone.com --no-probe
 $ sudomy -pS -sC -sS -d hackerone.com

Reconftw:通过运行一组最佳工具来执行扫描和查找漏洞,从而在目标域上执行自动侦察

工具地址:https://github.com/six2dez/reconftw

用法:
对单个目标执行完全侦察
./reconftw.sh -d target.com -r

对目标列表执行完全侦察
./reconftw.sh -l sites.txt -r -o /output/directory/

执行更耗时任务的完整侦察(仅限 VPS)
./reconftw.sh -d target.com -r --deep -o /output/directory/

在多域目标中执行侦察
./reconftw.sh -m company -l domains_list.txt -r

使用 axiom 积分执行侦察
./reconftw.sh -d target.com -r -v

执行所有步骤(整个侦察+所有攻击),又名YOLO模式
./reconftw.sh -d target.com -a

Shuize:水泽,信息收集自动化工具

工具地址:https://github.com/0x727/ShuiZe_0x727

用法:
python3 ShuiZe.py -d domain.com
收集单一的根域名资产
python3 ShuiZe.py --domainFile 域.txt
批量跑根域名列表
python3 ShuiZe.py -c 192.168.1.0,192.168.2.0,192.168.3.0
收集C段资产
python3 ShuiZe.py -f url.txt
对url里的网站漏洞检测
python3 ShuiZe.py --fofaTitle XXX大学
从fofa里收集标题为XXX大学的资产,然后漏洞检测
python3 ShuiZe.py -d domain.com --justInfoGather 1
仅信息收集,不检测漏洞
python3 ShuiZe.py -d domain.com --ksubdomain 0
不调用ksubdomain爆破子域名


原文始发于微信公众号(划水但不摆烂):【攻防小词条 | 攻防技巧】高效信息收集技巧与工具的利用

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年12月23日01:28:15
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【攻防小词条 | 攻防技巧】高效信息收集技巧与工具的利用https://cn-sec.com/archives/2324731.html

发表评论

匿名网友 填写信息