Created
October 20, 2022 19:45
-
-
Save TheFlash2k/be92d65ac7017309707b443217c246c7 to your computer and use it in GitHub Desktop.
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
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