Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # +-------------------------------------+
- # | Multi-Protocol Honeypot (MPH v0.1) |
- # |-------------------------------------|
- # | A feeble attempt at doing something |
- # | constructive with my time. |
- # |-------------------------------------|
- # | --- By: k0pp | SABS Coding --- |
- # | -- irc.system-abuse.net:+6697 -- |
- # +-------------------------------------+
- use warnings;
- #use strict qw(vars);
- use IO::Socket;
- use Net::hostent;
- use Term::ANSIColor;
- use DBI::Mysqlsimple;
- use Data::Dumper;
- local $Data::Dumper::Purity = 1;
- my %config = (
- "ftp" => 21,
- "ssh" => 22,
- "telnet" => 23,
- "VNC" => 5900,
- "mysql_user" => 'k0pp',
- "mysql_pass" => 'fuck',
- "mysql_db" => 'honey',
- "verbosity" => 1,
- );
- print color 'white';
- my $db = DBI::Mysqlsimple->new($config{mysql_db},'127.0.0.1',$config{mysql_user},$config{mysql_pass});
- print "\n\n[MySQL]:\tConnected To Database...\n";
- my $telnet = IO::Socket::INET->new( LocalAddr => 'localhost',
- Proto => 'tcp',
- LocalPort => $config{telnet},
- Listen => SOMAXCONN,
- Reuse => 1,
- );
- print "[TELNET]:\tSuccesfully Created Telnet Server....\n";
- die("Cant start TELNET daemon.. $$") unless $telnet;
- print "[TELNET]:\tHoneypot Ready...]\n\n\n";
- print color 'cyan';
- my ($aut, $pat) = '';
- while ($telnet = $telnet->accept()) {
- $telnet->autoflush(1);
- printf "\tConnection attempt from %s\n",$telnet->peerhost;
- print $telnet "\n\nUser Access Verification\n\n";
- my $hostinfo = gethostbyaddr($telnet->peeraddr);
- print $telnet "Username: ";
- $uat = <$telnet>;
- chomp $uat;
- if($uat =~ /([a-z\d]+)/i){$uat = $1;}
- print $telnet "\nOk.\n\nPassword: ";
- $pat = <$telnet>;
- chomp $pat;
- if($pat =~ /([a-z]+)/i){$pat = $1;} else { print "Pat fucked up..\n $pat\n\n";}
- print $telnet "\nWelcome to rapture\n\nCommand: ";
- while (my $body = <$telnet>) {
- chomp $body;
- if($body =~ /([^\r\n]+)/i){$body = $1;}
- telog($telnet->peerhost,"USA",$uat,$pat,$body);
- print $telnet "$body is not a recognized command\n";
- if($body =~ /(?:quit|exit)/){ last; }
- } continue {
- print $telnet "Command: ";
- }
- print "Client disconnected\n";
- close $telnet;
- }
- $db->disconnect;
- sub telog {
- my ($ip,$country,$user,$pass,$command) = @_;
- $db->do("INSERT INTO telnet (IP,country,user,pass,command) VALUES (?,?,?,?,?)", [$ip,$country,$user,$pass,$command]);
- if($config{verbosity} == 1){
- print "[ Host: $_[0] ]\t[ Country: $_[1] ]\t[ User: $_[2] ]\t[ Pass: $_[3] ]\t[Command: $_[4] ]\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement