Last active
August 29, 2015 14:02
-
-
Save deekayen/67ed8972a0e54ef03e8e to your computer and use it in GitHub Desktop.
Node enumeration script finds the availability of content within a Drupal site for audit purposes. May help uncover pages mistakenly available to anonymous users.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url_prefix = 'https://deekayen.net/node/'; | |
$low = 1400; | |
$high = 1450; | |
$output_file = '/Users/davidnorman/Sites/scan/scan.csv'; | |
/******************************************/ | |
$fp = fopen($output_file, 'w'); | |
fputcsv($fp, array('URL', 'Status Code')); | |
for ($i = $low; $i <= $high; $i++) { | |
$ch = curl_init($url_prefix . $i); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
curl_exec($ch); | |
$info = curl_getinfo($ch); | |
if ($info['http_code'] != '404') { | |
fputcsv($fp, array($info['url'], $info['http_code'])); | |
} | |
curl_close($ch); | |
} | |
fclose($fp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment