Skip to content

Instantly share code, notes, and snippets.

@awesmubarak
Created June 20, 2021 14:44
Show Gist options
  • Save awesmubarak/2411c0b8d9d56847b0295d1647e44647 to your computer and use it in GitHub Desktop.
Save awesmubarak/2411c0b8d9d56847b0295d1647e44647 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import requests
import threading
from faker import Faker
from faker.providers import credit_card, phone_number, address, date_time, bank
from stem import Signal
from stem.control import Controller
def gen_data() -> dict:
"""Generates fake data"""
fake = Faker(locale="en_GB")
name = fake.name()
iban = fake.iban()
data = {
"pcode": fake.postcode(),
"fname": name,
"phone": fake.msisdn(),
"dob": fake.date_of_birth().strftime("%m / %d / %Y"),
"address": fake.address(),
"ccname": name,
"ccnum": " ".join(
[fake.credit_card_number()[i : i + 4] for i in range(0, 16, 4)]
),
"expiry": fake.credit_card_expire().replace("/", " / "),
"cvv": fake.credit_card_security_code(),
"acct": iban[14:],
"sort": "-".join([iban[8:14][i : i + 2] for i in range(0, 6, 2)]),
}
return data
def single_request(number_of_its: list) -> None:
url = "https://hermes.help-tracknow.com/complete.php?&URI=0e8970dd2e3106cd249487c294c41eb5&sessionid=5be14c492c784942dc6013e2dd0798e0&securessl=true" # got the URL by inspecting network requests while posting
proxies = {
"http": "socks5://127.0.0.1:9150",
"https": "socks5://127.0.0.1:9150",
} # tor proxies
while True:
data = gen_data()
try:
requests.post(url, data=data, allow_redirects=False, proxies=proxies).text
print(
f"[{(str(number_of_its[0]) + ']').ljust(8)}{data['fname']} sent their regards :)"
)
with threading.Lock(): # prevents multiple threads incrementing at once
number_of_its[0] += 1
except:
print("Error for this request :/")
# asks for new tor connection
with Controller.from_port(port=9051) as c:
c.authenticate()
c.signal(Signal.NEWNYM) # type: ignore
def main():
threads = []
number_of_its = [
0
] # lists passed by reference, not value, so can be incremented in threads
# creates and joins threads
for _ in range(50):
thread = threading.Thread(
target=single_request, args=(number_of_its,), daemon=True
)
threads.append(thread)
thread.start()
for thread in threads:
thread.join()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment