Skip to content

Instantly share code, notes, and snippets.

@wfyanmnm
wfyanmnm / analyze-ip-relationships.php
Last active September 7, 2015 12:12 — forked from ck-on/analyze-ip-relationships.php
Analyze a large list of IPs for potential relationships (eventually group IPs into CIDR ranges) Useful to help decode a botnet attacking servers.
<?php
$file='ip-list.txt';
$closeness=32768; // 65536 131072;
$minrelated=4;
$sorted=array();
$ips=file($file);
echo '<pre style="white-space:pre-wrap;">',count($ips)," IPs <br>\r\n"; flush();