|
Posted by d43m0n on 04/03/06 01:29
Hello,
Recently I have become more active in the hacking industry, and thought
it would be nice to post some simple source code here at the group.
This source code is copyrighted, so please give credit, where credit is
due.
As well, if anyone wishes to improove the source below, please be sure
to post the update here. This source code is a nice adition, it is
quick return for every 4,294,967,296 (256^4) IP Addresses.
<?php
if (php_sapi_name() == 'cli' && isset($argv[1]) || isset($argv[2]) ||
isset($argv[3]) || isset($argv[4])) {
$oct[0] = $argv[1];
$oct[1] = $argv[2];
$oct[2] = $argv[3];
$oct[3] = $argv[4];
}
elseif (php_sapi_name() == 'cli') {
echo 'First Oct: ';
$oct[0] = trim(fgets(STDIN));
echo 'Second Oct: ';
$oct[1] = trim(fgets(STDIN));
echo 'Third Oct: ';
$oct[2] = trim(fgets(STDIN));
echo 'Forth Oct: ';
$oct[3] = trim(fgets(STDIN));
}
else {
$oct[0] = '0';
$oct[1] = '0';
$oct[2] = '0';
$oct[3] = '0';
}
for ($ip['0'] = $oct[0]; $ip['0'] <= '255'; $ip['0']++) {
for ($ip['1'] = $oct[1]; $ip['1'] <= '255'; $ip['1']++) {
for ($ip['2'] = $oct[2]; $ip['2'] <= '255'; $ip['2']++) {
for ($ip['3'] = $oct[3]; $ip['3'] <= '255'; $ip['3']++) {
$addr = $ip['0'] . '.' . $ip['1'] . '.' . $ip['2'] . '.'
..$ip['3'] . "\n";
echo 'Testing ' . $addr;
}
}
}
}
?>
Any questions or comments, besure to send them here, or to my email.
~ Daemon
"Let's just save time and assume that I know everything."
Navigation:
[Reply to this message]
|