-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathctl.php
More file actions
47 lines (38 loc) · 1.38 KB
/
ctl.php
File metadata and controls
47 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?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);
$attack->setStatus(1);
} else if ($cmd == "hide") {
$cap = CapFile::fromDB($id);
$cap->setStatus(1);
header('Location: index.php');
die;
} else {
header('Location: index.php');
die;
}
?>