function dicmakeR()
{
    global $errorbox, $windows, $footer, $t, $et, $hcwd;
    $combo = empty($_REQUEST['combo']) ? 0 : 1;
    if (!empty($_REQUEST['range']) && !empty($_REQUEST['output']) && !empty($_REQUEST['min']) && !empty($_REQUEST['max'])) {
        $min = $_REQUEST['min'];
        $max = $_REQUEST['max'];
        if ($max < $min) {
            die($errorbox . "Bad input!{$et}" . $footer);
        }
        $s = $w = '';
        $out = $_REQUEST['output'];
        $r = $_REQUEST['range'];
        $dic = fopen($out, 'w');
        if ($r == 1) {
            for ($s = pow(10, $min - 1); $s < pow(10, $max - 1); $s++) {
                $w = $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
            }
        } else {
            $s = str_repeat($r, $min);
            while (strlen($s) < $max) {
                $w = $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
                $s++;
            }
        }
        fclose($dic);
        echo '<font color=blue>Done</font>';
    } elseif (!empty($_REQUEST['input']) && !empty($_REQUEST['output'])) {
        $input = fopen($_REQUEST['input'], 'r');
        if (!$input) {
            if ($windows) {
                echo $errorbox . 'Unable to read from ' . htmlspecialchars($_REQUEST['input']) . "{$et}<br>";
            } else {
                $input = explode("\n", shelL("cat {$input}"));
                $output = fopen($_REQUEST['output'], 'w');
                if ($output) {
                    foreach ($input as $in) {
                        $user = $in;
                        $user = trim(fgets($in), " \n\r");
                        if (!strstr($user, ':')) {
                            continue;
                        }
                        $user = substr($user, 0, strpos($user, ':'));
                        if ($combo) {
                            fwrite($output, $user . ':' . $user . "\n");
                        } else {
                            fwrite($output, $user . "\n");
                        }
                    }
                    fclose($input);
                    fclose($output);
                    echo '<font color=blue>Done</font>';
                }
            }
        } else {
            $output = fopen($_REQUEST['output'], 'w');
            if ($output) {
                while (!feof($input)) {
                    $user = trim(fgets($input), " \n\r");
                    if (!strstr($user, ':')) {
                        continue;
                    }
                    $user = substr($user, 0, strpos($user, ':'));
                    if ($combo) {
                        fwrite($output, $user . ':' . $user . "\n");
                    } else {
                        fwrite($output, $user . "\n");
                    }
                }
                fclose($input);
                fclose($output);
                echo '<font color=blue>Done</font>';
            } else {
                echo $errorbox . ' Unable to write data to ' . htmlspecialchars($_REQUEST['input']) . "{$et}<br>";
            }
        }
    } elseif (!empty($_REQUEST['url']) && !empty($_REQUEST['output'])) {
        $res = downloadiT($_REQUEST['url'], $_REQUEST['output']);
        if ($combo && $res) {
            $file = file($_REQUEST['output']);
            $output = fopen($_REQUEST['output'], 'w');
            foreach ($file as $v) {
                fwrite($output, "{$v}:{$v}\n");
            }
            fclose($output);
        }
        echo '<font color=blue>Done</font>';
    } else {
        $temp = whereistmP() . DIRECTORY_SEPARATOR;
        echo "<center>{$t}Wordlist generator:</td><td bgcolor='#333333'></td></tr><form method='POST'><tr><td width='20%' bgcolor='#666666'>Range:</td><td bgcolor='#666666'><select name=range><option value=a>a-z</option><option value=A>A-Z</option><option value=1>0-9</option></select></td></tr><tr><td width='20%' bgcolor='#808080'>Min lenght:</td><td bgcolor='#808080'><select name=min><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option></select></td></tr><tr><td width='20%' bgcolor='#666666'>Max lenght:</td><td bgcolor='#666666'><select name=max><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8 selected>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option><option value=12>12</option><option value=13>13</option><option value=14>14</option><option value=15>15</option></select></td></tr><tr><td width='20%' bgcolor='#808080'>Output:</td><td bgcolor='#808080'><input type=text value='{$temp}.dic' name=output size=35></td></tr><tr><td width='20%' bgcolor='#666666'></td><td bgcolor='#666666'><input type=checkbox name=combo style='border-width:1px;background-color:#666666;' value=1 checked>Combo style output</td></tr><td bgcolor='#808080'></td><td bgcolor='#808080' align=right>{$hcwd}<input class=buttons type=submit value=Make></form>{$et}<br>{$t}Grab dictionary:</td><td bgcolor='#333333'></td></tr><form method='POST'><tr><td width='20%' bgcolor='#666666'>Grab from:</td><td bgcolor='#666666'><input type=text value='/etc/passwd' name=input size=35></td></tr><tr><td width='20%' bgcolor='#808080'>Output:</td><td bgcolor='#808080'><input type=text value='{$temp}.dic' name=output size=35></td></tr><tr><td width='20%' bgcolor='#666666'></td><td bgcolor='#666666'><input type=checkbox style='border-width:1px;background-color:#666666;' name=combo value=1 checked>Combo style output</td></tr><td bgcolor='#808080'></td><td bgcolor='#808080' align=right>{$hcwd}<input class=buttons type=submit value=Grab></form>{$et}<br>{$t}Download dictionary:</td><td bgcolor='#333333'></td></tr><form method='POST'><tr><td width='20%' bgcolor='#666666'>URL:</td><td bgcolor='#666666'><input type=text value='http://vburton.ncsa.uiuc.edu/wordlist.txt' name=url size=35></td></tr><tr><td width='20%' bgcolor='#808080'>Output:</td><td bgcolor='#808080'><input type=text value='{$temp}.dic' name=output size=35></td></tr><tr><td width='20%' bgcolor='#000000'></td><td bgcolor='#000000'><input type=checkbox style='border-width:1px;background-color:#666666;' name=combo value=1 checked>Combo style output</td></tr><tr><td bgcolor='#808080'></td><td bgcolor='#808080' align=right>{$hcwd}<input class=buttons type=submit value=Get></form>{$et}</center>";
    }
}
Exemple #2
0
function dicmakeR()
{
    global $windows, $hcwd, $CheckedLinks, $GrabedWords;
    $combo = empty($_REQUEST['combo']) ? 0 : 1;
    if (!empty($_REQUEST['range']) && !empty($_REQUEST['output']) && !empty($_REQUEST['min']) && !empty($_REQUEST['max'])) {
        $min = $_REQUEST['min'];
        $max = $_REQUEST['max'];
        if ($max < $min) {
            echo "Bad input!";
            return;
        }
        $s = $w = '';
        $out = $_REQUEST['output'];
        $r = $_REQUEST['range'];
        $dic = fopen($out, 'w');
        if ($r == 1) {
            for ($s = pow(10, $min - 1); $s < pow(10, $max - 1); $s++) {
                $w = $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
            }
        } else {
            $s = str_repeat($r, $min);
            while (strlen($s) < $max) {
                $w = $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
                $s++;
            }
        }
        fclose($dic);
        echo '<font color=#FA0>Done</font>';
    } elseif (!empty($_REQUEST['input']) && !empty($_REQUEST['output'])) {
        $input = fopen($_REQUEST['input'], 'r');
        if (!$input) {
            if ($windows) {
                echo 'Unable to read from ' . htmlspecialchars($_REQUEST['input']) . "<br />";
            } else {
                $input = explode("\n", shelL("cat {$input}"));
                $output = fopen($_REQUEST['output'], 'w');
                if ($output) {
                    foreach ($input as $in) {
                        $user = $in;
                        $user = trim(fgets($in), " \n\r");
                        if (!strstr($user, ':')) {
                            continue;
                        }
                        $user = substr($user, 0, strpos($user, ':'));
                        if ($combo) {
                            fwrite($output, $user . ':' . $user . "\n");
                        } else {
                            fwrite($output, $user . "\n");
                        }
                    }
                    fclose($input);
                    fclose($output);
                    echo '<font color=#FA0>Done</font>';
                }
            }
        } else {
            $output = fopen($_REQUEST['output'], 'w');
            if ($output) {
                while (!feof($input)) {
                    $user = trim(fgets($input), " \n\r");
                    if (!strstr($user, ':')) {
                        continue;
                    }
                    $user = substr($user, 0, strpos($user, ':'));
                    if ($combo) {
                        fwrite($output, $user . ':' . $user . "\n");
                    } else {
                        fwrite($output, $user . "\n");
                    }
                }
                fclose($input);
                fclose($output);
                echo '<font color=#FA0>Done</font>';
            } else {
                echo 'Unable to write data to ' . htmlspecialchars($_REQUEST['input']) . "<br />";
            }
        }
    } elseif (!empty($_REQUEST['url']) && !empty($_REQUEST['output'])) {
        $res = downloadiT($_REQUEST['url'], $_REQUEST['output']);
        if ($combo && $res) {
            $file = file($_REQUEST['output']);
            $output = fopen($_REQUEST['output'], 'w');
            foreach ($file as $v) {
                fwrite($output, "{$v}:{$v}\n");
            }
            fclose($output);
        }
        echo '<font color=#FA0>Done</font>';
    } elseif (!empty($_REQUEST['url']) && !empty($_REQUEST['pout']) && !empty($_REQUEST['lvl'])) {
        $url = $_REQUEST['url'];
        echo '<font color=#FA0>Please wait';
        @flush_buffers();
        Site2profile($url, $_REQUEST['lvl']);
        $output = fopen($_REQUEST['pout'], 'w');
        if ($output) {
            foreach ($GrabedWords as $word) {
                fwrite($output, "{$word}\n");
            }
            echo '<br /><br />Done!';
        } else {
            echo 'Can not write to file!';
        }
        echo '</font>';
    } else {
        $temp = whereistmP() . DIRECTORY_SEPARATOR;
        echo '<form name=dldic method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Website profiler</label>
</div><div class="fieldwrapper"><label class="styled">URL:</label><div class="thefield"><input type="url" name="url" value="http://' . getenv('HTTP_HOST') . '/" size="30" />
</div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="pout" value="' . $temp . '.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Level:</label><div class="thefield"><input type="number" min="1" name=lvl value=3></div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Get" name="profile" style="margin-left: 150px;" /></div></form><br /><form name=wordlist method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Wordlist generator</label>
</div><div class="fieldwrapper"><label class="styled">Range:</label><div class="thefield"><select name=range><option value=a>a-z</option><option value=A>A-Z</option><option value=1>0-9</option></select>
</div></div><div class="fieldwrapper"><label class="styled">min lenght:</label><div class="thefield"><select name=min><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option></select></div>
</div><div class="fieldwrapper"><label class="styled">Max lenght:</label><div class="thefield"><select name=max><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option></select></div>
</div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="' . $temp . '.dic" size="30" /></div>
</div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output
</div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Make" style="margin-left: 150px;" /></div></form><br /><form name=grab method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Grab dictionary</label></div><div class="fieldwrapper"><label class="styled">Input:</label><div class="thefield"><input type="text" name="input" value="/etc/passwd" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="' . $temp . '.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output</div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Grab" style="margin-left: 150px;" />
</div></form><br /><form name=dldic method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Download dictionary</label>
</div><div class="fieldwrapper"><label class="styled">URL:</label><div class="thefield"><input type="url" name="url" value="http://people.sc.fsu.edu/~jburkardt/datasets/words/wordlist.txt" size="30" />
</div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="' . $temp . '.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output</div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Get" style="margin-left: 150px;" /></div></form><br />';
    }
}
                 $w = "{$w}:{$w}";
             }
             fwrite($dic, $w . "\n");
             $s++;
         }
     }
     fclose($dic);
     echo "<font color=yellow>Done</font>";
 }
 if (!empty($_REQUEST['input']) && !empty($_REQUEST['output'])) {
     $input = fopen($_REQUEST['input'], 'r');
     if (!$input) {
         if ($windows) {
             echo $errorbox . "Unable to read from " . htmlspecialchars($_REQUEST['input']) . "{$et}<br>";
         } else {
             $input = explode("\n", shelL("cat {$input}"));
             $output = fopen($_REQUEST['output'], 'w');
             if ($output) {
                 foreach ($input as $in) {
                     $user = $in;
                     $user = trim(fgets($in), " \n\r");
                     if (!strstr($user, ":")) {
                         continue;
                     }
                     $user = substr($user, 0, strpos($user, ':'));
                     if ($combo) {
                         fwrite($output, $user . ":" . $user . "\n");
                     } else {
                         fwrite($output, $user . "\n");
                     }
                 }
Exemple #4
0
function dicmakeR()
{
    global $errorbox, $windows, $footer, $t, $et, $hcwd;
    if (!empty($_REQUEST['combo']) && $_REQUEST['combo'] == 1) {
        $combo = 1;
    } else {
        $combo = 0;
    }
    if (!empty($_REQUEST['range']) && !empty($_REQUEST['output']) && !empty($_REQUEST['min']) && !empty($_REQUEST['max'])) {
        $min = $_REQUEST['min'];
        $max = $_REQUEST['max'];
        if ($max < $min) {
            die($errorbox . "Bad input!{$et}" . $footer);
        }
        $s = $w = "";
        $out = $_REQUEST['output'];
        $r = $_REQUEST['range'] == 'a' ? 'a' : 'A';
        if ($_REQUEST['range'] == 0) {
            $r = 0;
        }
        for ($i = 0; $i < $min; $i++) {
            $s .= $r;
        }
        $dic = fopen($out, 'a');
        if (is_nan($r)) {
            while (strlen($s) <= $max) {
                $w = $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
                $s++;
            }
        } else {
            while (strlen($w) <= $max) {
                $w = (string) str_repeat("0", $min - strlen($s)) . $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
                $s++;
            }
        }
        fclose($dic);
        echo "<font color=blue>Done</font>";
    }
    if (!empty($_REQUEST['input']) && !empty($_REQUEST['output'])) {
        $input = fopen($_REQUEST['input'], 'r');
        if (!$input) {
            if ($windows) {
                echo $errorbox . "Unable to read from " . htmlspecialchars($_REQUEST['input']) . "{$et}<br>";
            } else {
                $input = explode("\n", shelL("cat {$input}"));
                $output = fopen($_REQUEST['output'], 'w');
                if ($output) {
                    foreach ($input as $in) {
                        $user = $in;
                        $user = trim(fgets($in), " \n\r");
                        if (!strstr($user, ":")) {
                            continue;
                        }
                        $user = substr($user, 0, strpos($user, ':'));
                        if ($combo) {
                            fwrite($output, $user . ":" . $user . "\n");
                        } else {
                            fwrite($output, $user . "\n");
                        }
                    }
                    fclose($input);
                    fclose($output);
                    echo "<font color=blue>Done</font>";
                }
            }
        } else {
            $output = fopen($_REQUEST['output'], 'w');
            if ($output) {
                while (!feof($input)) {
                    $user = trim(fgets($input), " \n\r");
                    if (!strstr($user, ":")) {
                        continue;
                    }
                    $user = substr($user, 0, strpos($user, ':'));
                    if ($combo) {
                        fwrite($output, $user . ":" . $user . "\n");
                    } else {
                        fwrite($output, $user . "\n");
                    }
                }
                fclose($input);
                fclose($output);
                echo "<font color=blue>Done</font>";
            } else {
                echo $errorbox . " Unable to write data to " . htmlspecialchars($_REQUEST['input']) . "{$et}<br>";
            }
        }
    } elseif (!empty($_REQUEST['url']) && !empty($_REQUEST['output'])) {
        $res = downloadiT($_REQUEST['url'], $_REQUEST['output']);
        if ($combo && $res) {
            $file = file($_REQUEST['output']);
            $output = fopen($_REQUEST['output'], 'w');
            foreach ($file as $v) {
                fwrite($output, "{$v}:{$v}\n");
            }
            fclose($output);
        }
        echo "<font color=blue>Done</font>";
    } else {
        $temp = whereistmP();
        echo "<center>{$t}Wordlist generator:</td><td bgcolor=\"#333333\"></td></tr><form method=\"POST\"><tr><td width=\"20%\" bgcolor=\"#666666\">Range:</td><td bgcolor=\"#666666\"><select name=range><option value=a>a-z</option><option value=Z>A-Z</option><option value=0>0-9</option></select></td></tr><tr><td width=\"20%\" bgcolor=\"#808080\">Min lenght:</td><td bgcolor=\"#808080\"><select name=min><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option></select></td></tr><tr><td width=\"20%\" bgcolor=\"#666666\">Max lenght:</td><td bgcolor=\"#666666\"><select name=max><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8 selected>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option><option value=12>12</option><option value=13>13</option><option value=14>14</option><option value=15>15</option></select></td></tr><tr><td width=\"20%\" bgcolor=\"#808080\">Output:</td><td bgcolor=\"#808080\"><input type=text value=\"{$temp}/.dic\" name=output size=35></td></tr><tr><td width=\"20%\" bgcolor=\"#666666\"></td><td bgcolor=\"#666666\"><input type=checkbox name=combo style=\"border-width:1px;background-color:#666666;\" value=1 checked>Combo style output</td></tr><td bgcolor=\"#808080\"></td><td bgcolor=\"#808080\" align=right>{$hcwd}<input class=buttons type=submit value=Make></td></tr></form></table><br>{$t}Grab dictionary:</td><td bgcolor=\"#333333\"></td></tr><form method=\"POST\"><tr><td width=\"20%\" bgcolor=\"#666666\">Grab from:</td><td bgcolor=\"#666666\"><input type=text value=\"/etc/passwd\" name=input size=35></td></tr><tr><td width=\"20%\" bgcolor=\"#808080\">Output:</td><td bgcolor=\"#808080\"><input type=text value=\"{$temp}/.dic\" name=output size=35></td></tr><tr><td width=\"20%\" bgcolor=\"#666666\"></td><td bgcolor=\"#666666\"><input type=checkbox style=\"border-width:1px;background-color:#666666;\" name=combo value=1 checked>Combo style output</td></tr><td bgcolor=\"#808080\"></td><td bgcolor=\"#808080\" align=right>{$hcwd}<input class=buttons type=submit value=Grab></td></tr></form></table><br>{$t}Download dictionary:</td><td bgcolor=\"#333333\"></td></tr><form method=\"POST\"><tr><td width=\"20%\" bgcolor=\"#666666\">URL:</td><td bgcolor=\"#666666\"><input type=text value=\"http://vburton.ncsa.uiuc.edu/wordlist.txt\" name=url size=35></td></tr><tr><td width=\"20%\" bgcolor=\"#808080\">Output:</td><td bgcolor=\"#808080\"><input type=text value=\"{$temp}/.dic\" name=output size=35></td></tr><tr><td width=\"20%\" bgcolor=\"#666666\"></td><td bgcolor=\"#666666\"><input type=checkbox style=\"border-width:1px;background-color:#666666;\" name=combo value=1 checked>Combo style output</td></tr><tr><td bgcolor=\"#808080\"></td><td bgcolor=\"#808080\" align=right>{$hcwd}<input class=buttons type=submit value=Get></td></tr></form></table></center>";
    }
}