□ 개요
공격 도구로써 다양한 위협 행위를 위해 사용되던 Cobalt Strike를 통한 공격 탐지율이 증가하면서, 해커들은 EDR 및 안티바이러스 솔루션을 회피할 수 있는 다른 방법을 시도하고 있다. 공격자들은 Cobalt Strike 대신 Go언어 기반으로 작성된 Sliver라는 툴킷을 활용하기 시작했다.
[그림 1] Sliver 실행 화면
특히 FIN12로 알려진 DEV-0237이라는 공격 그룹은 Sliver를 공격에 사용한 것으로 밝혀졌으며, 해당 그룹은 BazarLoader, TrickBot 등 다양한 악성 프로그램을 통해 과거 다양한 랜섬웨어(Ryuk, Conti, Hive, Conti, BlackCat 등)를 배포했다.
[그림 2] 다양한 악성 프로그램을 통해 랜섬웨어를 배포하는 DEV-0237 (Microsoft)
□ Sliver Toolkit
Sliver는 2019년 말에 처음 공개되었으며, Github에 오픈소스로 코드가 공유되어 있다. 크로스 플랫폼으로써 MacOS, Windows, Linux를 지원한다. CobaltStrike와 마찬가지로 레드팀에서 침투 테스트 도구로 사용될 수 있지만, 해커에 의해 악의적인 목적으로 사용될 수도 있다. [그림 3]은 Sliver에서 지원하는 명령어 리스트이다.
[그림 3] Sliver에서 지원하는 명령어
- Infrastructure
Sliver는 다른 C2 프레임워크와 마찬가지로 C2 통신을 위해 다양한 프로토콜(DNS, HTTP/TLS, MTLS, TCP)을 지원한다. HTTP 프로토콜을 사용할 경우, HTTP 요청 URL에 대한 패턴은 Implant/sliver/transports/tcp-http.go 파일을 참조하게 된다. [그림 4]는 커스텀 되지 않은 HTTP 기본 설정 파일(tcp-http.go)의 내용 중 일부이다.
[그림 4] Implant/sliver/transports/tcp-http.go
NCSC는 기본 설정 파일을 토대로 Sliver HTTP C2 통신에 대한 Snort Rule을 작성하여 공유하였다.
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - robots.txt getPublicKey"; content:"/robots.txt?_="; pcre:"/\AGET(?:\/(?:static|www|assets|text|docs|sample))?\/robots\.txt\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - sample.txt getPublicKey"; content:"/sample.txt?_="; pcre:"/\AGET(?:\/(?:static|www|assets|text|docs|sample))?\/sample\.txt\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - info.txt getPublicKey"; content:"/info.txt?_="; pcre:"/\AGET(?:\/(?:static|www|assets|text|docs|sample))?\/info\.txt\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - example.txt getPublicKey"; content:"/example.txt?_="; pcre:"/\AGET(?:\/(?:static|www|assets|text|docs|sample))?\/example\.txt\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - .jsp getSessionID"; content:".jsp?_="; pcre:"/\APOST(?:\/(?:app|admin|upload|actions|api))?\/(?:login|admin|session|action)\.jsp\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - login.php Send"; content:"/login.php?_="; pcre:"/\APOST(?:\/(?:api|rest|drupal|wordpress))?\/login\.php\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - signin.php Send"; content:"/signin.php?_="; pcre:"/\APOST(?:\/(?:api|rest|drupal|wordpress))?\/signin\.php\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - api.php Send"; content:"/api.php?_="; pcre:"/\APOST(?:\/(?:api|rest|drupal|wordpress))?\/api\.php\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - samples.php Send"; content:"/samples.php?_="; pcre:"/\APOST(?:\/(?:api|rest|drupal|wordpress))?\/samples\.php\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - underscore.min.js Poll"; content:"/underscore.min.js?_="; pcre:"/\AGET(?:\/(?:js|static|assets|dist|javascript))?\/underscore\.min\.js\?_=[0-9]{1,9} HTTP/";) |
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - jquery.min.js Poll"; content:"/jquery.min.js?_="; pcre:"/\AGET(?:\/(?:js|static|assets|dist|javascript))?\/jquery\.min\.js\?_=[0-9]{1,9} HTTP/";) |
[표 1] Sliver HTTP Snort Rule (www.ncsc.gov.uk)
- Payloads
Sliver는 쉘코드, 실행파일, DLL, 스테이저 등 다양한 유형의 페이로드를 생성할 수 있다. 쉘코드의 경우, Bumblebee와 같은 사용자 지정 로더에 포함시켜 실행하는 방식으로 공격에 사용되기도 하며, 피싱 이메일과 같은 초기 공격 벡터에는 악성코드를 최소화하기 위해 스테이저 유형의 페이로드가 사용되기도 한다.
다음은 NCSC에서 공유한 Sliver 페이로드를 탐지하기 위한 YARA Rule이다.
rule sliver_github_file_paths_function_names { meta: author = "NCSC UK" description = "Detects Sliver Windows and Linux implants based on paths and function names within the binary" strings: $p1 = "/sliver/" $p2 = "sliverpb." $fn1 = "RevToSelfReq" $fn2 = "ScreenshotReq" $fn3 = "IfconfigReq" $fn4 = "SideloadReq" $fn5 = "InvokeMigrateReq" $fn6 = "KillSessionReq" $fn7 = "ImpersonateReq" $fn8 = "NamedPipesReq" condition: (uint32(0) == 0x464C457F or (uint16(0) == 0x5A4D and uint16(uint32(0x3c)) == 0x4550)) and (all of ($p*) or 3 of ($fn*)) } |
rule sliver_proxy_isNotFound_retn_cmp_uniq { meta: author = "NCSC UK" description = "Detects Sliver implant framework based on some unique CMPs within the Proxy isNotFound function. False positives may occur" strings: $ = {C644241800C381F9B3B5E9B2} $ = {8B481081F90CAED682} condition: (uint32(0) == 0x464C457F or (uint16(0) == 0x5A4D and uint16(uint32(0x3c)) == 0x4550)) and all of them } |
rule sliver_nextCCServer_calcs { meta: author = "NCSC UK" description = "Detects Sliver implant framework based on instructions from the nextCCServer function. False positives may occur" strings: $ = {4889D3489948F7F94839CA????48C1E204488B0413488B4C1308} condition: (uint32(0) == 0x464C457F or (uint16(0) == 0x5A4D and uint16(uint32(0x3c)) == 0x4550)) and all of them } |
[표 2] Sliver YARA Rule (www.ncsc.gov.uk)
- Config Extraction
Sliver는 분석 및 탐지를 우회하기 위해 난독화 및 암호화 기법을 사용한다. 난독화의 경우, GoLang을 기반으로 하는 공개 gobfuscate 라이브러리가 사용된다.
Sliver 페이로드에는 설정 정보가 난독화되어 있으며, 이는 메모리에 로드될 때 해제된다. [그림 5]는 메모리에 로드되어 난독화가 해제된 Sliver 페이로드의 설정 정보이다.
[그림 5] Sliver 페이로드에서 추출된 설정 정보 (Microsoft)
- Code Execution
Sliver는 다른 C2 프레임워크와 마찬가지로 많은 기능의 핵심 부분으로 프로세스 인젝션을 활용한다. 프로세스 인젝션 과정은 [그림 6]과 같다. 먼저, 인젝션하고자 하는 타겟 프로세스에 VirtualAllocEx() 함수를 이용하여 메모리를 할당한다. 메모리가 할당되면 WriteProcessMemory() 함수를 이용하여 악성코드를 삽입한다. 이후, VirtualProtectEx() 함수를 이용하여 할당된 메모리 공간에 실행 권한을 부여하고, CreateRemoteThread() 함수를 이용하여 악성코드를 실행시킨다. 이러한 API 호출 시퀀스는 “migrate”, “Sideload”, “SpawnDll”, “Execute-Assembly” 등 다양한 명령에서 프로세스 인젝션을 위해 사용된다.
[그림 6] 프로세스 인젝션 작동 방식 (Microsoft)
[표 3]은 프로세스 인젝션을 활용하는 기본 명령어 및 기능이다.
- migrate : 원격 프로세스로 마이그레이션 - spawndll : 원격 프로세스에서 reflective DLL 로드 및 실행 - sideload : 원격 프로세스에서 공유 개체(공유 라이브러리/DLL) 로드 및 실행 - msf-inject : Metasploit Framework 페이로드를 프로세스에 주입 - execute-assembly : 자식 프로세스에서 .NET 어셈블리 로드 및 실행 - getsystem : NT AUTHORITY\SYSTEM 사용자로 새 Sliver 세션 생성 - extensions/aliases : BOF(Beacon Object Files), .NET 앱 및 기타 서드파티 도구 |
[표 3] 프로세스 인젝션을 활용하는 Sliver 명령어 및 기능
□ IoCs
- IP(5)
15.152.186[.]38:80
16.162.223[.]161
176.113.115[.]107
193.27.228[.]127:8888
45.9.148[.]243
- Domain(9)
dxb.ntcgov[.]org
geo-raabta.ntcgov[.]org
geo-tv.ntcgov[.]org
nationalhelpdesk[.]pk
ntcgov[.]org
ping.turkey.g0v.cq[.]cn
pkgov[.]org
sngpl.org[.]pk
uno-desk[.]org
□ 참고 자료
- Microsoft, Looking for the ‘Sliver’ lining: Hunting for emerging command-and-control frameworks
- RiskIQ, Sliver Case Study: Assessing Common Offensive Security Tools
- NCSC, Advisory Further TTPs associated with SVR cyber actors