PsExec

当我们输入

PsExec.exe \\192.168.100.26 -u sh-testcp-s1\Administrator -h cmd.exe

发生了如下事情

1. 在目标机器的$ADMIN中上传了PSEXESVC.exe
2. 创建了服务,并启动该服务

具体的发包情况如下

  1. 开启一个SMB session
  2. 通过SMB访问共享文件夹,并且访问PSEXESVC.exe

Image text

  1. 打开\xxx\pipe\svcct句柄来与目标机Service Control Manager进行通信,使之可以进行远程通信

  2. 创建一个服务并运行它

Image text

Image text

我们也可以看到它创建管道的stdin 和stdout

Image text

[未完待续]

参考

https://www.contextis.com/en/blog/lateral-movement-a-deep-look-into-psexec

https://401trg.com/an-introduction-to-smb-for-network-security-analysts/