By mosajjal
Fortinet firmware tooling by Ali Mosajjal - fortitool for supported FortiGate/FortiWiFi firmware and FortiAnalyzer/FortiManager KVM installation packages.
npx claudepluginhub mosajjal/fortitoolDecrypt and unpack supported FortiGate/FortiWiFi FortiOS firmware and FortiAnalyzer/FortiManager KVM installation disks (QCOW2 or single-disk ZIP), with automatic format/crypto detection. Also inspect FortiGuard PKCS#7 signatures and decrypt FortiOS config-backup secrets. One static Go binary, no runtime OS packages.
7-day visitors to each marketplace page
Harness-native ECC skills, hooks, rules, MCP conventions, and operator workflows
Anthropic's Claude Code plugins, installed from the claude-plugins-official repository
RuFlo Marketplace: Claude Code native agents, swarms, workers, and MCP tools for continuous software engineering
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.
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").
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.