Detection stack
- AIDR
- Alert
- ETL
- Query
요약
이 기사는 국지 관리자 접근을 가진 위협 행위자가 Global Assembly Cache (GAC)의 .NET 어셈블리를 손상시켜 신뢰할 수 있는 실행 경로에서 코드를 실행할 수 있는 방법을 설명합니다. 예를 들어 MIGUIControls.dll과 같은 DLL을 교체하여 공격자는 합법적인 프로세스 하에서 악성 페이로드를 지속적으로 실행할 수 있습니다. 이 방법은 GAC 위치에 쓰기 위한 승격된 권한을 필요로 하며, 런타임에서 수정된 어셈블리를 로드하도록 강제하기 위해 네이티브 이미지를 제거하는 것을 포함할 수 있습니다.
조사
증명 개념 유틸리티(GAC-POC.exe)는 정당한 DLL을 복사하고 Mono.Cecil로 패치하여 메시지 박스를 표시하며, 수정된 버전을 GAC에 다시 작성하는 작업 흐름을 보여줍니다. 관찰 가능한 행동에는 GAC 쓰기 작업, ngen.exe를 사용한 네이티브 이미지 삭제, 업데이트된 어셈블리가 로드될 때 발생하는 후속 프로세스 생성 활동이 포함됩니다.
완화 조치
GAC 디렉토리에 대한 상세한 프로세스 생성 감사(이벤트 ID 4688)와 파일 시스템 감사(이벤트 ID 4663)를 활성화합니다. ngen.exe의 의심스러운 사용, mscorsvw.exe의 실행, GAC 경로에서 예상치 못한 DLL 쓰기 활동에 대해 경고합니다. 지역 관리자 접근을 제한하고 GAC에 저장된 어셈블리에 대해 코드 서명 검증이나 무결성 검사를 시행하여 노출을 줄입니다.
대응
GAC-POC.exe 실행, 예상치 못한 어셈블리 수정, 또는 네이티브 이미지 제거가 감지된 경우 호스트를 격리하고 포렌식 아티팩트를 보존하며, 신뢰할 수 있는 기본 상태에서 GAC 어셈블리를 복원합니다. 공격자가 관리자 권한을 어떻게 얻었는지 추가 지속 가능성이 설정되었는지 여부를 결정하기 위해 범위를 계속 확장합니다.
graph TB %% Class Definitions Section classDef technique fill:#ffcc99 classDef process fill:#c2f0c2 classDef malware fill:#ffeb99 %% Node definitions tech_valid_accounts[“<b>기술</b> – <b>T1078.003 유효한 계정: 로컬 계정</b><br/><b>설명</b>: 공격자는 로컬 계정(관리자 포함)의 자격 증명을 획득하고 악용하여 무단 접근을 얻습니다.”] class tech_valid_accounts technique tech_hijack_exec[“<b>기술</b> – <b>T1574.014 실행 흐름 하이재킹: AppDomainManager</b><br/><b>설명</b>: 공격자는 .NET 애플리케이션 실행 흐름을 가로채기 위해 Global Assembly Cache의 .NET AppDomainManager 어셈블리를 교체하거나 수정합니다.”] class tech_hijack_exec technique tech_dll_injection[“<b>기술</b> – <b>T1055.001 DLL 인젝션</b><br/><b>설명</b>: 공격자는 신뢰된 프로세스에 악성 DLL을 주입하여 해당 프로세스 컨텍스트에서 코드를 실행합니다.”] class tech_dll_injection technique process_task_sched[“<b>프로세스</b> – 작업 스케줄러 MMC 스냅인<br/><b>역할</b>: 작업 예약에 사용되는 신뢰된 시스템 구성 요소입니다.”] class process_task_sched process malicious_dll[“<b>악성코드</b> – 악성 DLL (예: 페이로드)<br/><b>목적</b>: 주입 후 악성 동작을 실행하기 위해 실행됩니다.”] class malicious_dll malware %% Connections showing attack flow tech_valid_accounts –>|활성화| tech_hijack_exec tech_hijack_exec –>|이어짐| tech_dll_injection tech_dll_injection –>|사용| process_task_sched process_task_sched –>|로드| malicious_dll
탐지
시뮬레이션 실행
필수 준비 사항: Telemetry & Baseline Pre-flight Check가 통과해야 합니다.
-
공격 내러티브 & 명령:
적은 악의적인 어셈블리 (
GAC-PoC.exe) 를 준비했으며, Global Assembly Cache에 배치되면 일치하는 강력한 이름을 해결하는 모든 .NET 프로세스에 의해 로드됩니다. 즉각적인 실행을 트리거하고 탐지 규칙이 정확한 명령행을 볼 수 있도록 보장하기 위해, 공격자는 어셈블리를 직접 실행하고 또한ngen.exe를 호출하여 악의적인 DLL을 사전 컴파일하며, 이는 스텔스를 개선하기 위한 GAC 하이재킹에서의 전형적인 단계입니다. 이 작업들은 감시된 문자열을 포함하는 분명한 4688 이벤트를 생성합니다.- 악성 어셈블리를 쓰기 가능한 디렉토리에 복사하기 (예:
C:Temp). - 가짜 이진 파일을 실행하여 하이재킹을 시연합니다. 악성 어셈블리에 대해
- Run
ngen.exe를 실행하여 GAC 배치 후 자주 관찰되는 네이티브 이미지 생성 단계를 시뮬레이션합니다. 회귀 테스트 스크립트:
- 악성 어셈블리를 쓰기 가능한 디렉토리에 복사하기 (예:
-
# ————————————————- # GAC‑Hijacking 탐지 검증 스크립트 # ————————————————- # 필수 준비 사항: 테스트 계정이 로컬 관리자 권한을 가졌는지 # 및 Windows 감사 정책이 사전 검사 단계를 통과했는지 확인 # ————————————————- # 1. 악성 실행 파일 배포 (시뮬레이션) $tempDir = “C:Temp” if (-not (Test-Path $tempDir)) { New-Item -Path $tempDir -ItemType Directory | Out-Null } $gacPoCPath = Join-Path $tempDir “GAC-PoC.exe” # 페이로드 시뮬레이션 – 로그에 쓰기 위한 작은 실행파일 생성. # 여기서는 플레이스홀더 바이너리를 사용합니다; 실제 테스트에서는 진짜 파일을 복사합니다. Write-Output “페이크 페이로드 플레이스홀더” | Out-File “$gacPoCPath.txt” # 데모를 위해 cmd/c echo를 호출 (파일 이름은 여전히 CommandLine에 나타납니다) & cmd.exe /c “echo Running GAC-PoC simulation > NUL” # 2. GAC-PoC.exe 직접 실행 Write-Host “[*] GAC-PoC.exe 실행 중” Start-Process -FilePath $gacPoCPath -WindowStyle Hidden -PassThru | Out-Null # 3. 동일한 바이너리에 대해 ngen.exe 호출 $ngenPath = “$env:WINDIRMicrosoft.NETFramework64v4.0.30319ngen.exe” if (Test-Path $ngenPath) { Write-Host “[*] GAC-PoC.exe에 대해 ngen.exe 실행 중” & $ngenPath install $gacPoCPath } else { Write-Warning “ngen.exe가 이 호스트에서 발견되지 않았습니다 – 단계를 건너뜁니다.” } # 4. 분석가를 위한 완료 로그 Write-Host “[+] 시뮬레이션 완료. SIEM에서 EventID 4688 경고를 검토하십시오.”
정리 명령: -
# ————————————————- # GAC‑Hijacking 검증 후 정리 # ————————————————- $tempDir = “C:Temp” $gacPoCPath = Join-Path $tempDir “GAC-PoC.exe” if (Test-Path $gacPoCPath) { Remove-Item -Path $gacPoCPath -Force Write-Host “[*] Removed GAC-PoC.exe” } # 생성된 네이티브 이미지 제거 (만약 생성되었다면) $ngenPath = “$env:WINDIRMicrosoft.NETFramework64v4.0.30319ngen.exe” if (Test-Path $ngenPath) { & $ngenPath uninstall $gacPoCPath 2>$null Write-Host “[*] 네이티브 이미지 제거 완료 (존재했다면).” } # 옵션으로 임시 폴더 삭제 (비어 있다면) if ((Get-ChildItem $tempDir).Count -eq 0) { Remove-Item -Path $tempDir -Force Write-Host “[*] 임시 디렉터리 $tempDir 제거 완료” } Write-Host “[+] 정리 완료.”
공격 흐름
SOC Prime의 Detection as Code 플랫폼에 가입하세요 귀사의 비즈니스에 가장 중요한 위협에 대한 가시성을 개선하세요. 시작을 돕고 즉각적인 가치를 제공하기 위해 지금 SOC Prime 전문가와의 회의를 예약하세요.
Cookie Settings
You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.
| Name | Descripiton |
|---|---|
| PHPSESSID | Preserves user session state across page requests. Cookie generated by applications based on the PHP language. This is a general purpose identifier used to maintain user session variables. It is normally a random generated number, how it is used can be specific to the site, but a good example is maintaining a logged-in status for a user between pages. |
| sp_i | Used to store information about authenticated User. |
| sp_r | Used to store information about authenticated User. |
| sp_a | Used to store information about authenticated User. |
All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
| Name | Descripiton |
|---|---|
| tuuid | Collects anonymous data related to the user's visits to the website, such as the number of visits, average time spent on the website and what pages have been loaded. |
| tuuid_last_update | Collects anonymous data related to the user's visits to the website, such as the number of visits, average time spent on the website and what pages have been loaded. |
| um | Collects anonymous data related to the user's visits to the website, such as the number of visits, average time spent on the website and what pages have been loaded. |
| umeh | Collects anonymous data related to the user's visits to the website, such as the number of visits, average time spent on the website and what pages have been loaded. |
| na_sc_x | Used by the social sharing platform AddThis to keep a record of parts of the site that has been visited in order to recommend other parts of the site. |
| APID | Collects anonymous data related to the user's visits to the website. |
| IDSYNC | Collects anonymous data related to the user's visits to the website. |
| _cc_aud | Collects anonymous statistical data related to the user's website visits, such as the number of visits, average time spent on the website and what pages have been loaded. The purpose is to segment the website's users according to factors such as demographics and geographical location, in order to enable media and marketing agencies to structure and understand their target groups to enable customised online advertising. |
| _cc_cc | Collects anonymous statistical data related to the user's website visits, such as the number of visits, average time spent on the website and what pages have been loaded. The purpose is to segment the website's users according to factors such as demographics and geographical location, in order to enable media and marketing agencies to structure and understand their target groups to enable customised online advertising. |
| _cc_dc | Collects anonymous statistical data related to the user's website visits, such as the number of visits, average time spent on the website and what pages have been loaded. The purpose is to segment the website's users according to factors such as demographics and geographical location, in order to enable media and marketing agencies to structure and understand their target groups to enable customised online advertising. |
| _cc_id | Collects anonymous statistical data related to the user's website visits, such as the number of visits, average time spent on the website and what pages have been loaded. The purpose is to segment the website's users according to factors such as demographics and geographical location, in order to enable media and marketing agencies to structure and understand their target groups to enable customised online advertising. |
| dpm | Via a unique ID that is used for semantic content analysis, the user's navigation on the website is registered and linked to offline data from surveys and similar registrations to display targeted ads. |
| acs | Collects anonymous data related to the user's visits to the website, such as the number of visits, average time spent on the website and what pages have been loaded, with the purpose of displaying targeted ads. |
| clid | Collects anonymous data related to the user's visits to the website, such as the number of visits, average time spent on the website and what pages have been loaded, with the purpose of displaying targeted ads. |
| KRTBCOOKIE_# | Registers a unique ID that identifies the user's device during return visits across websites that use the same ad network. The ID is used to allow targeted ads. |
| PUBMDCID | Registers a unique ID that identifies the user's device during return visits across websites that use the same ad network. The ID is used to allow targeted ads. |
| PugT | Registers a unique ID that identifies the user's device during return visits across websites that use the same ad network. The ID is used to allow targeted ads. |
| ssi | Registers a unique ID that identifies a returning user's device. The ID is used for targeted ads. |
| _tmid | Registers a unique ID that identifies the user's device upon return visits. The ID is used to target ads in video clips. |
| wam-sync | Used by the advertising platform Weborama to determine the visitor's interests based on pages visits, content clicked and other actions on the website. |
| wui | Used by the advertising platform Weborama to determine the visitor's interests based on pages visits, content clicked and other actions on the website. |
| AFFICHE_W | Used by the advertising platform Weborama to determine the visitor's interests based on pages visits, content clicked and other actions on the website. |
| B | Collects anonymous data related to the user's website visits, such as the number of visits, average time spent on the website and what pages have been loaded. The registered data is used to categorise the users' interest and demographical profiles with the purpose of customising the website content depending on the visitor. |
| 1P_JAR | These cookies are used to gather website statistics, and track conversion rates. |
| APISID | Google set a number of cookies on any page that includes a Google reCAPTCHA. While we have no control over the cookies set by Google, they appear to include a mixture of pieces of information to measure the number and behaviour of Google reCAPTCHA users. |
| HSID | Google set a number of cookies on any page that includes a Google reCAPTCHA. While we have no control over the cookies set by Google, they appear to include a mixture of pieces of information to measure the number and behaviour of Google reCAPTCHA users. |
| NID | Google set a number of cookies on any page that includes a Google reCAPTCHA. While we have no control over the cookies set by Google, they appear to include a mixture of pieces of information to measure the number and behaviour of Google reCAPTCHA users. |
| SAPISID | Google set a number of cookies on any page that includes a Google reCAPTCHA. While we have no control over the cookies set by Google, they appear to include a mixture of pieces of information to measure the number and behaviour of Google reCAPTCHA users. |
| SID | Google set a number of cookies on any page that includes a Google reCAPTCHA. While we have no control over the cookies set by Google, they appear to include a mixture of pieces of information to measure the number and behaviour of Google reCAPTCHA users. |
| SIDCC | Security cookie to protect users data from unauthorised access. |
| SSID | Google set a number of cookies on any page that includes a Google reCAPTCHA. While we have no control over the cookies set by Google, they appear to include a mixture of pieces of information to measure the number and behaviour of Google reCAPTCHA users. |
| __utmx | This cookie is associated with Google Website Optimizer, a tool designed to help site owners improve their wbesites. It is used to distinguish between two varaitions a webpage that might be shown to a visitor as part of an A/B split test. This helps site owners to detemine which version of a page performs better, and therefore helps to improve the website. |
| __utmxx | This cookie is associated with Google Website Optimizer, a tool designed to help site owners improve their wbesites. It is used to distinguish between two varaitions a webpage that might be shown to a visitor as part of an A/B split test. This helps site owners to detemine which version of a page performs better, and therefore helps to improve the website. |
If you do not allow these cookies then some or all of these services may not function properly.
| Name | Descripiton |
|---|---|
| _hjid | Hotjar cookie. This cookie is set when the customer first lands on a page with the Hotjar script. It is used to persist the random user ID, unique to that site on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID. |
| _hjIncludedInSample | This cookie is associated with web analytics functionality and services from Hot Jar, a Malta based company. It uniquely identifies a visitor during a single browser session and indicates they are included in an audience sample. |
| intercom-id-[xxx] | This cookie is used by Intercom as a session so that users can continue a chat as they move through the site. |
| intercom-session-[xxx] | Used to keeping track of sessions and remember logins and conversations. |
| demdex | Via a unique ID that is used for semantic content analysis, the user's navigation on the website is registered and linked to offline data from surveys and similar registrations to display targeted ads. |
| CookieConsent | Stores the user's cookie consent state for the current domain. |
| __cfduid | Used by the content network, Cloudflare, to identify trusted web traffic. |
| ss | These cookies enable the website to provide enhanced functionality and
personalisation . They may be set by us or by third party providers whose
services we have added to our pages. These services may include the Live Chat facility, Contact Us form(s), the Product Quotation forms and submission process, and the Email Newsletter sign up functionality . |
They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.
| Name | Descripiton |
|---|---|
| _ga | This cookie name is asssociated with Google Universal Analytics - which is a significant update to Google's more commonly used analytics service. This cookie is used to distinguish unique users by assigning a randomly generated number as a client identifier. It is included in each page. Registers a unique ID that is used to generate statistical data on how the visitor uses the website. request in a site and used to calculate visitor, session and campaign data for the sites analytics reports. By default it is set to expire after 2 years, although this is customisable by website owners. |
| _gat | Used by Google Analytics to throttle request rate. This cookie name is associated with Google Universal Analytics, according to documentation it is used to throttle the request rate - limiting the collection of data on high traffic sites. It expires after 10 minutes. |
| _gid | This cookie name is asssociated with Google Universal Analytics. This appears to be a new cookie and as of Spring 2017 no information is available from Google. It appears to store and update a unique value for each page visited. Registers a unique ID that is used to generate statistical data on how the visitor uses the website. |
| IDE | Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user. |
| r/collect | Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user. |
| test_cookie | Used to check if the user's browser supports cookies. |
| collect | Used to send data to Google Analytics about the visitor's device and behaviour. Tracks the visitor across devices and marketing channels. |
| ads/user-lists/# | These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. |
| c | Registers anonymised user data, such as IP address, geographical location, visited websites, and what ads the user has clicked, with the purpose of optimising ad display based on the user's movement on websites that use the same ad network. |
| khaos | Registers anonymised user data, such as IP address, geographical location, visited websites, and what ads the user has clicked, with the purpose of optimising ad display based on the user's movement on websites that use the same ad network. |
| put_# | Registers anonymised user data, such as IP address, geographical location, visited websites, and what ads the user has clicked, with the purpose of optimising ad display based on the user's movement on websites that use the same ad network. |
| rpb | Registers anonymised user data, such as IP address, geographical location, visited websites, and what ads the user has clicked, with the purpose of optimising ad display based on the user's movement on websites that use the same ad network. |
| rpx | Registers anonymised user data, such as IP address, geographical location, visited websites, and what ads the user has clicked, with the purpose of optimising ad display based on the user's movement on websites that use the same ad network. |
| tap.php | Registers anonymised user data, such as IP address, geographical location, visited websites, and what ads the user has clicked, with the purpose of optimising ad display based on the user's movement on websites that use the same ad network. |