Detection stack
- AIDR
- Alert
- ETL
- Query
요약
Swarmer는 필수 사용자 프로필 하이브(NTUSER.MAN)를 생성하고 Offline 레지스트리 API를 통해 편집하는 저권한 Windows 영속성 유틸리티입니다. 일반적인 Reg* Windows API에 의존하지 않기 때문에 표준 레지스트리 쓰기 동작에 맞춘 EDR 텔레메트리에 대한 가시성을 줄이면서 Run 키 영속성을 심을 수 있습니다. 이 방법은 관리 권한 없이도 로그인 간 시작 항목을 유지하기 위해 필수 프로필 처리를 악용합니다. Swarmer는 독립 실행형 실행 파일 또는 PowerShell 모듈로 사용할 수 있으며 디스크 아티팩트를 최소화하는 방식으로 사용할 수 있습니다.
조사
보고서는 Swarmer의 종단 간 흐름을 설명합니다: 현재의 HKCU 하이브를 내보내고 내보낸 데이터를 변경하여 시작 영속성을 포함시키며, Offreg.dll 루틴인 ORCreateHive 및 ORSetValue와 같은 루틴을 사용하여 하이브를 재구성합니다. 재구성된 하이브는 사용자 프로필 경로 내 NTUSER.MAN으로 배치되어 로그인 시 적용됩니다. 실행은 목표 시작 값과 실행할 페이로드 위치를 정의하는 명령 줄 옵션을 통해 제어됩니다. 저자들은 이 기술을 Windows 10 및 Windows 11에서 검증했습니다.
완화
생성 모니터링 NTUSER.MAN 필수 프로필이 예상되지 않는 사용자 컨텍스트에서, 그리고 비정상적인 프로세스에 의해 Offreg.dll이 로드되는 경우 경고를 발생시킵니다. 필수 프로필에 사용되는 디렉토리를 보호 및 무결성 검사하고, 합법적인 오프라인 레지스트리 작업을 기준으로 하여 편차가 두드러지게 합니다. 로그온 시점에 적용되는 수상한 하이브 변경 사항을 탐지하도록 감지기를 추가합니다. 가능한 경우, 사용자가 필수 프로필 아티팩트를 생성하거나 조작할 수 있는 능력을 제한합니다.
대응
식별된 경우, 엔드포인트를 격리하고, 분석을 위해 NTUSER.MAN 하이브를 획득하며, 주입된 Run 키 항목을 열거합니다. 승인되지 않은 시작 값을 제거하고 알려진 좋은 사용자 하이브를 복구하여 영속성을 제거합니다. 보조 페이로드나 대체 영속성 경로가 설정되지 않았음을 확인하기 위해 광범위한 포렌식 검토를 수행하며, 동일한 하이브 작성 패턴을 찾기 위해 플릿 전반에 대한 사냥을 수행합니다. 저권한 사용자가 필수 프로필을 생성하지 못하도록 최소 권한 제어를 강화합니다.
공격 흐름
이 부분은 아직 업데이트 중입니다. 알림을 받기 위해 가입하십시오
알림 받기시뮬레이션 실행
전제 조건: 텔레메트리 및 기본 체크가 통과되었어야 합니다.
이유: 이 섹션은 탐지 규칙을 유발하도록 설계된 적의 기술(TTP)의 정확한 실행을 상세히 설명합니다. 명령어와 서술은 식별된 TTP를 직접적으로 반영하고 탐지 로직에서 기대되는 정확한 텔레메트리를 생성하는 것을 목표로 해야 합니다. 추상적이거나 관련이 없는 예시는 오진으로 이어질 수 있습니다.
-
공격 내러티브 및 명령어:
공격자는 감염된 호스트에서 발판을 잡았으며 사용자 로그온을 견디는 영속성을 수립하고자 합니다. 이는 표준 레지스트리 하이브(EDR 후크를 피하기 위해)를 건드리지 않고 수행합니다. Swarmer 도구를 사용하여 공격자는:- 대상 사용자의 프로필 디렉토리 결정 (
C:Usersvictim). - 로그온 시 백도어 페이로드를 실행하는 Run 키가 포함된 악성 하이브 파일 제작 (
NTUSER.MAN). - 저수준 파일 I/O를 사용해 피해자의 프로필에 파일을 직접 작성합니다(WinAPI 고급 호출을 우회).
- 호출 오프라인 레지스트리 API
ORCreateHive로 새로 생성된 하이브를 메모리에 로드하고 Run 키를 등록하며, 마침내ORSaveHive를 호출하여 변경 사항을 영구화합니다.
두 작업 모두 생성:
- Sysmon EventID 11 – 파일 생성 끝
NTUSER.MAN. - 보안 이벤트 ID 4688 – 프로세스 (
swarmer.exe)는 명령줄에ORCreateHive(다른 OR* 플래그 또는 포함).
- 대상 사용자의 프로필 디렉토리 결정 (
-
회귀 테스트 스크립트:
#-------------------------------------------------------------- # Swarmer 스타일의 레지스트리 영속성 시뮬레이션 (PowerShell) #-------------------------------------------------------------- # 1. 피해자 프로필 경로 정의 $victimProfile = "$env:SystemDriveUsersvictim" $ntUserManPath = Join-Path $victimProfile "NTUSER.MAN" # 2. 최소 하이브 파일 생성 (바이너리 자리표시자) # 실제 공격에서는 정교하게 작성된 레지스트리 하이브일 것입니다. $hiveBytes = [byte[]] (0..255) # 더미 데이터 [IO.File]::WriteAllBytes($ntUserManPath, $hiveBytes) # 3. 도움 실행 파일을 통해 오프라인 레지스트리 API 호출. # swarmer_helper.exe가 네이티브 오프라인 레지스트리 기능을 래핑하는 컴파일된 바이너리라고 가정합니다. $helper = "C:Toolsswarmer_helper.exe" $args = @( "ORCreateHive", "`"$ntUserManPath`"" "ORSetValue", "HKLMSoftwareMicrosoftWindowsCurrentVersionRunmyBackdoor", "`"C:Malwarebackdoor.exe`"" "ORSaveHive", "`"$ntUserManPath`"" ) & $helper $args #-------------------------------------------------------------- -
정리 명령어:
# 악성 하이브 제거 및 필요하면 이를 언로드합니다 Remove-Item -Path "$env:SystemDriveUsersvictimNTUSER.MAN" -Force # 도움이 메모리에 남긴 하이브가 있으면, 예시로 강제 언로드합니다 & "$env:ProgramFilesWindows Kits10binx64reg.exe" unload "HKUTempHive"
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. |