Skip to content

Instantly share code, notes, and snippets.

@TheFlash2k
Created October 20, 2022 19:45
Show Gist options
  • Save TheFlash2k/be92d65ac7017309707b443217c246c7 to your computer and use it in GitHub Desktop.
Save TheFlash2k/be92d65ac7017309707b443217c246c7 to your computer and use it in GitHub Desktop.
import requests
import re
url = "http://192.168.0.130:8000/"
def download(file_name):
r = requests.get(url + file_name, allow_redirects=True)
print(f"[+] Downloading {file_name}", end='')
try:
with open(file_name, 'wb') as f:
f.write(r.content)
except Exception as E:
print(f" -- ERROR: {E}")
return
print("-- Done!")
def main():
r = requests.get(url)
vals = re.findall('<li><a href="(.*?)">', r.text)
for val in vals:
download(val)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment