<?php require_once "Attack.class.php"; $type = $_GET['type']; $data = array(); switch ($type) { case "cap": for ($a = 1; $a <= 9; $a++) { unset($attack); $attack = Attack::fromDB($_GET['id'], $a); $attack->updateData(); $data[$a]['status'] = $attack->getStatus(); $data[$a]['password'] = $attack->getPassword(); $data[$a]["complete"] = sprintf("%.2f", round($attack->getCurrent() / $attack->getDictionarySize() * 100, 2)); $data[$a]["rate"] = number_format($attack->getRate()); $data[$a]["runtime"] = $attack->getRuntime(); if ($attack->getRate() != 0 && $attack->getStatus() == 1) { $days = (int) (gmdate("d", round(($attack->getDictionarySize() - $attack->getCurrent()) / $attack->getRate())) - 1); if ($days < 10) { $days = "0" . $days; } $data[$a]["etc"] = $days . gmdate(":H:i:s", round(($attack->getDictionarySize() - $attack->getCurrent()) / $attack->getRate())); } else { $data[$a]["etc"] = "00:00:00:00"; } } break; case "system": $name = array("CPU1", "CPU2", "CPU3", "CPU4", "GPU", "Uptime", "1m", "5m", "15m", "Uploads", "Logs", "Scans"); for ($i = 0; $i < count($name); $i++) { $data[$name[$i]] = $wicker->status()[$i];
<?php require_once "Wicker.php"; require_once "CapFile.class.php"; require_once "Attack.class.php"; $cmd = $_GET['cmd']; $id = $_GET['id']; $attack_type = $_GET['attack']; if (is_null($cmd) || is_null($id)) { header('Location: view.php?id=' . $_GET['id']); die; } $attack = Attack::fromDB($_GET['id'], $_GET['attack']); if ($cmd == "execute") { $dictionaries = array("10k most common.txt", "rockyou.txt", "small", "Custom-WPA", "Super-WPA", "big", "bigger", "combined", "eight"); $cap = CapFile::fromDB($id); $attack->setTmpfile($wicker->newGUID()); system($wicker->config->getPyrit() . " -i \"dictionaries/" . $dictionaries[$attack_type - 1] . "\" -r \"uploads/" . $cap->getLocation() . "\" attack_passthrough > \"logs/" . $attack->getTmpFile() . "\" &"); exec("ps aux | grep '" . $cap->getLocation() . "' | grep -v grep | awk '{ print \$2 }' | tail -1", $out); $attack->setPID($out[0]); $attack->setStatus(1); } else { if ($cmd == "terminate") { $attack->terminate(); } else { if ($cmd == "pause") { posix_kill($attack->getPID(), 19); $attack->setStatus(5); } else { if ($cmd == "resume") { posix_kill($attack->getPID(), 18);
<th>Action</th> <th>Dictionary</th> <th>Status</th> <th>Dictionary size</th> <th>Rate (w/s)</th> <th>Run Time</th> <th>ETC</th> </tr> </thead> <tbody> <?php for ($a = 1; $a <= 9; $a++) { unset($status); unset($runtime); $attack = Attack::fromDB($cap->getID(), $a); $attack->updateData(); echo "<tr id=\"{$a}\">"; ?> <td id="actions"> <div class="btn-group"> <button type="button" onclick="execute(<?php echo $a; ?> )" class="btn btn-default">Execute</button> <button type="button" onclick="pauseToggle(<?php echo $a; ?> )" class="btn btn-default">Pause</button> <button type="button" onclick="terminate(<?php echo $a;