[Tryhackme] Juicy Details :: 로그파일 분석 Writeup

2025. 3. 17. 20:32·Writeup

 

이번 juicy details 룸은 공격이 발생한 네트워크 로그 파일을 분석해서

공격자가 사용한 기술과 툴, 취약한 엔드포인트, 액세스 된/탈취된 중요 데이터를 파악하면 된다

첨부된 로그 파일을 분석해서 알아보자


Reconnaissance

1. What tools did the attacker use? (Order by the occurrence in the log)

 

 

공격자가 사용한 툴을 찾는 문제다. 로그 목록이 엄청 길긴 하지만 Nmap, Hydra, sqlmap 등 툴 이름을 찾을 수 있었다

: nmap, hydra, sqlmap, curl, feroxbuster

 

2. What endpoint was vulnerable to a brute-force attack?

 

brute force 공격에 취약한 엔드포인트를 보니까 GET, POST 메소드가 연달아서 발생했으므로 브루트 포스라는 걸 알 수 있다

: /rest/user/login

 

3. What endpoint was vulnerable to SQL injection?

4. What parameter was used for the SQL injection?

 

cat access.log | grep "sqlmap"

 

sql injection에 취약한 엔드포인트

: /rest/products/search

 

사용된 파라미터는 searchc?q=[파라미터 값] 이므로

: q

 

 

5. What endpoint did the attacker try to use to retrieve files? (Include the /)

파일을 주고받고 처리하는 프로토콜이 ftp 이기 때문에 쉽게 맞힐 수 있음

: ftp

 


 

Stolen data

이번 섹션에서는 3가지를 분석해야 함

  • 웹사이트에서 공격자의 행위
  • 응답 코드
  • 비정상 쿼리 문자열

1. What section of the website did the attacker use to scrape user email addresses?

 

유저의 이메일 주소 정보를 얻는데 사용하는 웹사이트의 섹션을 찾아야 한다

힌트를 보니까 유저가 보통 어떤 기능에 글을 게시하는지를 생각해 보라고 함 -> 댓글 아니면 리뷰겠다

 

cat access.log | grep "review"

 

: product review

 

2. Was their brute-force attack successful? If so, what is the timestamp of the successful login? (Yay/Nay, 11/Apr/2021:09:xx:xx +0000)

 

brute-force 공격이 성공했다면 성공한 시간의 타임스탬프를 적어야 한다

처음에는 /rest/admin 어드민 권한을 얻은 2021:09:20:32을 적었는데 오답이었다

알고 보니까 로그인 성공 시간이 아니라 브루트포스 공격 시도에 해당하는 GET 요청의 시간을 가리키는 거임

 

: Yay, 11/Apr/2021:09:16:31 +0000

 

 

3. What user information was the attacker able to retrieve from the endpoint vulnerable to SQL injection?

 

union, select 등의 연산자로 이메일과 패스워드 정보를 가져온다

: email, password

 

 

4. What files did they try to download from the vulnerable endpoint (endpoint from the previous task, question #5)

 

취약한 엔드포인트에서 어떤 파일을 다운로드하였는지는 파일을 다루는 ftp 프로토콜을 검색하면 된다

파일 다운로드는 .bak 확장자 두 개인 것으로 보임

 

: coupons_2013.md.bak, www-data.bak

 

 

5. What service and account name were used to retrieve files from the previous question? (service, username)

 

마찬가지로 ftp를 검색하면 되는데, access.log 파일에서는 단서를 찾을 수가 없었음

vsftpd.log로 이동해서 ftp를 검색하니 로그인에 성공하고 파일을 다운로드한 로그 기록이 있음

 

: ftp, anonymous

 

 

6. What service and username were used to gain shell access to the server? (service, username)

 

 

쉘 액세스 정보는 ssh를 쓰면 되겠다고 추측하고 진행했으나 access.log에서는 단서가 X

대신에 로그인이나 인증 방법에 대한 정보가 있는 auth.log 파일에서 ssh를 찾아보니 발견

 

: ssh, www-data

 

 

 

 

리눅스 로그파일 종류가 엄청 다양하고 많아서 더 알아봐야 할 듯

 

https://www.crowdstrike.com/en-us/guides/linux-logging/

 

<strong>Linux Logging Guide</strong>: <br />The Basics

Linux is an open-source operating system originating from the Unix kernel. It’s now one of the most used operating systems across devices. You may be familiar with the various flavors of Linux, including Ubuntu, Centos, and Red Hat Enterprise Linux (RHEL

www.crowdstrike.com

https://sematext.com/blog/17-linux-log-files-you-must-be-monitoring/

 

17 Linux Log Files You Must Be Monitoring

Learn how to monitor Linux log files such as syslog, auth.log, kern.log, and more for system stability, security, and performance.

sematext.com

 

'Writeup' 카테고리의 다른 글

[HackTheBox] Sherlock Brutus 리눅스 로그파일 분석 Writeup  (0) 2025.03.19
[Hackthebox] SpookyPass Writeup  (0) 2025.03.18
[Tryhackme] 리버싱 Reversing ELF Writeup  (0) 2025.03.13
Lab: Exploiting LLM APIs with excessive agency Writeup  (0) 2025.03.12
Lab: JWT authentication bypass via unverified signature Writeup  (1) 2025.03.11
'Writeup' 카테고리의 다른 글
  • [HackTheBox] Sherlock Brutus 리눅스 로그파일 분석 Writeup
  • [Hackthebox] SpookyPass Writeup
  • [Tryhackme] 리버싱 Reversing ELF Writeup
  • Lab: Exploiting LLM APIs with excessive agency Writeup
이둥둥
이둥둥
"><script>prompt(document.cookie)</script>
  • 이둥둥
    시골쥐 해커
    이둥둥
  • 전체
    오늘
    어제
    • 분류 전체보기 N
      • 방통대
      • 리버싱
      • 웹해킹
      • 악성코드 분석
      • Defensive
      • 네트워크
      • 포렌식
      • Writeup
      • 사이버보안
      • 정보처리기사
      • Troubleshooting
      • 취준
  • 블로그 메뉴

    • 홈
    • 사이버보안
    • 방통대
    • 독후감
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    hackthebox
    정보보안
    독후감
    악성코드분석
    리버싱
    사이버보안
    CTF
    tryhackme
    burpsuite
    웹해킹
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
이둥둥
[Tryhackme] Juicy Details :: 로그파일 분석 Writeup
상단으로

티스토리툴바