
Linuxホスト向けインシデント対応ツール。リバースシェル、Webシェル、Meterpreter、ファイルレスインプラントを検出し、プロセスの凍結、攻撃者IPのブロック、バイナリの隔離を行います。
██╗ ██╗██╗██████╗ ██╗███████╗
██║ ██║██║██╔══██╗██║██╔════╝
███████║██║██████╔╝██║███████╗
██╔══██║██║██╔══██╗██║╚════██║
██║ ██║██║██║ ██║██║███████║
╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝╚══════╝
HIRIS(Host Incident Response & Isolation System)は、ホスト上で攻撃者を追跡し、その場で凍結するLinuxインシデントレスポンスツールです。リバースシェル、ウェブシェル、Meterpreter、ファイルレスインプラント、ブルートフォースによる侵入——HIRISはこれらを検知し、SIGSTOP でプロセスを停止し、攻撃者のIPを遮断し、バイナリを隔離し、すべてをジャーナルに記録してロールバックできるようにします。
❗ 注意: HIRISはあなたの邪魔をしないように作られています。自身のプロセスツリー、あなたのSSHセッション、送信元IP、および
sshd、systemd、auditdのようなコアサービスには決して触れません。
ほとんどのツールは攻撃者が侵入したことを教えてくれます。HIRISは攻撃者がまだ侵入している間にそれを止めます。
起動時にすべての実行中プロセスをスキャンするため、HIRISの起動前から存在していたシェルも検知され、その後も新しいプロセスの監視を続けます。何かがマッチすると、対応プランが順番に実行されます:
HIRIS iptablesチェーンにドロップされ、既存の接続は ss -K で切断されます。SIGSTOP(またはcgroup v2 freezer)で停止されます。デフォルトでは何も強制終了されないため、証拠はメモリ内に保持されます。hiris thaw で元に戻せます。ヒューリスティックが誤検知した場合に備え、凍結は freeze_timeout(デフォルトで1時間)後に自動的に解除されます。
nc、socat、python の背後でptyにアップグレードされたシェル 🐚。nginx、apache、php-fpm などから起動されたシェル、または www-data として実行されているシェル 🌐。/tmp または /dev/shm 内のMeterpreterおよびmsfvenomペイロード、ターミナルのない ssh_login セッション、postgres_login スーパーユーザーセッション 🎯。memfd_create から実行されるプロセス、memfdからマッピングされたコード、およびリモート接続を伴う大きな匿名実行可能メモリ 👻。postgres または mysqld(COPY ... FROM PROGRAM、UDF exec)から起動されたシェル 🗄️。/root/.ssh に対するinotify 📌。execve をログに記録した瞬間にプロセスを凍結、ポーリング遅延なし ⚡。hiris thaw がジャーナルから凍結とiptablesルールを元に戻します ↩️。/proc を備えたLinux/proc/*/fd の読み取りに必要)iptables および sshiris ips 用の auditdリポジトリをクローンします:
git clone https://github.com/K3ysTr0K3R/HIRIS.git
cd HIRIS
インストールします:
sudo pip install -e .
または、インストールせずにフォルダから直接実行することもできます:
sudo python3 -m hiris --help
オプションのYARAサポート:
sudo pip install -e ".[yara]"
Usage: hiris [-h] [--version] [-v] {scan,respond,watch,ips,thaw} ...
Commands:
scan One-shot scan, print findings and the response plan
respond Scan and build the plan; --force applies it
watch Continuously monitor and respond
ips Inline IPS on the auditd execve stream
thaw Reverse a response journal
Global:
-v, --verbose -v for INFO logs, -vv for DEBUG
--version Show version and exit
watch:
--auto-respond Execute the response plan automatically (default: alert only)
--i-understand-the-risk
Required with --auto-respond
--kill After freezing, kill the process (irreversible)
--break-glass Strip unsafe actions instead of refusing the plan
--interval SECONDS Seconds between /proc polls (default: 2.0)
--sweep-interval SECONDS
Seconds between full-system sweeps (default: 60, 0 = startup only)
--network Also capture and inspect network traffic
--rules FILE Suricata-style rules file for --network
--interface IFACE Capture interface (default: any)
--config FILE Config file (default: /etc/hiris/config.yaml)
scan / respond:
--force (respond) Apply the plan: isolate, freeze, quarantine
--kill (respond) Kill after freezing (irreversible)
--json FILE Write the full report as JSON
--yara RULES YARA rules to scan executables with
--since-days N Persistence lookback window
--fail-on SEVERITY Exit non-zero if a finding is this severe or worse
アラートのみで、何も変更されません:
sudo hiris watch
攻撃者を自動的に凍結する:
sudo hiris watch --auto-respond --i-understand-the-risk
HIRISは監視中にライブのステータス行を表示し、何かが検知された瞬間にアラートボックスを出力します:
╭─ ◆ CRITICAL ──────────────────────────────────────────── shell_socket_stdio 16:26:11 ─╮
│ Reverse shell: bash (pid 516) has stdio on a network socket │
│ │
│ bash pid 516 has its standard input/output connected to 10.10.14.7. Interactive │
│ shells should never read from a TCP socket. │
│ │
│ → 10.10.14.7 │
│ ⊘ pid 516 │
╰────────────────────────────────────────────────────────────────────────────────────────╯
⚡ froze 516 · isolated 10.10.14.7 · journal-1795814771.jsonl
[*] Monitoring system ⠹ 237 procs · 1 findings · 1 frozen · sweep in 42s · up 00:05:12
sudo hiris scan
sudo hiris respond --force
sudo hiris scan --json report.json --fail-on high
次の /proc ポーリングを待つのではなく、auditd が execve をログに記録した瞬間にプロセスを凍結します:
sudo hiris ips --auto-respond --i-understand-the-risk
各レスポンスはジャーナルを /var/lib/hiris/reports/ に書き込みます。ロールバックをプレビューしてから、適用します:
sudo hiris thaw /var/lib/hiris/reports/journal-1795814771.jsonl
sudo hiris thaw /var/lib/hiris/reports/journal-1795814771.jsonl --force
隔離されたバイナリは意図的にディスク上に残されます。それらは証拠です。
HIRIS は /etc/hiris/config.yaml を読み込みます。すべてのキーは任意です:
quarantine_dir: /var/lib/hiris/quarantine
report_dir: /var/lib/hiris/reports
freeze_method: sigstop
freeze_timeout: 3600
ignore_loopback: true
protected_uids: [1000]
protected_ttys: [/dev/pts/0]
watch_auto_respond: false
watch_kill: false
db_auto_respond: false
correlation_window_sec: 3600
memory_allow_comms: [myjitapp]
ssh_brute_threshold: 5
ssh_brute_window_sec: 300
auth_log_path: /var/log/auth.log
auth_log_paths:
5432: /var/log/postgresql/postgresql-18-main.log
network_auto_respond_sids: [2100498]
| キー | 機能 |
|---|---|
freeze_method | sigstop、cgroup または both |
freeze_timeout | フリーズが自動解除されるまでの秒数。0 で解除しない |
ignore_loopback | 127.0.0.1 接続をスキップ。false を設定して localhost に対してテストする |
protected_uids / protected_ttys | これらが所有するプロセスをフリーズしない |
db_auto_respond | PostgreSQL スーパーユーザーの TCP セッションをフリーズする(デフォルトではアラートのみ) |
correlation_window_sec | ブルートフォースを行った IP を記憶しておく期間 |
memory_allow_comms | 匿名の実行可能メモリを許可する追加の JIT ランタイム |
auth_log_paths | ブルートフォースを監視する追加のポート別サービスログ |
network_auto_respond_sids | --network モードで応答をトリガーできるルール SID |
systemd ユニットは contrib/ に同梱されています:
sudo cp -r . /opt/hiris
sudo cp contrib/hiris.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now hiris
ライブで視聴する:
journalctl -u hiris -f
まず数日間はアラートのみのモードで実行し、何がフリーズ対象になったかを確認してください。一部のWebアプリは正当にシェルコマンドを実行します。
HIRISは実行中のマシン上でプロセスをフリーズおよび強制終了し、ファイアウォールルールを変更します。ヒューリスティックが誤作動を起こし、正当なものを停止してしまう可能性があります。まずアラートのみのモードでテストし、自己責任で使用してください。このツールによって生じたいかなる損害についても、私は責任を負いません。