Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/php -q
- <?php
- /*
- Uso ./capurl.php --site=http://alvo.com.br
- Permição 775 no arquivo capurl
- By: Googleinurl
- */
- function argumentos($argv) {
- $_ARG = array();
- foreach ($argv as $arg) {
- if (ereg('--[a-zA-Z0-9]*=.*',$arg)) {
- $str = split("=",$arg); $arg = '';
- $key = ereg_replace("--",'',$str[0]);
- for ( $i = 1; $i < count($str); $i++ ) {
- $arg .= $str[$i];
- }
- $_ARG[$key] = $arg;
- } elseif(ereg('-[a-zA-Z0-9]',$arg)) {
- $arg = ereg_replace("-",'',$arg);
- $_ARG[$arg] = 'true';
- }
- }
- return $_ARG;
- }
- ini_set("max_execution_time",0);
- $html=file_get_contents(argumentos($argv)['site']); // Abre a página
- preg_match_all("((href|src) *?= *?(\"|\')(.+?)\\2)i",$html,$array);
- $abrirtxt = fopen("resultado".date("H-i-s").".txt", "a");
- foreach($array[3] as $url){
- echo $url."\n\r";
- $escreve = fwrite($abrirtxt, $url."\n\r");
- }
- fclose($abrirtxt);
- ?>
Add Comment
Please, Sign In to add comment