Advertisement
Guest User

Untitled

a guest
May 8th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3.  
  4. # |-------------------------------------|
  5. # | A feeble attempt at doing something |
  6. # | constructive with my time. |
  7. # |-------------------------------------|
  8.  
  9. use warnings;
  10. #use strict qw(vars);
  11.  
  12. use IO::Socket;
  13. use Net::hostent;
  14. use Term::ANSIColor;
  15. use DBI::Mysqlsimple;
  16. use Data::Dumper;
  17. local $Data::Dumper::Purity = 1;
  18. my %config = (
  19. "ftp" => 21,
  20. "ssh" => 22,
  21. "telnet" => 23,
  22. "VNC" => 5900,
  23. "mysql_user" => 'k0pp',
  24. "mysql_pass" => '*******',
  25. "mysql_db" => '****************8',
  26. "verbosity" => 1,
  27. );
  28. print color 'white';
  29. my $db = DBI::Mysqlsimple->new($config{mysql_db},'127.0.0.1',$config{mysql_user},$config{mysql_pass});
  30. print "\n\n[MySQL]:\tConnected To Database...\n";
  31.  
  32. ftp_s();
  33.  
  34. sub ftp_s {
  35. my $telnet = IO::Socket::INET->new( LocalAddr => 'localhost',
  36. Proto => 'tcp',
  37. LocalPort => $config{ftp},
  38. Listen => SOMAXCONN,
  39. Reuse => 1,
  40. );
  41. print "[TELNET]:\tSuccesfully Created Telnet Server....\n";
  42. die("Cant start TELNET daemon.. $$") unless $telnet;
  43. print "[TELNET]:\tHoneypot Ready...]\n\n\n";
  44. print color 'cyan';
  45. my ($user,$pass) = '';
  46. while ($telnet_c = $telnet->accept()) {
  47. $telnet_c->autoflush(1);
  48. print $telnet_c "220 Rapture FTP Service\n";
  49. printf "\tConnection attempt from %s\n",$telnet_c->peerhost;
  50. print $telnet_c "\n\nWelcome to rapture FTP\n\n";
  51. my $hostinfo = gethostbyaddr($telnet_c->peeraddr);
  52. while (my $body = <$telnet_c>) {
  53. chop $body;
  54. if($body =~ /USER ([a-z\d]+)/i){
  55. print $telnet_c "331 User name okay, need password.\r\n";
  56. $user = $1;
  57. }
  58. if($body =~ /PASS ([a-z\d]+)/i){
  59. print $telnet_c "230 User logged in, proceed.\r\n";
  60. }
  61. if($body =~ /PORT (.+)/){
  62. print $telnet_c "200 PORT command successful.\r\n";
  63. }
  64. if($body =~ /(?:quit|exit)/){ last; }
  65. } #continue {
  66. # print $telnet_c "Command: ";
  67. # } telog($telnet_c->peerhost,"USA",$user,$pass,$body);
  68.  
  69. printf "\tDisconnect from %s ($user/$pass)\n",$telnet_c->peerhost;
  70. close $telnet_c;
  71. }
  72. }
  73. sub telog {
  74. my ($ip,$country,$user,$pass,$command) = @_;
  75. $db->do("INSERT INTO ftp (IP,country,user,pass,command) VALUES (?,?,?,?,?)", [$ip,$country,$user,$pass,$command]);
  76. if($config{verbosity} == 1){
  77. print "[TELNET] [ Host: $_[0] ][ Country: $_[1] ][ User: $_[2] ][ Pass: $_[3] ][ Command: $_[4] ]\n";
  78. }
  79. }
  80. $db->disconnect;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement