Skip to content

Commit 30cbb77

Browse files
authored
Merge pull request #6 from maxDcb/develop
Release 0.5.0
2 parents 567bd97 + 3d6dc28 commit 30cbb77

29 files changed

+512
-826
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@
2828
[submodule "client/GoDroplets"]
2929
path = client/GoDroplets
3030
url = https://github.com/almounah/GoDroplets
31+
[submodule "libs/libSocketHandler"]
32+
path = libs/libSocketHandler
33+
url = https://github.com/maxDcb/libSocketHandler.git

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
4+
## [0.5.0] - 2024-12-01
5+
6+
First change log entry
7+
8+
### Added
9+
10+
- Graph tab in the client with the simplest visualisation
11+
- 2 new modules, KeyLogger and ScreenShot for windows
12+
- Batcave
13+
14+
### Changed
15+
16+
- TCP communication in windows and linux for both beacon and listener
17+
18+
### Fixed
19+

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ set(CMAKE_CXX_STANDARD 17)
1212

1313
set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
1414

15-
find_package(Boost REQUIRED)
1615
find_package(gRPC REQUIRED)
1716
find_package(OpenSSL REQUIRED)
1817
find_package(protobuf REQUIRED)

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ The TeamServer is a stand alone application, coded in c++, that handle listeners
2121
Beacons run on the victime host. Each Beacons which connects back to the TeamServer open a new session. This session is used to control the Beacon, send commands and receive results.
2222
Listener and Beacons can communicate through TCP, SMB, HTTP ,HTTPS and Github issues depending on the situation.
2323

24+
2425
![alt text](https://github.com/maxDcb/C2TeamServer/blob/master/images/ListenersAndSessions.png?raw=true)
2526

27+
28+
![alt text](https://github.com/maxDcb/C2TeamServer/blob/master/images/ListenersAndSessions2.png?raw=true)
29+
30+
2631
A compiled version of the TeamServer is ready to use in the Releases, with some default certificats for GRPC communication and HTTP Listener:
2732

2833
The TeamServer binary is in Release/TeamServer
@@ -40,7 +45,6 @@ It's launched using 'python3 GUI.py'
4045

4146
```
4247
pip3 install pycryptodome
43-
pip3 install conan==2.1.0
4448
pip3 install grpcio==1.66.1
4549
pip3 install PyQt5
4650
pip3 install pyqtdarktheme

client/ConsolePanel.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
import os
33
import time
4+
from datetime import datetime
45
from threading import Thread, Lock
56
from PyQt5.QtWidgets import *
67
from PyQt5.QtGui import *
@@ -258,9 +259,6 @@
258259
]),
259260
]
260261

261-
orangeText = '<p style=\"color:orange;white-space:pre\">[+] {} </p>'
262-
redText = '<p style=\"color:red;white-space:pre\">[+] {} </p>'
263-
264262

265263
#
266264
# Consoles Tab Implementation
@@ -380,14 +378,29 @@ def event(self, event):
380378
return True
381379
return super().event(event)
382380

381+
def printInTerminal(self, cmdSent, cmdReived, result):
382+
now = datetime.now()
383+
sendFormater = '<p style="white-space:pre">'+'<span style="color:blue;">['+now.strftime("%Y:%m:%d %H:%M:%S").rstrip()+']</span>'+'<span style="color:orange;"> [&gt;&gt;] </span>'+'<span style="color:orange;">{}</span>'+'</p>'
384+
receiveFormater = '<p style="white-space:pre">'+'<span style="color:blue;">['+now.strftime("%Y:%m:%d %H:%M:%S").rstrip()+']</span>'+'<span style="color:red;"> [&lt;&lt;] </span>'+'<span style="color:red;">{}</span>'+'</p>'
385+
386+
if cmdSent:
387+
self.editorOutput.appendHtml(sendFormater.format(cmdSent))
388+
self.editorOutput.insertPlainText("\n")
389+
elif cmdReived:
390+
self.editorOutput.appendHtml(receiveFormater.format(cmdReived))
391+
self.editorOutput.insertPlainText("\n")
392+
if result:
393+
self.editorOutput.insertPlainText(result)
394+
self.editorOutput.insertPlainText("\n")
395+
383396
def runCommand(self):
384397
commandLine = self.commandEditor.displayText()
385398
self.commandEditor.clearLine()
386399
self.setCursorEditorAtEnd()
387400

388401
if commandLine == "":
389-
line = '\n';
390-
self.editorOutput.insertPlainText(line)
402+
self.printInTerminal("", "", "")
403+
391404
else:
392405
cmdHistoryFile = open(CmdHistoryFileName, 'a')
393406
cmdHistoryFile.write(commandLine)
@@ -402,34 +415,26 @@ def runCommand(self):
402415
self.commandEditor.setCmdHistory()
403416
instructions = commandLine.split()
404417
if instructions[0]==HelpInstruction:
405-
command = TeamServerApi_pb2.Command(
406-
cmd=commandLine)
418+
command = TeamServerApi_pb2.Command(cmd=commandLine)
407419
response = self.grpcClient.getHelp(command)
408-
self.editorOutput.appendHtml(orangeText.format(response.cmd))
409-
line = '\n' + response.response.decode(encoding="latin1", errors="ignore") + '\n';
410-
self.editorOutput.insertPlainText(line)
420+
self.printInTerminal(response.cmd, "", "")
421+
self.printInTerminal("", response.cmd, response.response.decode(encoding="latin1", errors="ignore"))
422+
411423
else:
412-
self.editorOutput.appendHtml(orangeText.format(commandLine))
413-
line = '\n';
414-
self.editorOutput.insertPlainText(line)
415-
command = TeamServerApi_pb2.Command(
416-
beaconHash=self.beaconHash,
417-
listenerHash=self.listenerHash,
418-
cmd=commandLine)
424+
self.printInTerminal(commandLine, "", "")
425+
command = TeamServerApi_pb2.Command(beaconHash=self.beaconHash, listenerHash=self.listenerHash, cmd=commandLine)
419426
result = self.grpcClient.sendCmdToSession(command)
420427
if result.message:
421-
line = result.message.decode(encoding="latin1", errors="ignore") + '\n';
422-
self.editorOutput.insertPlainText(line)
428+
self.printInTerminal("", commandLine, result.message.decode(encoding="latin1", errors="ignore"))
429+
423430
self.setCursorEditorAtEnd()
424431

425432
def displayResponse(self):
426433
session = TeamServerApi_pb2.Session(beaconHash=self.beaconHash)
427434
responses = self.grpcClient.getResponseFromSession(session)
428435
for response in responses:
429436
self.setCursorEditorAtEnd()
430-
self.editorOutput.appendHtml(redText.format(response.instruction + " " + response.cmd))
431-
line = '\n' + response.response.decode(encoding="latin1", errors="ignore") + '\n'
432-
self.editorOutput.insertPlainText(line)
437+
self.printInTerminal("", response.instruction + " " + response.cmd, response.response.decode(encoding="latin1", errors="ignore"))
433438
self.setCursorEditorAtEnd()
434439

435440
logFile = open("./logs/"+self.logFileName, 'a')

client/GUI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def topLayout(self):
7171

7272
self.topWidget.addTab(self.m_main, "Main")
7373

74-
# self.graphWidget = Graph(self, self.ip, self.port, self.devMode)
75-
# self.topWidget.addTab(self.graphWidget, "Graph")
74+
self.graphWidget = Graph(self, self.ip, self.port, self.devMode)
75+
self.topWidget.addTab(self.graphWidget, "Graph")
7676

7777
self.mainLayout.addWidget(self.topWidget, 1, 1, 1, 1)
7878

0 commit comments

Comments
 (0)