Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
pyMalleableC2 — Cobalt Strike Malleable C2プロファイルのためのPythonインタープリタ。プログラムで解析、構築、変更することができます。 | Kitploit
ツール/GitHubGitHub/byt3bl33d3r/pymalleablec2
コマンド&コントロールユーティリティとフレームワークレッドチーミングペイロード開発
GitHubbyt3bl33d3r/pymalleablec2

pyMalleableC2

Cobalt Strike Malleable C2プロファイルのためのPythonインタープリタ。プログラムで解析、構築、変更することができます。

リポジトリを見る
28935473ヶ月前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

pyMalleableC2

pyMalleableC2

Cobalt Strike Malleable C2 プロファイルの Python インタプリタです。プログラムで解析、変更、構築、および構文の検証ができます。

Cobalt Strike バージョン 4.3 以降の Cobalt Strike Malleable C2 プロファイルの文法をすべてサポートしています。

以前の Cobalt Strike リリースとの後方互換性はありません。

pyMalleableC2 と他の同種のプロジェクトとの違いは何ですか?

  1. Lark と eBNF記法 を使用してプロファイルを解析します。このアプローチは、ユーザー定義の正規表現やテンプレートエンジンなどの方法よりもはるかに堅牢です。
  2. プロファイルを 抽象構文木 (AST) に変換し、そこからソースコードに再構築できます。
  3. 上記の理由により、pyMalleableC2 を使用すると、プログラムでプロファイルを構築したり、その場で変更したりできます。
  4. Malleable C2 プロファイルの構文を検証できます (ランタイムチェックは行いません。下記の警告を参照してください)。
  5. 多数の if 文という形で AI を備えています。

目次

  • pyMalleableC2
    • インストール
    • 🚨 警告!まだランタイムチェックはありません 🚨
    • 著者
    • 公式 Discord チャンネル
    • 例
    • FAQ

インストール

pyMalleableC2 は Python 3.9 を使用して構築されましたが、Python 3.6 までの後方互換性があるはずです。

Pip を使用してインストール:

  • pip3 install pymalleablec2

🚨 警告 🚨

pyMalleableC2 はあなたを同意した大人として扱い、Malleable C2 プロファイルの書き方を知っていることを前提としています。構文エラーを検出できますが、ランタイムチェックは実装されていません。指示されれば、実際には本番環境で動作しないプロファイルも喜んで生成します。生成したプロファイルは、本番環境で使用する前に必ず c2lint で実行してください!

(技術的には、このライブラリを使用して c2lint の Python バージョンを構築することもできます。*ゴホン* PR 歓迎 *ゴホン*)

著者

pyMalleableC2 の主著者は Marcello Salvati です

Twitter: @byt3bl33d3r, Github: @byt3bl33d3r

例

(詳細は examples フォルダを参照してください)

ファイル内の Malleable C2 プロファイルの AST を生成し、AST からソースコードを再構築します:

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)

インラインの Malleable C2 プロファイルの AST を生成し、AST からソースコードを再構築します:

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)

Malleable C2 プロファイルをゼロからプログラムで構築します:

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)

Malleable C2 プロファイルをプログラムでランダム化する方法を示す非常に簡単な例:

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)
ツールをダウンロード