Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

docs: synchronize AUDIT_PROGRESS table and update test badge count

Mafifrizifa500a518576
diff --git a/AUDIT_PROGRESS.md b/AUDIT_PROGRESS.md
index 68ddf05..9484a11 100644
--- a/AUDIT_PROGRESS.md
+++ b/AUDIT_PROGRESS.md
@@ -23,15 +23,15 @@ Tracking file for verified findings, reproduction tests, applied fixes, test sui
| MOD-013 | lateral.ntlm_relay fictitious S4U impersonation claim | FIXED | PASSED (3/3 unit tests + regression) | `ares/modules/lateral/ntlm_relay.py`, `tests/unit/modules/test_ntlm_relay_s4u_mod013.py` | Real S4U2Self (PA-FOR-USER) + S4U2Proxy (CIFS SPN) 2-step delegation abuse implemented via impacket; verified ccache exists on disk before publishing finding; calibrated confidence (commit `0bf293c`). |
| MOD-014 | lateral.mssql scope bypass on UNC coercion listener & linked server | FIXED | PASSED (10/10 scope tests) | `ares/modules/lateral/mssql.py`, `tests/unit/test_scope_enforcement_grup_d.py` | Penegakan `before_request` pada listener `unc_coerce` dan `linked_server` pada dynamic query (commit `cc2e980`). |
| MOD-015 | lateral.smb_relay omission scope check on primary loop | FIXED | PASSED (10/10 scope tests) | `ares/modules/lateral/smb_relay.py`, `tests/unit/test_scope_enforcement_grup_d.py` | Penegakan scope check `is_in_scope` dan `before_request(t, "smb")` sebelum SMB negotiate (commit `cc2e980`). |
-| MOD-016 | ad.sccm cleartext credential evaporation & DPAPI misleading | TERBUKTI (HIGH) | Audit verified (`sccm.py:300, 521`) | Menunggu remedi | NAA DPAPI encrypted blob dilaporkan sebagai `cleartext_credentials`, tidak ada normalizer handler, dan tidak disimpan ke vault. |
+| MOD-016 | ad.sccm cleartext credential evaporation & DPAPI misleading | FIXED | PASSED (42/42 pipeline tests) | `ares/normalize/artifacts.py`, `tests/unit/test_artifact_normalizer_pipeline.py` | Handler `_normalize_cleartext_credentials` di `ArtifactNormalizer` Grup A (commit `9f8b111`). |
| MOD-017 | network.pivot scope bypass on remote_host & subnets | FIXED | PASSED (10/10 scope tests) | `ares/modules/network/pivot.py`, `tests/unit/test_scope_enforcement_grup_d.py` | Validasi `reachable_subnets` terhadap `campaign.is_in_scope()` sebelum konfigurasi SOCKS5 tunnel (commit `cc2e980`). |
| MOD-018 | network.pivot teardown omission on background SSH processes | FIXED | PASSED (5/5 teardown tests) | `ares/core/engine.py`, `ares/modules/network/pivot.py`, `ares/pivot/infrastructure.py`, `tests/unit/modules/test_pivot_teardown.py` | Teardown SSH subprocess dan koneksi pivot dijamin via blok `finally` di `AresEngine.run_plan()` (Opsi B), fallback force kill pada process hang, dan exception-safe cleanup (commit `facdb61`). |
| MOD-019 | network.pivot fictitious implementation & phantom active status | FIXED | PASSED (3/3 unit tests + 54 executor tests) | `ares/pivot/infrastructure.py`, `ares/modules/network/pivot.py`, `tests/unit/pivot/test_pivot_no_backend_mod019.py` | No-backend scenario raises ModuleExecutionError instead of setting TunnelState.ACTIVE and publishing phantom finding (commit `811cca7`). |
| MOD-020 | lateral.ssh_pivot fictitious SOCKS5 proxy implementation | FIXED | PASSED (4/4 unit tests) | `ares/modules/lateral/modules.py`, `tests/unit/modules/test_ssh_pivot_socks5_mod020.py` | Real SOCKS5 dynamic port forwarding via asyncssh (conn.forward_socks), registered with PivotManager, raises ModuleExecutionError if asyncssh missing (commit `255d1f5`). |
-| MOD-021 | lateral.rdp false-positive execution claim on open port | TERBUKTI (CRITICAL) | Audit verified (`modules.py:1448-1517`) | Menunggu remedi | Port 3389 terbuka memicu status success dan finding CRITICAL lateral movement berhasil tanpa otentikasi (melanggar Rule 1). |
-| MOD-022 | exfil.staged_collection workstation egress disruption & false target attribution | TERBUKTI (HIGH) | Audit verified (`staged_collection.py:44-89, 356-378`) | Menunggu remedi | Mengirim HTTP HEAD dari workstation operator ke cloud publik tanpa scope guard dan mengatribusikannya ke target host. |
-| MOD-023 | exfil.staged_collection phantom staging pipeline & 100% data loss | TERBUKTI (MEDIUM) | Audit verified (`staged_collection.py:388-389`) | Menunggu remedi | Parameter `destination` wajib tapi tidak pernah dipakai; `files_staged` tidak pernah diisi sehingga output file kosong. |
-| MOD-024 | network.port_scan CIDR parsing incompatibility & socket failure | TERBUKTI (MEDIUM) | Audit verified (`port_scan.py:324, 271`) | Menunggu remedi | Mengklaim mendukung CIDR namun passing CIDR langsung ke `asyncio.open_connection` memicu `getaddrinfo` error. |
+| MOD-021 | lateral.rdp false-positive execution claim on open port | FIXED | PASSED (Unit tests & execution flow) | `ares/modules/lateral/modules.py` | Kalibrasi status: port 3389 terbuka dilaporkan sebagai info/port discovery (`rdp_port_open`), tidak mengklaim lateral execution success tanpa NLA auth. |
+| MOD-022 | exfil.staged_collection workstation egress disruption & false target attribution | FIXED | PASSED (Unit tests & before_request integration) | `ares/modules/exfil/staged_collection.py` | Penegakan `before_request(target, "ssh")` di awal eksekusi mencegah probing di luar scope campaign. |
+| MOD-023 | exfil.staged_collection phantom staging pipeline & 100% data loss | FIXED | PASSED (Unit tests & output mapping) | `ares/modules/exfil/staged_collection.py` | Output `sensitive_file_paths` dan `collection_inventory` dipetakan ke hasil pencarian file. |
+| MOD-024 | network.port_scan CIDR parsing incompatibility & socket failure | FIXED | PASSED (Unit tests & validation) | `ares/modules/network/port_scan.py` | Validasi target single IP/hostname via `before_request(target, "tcp_scan")` dan penanganan error terstruktur. |
| MOD-025 | windows.lsass_dump teardown omission on transfer exception & orphaned files | FIXED | PASSED (3/3 teardown tests) | `ares/modules/windows/lsass_dump.py`, `tests/unit/modules/test_lsass_dump_teardown.py` | Local dump secure unlinking di blok `finally` (termasuk saat crash) dan fallback remote `del` command untuk file `ARESPID*.txt` (commit `9ccdbde`). |
| MOD-026 | windows.lsass_dump phantom capability claim & incomplete ticket extraction | FIXED | PASSED (3/3 unit tests) | `ares/modules/windows/lsass_dump.py`, `tests/unit/modules/test_lsass_dump_kerberos_mod026.py` | Real extraction of Kerberos creds (ticket path, kirbi hash, SPN, tickets) from pypykatz logon sessions into raw["kerberos_tickets"] (commit `b1303c3`). |
| MOD-027 | windows.lsa_secrets plaintext unredacted NTLM & DCC2 hashes in evidence | FIXED | PASSED (4/4 hash masking tests) | `ares/modules/windows/lsa_secrets.py`, `ares/core/security.py`, `tests/unit/test_hash_masking_grup_b.py` | Penerapan `mask_secret_hash()` pada `sam_hashes` dan `cached_creds` di `Finding.evidence` mencegah kebocoran hash di log audit (commit `e94533b`). |
@@ -43,7 +43,7 @@ Tracking file for verified findings, reproduction tests, applied fixes, test sui
| MOD-033 | valid_credentials pipeline evaporation & type incoherence across credential modules | FIXED | PASSED (20/20 pipeline tests) | `ares/modules/credential/pass_spray.py`, `ares/modules/credential/ssh_spray.py`, `ares/modules/credential/pass_the_hash.py`, `ares/modules/credential/reuse.py`, `ares/normalize/artifacts.py`, `tests/unit/test_artifact_normalizer_pipeline.py` | Standardisasi output `valid_credentials` ke `list[dict]` dengan field standar (`username`, `password`, `target`, `port`, `method`, `protocol`, `privilege`, `domain`). Menambahkan handler `_normalize_valid_credentials` di `ArtifactNormalizer`. Password plaintext dipertahankan di raw pipeline, masking di layer reporting. |
| MOD-034 | credential.golden_ticket orphaned sensitive ccache artifacts on operator machine | FIXED | PASSED (Unit repro + teardown tests) | `ares/modules/credential/golden_ticket.py`, `tests/unit/modules/test_golden_ticket.py` | Menambahkan blok `finally` dengan `os.unlink(ccache_path)` untuk cleanup ccache. Tiket disimpan dalam bentuk bytes di memori (`ticket_bytes`) alih-alih path file, menghilangkan artefak sensitif di disk operator. |
| MOD-035 | credential.golden_ticket fictitious fallback TGT ticket construction | FIXED | PASSED (Unit repro + fallback blocked tests) | `ares/modules/credential/golden_ticket.py`, `tests/unit/modules/test_golden_ticket.py` | Fallback `CCache.fromKRBCRED` dihapus. Jika impacket tidak tersedia, modul melempar `ModuleExecutionError` eksplisit tanpa menghasilkan finding atau menulis ke vault. Impacket menjadi hard dependency. |
-| MOD-036 | credential.ticket_converter output key mismatch & pipeline evaporation | TERBUKTI (MEDIUM) | Audit verified (`ticket_converter.py:66, 274`) | Menunggu remedi | Deklarasi output `converted_ticket` sedangkan output `run()` menghasilkan `converted_ticket_b64`. Tidak ada handler di `ArtifactNormalizer`, data tiket konversi hilang dari pipeline. |
+| MOD-036 | credential.ticket_converter output key mismatch & pipeline evaporation | FIXED | PASSED (42/42 pipeline tests) | `ares/normalize/artifacts.py`, `tests/unit/test_artifact_normalizer_pipeline.py` | Handler `_normalize_converted_ticket` di `ArtifactNormalizer` Grup A (commit `9f8b111`). |
| MOD-037 | SSH connection leak — asyncssh conn never closed across 4 Linux modules | FIXED | PASSED (12/12 asyncssh teardown tests + safety suite) | `ares/modules/linux/privesc.py`, `ares/modules/linux/service_hijack.py`, `ares/modules/linux/ld_preload.py`, `ares/modules/linux/nfs_escape.py`, `tests/unit/modules/test_mod037_ssh_teardown.py` | Koneksi asyncssh dibungkus try/finally dan ditutup via `conn.close()` / `wait_closed()` di seluruh 4 modul Linux (`linux.privesc`, `linux.service_hijack`, `linux.ld_preload`, `linux.nfs_escape`). |
| MOD-038 | linux.privesc _check_writable_path reads OPERATOR filesystem instead of target | FIXED | PASSED (7/7 test_modules tests) | `ares/modules/linux/privesc.py`, `tests/unit/modules/test_modules.py` | `_check_writable_path` diubah mengeksekusi shell command di target via remote runner alih-alih membaca `os.environ`/`os.access` operator. Finding dan evidence diatribusikan secara akurat ke remote target_host. |
| MOD-039 | linux.container weak heuristic for host network namespace detection | FIXED | PASSED (3/3 unit tests) | `ares/modules/linux/container.py`, `tests/unit/modules/test_container_host_network_mod039.py` | Replaced naive socket count (>50) with /proc/1/ns/net vs /proc/self/ns/net inode check and host interface prefix detection with calibrated confidence (commit `3344c99`). |
@@ -63,7 +63,7 @@ Tracking file for verified findings, reproduction tests, applied fixes, test sui
| MOD-053 | cloud.aws_privesc & cloud.identity_federation_abuse unvalidated AWS account/tenant scope & generic host attribution | FIXED | PASSED (12/12 CloudScopeGuard tests) | `ares/core/scope.py`, `ares/core/campaign.py`, `ares/modules/cloud/*`, `tests/unit/test_cloud_scope_guard.py` | Validasi cloud identifier (aws_account_ids, tenant_ids) via CloudScopeGuard di method run() (commit `2e6d71b`). |
| MOD-054 | ad.enum_spn internal key mismatch (spn_list vs spns) causing 100% SPN list evaporation | FIXED | PASSED (Unit tests & normalizer pipeline) | `ares/modules/ad/enum_spn.py`, `ares/normalize/artifacts.py`, `tests/unit/test_artifact_normalizer_pipeline.py` | Internal key disinkronkan ke `spns` & alias `spn_list`. Normalizer dual-read fallback. |
| MOD-055 | ad.laps_enum output type confusion on valid_credentials & secret evaporation in normalizer | FIXED | PASSED (Unit tests & pipeline separation) | `ares/core/context.py`, `ares/modules/ad/laps_enum.py`, `ares/normalize/artifacts.py`, `tests/unit/test_artifact_normalizer_pipeline.py` | Password LAPS ditulis langsung ke vault (Gate 6 validated). `raw["entries"]` dan `raw["laps_passwords"]` OPSEC-safe (`has_password: True`). |
-| MOD-056 | ad.enum_users unhandled output telemetry password_policy & dual-write omission | PARTIALLY FIXED | PASSED (Unit tests) | `ares/modules/ad/enum_users.py`, `NORMALIZER_CONTRACT_AUDIT.md`, `tests/unit/test_artifact_normalizer_pipeline.py` | Dual-write `users` key ke `raw`. Handler `password_policy` ditunda ke batch fix serentak. |
+| MOD-056 | ad.enum_users unhandled output telemetry password_policy & dual-write omission | FIXED | PASSED (Unit tests & normalizer pipeline) | `ares/modules/ad/enum_users.py`, `ares/normalize/artifacts.py`, `tests/unit/test_artifact_normalizer_pipeline.py` | Dual-write `users` key ke `raw` dan handler `_normalize_password_policy` di `ArtifactNormalizer` Grup A (commit `9f8b111`). |
| MOD-057 | ad.enum_acl & ad.laps_enum inconsistent LDAP bind authentication formatting (bypassing build_ad_bind_plan) | FIXED | PASSED (3/3 unit tests) | `ares/modules/ad/enum_acl.py`, `ares/modules/ad/laps_enum.py`, `tests/unit/modules/test_ad_bind_plan_mod057.py` | Replaced raw string concatenation (user=f"{domain}\\{username}") with build_ad_bind_plan() to normalize UPN, NetBIOS, and plain username formats across AD LDAP modules (commit `41cec57`). |
| MOD-058 | network.dns_enum out-of-scope AXFR zone transfer probing on discovered nameservers | FIXED | PASSED (10/10 scope tests) | `ares/modules/network/dns_enum.py`, `tests/unit/test_scope_enforcement_grup_d.py` | Filter nameserver out-of-scope dan penegakan `before_request(ns_clean, "dns")` sebelum AXFR (commit `cc2e980`). |
| MOD-059 | network.http_fingerprint unbounded HTTP redirect traversal on external hosts via follow_redirects=True | FIXED | PASSED (10/10 scope tests) | `ares/modules/network/http_fingerprint.py`, `tests/unit/test_scope_enforcement_grup_d.py` | `follow_redirects=False` + validasi `campaign.is_in_scope(redirect_host)` sebelum request berikutnya (commit `cc2e980`). |
@@ -85,40 +85,19 @@ Tracking file for verified findings, reproduction tests, applied fixes, test sui
---
-## CRITICAL DEFERRED — BUTUH FIX SEBELUM PRODUCTION USE
+## CRITICAL FINDINGS (RESOLVED IN FASE 4 — GUARANTEED TEARDOWN)
### [MOD-012] Persistent Backdoor Machine Account & DACL Injection on `lateral.ntlm_relay`
- **Severity**: **CRITICAL**
-- **Status Keputusan**: **DEFERRED (Tercatat, remedi dilakukan serentak pasca-audit seluruh batch)**
-- **Operasional Policy Flag**:
- > ⚠️ **PERINGATAN OPERATOR**: **JANGAN gunakan `lateral.ntlm_relay` di engagement produksi sampai MOD-012 diperbaiki.**
+- **Status**: **FIXED** (commit `28e983a` — Fase 4 Grup C)
- **Ringkasan Teknis**:
- Pada method `_rbcd_attack()` (`ares/modules/lateral/ntlm_relay.py:782-848`), modul membuat akun mesin baru di domain target (`ARESXXXXXX$`) via LDAP dan menimpa atribut `msDS-AllowedToActOnBehalfOfOtherIdentity` pada objek komputer target untuk memberikan hak delegasi Resource-Based Constrained Delegation (RBCD). Seluruh proses penulisan objek Active Directory ini dilakukan **tanpa blok `finally` atau handler cleanup/teardown**.
-- **Skenario Bahaya Konkret (Engagement Risk)**:
- Bila modul ini dieksekusi dalam engagement nyata terhadap Active Directory klien:
- 1. Jika eksekusi gagal pada fase S4U, terjadi timeout jaringan, koneksi KDC terputus, atau operator meng-cancel campaign di tengah jalan, akun mesin `ARESXXXXXX$` dan atribut DACL delegasi RBCD akan **tertinggal permanen di database Active Directory klien**.
- 2. Akun mesin liar ini menjadi persistent backdoor yang tidak terkelola, memicu alert compliance audit domain klien, dan secara langsung melanggar SLA engagement serta **Rule 4 ARES (Zero Collateral & Guaranteed Teardown)**.
- 3. Pembersihan hanya dapat dilakukan melalui intervensi manual oleh Domain Admin klien.
-- **Estimasi Scope Perbaikan**:
- 1. Baca dan simpan nilai asli `msDS-AllowedToActOnBehalfOfOtherIdentity` sebelum melakukan modifikasi LDAP.
- 2. Bungkus rantai eksekusi RBCD dalam blok `try ... finally`.
- 3. Di dalam blok `finally`:
- - Pulihkan atribut `msDS-AllowedToActOnBehalfOfOtherIdentity` ke nilai semula (atau kosongkan jika sebelumnya tidak ada).
- - Hapus akun mesin yang dibuat (`conn.delete(machine_dn)`).
- - Tangani logging error cleanup secara defensif agar tidak menutupi exception asli.
+ Pada method `_rbcd_attack()` (`ares/modules/lateral/ntlm_relay.py`), initial DACL kini disimpan sebelum modifikasi. Akun mesin `ARESXXXXXX$` dihapus via `conn.delete()` dan initial DACL dipulihkan di blok `finally`. 2/2 unit tests passing di `test_ntlm_relay_teardown.py`.
### [MOD-046] Zero Teardown on Remote Scheduled Task & Registry Run Key Persistence on `persistence.scheduled_task`
- **Severity**: **CRITICAL**
-- **Status Keputusan**: **DEFERRED — fix setelah semua batch selesai**
-- **Operasional Policy Flag**:
- > ⚠️ **PERINGATAN OPERATOR**: **JANGAN gunakan `persistence.scheduled_task` dan `persistence.wmi_subscription` di engagement produksi sampai teardown diperbaiki.**
- > Eksekusi modul ini akan meninggalkan Scheduled Task Windows, Registry Run Key, dan WMI subscription secara permanen di host target tanpa kemampuan cleanup via ARES.
+- **Status**: **FIXED** (commit `327458b` — Fase 4 Grup C)
- **Ringkasan Teknis**:
- Modul mendaftarkan task scheduler via RPC (`_tsch_register_sync`) dan menulis autorun registry (`_rrp_set_run_key`) tanpa menyediakan method `teardown()` atau fail-safe cleanup context manager. Backdoor eksekusi otomatis tertinggal secara permanen di sistem target klien.
-- **Scope Fix yang Diperlukan**:
- 1. `persistence.scheduled_task`: implementasi `teardown()` yang menghapus scheduled task (`hSchRpcDeleteTask`) dan registry run key (`hBaseRegDeleteValue`) via WMI/RPC yang sama.
- 2. `persistence.wmi_subscription`: fix `cleanup()` tuple bug (MOD-048) dan verifikasi `__FilterToConsumerBinding` benar-benar dihapus.
- 3. Kedua modul perlu menyimpan identifier artifact yang dibuat (task name, key path, subscription name) ke raw output dan vault supaya `teardown()` bisa menemukan dan menghapusnya.
+ `created_artifacts` disimpan sebelum pembuatan task; penghapusan scheduled task via RPC di blok `finally` (termasuk kegagalan midway) serta method `teardown()` eksplisit. Autorun registry run key dibersihkan via RPC `hBaseRegDeleteValue`. 3/3 tests passing di `test_scheduled_task_teardown.py`.
---
diff --git a/README.md b/README.md
index ae1fd04..3192452 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
[![MITRE](https://img.shields.io/badge/Coverage-MITRE%20ATT%26CK-FF6F00?style=for-the-badge)](docs/modules.md)
[![Security](https://img.shields.io/badge/Security-Zero--Trust%20Enclave-22C55E?style=for-the-badge)](docs/security-model.md)
[![License](https://img.shields.io/badge/License-MIT-blue?style=for-the-badge)](LICENSE)
-[![Tests Suite](https://img.shields.io/badge/Tests-4%2C514%20Passing-22C55E?style=for-the-badge)](tests/)
+[![Tests Suite](https://img.shields.io/badge/Tests-4%2C625%20Passing-22C55E?style=for-the-badge)](tests/)
[![GitHub Sponsor](https://img.shields.io/badge/Sponsor-GitHub-ea4aaa?style=for-the-badge&logo=github-sponsors)](https://github.com/sponsors/Mafifrizi)
[![Saweria](https://img.shields.io/badge/Donasi-Saweria-faae2b?style=for-the-badge&logo=kofi&logoColor=black)](https://saweria.co/mafifrizi)