天天看点

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执行命令方法总结

继续阅读