26. Sona (GET TO WORK) - Linux
1. Enumeration
: NMAP

: Service enum

> 위 힌트에 대한 답을 찾아야
비번 recover가 가능한듯하다.
: Web enum


: LOG IN
기본 Credential로 로그인이 불가능하나
간단한 Response 응답 값 변조로 우회 가능

> 의미없음
2. Exploitation
: 비번 recover

: 1번 힌트는 별자리

2번 힌트는 좋아하는 색상인데
하나씩 넣어보면 서버 응답을 통해
유추가 가능하고,
이렇게 찾은
두 가지 답을 조합해
RECOVER을 시도하면
임시 비밀번호가 주어지고
해당 임시 비번으로 로그인하면
새로운 비밀번호 설정이 가능하다.
되도록 metasploit을 사용하지 않고
문제를 푸는데 이번 박스는 사용

payload가
linux/x64/meterpreter_reverse_tcp 말고
linux/x64/shell_reverse_tcp로 변경해야
정상 작동하고 여튼
침투 성공
3. Privilege Escalation
방법 1)

policykit 버전 확인 후

관련 exploit 돌려보면

끝
방법 2)
특정 경로에서
특정 사용자 비번 확인이 가능하고

홈 디렉터리를 뒤져보면
파이썬 스크립트 확인이 가능한데

해당 스크립트는 루트 권한으로
매 분마다 실행되고

base64 라이브러리를
import 해온다.
base64 라이브러리
퍼미션을 확인해보면

누구나 편집이 가능
: netcat으로 리버스 쉘이 가능한지 확인

> nc 말고 ncat으로 가능
: os 명령어가 실행되는
스크립트를 만들어주고

: wget으로 받아
base64.py로 저장한 뒤

리스너 기동 후 대기하고 있으면

끝