Update the FortiWeb exploit module (CVE-2025-64446 + CVE-2025-58034) to target older unsupported versions 6.x #20736
+329
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull requests updates the
exploit/linux/http/fortinet_fortiweb_rcemodule (added in #20717) to add in support for older version of FortiWeb, versions6.*, which are no longer under support from the vendor (so no patches available AFAIK), but are also vulnerable to this exploit chain.To do this the module now has two targets,
FortiWeb 8.x(set target 0), andFortiWeb 7.x and 6.x(set target 1). This is required as exploiting different major versions differs as follows:6.*and7.*both the Unix and Linux payloads work (like a fetch based native Meterpreter).8.*the Unix payloads do work, but the Linux payloads do not, as the Linux Integrity Measurement Architecture (IMA) appraisal feature is present (see here for some discussion).As we have different platforms for the payloads that can be used it makes sense to split it out into two targets.
Additionally the mechanism to trigger the command injection is via the CLI, and how we target the CLI differs between
6.*and8.*/7.*.The module will now version fingerprint the target before exploiting the command injection to make sure the Metasploit target supports the actual remote target appliance version.
The exploit module has now been verified to work successfully against
8.0.1,7.4.8,6.4.3, and6.3.9.Example against FortiWeb 6.3.9