Skip to content

Commit

Permalink
Merge pull request #6 from maxDcb/develop
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
maxDcb authored Nov 28, 2024
2 parents 567bd97 + 3d6dc28 commit 30cbb77
Show file tree
Hide file tree
Showing 29 changed files with 512 additions and 826 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@
[submodule "client/GoDroplets"]
path = client/GoDroplets
url = https://github.com/almounah/GoDroplets
[submodule "libs/libSocketHandler"]
path = libs/libSocketHandler
url = https://github.com/maxDcb/libSocketHandler.git
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Change Log
All notable changes to this project will be documented in this file.

## [0.5.0] - 2024-12-01

First change log entry

### Added

- Graph tab in the client with the simplest visualisation
- 2 new modules, KeyLogger and ScreenShot for windows
- Batcave

### Changed

- TCP communication in windows and linux for both beacon and listener

### Fixed

1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ set(CMAKE_CXX_STANDARD 17)

set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})

find_package(Boost REQUIRED)
find_package(gRPC REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(protobuf REQUIRED)
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ The TeamServer is a stand alone application, coded in c++, that handle listeners
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.
Listener and Beacons can communicate through TCP, SMB, HTTP ,HTTPS and Github issues depending on the situation.


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


![alt text](https://github.com/maxDcb/C2TeamServer/blob/master/images/ListenersAndSessions2.png?raw=true)


A compiled version of the TeamServer is ready to use in the Releases, with some default certificats for GRPC communication and HTTP Listener:

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

```
pip3 install pycryptodome
pip3 install conan==2.1.0
pip3 install grpcio==1.66.1
pip3 install PyQt5
pip3 install pyqtdarktheme
Expand Down
49 changes: 27 additions & 22 deletions client/ConsolePanel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import os
import time
from datetime import datetime
from threading import Thread, Lock
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
Expand Down Expand Up @@ -258,9 +259,6 @@
]),
]

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


#
# Consoles Tab Implementation
Expand Down Expand Up @@ -380,14 +378,29 @@ def event(self, event):
return True
return super().event(event)

def printInTerminal(self, cmdSent, cmdReived, result):
now = datetime.now()
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>'
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>'

if cmdSent:
self.editorOutput.appendHtml(sendFormater.format(cmdSent))
self.editorOutput.insertPlainText("\n")
elif cmdReived:
self.editorOutput.appendHtml(receiveFormater.format(cmdReived))
self.editorOutput.insertPlainText("\n")
if result:
self.editorOutput.insertPlainText(result)
self.editorOutput.insertPlainText("\n")

def runCommand(self):
commandLine = self.commandEditor.displayText()
self.commandEditor.clearLine()
self.setCursorEditorAtEnd()

if commandLine == "":
line = '\n';
self.editorOutput.insertPlainText(line)
self.printInTerminal("", "", "")

else:
cmdHistoryFile = open(CmdHistoryFileName, 'a')
cmdHistoryFile.write(commandLine)
Expand All @@ -402,34 +415,26 @@ def runCommand(self):
self.commandEditor.setCmdHistory()
instructions = commandLine.split()
if instructions[0]==HelpInstruction:
command = TeamServerApi_pb2.Command(
cmd=commandLine)
command = TeamServerApi_pb2.Command(cmd=commandLine)
response = self.grpcClient.getHelp(command)
self.editorOutput.appendHtml(orangeText.format(response.cmd))
line = '\n' + response.response.decode(encoding="latin1", errors="ignore") + '\n';
self.editorOutput.insertPlainText(line)
self.printInTerminal(response.cmd, "", "")
self.printInTerminal("", response.cmd, response.response.decode(encoding="latin1", errors="ignore"))

else:
self.editorOutput.appendHtml(orangeText.format(commandLine))
line = '\n';
self.editorOutput.insertPlainText(line)
command = TeamServerApi_pb2.Command(
beaconHash=self.beaconHash,
listenerHash=self.listenerHash,
cmd=commandLine)
self.printInTerminal(commandLine, "", "")
command = TeamServerApi_pb2.Command(beaconHash=self.beaconHash, listenerHash=self.listenerHash, cmd=commandLine)
result = self.grpcClient.sendCmdToSession(command)
if result.message:
line = result.message.decode(encoding="latin1", errors="ignore") + '\n';
self.editorOutput.insertPlainText(line)
self.printInTerminal("", commandLine, result.message.decode(encoding="latin1", errors="ignore"))

self.setCursorEditorAtEnd()

def displayResponse(self):
session = TeamServerApi_pb2.Session(beaconHash=self.beaconHash)
responses = self.grpcClient.getResponseFromSession(session)
for response in responses:
self.setCursorEditorAtEnd()
self.editorOutput.appendHtml(redText.format(response.instruction + " " + response.cmd))
line = '\n' + response.response.decode(encoding="latin1", errors="ignore") + '\n'
self.editorOutput.insertPlainText(line)
self.printInTerminal("", response.instruction + " " + response.cmd, response.response.decode(encoding="latin1", errors="ignore"))
self.setCursorEditorAtEnd()

logFile = open("./logs/"+self.logFileName, 'a')
Expand Down
4 changes: 2 additions & 2 deletions client/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def topLayout(self):

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)

Expand Down
Loading

0 comments on commit 30cbb77

Please sign in to comment.