Skip to content

Support FortiOS 7.6.6 and 8.0.0 rootfs decryption#4

Open
freeqaz wants to merge 4 commits into
randorisec:mainfrom
freeqaz:fortios-766-800-rootfs
Open

Support FortiOS 7.6.6 and 8.0.0 rootfs decryption#4
freeqaz wants to merge 4 commits into
randorisec:mainfrom
freeqaz:fortios-766-800-rootfs

Conversation

@freeqaz

@freeqaz freeqaz commented Jun 2, 2026

Copy link
Copy Markdown

Adds support for newer FortiOS rootfs verifier layouts observed in FortiGate 7.6.6 and 8.0.0, while keeping the existing legacy decrypt path as a fallback. Also adds a guarded legacy stack-size locator fallback inspired by #2.

Changes:

  • Adds ELF section parsing and __ksymtab-based rsa_parse_pub_key discovery for newer kernels with tampered kallsyms.
  • Recovers the newer XOR-obfuscated RSA public key material.
  • Verifies the RSA trailer and encrypted rootfs SHA256.
  • Adds the newer custom stream body decryptor, including both tested PRGA initialization variants.
  • Replaces the legacy shell-pipeline locator with parsed objdump output.
  • Adds a legacy stack-size fallback locator for symbolization edge cases reported on nearby 7.4.x builds.
  • Cleans up README usage, validation, extraction, compatibility, and troubleshooting docs.

Validation performed:

  • python3 -m py_compile decrypt_rootfs.py
  • git diff --check
  • FortiGate 7.6.6 decrypted output passed gzip -t and matched known-good output byte-for-byte.
  • FortiGate 8.0.0 decrypted output passed gzip -t and matched known-good output byte-for-byte.

Notes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant