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 Fortinet AES encrypted firmware images #969

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

yunzheng
Copy link
Member

@yunzheng yunzheng commented Dec 6, 2024

This PR also adds the already dumped AES keys for convienience. It contains dumped FortiGate keys up to the latest v7.6.1.

The AES keys are extracted from the 256 byte rootfs.gz footer which is encrypted using RSA. The RSA public key needed to decrypt this is encrypted using ChaCha20, both are stored in the flatkc kernel file.

Closes #968

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 9 lines in your changes missing coverage. Please review.

Project coverage is 77.71%. Comparing base (63e52e1) to head (ad17078).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...issect/target/plugins/os/unix/linux/fortios/_os.py 82.35% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #969      +/-   ##
==========================================
+ Coverage   77.70%   77.71%   +0.01%     
==========================================
  Files         326      326              
  Lines       28481    28543      +62     
==========================================
+ Hits        22131    22183      +52     
- Misses       6350     6360      +10     
Flag Coverage Δ
unittests 77.71% <82.35%> (+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 force-pushed the improvement/fortinet-aes-crypto branch 2 times, most recently from 8f6fa12 to 16f8e01 Compare December 6, 2024 10:36
yunzheng and others added 3 commits December 6, 2024 14:05
This PR also adds the already dumped AES keys for convienience.
It contains dumped FortiGate keys up to the latest v7.6.1.

The AES keys are extracted from the 256 byte rootfs.gz footer which is
encrypted using RSA. The RSA public key needed to decrypt this is
encrypted using ChaCha20, both are stored in the flatkc kernel file.

Closes #968
@yunzheng yunzheng force-pushed the improvement/fortinet-aes-crypto branch from d890fac to ad17078 Compare December 6, 2024 13:05
@Schamper Schamper merged commit aab863c into main Dec 6, 2024
18 of 20 checks passed
@Schamper Schamper deleted the improvement/fortinet-aes-crypto branch December 6, 2024 14:54
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 AES encrypted Fortinet rootfs.gz files
2 participants