OSCP/Proving Ground
30. Fail (GET TO WORK) - Linux (rsync, ssh, fail2ban)
takudaddy
2022. 8. 25. 23:36
1. Enumeration

rsync protocol version 31
: rsync manual enum

or nmap enum

> fox라는 사용자 폴더가 있고
붙어보면

파일 다운이 가능,

파일 업로드 역시 가능,

2. Exploitation
ssh authorized 키를 가져와서 업로드,

private 키를 사용해 ssh로 붙으면

침투 성공
3. Privilege Escalation
: SUID 확인

: 그룹 확인

: 그룹 권한 확인

writable 권한이 있는
파일들 확인이 가능하고
그중 의심되는 디렉터리를 확인해 보면

write / execute 권한이 모두 있다.
이 중 jail.conf라는 파일을 보면
fail2ban의 구성 방식 확인이 가능한데

최대 재시도는 2번,
ban 당하는 시간은 1분이고
action.d 경로로 이동한 뒤

새로운 룰 설정이 가능한
설정파일을 변조해 주고


ssh로 2회 이상 로그인을 실패 시
강제 밴을 당하면 설정해 둔
actionban 명령어 즉,
쉘이 실행된다.
리스너 기동 후 ssh 로그인을 시도하면


끝
728x90