I think you meant
if (strpos(@file_get_contents('http://'.long2ip($c), false, stream_context_create(array('http’ => array('timeout’ => $argv[3])))), $argv[4]) !== false)
Re:LulzSec's 3-line PHP Portscan
by PawelDecowski on Friday June 24, 2011 @11:39AM
(#2692591)
Well spotted.
I forgot to replace it on line 2, only did it on line 3.
Your code has a bug on line 2.
@file_get_contents('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.
Re:LulzSec's 3-line PHP Portscan
by PawelDecowski on Friday June 24, 2011 @11:40AM
(#2692594)
Yeah, I missed it. Thanks for spotting.
Why not just: