In this very easy Sherlock, you will familiarize yourself with Unix auth.log and wtmp logs. We'll explore a scenario where a Confluence server was brute-forced via its SSH service. After gaining access to the server, the attacker performed additional activities, which we can track using auth.log. Although auth.log is primarily used for brute-force analysis, we will delve into the full potential of this artifact in our investigation, including aspects of privilege escalation, persistence, and even some visibility into command execution.
Analyze the auth.log. What is the IP address used by the attacker to carry out a brute force attack?

주어진 문제 폴더를 보면 log 파일을 준다.
여기에서 공격자가 65.2.161.68 를 사용하여 Bruteforce attack을 시도하는 것을 알 수 있다.
사진 부분만이 아니라 스크롤을 내려보면 해당 ip 주소를 이용하여 시도하는 것을 계속해서 확인 가능하다.
The bruteforce attempts were successful and attacker gained access to an account on the server. What is the username of the account?

로그 파일의 스크롤을 가장 아래로 내려보면 어떤 계정으로 로그인에 성공했는지 확인 가능하다.
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 파일은 Linux/UNIX 계열 시스템에서 사용자 로그인/로그아웃, 시스템 재부팅 등 세션 정보를 기록하는 바이너리 로그 파일이다.
칼리로 옮겨와 아래와 같이 분석했다.
┌──(kali㉿kali)-[~/Downloads]
└─$ utmpdump wtmp > wtmp.txt
Utmp dump of wtmp
wtmp.txt 파일을 보면 위에서 공격에 사용한 65.2.161.68 을 통해 root 계정에서 터미널창을 실행했던 것을 확인할 수 있다.

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?

공격자는 root 계정을 탈취했기 때문에 root 세션에 부여된 session number를 찾았다.
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?

노란 부분을 보면 cyberjunkie 라는 username으로 sudo 그룹에 추가하여 관리자 권한을 갖게 되었음을 알 수 있다.
What is the MITRE ATT&CK sub-technique ID used for persistence by creating a new account?
이거는 검색을 했다.

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

session closed for user root 이 문구를 통해 찾을 수 있었다.
The attacker logged into their backdoor account and utilized their higher privileges to download a script. What is the full command executed using sudo?

auth.log 파일의 하단에서 cyberjunkie 계정으로 명령을 실행했음을 알 수 있다.
