3 ms·
What's with the weird for loop? Why not just: for ($c = ip2long($argv[1]); $c <= ip2long($argv[2]); $c++) if (strpos(@file_get_contents('http:
by PawelDecowski 15y ago
What's with the weird for loop?
Why not just:
for ($c = ip2long($argv[1]); $c <= ip2long($argv[2]); $c++)
if (strpos(@file_get_contents('http://'.long2ip(ip2long($argv[1])+$c), false, stream_context_create(array('http’ => array('timeout’ => $argv[3])))), $argv[4]) !== false)
die('H4xed :D — '.long2ip($c));
- pak 15y agoI think you meant if (strpos(@file_get_contents('http://'.long2ip($c), false, stream_context_create(array('http’ => array('timeout’ => $argv[3])))), $argv[4]) !== false)
- PawelDecowski 15y agoWell spotted. I forgot to replace it on line 2, only did it on line 3.
- zbanks 15y agoYour code has a bug on line 2. @file_get_contents('http://.long2ip(ip2long($argv[1])+$c http://.long2ip(ip2long($argv[1])+$c) Since $c is the IP address itself, adding the starting IP again will check a completely different IP. Besides that, you have a point. I feel like the code would be so much cleaner if they just added a 4th line to declare ip2long($argv[1]) as a variable.
- PawelDecowski 15y agoYeah, I missed it. Thanks for spotting.