Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Get CIDRs from Robtex, per ASN
- */
- $output = array();
- #400000
- for($i = 0; $i<=400000; $i++)
- {
- $data = @file_get_contents('https://www.robtex.com/as/as'.$i.'.html');
- preg_match('/<title>(.*)<\/title>/', $data, $ASN_title);
- preg_match_all('/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}\/[0-9]{2}/', $data, $ASN_ranges);
- if(count($ASN_title)<1)
- {
- continue;
- }
- foreach($ASN_ranges[0] as $range)
- {
- $return[$ASN_title[1]][] = $range;
- }
- $output[] = $return;
- unset($return);
- }
- file_put_contents('output.txt', serialize($output));
Advertisement
Add Comment
Please, Sign In to add comment