Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre>
- <?php
- set_time_limit(0);
- if ($f = fopen('/home/alex/Desktop/X/SHIT-FTP.txt', 'r'))
- {
- $fout = fopen('/tmp/ftpc.txt', 'w');
- while (!feof($f))
- {
- $line = trim(fgets($f));
- if (substr($line, -1) == '/')
- $line = substr($line, 0, strlen($line)-1);
- $parsed = parse_url($line);
- if (isset($parsed['host']))
- {
- $host = $parsed['host'];
- $user = $parsed['user'];
- $pass = $parsed['pass'];
- }
- else
- {
- if (preg_match('/^ftp:\/\/(.+?):(.+?)@\s*([\w\.\-]+):?\d*/', $line, $m) || preg_match('/^(.+?):(.+?)@\s*([\w\.\-]+):?\d*/', $line, $m))
- {
- $host = $m[3];
- $user = $m[1];
- $pass = $m[2];
- }
- else
- {
- echo "Cannot parse $line\n"; flush();
- continue;
- }
- }
- echo "$host:$user:$pass\n"; flush();
- fwrite($fout, "$host:$user:$pass\n");
- }
- fclose($fout);
- fclose($f);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement