Commit Graph
5 Commits
Author SHA1 Message Date
ergosteur d2ff9d2617 Fix stored-HTML-injection: escape AD data before it hits Markdown tables
Every table cell fed from directory content (descriptions, sAMAccountName,
OS strings, DNs, object classes) was interpolated into the Markdown report
raw. python-markdown doesn't escape inline HTML by default, so a
directory-controlled value like an OU description containing <script>...
would render live once the report was converted to HTML with md_to_html.py
-- and the underlying data is attacker-influenceable, not just
operator-authored.

Added md_escape() (Python) / ConvertTo-MdSafe (PowerShell), applied at
every table-row interpolation in both scripts. Escapes &, <, > to HTML
entities and | plus embedded newlines to keep the table structure intact.
Raw JSON dumps are left untouched -- this only affects the Markdown/HTML
presentation layer.

Verified end-to-end with <script>, <img onerror=...>, embedded &, and
embedded | payloads across every affected table in both scripts; confirmed
no live tags reach the rendered HTML and no double-escaping occurs.
2026-08-21 17:13:23 -04:00
ergosteur ce4f5ec625 Sortable HTML tables, local-time toggle, and RFC 3339 dates everywhere
- All timestamps (last logon, password last set, whenCreated, report
  generation time) now emit as RFC 3339 UTC in both the Markdown
  report and raw JSON dump, for both the Python and PowerShell
  scripts.
- md_to_html.py: click any table header to sort ascending/descending
  (vanilla JS, numeric-aware); a "Show local time" toggle swaps every
  timestamp between UTC and the viewer's local offset, still RFC 3339.
2026-08-21 16:50:31 -04:00
ergosteur 1a2a9b8d16 Add per-object detail lists to each risk finding
Each finding in the Risk & Cleanup table now expands into a full list
of the matching accounts/computers/groups (sAMAccountName, last logon
or type, DN) so the report can be acted on directly instead of just
citing counts. Removed the now-redundant standalone stale-user and
empty-group sections since they're covered by the finding lists.
2026-08-21 16:25:18 -04:00
ergosteur 903f64a40b Add executive summary with prioritized risk findings to both reports
Surfaces blank-password, AS-REP roastable, unconstrained delegation,
lockout, stale-account, empty-group, and password-never-expires
counts as a severity-ranked findings table at the top of the report,
ahead of the full detail tables -- useful as a reorg-planning summary.
2026-08-21 16:17:44 -04:00
ergosteur 60cbfadbae Add AD audit scripts (Python/LDAP and PowerShell/RSAT)
Read-only structural/health audit of Active Directory: OU tree, user
and computer account status/hygiene flags, and group breakdown. Two
equivalent implementations depending on available access -- raw LDAP
via ldap3, or Get-AD* cmdlets via RSAT on a domain-joined machine.
2026-08-21 16:14:28 -04:00