8000 FortiGate loader is broken · Issue #1169 · fox-it/dissect.target · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
FortiGate loader is broken #1169
Open
@yunzheng

Description

@yunzheng

It is detecting the FortiGate image as a Tar file now, while it's a gzip file.

Steps to reproduce:

$ wget https://dl.partian.co/FortiGate/Version_7.00/7.6/7.6.1/FGT_1000D-v7.6.1.F-build3457-FORTINET.out

% uv run --with "dissect.target[full]" target-shell --version
dissect.target version 3.22

$ uv run --with "dissect.target[full]" target-shell FGT_1000D-v7.6.1.F-build3457-FORTINET.out
2025-06-11T13:43:13.878407Z [warning  ] Tar file PosixPath('FGT_1000D-v7.6.1.F-build3457-FORTINET.out') is compressed, which will affect performance. Consider uncompressing the archive before passing the tar file to Dissect. [dissect.target.loaders.tar]
2025-06-11T13:43:13.878801Z [error    ] FGT_1000D-v7.6.1.F-build3457-FORTINET.out: Failed to initiate loader: file could not be opened successfully:
- method gz: ReadError('invalid header')
- method bz2: ReadError('not a bzip2 file')
- method xz: ReadError('not an lzma file')
- method tar: ReadError('invalid header') [dissect.target.target]
2025-06-11T13:43:13.878857Z [error    ] Error opening shell [dissect.target.tools.shell]
Traceback (most recent call last):
  File "/Users/yun/.cache/uv/archive-v0/zJmKO8rejR1Jwk0GHcYYl/lib/python3.13/site-packages/dissect/target/tools/shell.py", line 1595, in main
    open_shell(args.targets, args.python, args.registry, args.commands)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/yun/.cache/uv/archive-v0/zJmKO8rejR1Jwk0GHcYYl/lib/python3.13/site-packages/dissect/target/tools/shell.py", line 1472, in open_shell
    targets = list(Target.open_all(targets))
  File "/Users/yun/.cache/uv/archive-v0/zJmKO8rejR1Jwk0GHcYYl/lib/python3.13/site-packages/dissect/target/target.py", line 374, in open_all
    raise TargetError(f"Failed to find any loader for targets: {paths}")
dissect.target.exceptions.TargetError: Failed to find any loader for targets: ['FGT_1000D-v7.6.1.F-build3457-FORTINET.out']

The only way to get it to work now is to pass the -L raw flag to target-shell:

$ uv run --with "dissect.target[full]" target-shell FGT_1000D-v7.6.1.F-build3457-FORTINET.out -L raw
2025-06-11T13:44:00.657676Z [warning  ] <Target FGT_1000D-v7.6.1.F-build3457-FORTINET.out>: Can't identify volume system or no volumes found, adding as raw volume instead: <FortiFirmwareContainer size=268435968 vs=None> [dissect.target.target]
2025-06-11T13:44:01.162055Z [warning  ] <Target FGT_1000D-v7.6.1.F-build3457-FORTINET.out>: Attempting to load rootfs.gz, this can take a while [dissect.target.target]
2025-06-11T13:44:17.589034Z [warning  ] <Target FGT_1000D-v7.6.1.F-build3457-FORTINET.out>: Attempting to load XZ files, this can take a while [dissect.target.target]
FGT_1000D-v7.6.1.F-build3457-FORTINET.out:/$ ls
bin
bin.tar.xz
boot
data
data2
dev
etc
fortidev
init
lib
lib64
migadmin
migadmin.tar.xz
node-scripts
node-scripts.tar.xz
proc
sbin
sys
tmp
usr
usr.tar.xz
var
FGT_1000D-v7.6.1.F-build3457-FORTINET.out:/$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0