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;
- my %config = (
- "ftp" => 21,
- "ssh" => 22,
- "telnet" => 23,
- "VNC" => 5900,
- "verbosity" => 1,
- );
- #my $log = `echo \$LOGNAME`;
- #die("Must run as root") unless $log eq 'root';
- my $telnet = IO::Socket::INET->new( LocalAddr => 'localhost',
- Proto => 'tcp',
- LocalPort => $config{telnet},
- Listen => 1,
- Reuse => 1,
- );
- die("Cant start TELNET daemon.. $$") unless $telnet;
- print "[TELNET honeypot waiting for connections...]\n";
- while ($telnet = $telnet->accept()) {
- $telnet->autoflush(1);
- print $telnet "\n\nUser Access Verification\n\n";
- my $hostinfo = gethostbyaddr($telnet->peeraddr);
- print $telnet "Username: ";
- chomp(my $uat = <$telnet>);
- print $telnet "\nOk.\n\nPassword: ";
- while(my $pat = <$telnet>){
- chop $pat;
- if($pat =~ /(?:admin|root|password)/){
- print $telnet "\nOk.\n\n";
- telog("[TELNET]: Login from " . $telnet->peerhost,"(".$uat."/".$pat.")");
- last;
- }
- else {
- print $telnet "\nWrong.\nPassword: ";
- }
- }
- print $telnet "Command: ";
- while (my $body = <$telnet>) {
- chop $body;
- telog("[TELNET]: " . $telnet->peerhost,"Command: " . $body);
- print $telnet "$body is not a recognized command\n";
- print $telnet "Command: ";
- }
- close $telnet;
- }
- sub telog {
- if($config{verbosity} == 1){
- print color 'bold red';
- print "$_[0] $_[1]\n";
- print color 'reset';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement