리버스 셸, 웹 셸, Meterpreter 및 파일리스 임플란트를 탐지한 후 프로세스를 동결하고 공격자 IP를 차단하며 바이너리를 격리하는 Linux 호스트 사고 대응 도구입니다.
██╗ ██╗██╗██████╗ ██╗███████╗
██║ ██║██║██╔══██╗██║██╔════╝
███████║██║██████╔╝██║███████╗
██╔══██║██║██╔══██╗██║╚════██║
██║ ██║██║██║ ██║██║███████║
╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝╚══════╝
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이 되돌릴 수 있는 JSONL 저널에 기록됩니다.휴리스틱이 오작동할 경우를 대비해 동결은 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
auditd가 프로세스의 execve를 기록하는 즉시 프로세스를 동결하며, 다음 /proc 폴링을 기다리지 않습니다:
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 연결 건너뛰기. localhost를 대상으로 테스트하려면 false 설정 |
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 |
contrib/에 systemd 유닛이 포함되어 있습니다:
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
먼저 며칠 동안 경고 전용 모드로 실행하고, 무엇을 동결했을지 확인하세요. 일부 웹 앱은 셸 명령을 정당하게 실행합니다.
HIRIS는 실행 중인 머신에서 프로세스를 동결하고 종료할 수 있으며 방화벽 규칙을 변경합니다. 휴리스틱이 잘못 작동하여 정당한 무언가를 중단시킬 수 있습니다. 먼저 경고 전용 모드에서 테스트하고, 사용에 따른 위험은 본인이 감수하세요. 이 도구로 인해 발생하는 어떠한 손해에 대해서도 저는 책임지지 않습니다.