Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env php
- __ __ _ _ __ _
- \ \ / /__| |__ | |/ /___| | ___ _ __
- \ \ /\ / / _ \ '_ \| ' // _ \ |/ _ \| '_ \
- \ V V / __/ |_) | . \ __/ | (_) | | | |
- \_/\_/ \___|_.__/|_|\_\___|_|\___/|_| |_|
- <?php
- function cli_color($text, $color) {
- $colors = array(
- 'black' => '0;30',
- 'dark_gray' => '1;30',
- 'blue' => '0;34',
- 'light_blue' => '1;34',
- 'green' => '0;32',
- 'light_green' => '1;32',
- 'cyan' => '0;36',
- 'light_cyan' => '1;36',
- 'red' => '0;31',
- 'light_red' => '1;31',
- 'purple' => '0;35',
- 'light_purple' => '1;35',
- 'brown' => '0;33',
- 'yellow' => '1;33',
- 'light_gray' => '0;37',
- 'white' => '1;37',
- );
- return "\033[" . $colors[$color] . "m" . $text . "\033[0m";
- }
- echo "[!] Input URL Lists > "; $lists = trim(fgets(STDIN));
- $SCAN = explode("\n" , str_replace("\r","",file_get_contents($lists)));
- foreach($SCAN as $file)
- {
- echo "======================================================================\n";
- echo "[!] Scanning ".cli_color($file,'green')." ...\n";
- $tmp = file_get_contents($file);
- if(preg_match("/<title>(.*)<\/title>/i" , $tmp , $title))
- {
- echo cli_color("[!] Title : ".$title[1]."\n","yellow");
- file_put_contents($title[1].".html" , $tmp);
- $filename = $title[1].".html";
- }
- echo cli_color("[####] PROCESS $file \n","blue");
- sleep(2);
- $file = file_get_contents($filename);
- preg_match_all('/(href|src)\s*=\s*"([^\s]+\/\/[^\/]+.\/[^\s]+\.(jpg|jpeg|png|gif|bmp|css|js))/ixu' , $file,$match);
- $asset = $match[2];
- $asset = array_unique($asset);
- foreach($asset as $ass)
- {
- $folder = str_replace(['http://','https://' , basename($ass)],'',$ass);
- echo "[!] Making folder : ".cli_color($folder,"yellow");
- if(!is_dir($folder))
- {
- @mkdir($folder,0777,true);
- echo cli_color(" OK \n","green");
- }else{
- echo cli_color(" EXISTS \n","red");
- }
- echo "[+] Save output $ass ";
- $ff = @file_get_contents($ass);
- file_put_contents($folder.'/'.basename($ass),$ff);
- echo " OK \n";
- }
- file_put_contents($filename , str_replace(['http://' , 'https://'],'./' , $file));
- echo "======================================================================\n";
- sleep(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement