0x01 前言
实战中经常碰到内网Windows机器不出网的情况,一台一台登录测出网非常麻烦,学习倾旋师傅的思路,利用Windows RPC协议进行探测,并且提到用python的impacket模块可以方便调用RPC;于是和syyu师傅实现了通过dnslog实现内网批量探测Windows出网机器;具体细节可以参考文末链接。
0x02 实现
syyu师傅的脚本:
https://github.com/syyu6/WinRpcTest
usage:
python3 WinRpcTest.py [-h] [--target/-t TARGET] [--file/-f FILE] -u USERNAME -p PASSWORD
eg:
python3 WinRPCtest.py -t 192.168.101.10 -u administrator -p admin123
python3 WinRPCtest.py -f ips.txt -u administrator -p admin123
功能:
批量导入IP地址(导入windows机器IP地址、有账号密码的情况下)
dnslog验证(批量验证IP地址,结束后取dnslog结果,有返回即存在)
dnslog结果去重(dnslog结果去重,返回出网机器的IP地址)
校验失败的IP(验证IP格式错误、连接超时、没有登录成功)
校验结果(最终返回的successful ips,为可出网机器的IP地址)
ToDo:
后期考虑增加 nthash 和 lmhash 的认证方式
0x03 参考
参考链接:
https://github.com/Rvn0xsy/rvn0xsy.github.io/blob/0c31bb921398e9e2b79fb18ab8c4f6a53001ce50/content/post/2022/2022-03-04-windows-rpc.md
https://payloads.online/archivers/2022-03-04/1/
https://github.com/zeronetworks/cornershot
https://s3cur3th1ssh1t.github.io/On-how-to-access-protected-networks/
https://docs.microsoft.com/en-us/windows/win32/rpc/protocol-sequence-constants
原文始发于微信公众号(鸿鹄实验室):通过Windows RPC批量探测出网机器
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论