Advertisement
Guest User

Untitled

a guest
May 10th, 2017
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3.  
  4. # +-------------------------------------+
  5. # | Multi-Protocol Honeypot (MPH v0.1) |
  6. # |-------------------------------------|
  7. # | A feeble attempt at doing something |
  8. # | constructive with my time. |
  9. # |-------------------------------------|
  10. # | --- By: k0pp | SABS Coding --- |
  11. # | -- irc.system-abuse.net:+6697 -- |
  12. # +-------------------------------------+
  13.  
  14.  
  15. use warnings;
  16. #use strict qw(vars);
  17.  
  18. use IO::Socket;
  19. use Net::hostent;
  20. use Term::ANSIColor;
  21. use DBI::Mysqlsimple;
  22. use Data::Dumper;
  23. local $Data::Dumper::Purity = 1;
  24. my %config = (
  25. "ftp" => 21,
  26. "ssh" => 22,
  27. "telnet" => 23,
  28. "VNC" => 5900,
  29. "mysql_user" => 'k0pp',
  30. "mysql_pass" => 'fuck',
  31. "mysql_db" => 'honey',
  32. "verbosity" => 1,
  33. );
  34. print color 'white';
  35. my $db = DBI::Mysqlsimple->new($config{mysql_db},'127.0.0.1',$config{mysql_user},$config{mysql_pass});
  36. print "\n\n[MySQL]:\tConnected To Database...\n";
  37. my $telnet = IO::Socket::INET->new( LocalAddr => 'localhost',
  38. Proto => 'tcp',
  39. LocalPort => $config{telnet},
  40. Listen => SOMAXCONN,
  41. Reuse => 1,
  42. );
  43. print "[TELNET]:\tSuccesfully Created Telnet Server....\n";
  44. die("Cant start TELNET daemon.. $$") unless $telnet;
  45. print "[TELNET]:\tHoneypot Ready...]\n\n\n";
  46. print color 'cyan';
  47. my ($aut, $pat) = '';
  48. while ($telnet = $telnet->accept()) {
  49. $telnet->autoflush(1);
  50. printf "\tConnection attempt from %s\n",$telnet->peerhost;
  51. print $telnet "\n\nUser Access Verification\n\n";
  52. my $hostinfo = gethostbyaddr($telnet->peeraddr);
  53. print $telnet "Username: ";
  54. $uat = <$telnet>;
  55. chomp $uat;
  56. if($uat =~ /([a-z\d]+)/i){$uat = $1;}
  57. print $telnet "\nOk.\n\nPassword: ";
  58. $pat = <$telnet>;
  59. chomp $pat;
  60. if($pat =~ /([a-z]+)/i){$pat = $1;} else { print "Pat fucked up..\n $pat\n\n";}
  61. print $telnet "\nWelcome to rapture\n\nCommand: ";
  62. while (my $body = <$telnet>) {
  63. chomp $body;
  64. if($body =~ /([^\r\n]+)/i){$body = $1;}
  65. telog($telnet->peerhost,"USA",$uat,$pat,$body);
  66. print $telnet "$body is not a recognized command\n";
  67. if($body =~ /(?:quit|exit)/){ last; }
  68. } continue {
  69. print $telnet "Command: ";
  70. }
  71. print "Client disconnected\n";
  72. close $telnet;
  73. }
  74. $db->disconnect;
  75. sub telog {
  76. my ($ip,$country,$user,$pass,$command) = @_;
  77. $db->do("INSERT INTO telnet (IP,country,user,pass,command) VALUES (?,?,?,?,?)", [$ip,$country,$user,$pass,$command]);
  78. if($config{verbosity} == 1){
  79. print "[ Host: $_[0] ]\t[ Country: $_[1] ]\t[ User: $_[2] ]\t[ Pass: $_[3] ]\t[Command: $_[4] ]\n";
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement