Ejemplo n.º 1
0
 $kv2 = "',{$zaptable}.time={$cas},hashlists.cracked=hashlists.cracked+" . ($over ? "IF({$zaptable}.plaintext IS NULL,1,0)" : "1") . " WHERE {$zaptable}.hashlist IN ({$hlisty})" . ($over ? "" : " AND {$zaptable}.plaintext IS NULL");
 switch ($format) {
     case 0:
         $kv2 .= " AND {$zaptable}.hash='" . mysqli_real_escape_string($dblink, $zaphash) . "'";
         if ($zapsalt != "") {
             $kv2 .= " AND {$zaptable}.salt='" . mysqli_real_escape_string($dblink, $zapsalt) . "'";
         }
         break;
     case 1:
         $kv2 .= " AND {$zaptable}.essid='" . mysqli_real_escape_string($dblink, $zaphash) . "'";
         break;
 }
 if ($zapplain != "") {
     $vysledek = mysqli_query_wrapper($dblink, $kv . mysqli_real_escape_string($dblink, $zapplain) . $kv2, true);
     if (!$vysledek) {
         $vysledek = mysqli_query_wrapper($dblink, $kv . "\$HEX[" . bintohex($zapplain) . "]" . $kv2, true);
     }
     if ($vysledek) {
         $aff = mysqli_affected_rows($dblink);
         if ($aff == 0) {
             $skipy++;
         } else {
             $zapy++;
         }
     } else {
         echo "Problems pre-cracking hash " . $zaphash . " ({$kv}--{$kv2})<br>";
         $chyby++;
     }
 } else {
     $skipy++;
 }
Ejemplo n.º 2
0
         $newline = "\n";
     } else {
         $newline = "\r\n";
     }
     $agid = $erej["id"];
     $data = explode($newline, $HTTP_RAW_POST_DATA);
     $i = 0;
     $j = 0;
     foreach ($data as $dato) {
         // for non empty lines add error to the db
         if ($dato == "") {
             continue;
         }
         $j++;
         //$dato=bin2hex($dato);
         $ndato = bintohex($dato);
         if (mysqli_query_wrapper($dblink, "INSERT INTO errors (agent,task,time,error) VALUES ({$agid},{$task},{$cas},x'{$ndato}')")) {
             $i++;
         }
     }
     if ($i == $j) {
         echo "err_ok" . $separator . $i;
     } else {
         echo "err_nok" . $separator . "Uploaded {$i}/{$j} errors.";
         file_put_contents("err_" . $agid . "_" . $cas . ".txt", $HTTP_RAW_POST_DATA);
     }
 } else {
     echo "err_nok" . $separator . "Task does not exist or you are not assigned to it.";
 }
 // pause any agent activity because of error
 mysqli_query_wrapper($dblink, "UPDATE agents SET active=0 WHERE id={$agid} AND ignoreerrors=0");
function encrypt($text)
{
    /*global $encryption_iv,$encryption_key;
    	$text = trim($text);
    	$text = mcrypt_cfb (MCRYPT_TWOFISH, $encryption_key, $text, MCRYPT_ENCRYPT, $encryption_iv);
    	return bintohex(trim(chop(base64_encode($text))));*/
    $iv_size = mcrypt_get_iv_size(MCRYPT_XTEA, MCRYPT_MODE_ECB);
    $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
    $encryption_key = "@#MCX%@CADas";
    return $enc = bintohex(mcrypt_encrypt(MCRYPT_XTEA, $encryption_key, $text, MCRYPT_MODE_ECB, $iv));
}