Skip to content
KitploitKITPLOIT
ToolsBlog
Einreichen
ToolsBlog
Einreichen

Hacking-, PenTest- und Cybersicherheits-Tools für Ihr Sicherheitsarsenal!

Kitploit ist ein Verzeichnis von Hacking-, Cybersicherheits- und Pentesting-Tools. Entdecken Sie die neuesten Projekt-Updates, um Schwachstellen zu finden, Systeme zu analysieren, Tests zu automatisieren und Ihre Sicherheit zu stärken.

··Feeds·Kontakt·Datenschutz·© 2026 Kitploit

Tool-Verzeichnis

Kategorien

Alle Kategorien anzeigen
Loading categories
pyMalleableC2 — Python-Interpreter für Cobalt Strike Malleable C2 Profile. Ermöglicht es Ihnen, sie programmatisch zu parsen, zu erstellen und zu modifizieren. | Kitploit
Tools/GitHubGitHub/byt3bl33d3r/pymalleablec2
Command and ControlDienstprogramme & FrameworksRed TeamingPayload-Entwicklung
GitHubbyt3bl33d3r/pymalleablec2

pyMalleableC2

Python-Interpreter für Cobalt Strike Malleable C2 Profile. Ermöglicht es Ihnen, sie programmatisch zu parsen, zu erstellen und zu modifizieren.

Repository anzeigen
28935vor 2 MonatenVon Kitploit geprüft

Beliebteste

Alle anzeigen →

Entdecken Sie die meistgenutzten Tools unserer Community.

Alle Tools erkunden

Durchsuchen Sie unsere Tool-Sammlung

Alle Tools anzeigen →
Teilen

pyMalleableC2

pyMalleableC2

Ein Python-Interpreter für Cobalt Strike Malleable C2-Profile, mit dem Sie diese parsen, modifizieren, programmatisch erstellen und die Syntax validieren können.

Unterstützt die gesamte Grammatik der Cobalt Strike Malleable C2-Profile ab Version 4.3.

Es ist nicht abwärtskompatibel mit früheren Cobalt-Strike-Versionen.

Was sind die Unterschiede zwischen pyMalleableC2 und anderen Projekten dieser Art?

  1. Parst Profile mit Lark unter Verwendung der eBNF-Notation. Dieser Ansatz ist wesentlich robuster als benutzerdefinierte Regexes, Template-Engines oder ähnliche Methoden.
  2. Wandelt Profile in einen Abstract Syntax Tree (AST) um, der dann wieder in Quellcode zurückverwandelt werden kann.
  3. Aufgrund des oben Genannten ermöglicht pyMalleableC2 das programmatische Erstellen von Profilen oder das Ändern im laufenden Betrieb.
  4. Ermöglicht die Validierung der Syntax von Malleable C2-Profilen (führt keine Laufzeitprüfungen durch, siehe Warnung unten).
  5. Es verfügt über KI in Form einer Menge von if-Anweisungen.

Inhaltsverzeichnis

  • pyMalleableC2
    • Installation
    • 🚨 Warnung! Keine Laufzeitprüfungen (noch nicht!) 🚨
    • Autor
    • Offizieller Discord-Kanal
    • Beispiele
    • FAQ

Installation

pyMalleableC2 wurde mit Python 3.9 erstellt, sollte aber abwärtskompatibel bis Python 3.6 sein.

Installation mit Pip:

  • pip3 install pymalleablec2

🚨 WARNUNG 🚨

pyMalleableC2 behandelt Sie als mündigen Erwachsenen und geht davon aus, dass Sie wissen, wie man Malleable C2-Profile schreibt. Es kann Syntaxfehler erkennen, jedoch sind keine Laufzeitprüfungen implementiert. Es wird bereitwillig Profile generieren, die in der Produktion nicht funktionieren, wenn Sie es dazu anweisen. Führen Sie die generierten Profile immer mit c2lint aus, bevor Sie sie in der Produktion verwenden!

(Technisch gesehen könnten Sie mit dieser Bibliothek eine Python-Version von c2lint erstellen, **hust* PRs willkommen *hust*)

Autor

Der Hauptautor von pyMalleableC2 ist Marcello Salvati

Twitter: @byt3bl33d3r, Github: @byt3bl33d3r

Beispiele

(Siehe den Beispiele-Ordner für weitere)

AST für ein Malleable-C2-Profil aus einer Datei generieren und dann den Quellcode aus dem AST rekonstruieren:

root@kitploit:~
from malleablec2 import Profile

# Parse a profile given its path
p = Profile.from_file("amazon.profile")

# Print the generated AST
print(p.ast.pretty())

# Reconstruct source code from the AST and print to console
print(p.reconstruct())

# Shortcut for the above :)
print(p)

AST für ein 'inline' Malleable-C2-Profil generieren und dann den Quellcode aus dem AST rekonstruieren:

root@kitploit:~
code = '''
set jitter "0";
set sleeptime "3000";

http-get {
    set uri "/wow/this/is/cool";
}

http-post {
    set uri "/pymalleablec2/is/the/shit";
}
'''

# Parse a profile from a string
p = Profile.from_string(code)

# Print the generated AST
print(p.ast.pretty())

# Reconstruct source code from the AST and print to console
print(p)

Ein Malleable-C2-Profil von Grund auf programmatisch erstellen:

root@kitploit:~
from malleablec2 import Profile
from malleablec2.components import *

# Create an empty profile
p = Profile.from_scratch()

# Set some global options
p.set_option("sleeptime", "0")
p.set_option("jitter", "0")
p.set_option("pipename", "mojo__##")

# Create an http-get block
http_get = HttpGetBlock()
# Set the uri http-get option
http_get.set_option("uri", "/wat/a/tease")

# Create a client block
client = ClientBlock()
# Add a header statement to the client block
client.add_statement("header", "Accept", "*/*")

# Create a server block
server = ServerBlock()

# Add the client and server blocks to the http-get block
http_get.add_code_block(client)
http_get.add_code_block(server)

# Create a http-post block
http_post = HttpPostBlock()
# Set the uri http-post option
http_post.set_option("uri", "/wat/ucraycray")

# Add the http-get and http-post blocks to the profile
p.add_code_block(http_get)
p.add_code_block(http_post)

# Reconstruct source code from the generated AST and print to console
print(p)

Super einfaches Beispiel, das zeigt, wie man ein Malleable-C2-Profil programmatisch randomisiert:

root@kitploit:~
from malleablec2 import Profile
from malleablec2.randomizer import ProfileRandomizer
from lark import Token

class MyRandomizer(ProfileRandomizer):

    # We implement the global_option_set method which will get called on every parsed global option statement in the profile
    def global_option_set(self, tree):
        option_name = tree.children[0]

        if option_name == "pipename":
            # "Randomize" the pipename value
            tree.children[1].children[0] = Token('ESCAPED_STRING', '"my_random_pipename_##"')

# Parse a profile given its path
p = Profile.from_file("amazon.profile")

r = MyRandomizer()

# Walk through the generated profile AST and apply randomization rules
r.randomize(p)

# Reconstruct source code then output the profile to the console
print(p)
Tool herunterladen