Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reading Fortinet firmware files #652

Merged
merged 8 commits into from
Mar 28, 2024

Conversation

yunzheng
Copy link
Member

@yunzheng yunzheng commented Mar 26, 2024

This adds transparant decompression and deobfuscation of Fortinet firmware files via the FortiFirmwareContainer and FortiFirmwareFile classes.

The filename has to end with -FORTINET.out for it to be detected as a Fortinet firmware file.

Example usage:

$ target-shell FGT_VM64-v7.4.3.F-build2573-FORTINET.out
$ target-fs FGT_2000E-v5-build1673-FORTINET.out ls /migadmin

Or to decompress and deobfuscate a firmware file to stdout:

$ python3 -m dissect.target.containers.fortifw <FIRMWARE FILE> | xxd

Closes #655

@yunzheng yunzheng changed the title Add support for reading FortiGate firmware files Add support for reading Fortinet firmware files Mar 27, 2024
@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 85.50725% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 74.83%. Comparing base (12a4e46) to head (cd0d196).
Report is 1 commits behind head on main.

❗ Current head cd0d196 differs from pull request most recent head 42f3971. Consider uploading reports for the commit 42f3971 to get more accurate results

Files Patch % Lines
dissect/target/containers/fortifw.py 85.40% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #652      +/-   ##
==========================================
- Coverage   74.84%   74.83%   -0.01%     
==========================================
  Files         288      288              
  Lines       23932    24038     +106     
==========================================
+ Hits        17912    17990      +78     
- Misses       6020     6048      +28     
Flag Coverage Δ
unittests 74.83% <85.50%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yunzheng yunzheng requested a review from Schamper March 27, 2024 17:39
yunzheng and others added 8 commits March 27, 2024 21:47
This adds transparant decompression and deobfuscation of FortiGate
firmware files via the `FortiFirmwareContainer` and `FortiFirmwareFile`
classes.

The filename has to end with `-FORTINET.out` for it to be detected as a
Fortinet firmware file.

Example usage:

   $ target-shell FGT_VM64-v7.4.3.F-build2573-FORTINET.out
   $ target-fs FGT_2000E-v5-build1673-FORTINET.out ls /migadmin
To decrypt a Fortigate firmware file you can now also use:

    $ python3 -m dissect.target.containers.fortifw <firmware file> | xxd
@yunzheng yunzheng force-pushed the feature/add-fortifw-container branch from b46635e to 5a9c679 Compare March 27, 2024 20:47
@yunzheng yunzheng requested a review from Schamper March 27, 2024 22:35
@Schamper Schamper merged commit 8397141 into main Mar 28, 2024
16 checks passed
@Schamper Schamper deleted the feature/add-fortifw-container branch March 28, 2024 10:27
Zawadidone pushed a commit to Zawadidone/dissect.target that referenced this pull request Apr 5, 2024
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.

Add support for reading Fortinet firmware files
3 participants