Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # |-------------------------------------|
- # | A feeble attempt at doing something |
- # | constructive with my time. |
- # |-------------------------------------|
- 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" => '*******',
- "mysql_db" => '****************8',
- "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";
- ftp_s();
- sub ftp_s {
- my $telnet = IO::Socket::INET->new( LocalAddr => 'localhost',
- Proto => 'tcp',
- LocalPort => $config{ftp},
- 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 ($user,$pass) = '';
- while ($telnet_c = $telnet->accept()) {
- $telnet_c->autoflush(1);
- print $telnet_c "220 Rapture FTP Service\n";
- printf "\tConnection attempt from %s\n",$telnet_c->peerhost;
- print $telnet_c "\n\nWelcome to rapture FTP\n\n";
- my $hostinfo = gethostbyaddr($telnet_c->peeraddr);
- while (my $body = <$telnet_c>) {
- chop $body;
- if($body =~ /USER ([a-z\d]+)/i){
- print $telnet_c "331 User name okay, need password.\r\n";
- $user = $1;
- }
- if($body =~ /PASS ([a-z\d]+)/i){
- print $telnet_c "230 User logged in, proceed.\r\n";
- }
- if($body =~ /PORT (.+)/){
- print $telnet_c "200 PORT command successful.\r\n";
- }
- if($body =~ /(?:quit|exit)/){ last; }
- } #continue {
- # print $telnet_c "Command: ";
- # } telog($telnet_c->peerhost,"USA",$user,$pass,$body);
- printf "\tDisconnect from %s ($user/$pass)\n",$telnet_c->peerhost;
- close $telnet_c;
- }
- }
- sub telog {
- my ($ip,$country,$user,$pass,$command) = @_;
- $db->do("INSERT INTO ftp (IP,country,user,pass,command) VALUES (?,?,?,?,?)", [$ip,$country,$user,$pass,$command]);
- if($config{verbosity} == 1){
- print "[TELNET] [ Host: $_[0] ][ Country: $_[1] ][ User: $_[2] ][ Pass: $_[3] ][ Command: $_[4] ]\n";
- }
- }
- $db->disconnect;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement