보안동향

최신 보안정보를 신속하게 전해드립니다.

[해외동향] ProxyShell Exploit을 사용하는 Microsoft Exchange 백도어 주의

2021-08-17

ProxyShell은 Microsoft Exchange 취약점 3개의 연결성을 사용하여 인증되지 않은 원격 코드 실행을 하며 아래는 Devcore 수석 보안 연구원인 Orange Tsai가 발견한 ProxyShell에 사용되는 3개의 취약점이다. 이러한 연결 취약점은 IIS의 포트 443에서 실행되는 Microsoft Exchange의 CAS(클라이언트 액세스 서비스)를 통해 원격으로 악용된다.

 

- CVE-2021-34473 : 사전 인증 혼동으로 인한 ACL 우회
- CVE-2021-34523 : Exchange Powershell 백엔드에 대한 권한 상승
- CVE-2021-31207 : 사후 인증 임의 파일 쓰기로 인한 RCE

 

Tsai는 ProxyShell은 Microsoft Exchange의 ‘AutoDiscover’ 기능을 사용하여 SSRF 공격을 수행한다고 밝혔고 이후 ProxyShell의 자세한 기술정보를 공개하자 얼마 지나지 않아 공격자들이 해당 취약점을 악용하여 ProxyShell에 취약한 Microsoft Exchange 서버를 검색하는 움직임이 보였다.

Beaumont와 NCC Group의 취약점 연구원인 Warren은 공격자가 ProxyShell을 사용하여 Microsoft Exchange 허니팟을 악용했다고 밝혔다.

 

 

 

Attack Flow


Microsoft Exchange를 악용할 때 다음과 같은 초기 URL을 사용하였다.

https://exchange-server/autodiscover/autodiscover.json?@foo.com/mapi/nspi/?&Email=autodiscover/autodiscover.json%3F@foo.com

 

Proxy Shell Exploit은 현재 265KB 크기의 웹 쉘을 ‘C:\inetpub\wwwroot\aspnet_client\’ 폴더에 생성하고 있다. 265KB는 PST 파일을 만들기 위해 Exchange Powershell의 Mailbox Export 기능을 남용하기 때문에 ProxyShell Exploit을 사용하여 만들 수 있는 최소 파일 크기이다.

Warren이 BleepingComputer와 공유한 샘플에서 웹쉘은 공격자가 취약한 Microsoft Exchange 서버에 파일을 업로드하는 데 사용할 수 있는 간단한 인증 보호 스크립트로 구성되었다.

공격자는 첫 번째 웹쉘을 사용하여 원격으로 액세스할 수 있는 폴더에 추가 웹쉘을 업로드하고 아래 나열된 C:\Windows\System32 폴더에 두 개의 실행 파일을 업로드한다.

C:\Windows\System32\createhidetask.exe

C:\Windows\System32\ApplicationUpdate.exe

 

두 개의 실행 파일을 찾을 수 없으면 다음 폴더에 임의의 이름의 ASPX 파일로 다른 웹쉘이 생성된다.

C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\

 

공격자는 두 번째 웹쉘을 사용하여 매일 특정 시간에 'ApplicationUpdate.exe' 파일을 실행하는 'PowerManager'라는 예약 작업을 생성하는 'createhidetask.exe'를 실행한다. ‘ApplicationUpdate.exe’ 파일은 백도어로 사용되는 사용자 지정 .NET 로더이고 원격 서버에서 다른 .NET 바이너리를 가져오는 기능을 수행한다.

 


Mitigation


- 장치 검색을 위한 Azure Sentinel 쿼리 수행

W3CIISLog

| where csUriStem == "/autodiscover/autodiscover.json"

| where csUriQuery has "PowerShell" | where csMethod == "POST"

 

- Micorosoft Exchange 서버 업데이트

 


IOCs


Attacker(Scanner) IPs

- 3.15.221.32
- 194.147.142.0/24

 

E-mail Domains

- @abc.com
- @1337.com

 

Yara Rule

https://github.com/Neo23x0/signature-base/blob/master/yara/expl_proxyshell.yar


[참고자료]

https://www.bleepingcomputer.com/news/microsoft/microsoft-exchange-servers-are-getting-hacked-via-proxyshell-exploits/

 


보안관제센터 Team MIR

목록