Brutus

Description

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.

Files

~/VBoxShare ➜ 7z x .\Brutus.zip -p"hacktheblue" -o"Brutus"

7-Zip 22.01 (x64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15
...
~/VBoxShare ➜ tree /f
Folder PATH listing
Volume serial number is BC69-C561
C:.
   Brutus.zip

└───Brutus
        auth.log
        wtmp

Tasks

1. Analyzing the auth.log, can you identify the IP address used by the attacker to carry out a brute force attack?

If we filter the log for SSH we see a common pattern for failed authentication lines. Filter, select and group:

circle-check

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

If we filter by keyword opened we see there has been few logins, looks like attackers pwned the root user as well as cyberjunkie user.

circle-check

3. Can you identify the timestamp when the attacker manually logged in to the server to carry out their objectives?

The wtmparrow-up-right file records all logins and logouts. Its format is exactly like utmparrow-up-right except that a null username indicates a logout on the associated terminal.

Usually located at:

For parsing the wtmp I used python library: https://codeberg.org/hjacobs/utmparrow-up-right

Note: timedelta +5h was used to sync time with given auth.log.

Last login as root from suspicious IP is at 2024-03-06 06:32:45.387923

circle-check

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?

circle-check
circle-info

Hint: A session number is assigned immediately after the password is accepted.

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?

usermodarrow-up-right is a command used to modify account. We see user cyberjunkie being added to sudo or administrator group.

circle-check
circle-info

Hint: Auth.log also tracks changes related to users and groups on the server.

6. What is the MITRE ATT&CK sub-technique ID used for persistence?

Persistencearrow-up-right: T1136arrow-up-right.001arrow-up-rightLocal Accountarrow-up-right

T1136.001: Adversaries may create a local account to maintain access to victim systems. Local accounts are those configured by an organization for use by users, remote support, services, or for administration on a single system or service.

circle-check

7. How long did the attacker's first SSH session last based on the previously confirmed authentication time and session ending within the auth.log? (seconds)

circle-check

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?

circle-check

Last updated