Skip to content

Instantly share code, notes, and snippets.

@saltybeagle
Created March 20, 2015 00:56
Show Gist options
  • Save saltybeagle/4cb8910d602cc29bc067 to your computer and use it in GitHub Desktop.
Save saltybeagle/4cb8910d602cc29bc067 to your computer and use it in GitHub Desktop.
FREAK IPs
<?php
// file containing the nmap report
$file = file(__DIR__ . '/freak_443.txt');
$current_ip_number = false;
$weak_ips = array();
foreach ($file as $line) {
if (preg_match('/Nmap scan report for (.*)/', $line, $matches)) {
$current_ip_number = $matches[1];
}
if (strpos($line, 'EXPORT') !== false) {
$weak_ips[$current_ip_number] = 'weak';
}
}
foreach ($weak_ips as $weak_ip=>$blah) {
echo $weak_ip.PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment