Login Register






FTP Login With Proxy Mode - PERL filter_list
Author
Message
FTP Login With Proxy Mode - PERL #1
PHP Code:
#!/usr/bin/perl #+++++++++++++++++++++++++++++++++++++++++++++ # Cek FTP Login By Jei.Friee #============================================= # perl ftp.pl <host> <user> <pass> #============================================= # ex => perl ftp.pl 127.0.0.1 anonymous wampp #+++++++++++++++++++++++++++++++++++++++++++++ use Net::FTP; use Socket; use IO::Socket; use IO::Socket::INET; use IO::Select; use LWP; my $host = $ARGV***91;0***93;; my $port = "21"; # Default port 21 my $user = $ARGV***91;1***93;; my $pass = $ARGV***91;2***93;; $ARGV2 = @ARGV; if ($ARGV2 !=3) { print "\r\n+ Example : perl $0 <host> <user> <pass>\r\n"; exit(1); } #set proxy sebelum query. function ini sudah tak buat, lihat di bawah. set_proxy(); my $cekport = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port, Proto =>'tcp', Timeout => 4 ); if ($cekport) { my $ftp = Net::FTP->new($host, port => $port, Debug => 0, Timeout => 2) or die "\r\nCannot connect to $host: $@ \r\n"; $ftp->login($user,$pass) or die "\r\nCannot ", $ftp->message; print "\r\nSuccess login to $host with User: $user | pass: $pass\r\n"; $ftp->quit; } else { print "\r\nPort Connection Failed!!!\r\n"; } my $ua = LWP::UserAgent->new; #var berikut ini, digunakan sebagai header pas ambil proxy my @http_headers = ( 'User-Agent' => 'Mozilla/4.76 ***91;en***93; (Win98; U)', 'Accept' => '*/*', 'Accept-Charset' => 'iso-8859-1,*,utf-8', 'Accept-Language' => 'en-US', 'Host' => 'www.ip-adress.com', 'Connection' => 'Close' ); #sub proxy sub set_proxy { while(1){ $respon = $ua->get("http://www.ip-adress.com/proxy_list/",@http_headers); $tmp = $respon->content; while ($tmp =~ m/<a href="\/proxy_list\/(.*)" onclick="progress/g) { if(check_port($1)){ $proxy = "http://".$1."/"; $ua->proxy(***91;'http'***93;, $proxy); return; } } } } #sub cek port sub check_port { @hash = split(/:/,$_***91;0***93;); $sock = IO::Socket::INET->new(PeerAddr => $hash***91;0***93;, PeerPort => $hash***91;1***93;, Proto => 'tcp'); if($sock){ return 1; } return 0; }

Reply