echo "<option value='" . $rbvalue . "'>" . $msg . "</option>"; } echo "</select><br>"; ?> <br><input type="submit" class="btn" value='Submit' name='submit3'></input></form></div> <?php } else { if (isset($_POST["submit3"])) { echo "<div class='dashboard'>"; require_once "classes.php"; require_once "settings.php"; $choicearray = explode(";", $_POST["choices"][0]); $choice = $choicearray[0]; $size = $choicearray[1]; if ($size == "SMALL") { $url = getSHOST() . "?mode=choice&choice=" . $choice . "&token=" . $_COOKIE['token']; //echo $url."<br>"; $times = time(); //echo "<br><br>Time Start ".$times; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, "www.google.com"); $body = curl_exec($ch); curl_close($ch); $timee = time(); //echo "<br><br>Time End ".$timee; echo "<br><h2>Got In " . ($timee - $times) . " seconds</h2>"; $data = $body; include_once "aes/AES.class.php"; $key = substr($_COOKIE['keymas'], 0, 16);
echo "<input type='hidden' name='table' value='{$table}'></input>"; echo "<input type='hidden' name='cnt' value='{$cnt}'></input>"; echo "<input type='submit' class='btn' value='Click To Continue »' name='sub' style='width:300;' ></input>\n\t\t\t</form>"; } else { echo "<br><h3 style='color:white'>Completed Fetching Check The Results <a href='result.php?resid={$table}'>HERE</a></h3>"; } } if ($_GET["bid"] != "" && isset($_POST["sub"])) { $bid = $_GET["bid"]; $choicearray = explode(";", $_POST["chstring"]); $branches = explode(":", $choicearray[2]); $cnt = 0; $table = $_POST["table"]; $choice = $_POST["choice"]; $times = time(); $url = getSHOST() . "?mode=choice&choice=" . $choice . "&branch=" . $branches[$bid] . "&token=" . $_COOKIE['token']; //echo $url."<br>"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, "www.google.com"); $body = curl_exec($ch); curl_close($ch); $key = substr($_COOKIE['keymas'], 0, 16); $cryptox = new Crypto($key); $cont = json_decode($body); $result = $cont->results; if ($bid == 0) { $resname = $cont->name; insertResult($resname, $table); }
public function phase1($username, $passphrase) { $challenge = uniqid(); $x = $username . $passphrase; $pbkdf2 = new PBKDF2(); $key = $pbkdf2->deriveKey($x); $keymas = $pbkdf2->deriveKey($key . ":" . $challenge); $crypto = new Crypto($keymas); require_once "settings.php"; $url = getSHOST() . "?mode=handshake&values=" . $username . ":" . $challenge; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_REFERER, "www.google.com"); $body = curl_exec($ch); $json = json_decode($body); $emsg = utf8_decode($json->message); $token = $crypto->aesDecrypt(utf8_decode($json->token)); $plain = $crypto->aesDecrypt($emsg); $pl = $plain; if ($pl == "Standard Message#1") { setcookie("username", $username); setcookie("passphrase", $passphrase); setcookie("key", $key); setcookie("keymas", $keymas); setcookie("token", $token); echo "<script type='text/javascript'>window.location = \"phase2.php\";</script>"; } else { //redirect("?err=true"); } }