Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
fortitool — Fortinet Firmware decryption and analysis tools | Kitploit
Tools/GitHubGitHub/mosajjal/fortitool
Embedded Systems SecurityStatic AnalysisEncryption/Decryption ToolsReverse EngineeringNetwork SecurityCryptographyHardware SecurityUtilities & FrameworksBinary AnalysisFirmware Analysis
GitHub
5491 month agoReviewed by Kitploit
Share
mosajjal/fortitool

fortitool

Fortinet Firmware decryption and analysis tools

View RepositoryWebsite

fortitool

A single static Go binary and library for decrypting and unpacking Fortinet firmware: FortiGate/FortiWiFi FortiOS images and tested FortiAnalyzer/FortiManager KVM installation packages. Supported containers, filesystems and crypto schemes are detected from their contents, without a product, version or CPU architecture flag. See Supported firmware for the tested products, package types and stages.

The format and crypto readers are implemented in Go. No openssl, xz, tar, cpio, mount/debugfs, 7z, binwalk, vmlinux-to-elf, or Python is required at runtime. FortiOS config-secret decryption and FortiGuard PKCS#7 signature inspection are also included.

Historically, decrypting one firmware image meant picking the right tool out of several version-specific ones (forticrack, fgx, forticrack_v8, decrypt-fortigate-rootfs, ...) and chaining OS binaries by hand. fortitool folds all of that into one command.

Install

Download the archive for your platform from the GitHub releases. Each release includes a SHA-256 checksum file covering every prebuilt-binary archive. Extract the archive, put fortitool (or fortitool.exe) on your PATH, and run fortitool version to confirm the installed tag.

Alternatively, install with Go:

go install github.com/mosajjal/fortitool/cmd/fortitool@latest

Or build from source:

git clone https://github.com/mosajjal/fortitool
cd fortitool
CGO_ENABLED=0 go build -o fortitool ./cmd/fortitool

CGO_ENABLED=0 matters if you want the fully-static binary this project promises — without it, Go links against glibc for the (unused) net resolver. Verify with file fortitool (should say "statically linked") or ldd fortitool (should say "not a dynamic executable").

Usage

fortitool decrypt -o outdir image.out          # full pipeline, one command
fortitool inspect image.out                    # read-only format/support report
fortitool decrypt -o fmg image.out.kvm.zip     # FAZ/FMG single-QCOW2 package
fortitool decrypt --boot-only -o boot faz.qcow2 # original boot files only
fortitool l1 -o out.img image.out              # outer XOR layer only
fortitool rootfs -o out.gz kernel rootfs.gz    # kernel is flatkc or vmlinuz
fortitool unpack -o outdir archive.tar.xz      # generic gzip+tar / xz+tar
fortitool pkg inspect --content payload sig.x  # verify a PKCS#7 signature
fortitool pkg scan datafs/                     # classify files, find sigs
fortitool config decrypt --stdin < secret.txt  # config-backup ENC secret
fortitool config decrypt --file secret.txt     # file input without argv exposure

Every command has a full description, flags, and examples via fortitool <command> -h (or run fortitool -h for the command list). Flags must precede positional arguments — Go's flag package doesn't permute argv the way getopt does.

inspect reports one image as stable, human-readable field: value lines. It uses the same L1, disk-layout, required-member, rootfs-crypto and payload classification decisions as decrypt, but does not extract or write anything and never displays recovered key material. A readable image that is only partially recognised reports status: partial, a last-successful-stage and an unsupported-stage, and exits 0 because describing that boundary is a successful inspection. An absent or inaccessible input exits 1; invalid flags or argument count exit 2.

decrypt and unpack publish a completed tree only when the requested output directory does not already exist. Linux uses an atomic no-replace rename; other platforms perform a best-effort existence check before the rename. Staged trees and standalone decrypted files are private to the invoking identity: mode 0700 or 0600 on Unix, and a protected per-user DACL on Windows. Archive and filesystem symlinks with absolute targets are rewritten as confined relative links, so extracted links remain inside the output tree rather than referring to paths on the host.

For config secrets, prefer --stdin or --file so the ciphertext does not appear in process listings or shell history. The direct fortitool config decrypt <base64-blob> form remains available only for compatibility, and exactly one of the three input sources is accepted. Input is limited to 1 MiB; surrounding whitespace is trimmed, and the remaining value must be non-empty and contain no whitespace.

With pkg inspect --content, verification succeeds only when the wrapper contains at least one signer and every SignerInfo validates against the payload. This proves cryptographic integrity using the certificates embedded in the PKCS#7 wrapper; it does not validate their trust chains to a trusted root CA.

Supported firmware

Coverage is specific to the product, package type and processing stage. FAZ/FMG firmware support does not establish support for their configuration backup secrets or for other Fortinet products.

FortiGate and FortiWiFi

Across 167 unique FortiOS images tested, with versions spanning 3.0 through 8.0, L1/header recovery succeeded for every image and matched an independent decoder byte-for-byte. This covers that stage and tested set only; later decryption and extraction remain format-dependent, as detailed below.

LayerCoverageStatus
L1 .out outer cipherSupported FortiOS .out layoutsVerified across the 167-image corpus described above; real FWF-60E 7.4.7/7.4.10/7.4.11 output is byte-identical to an independent decoder
rootfs.gz — ChaCha20+RSA+AES-CTR family7.4.1–7.4.11 (ARM + x86_64 splits)ARM path verified byte-identical against real firmware; x86_64 splits ported from public write-ups, covered by a synthetic round-trip test, not run against a real x86 sample
rootfs.gz — ChaCha20 body (7.4.1–7.4.3 era)seed-derived key/IV, non-RFC7539 counterPorted from fortigate-crypto/Bishop Fox, covered by a synthetic round-trip test, not run against a real sample of that era
rootfs.gz — XOR+RSA+{FORT-RC4,modified-RC4} family7.6.x, 8.0Ported from public write-ups (fgx, forticrack_v8), covered by a synthetic round-trip test, not run against a real sample
Disk image layoutsappliance MBR+ext3 @512; QCOW2 VM disks; fixed-offset volumesAppliance path verified byte-identical against real firmware; QCOW2/partition and ext4-extent discovery covered by synthetic tests, not run against a real FortiGate VM image
ext2/3 filesystem readFSoC3/ARM appliance MBR+ext3 layoutVerified byte-identical against real firmware, including double-indirect block mapping
ext4 extent-mapped readFortiOS 8.0 VM rootfs (xz-compressed ext4 image)Synthetic round-trip tests only, no real 8.0 sample available
tar/gzip/xz unpackanyVerified byte-identical against real firmware
PKCS#7 SignedData verifydetached signatures (.x files), incl. dual-signedVerified against real signed engine/DB files, both signer chains
Config-secret ENC <base64> decryptall erasLegacy hardcoded AES-128 key verified against real device data through at least 7.2.3 (contrary to common belief it was never rotated at 6.2). The >=7.4 (build 2731) AES-256-CBC key was recovered by RE of the init monolith and verified against real device backups spanning both eras — both keys embedded, see Config-secret keys

"Verified" means run against real firmware/config samples and checked byte-identical or semantically correct output. Everything else is a faithful port of a documented, working reference implementation, exercised by this repo's test suite, but not yet run against a real sample of that specific era — patches with real-firmware validation welcome.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    487
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    459
  • 3

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    352
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    335
  • 5

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    304
  • 6

    estorides

    grisuno/estorides

    Aggregates 99+ free OSINT sources in parallel, resolves entities into a knowledge graph, and exports STIX 2.1, MISP, or GraphML with LLM-assisted analysis.

    290

Explore all tools

Browse our collection of tools

View all tools →