[GH-ISSUE #2239] ASan errors in prepare(), split(), valid(), etc. in various formats (fuzzed input) #1495

Closed
opened 2026-10-15 04:18:44 +07:00 by bsakaguchi · 41 comments
Owner

Originally created by @frank-dittrich on GitHub (Aug 26, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2239

(bleeding-jumbo)run $ cat fail_Raw-SHA1-AxCrypt.pw 
2a53e6ef507fabede6032a934c21aafc$
(bleeding-jumbo)run $ ./john --session=fdtest --format=Raw-SHA1-AxCrypt fail_Raw-SHA1-AxCrypt.pw 
=================================================================
==26791==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f468a9 at pc 0x7f51a0ddab32 bp 0x7ffe4ca2f600 sp 0x7ffe4ca2ed90
WRITE of size 42 at 0x000000f468a9 thread T0
    #0 0x7f51a0ddab31 in vsprintf (/lib64/libasan.so.3+0x8fb31)
    #1 0x7f51a0ddad62 in sprintf (/lib64/libasan.so.3+0x8fd62)
    #2 0x71156f in rawsha1_axcrypt_prepare /home/fd/git/JtR/src/rawSHA1_common_plug.c:120
    #3 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804
    #4 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #10 0x7f519f2bf730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

0x000000f468a9 is located 55 bytes to the left of global variable 'out' defined in 'rawSHA1_common_plug.c:94:14' (0xf468e0) of size 34
0x000000f468a9 is located 0 bytes to the right of global variable 'out' defined in 'rawSHA1_common_plug.c:115:14' (0xf46880) of size 41
SUMMARY: AddressSanitizer: global-buffer-overflow (/lib64/libasan.so.3+0x8fb31) in vsprintf
Shadow bytes around the buggy address:
  0x0000801e0cc0: 00 06 f9 f9 f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9
  0x0000801e0cd0: 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9
  0x0000801e0ce0: 00 00 04 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0000801e0cf0: 00 00 00 00 00 00 00 06 f9 f9 f9 f9 00 00 04 f9
  0x0000801e0d00: f9 f9 f9 f9 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9
=>0x0000801e0d10: 00 00 00 00 00[01]f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801e0d20: 02 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9
  0x0000801e0d30: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801e0d40: 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0000801e0d50: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0000801e0d60: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==26791==ABORTING
(bleeding-jumbo)run $ 
Originally created by @frank-dittrich on GitHub (Aug 26, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2239 ``` (bleeding-jumbo)run $ cat fail_Raw-SHA1-AxCrypt.pw 2a53e6ef507fabede6032a934c21aafc$ (bleeding-jumbo)run $ ./john --session=fdtest --format=Raw-SHA1-AxCrypt fail_Raw-SHA1-AxCrypt.pw ================================================================= ==26791==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f468a9 at pc 0x7f51a0ddab32 bp 0x7ffe4ca2f600 sp 0x7ffe4ca2ed90 WRITE of size 42 at 0x000000f468a9 thread T0 #0 0x7f51a0ddab31 in vsprintf (/lib64/libasan.so.3+0x8fb31) #1 0x7f51a0ddad62 in sprintf (/lib64/libasan.so.3+0x8fd62) #2 0x71156f in rawsha1_axcrypt_prepare /home/fd/git/JtR/src/rawSHA1_common_plug.c:120 #3 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804 #4 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #10 0x7f519f2bf730 in __libc_start_main (/lib64/libc.so.6+0x20730) #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) 0x000000f468a9 is located 55 bytes to the left of global variable 'out' defined in 'rawSHA1_common_plug.c:94:14' (0xf468e0) of size 34 0x000000f468a9 is located 0 bytes to the right of global variable 'out' defined in 'rawSHA1_common_plug.c:115:14' (0xf46880) of size 41 SUMMARY: AddressSanitizer: global-buffer-overflow (/lib64/libasan.so.3+0x8fb31) in vsprintf Shadow bytes around the buggy address: 0x0000801e0cc0: 00 06 f9 f9 f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 0x0000801e0cd0: 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 0x0000801e0ce0: 00 00 04 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0000801e0cf0: 00 00 00 00 00 00 00 06 f9 f9 f9 f9 00 00 04 f9 0x0000801e0d00: f9 f9 f9 f9 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 =>0x0000801e0d10: 00 00 00 00 00[01]f9 f9 f9 f9 f9 f9 00 00 00 00 0x0000801e0d20: 02 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9 0x0000801e0d30: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 00 00 0x0000801e0d40: 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0000801e0d50: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0000801e0d60: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==26791==ABORTING (bleeding-jumbo)run $ ```
bsakaguchi 2026-10-15 04:18:44 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

Here's an ASan error for whirlpool (--format=whirlpool|whirlpool0|whirlpool1)

(bleeding-jumbo)run $ cat fail_whirlpool.pw 
$whirlpool$19FA61D75522A4669B44E39C1D2E1726C530232130D407F89AFEE0964997F7A73E83BE698B288FEBCF88E3E03C4F0757EA8964E59B63D93708B138CC42A66EB3*
(bleeding-jumbo)run $ ./john --session=fdtest fail_whirlpool.pw                    
Warning: detected hash type "whirlpool", but the string is also recognized as "whirlpool0"
Use the "--format=whirlpool0" option to force loading these as that type instead
Warning: detected hash type "whirlpool", but the string is also recognized as "whirlpool1"
Use the "--format=whirlpool1" option to force loading these as that type instead
=================================================================
==27180==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f55b8c at pc 0x00000040659d bp 0x7ffcdbea8560 sp 0x7ffcdbea8550
READ of size 1 at 0x000000f55b8c thread T0
    #0 0x40659c in strupr /home/fd/git/JtR/src/jumbo.c:308
    #1 0x75f759 in split /home/fd/git/JtR/src/whirlpool_fmt_plug.c:128
    #2 0x7a1463 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:945
    #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #8 0x7f4b0f36f730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

0x000000f55b8c is located 52 bytes to the left of global variable 'buf' defined in 'whirlpool_fmt_plug.c:137:4' (0xf55bc0) of size 64
0x000000f55b8c is located 0 bytes to the right of global variable 'out' defined in 'whirlpool_fmt_plug.c:121:14' (0xf55b00) of size 140
SUMMARY: AddressSanitizer: global-buffer-overflow /home/fd/git/JtR/src/jumbo.c:308 in strupr
Shadow bytes around the buggy address:
  0x0000801e2b20: f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801e2b30: 00 00 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2b40: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2b50: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0000801e2b70: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0000801e2b80: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x0000801e2b90: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801e2ba0: 00 00 00 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801e2bc0: 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==27180==ABORTING
<!-- gh-comment-id:242709007 --> @frank-dittrich commented on GitHub (Aug 26, 2016): Here's an ASan error for whirlpool (--format=whirlpool|whirlpool0|whirlpool1) ``` (bleeding-jumbo)run $ cat fail_whirlpool.pw $whirlpool$19FA61D75522A4669B44E39C1D2E1726C530232130D407F89AFEE0964997F7A73E83BE698B288FEBCF88E3E03C4F0757EA8964E59B63D93708B138CC42A66EB3* (bleeding-jumbo)run $ ./john --session=fdtest fail_whirlpool.pw Warning: detected hash type "whirlpool", but the string is also recognized as "whirlpool0" Use the "--format=whirlpool0" option to force loading these as that type instead Warning: detected hash type "whirlpool", but the string is also recognized as "whirlpool1" Use the "--format=whirlpool1" option to force loading these as that type instead ================================================================= ==27180==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f55b8c at pc 0x00000040659d bp 0x7ffcdbea8560 sp 0x7ffcdbea8550 READ of size 1 at 0x000000f55b8c thread T0 #0 0x40659c in strupr /home/fd/git/JtR/src/jumbo.c:308 #1 0x75f759 in split /home/fd/git/JtR/src/whirlpool_fmt_plug.c:128 #2 0x7a1463 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:945 #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #8 0x7f4b0f36f730 in __libc_start_main (/lib64/libc.so.6+0x20730) #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) 0x000000f55b8c is located 52 bytes to the left of global variable 'buf' defined in 'whirlpool_fmt_plug.c:137:4' (0xf55bc0) of size 64 0x000000f55b8c is located 0 bytes to the right of global variable 'out' defined in 'whirlpool_fmt_plug.c:121:14' (0xf55b00) of size 140 SUMMARY: AddressSanitizer: global-buffer-overflow /home/fd/git/JtR/src/jumbo.c:308 in strupr Shadow bytes around the buggy address: 0x0000801e2b20: f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9 00 00 00 00 0x0000801e2b30: 00 00 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801e2b40: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801e2b50: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801e2b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0000801e2b70: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0000801e2b80: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 0x0000801e2b90: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801e2ba0: 00 00 00 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 0x0000801e2bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801e2bc0: 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==27180==ABORTING ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

Salted-SHA1 format:

(bleeding-jumbo)run $ cat fail_Salted-SHA1.pw
{SSHA}/EExmSfmhQSPHDJaTxwQSdb/uPpzYWx0ZXI=*000000000000000000000000000000000000000000000000000000000
(bleeding-jumbo)run $ ./john fail_Salted-SHA1.pw 
=================================================================
==27554==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffeda2f24e4 at pc 0x7f947c5daccf bp 0x7ffeda2f2470 sp 0x7ffeda2f1c18
READ of size 52 at 0x7ffeda2f24e4 thread T0
    #0 0x7f947c5dacce  (/lib64/libasan.so.3+0x5ecce)
    #1 0x72a7d1 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:217
    #2 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004
    #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #8 0x7f947aaf0730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

Address 0x7ffeda2f24e4 is located in stack of thread T0 at offset 84 in frame
    #0 0x72a686 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:199

  This frame has 1 object(s):
    [32, 84) 'realcipher' <== Memory access at offset 84 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5ecce) 
Shadow bytes around the buggy address:
  0x10005b456440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10005b456450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10005b456460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10005b456470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10005b456480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x10005b456490: 00 00 f1 f1 f1 f1 00 00 00 00 00 00[04]f4 f3 f3
  0x10005b4564a0: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10005b4564b0: 00 00 00 00 f1 f1 f1 f1 00 f4 f4 f4 f2 f2 f2 f2
  0x10005b4564c0: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2
  0x10005b4564d0: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f3 f3 f3 f3
  0x10005b4564e0: 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==27554==ABORTING
<!-- gh-comment-id:242710208 --> @frank-dittrich commented on GitHub (Aug 26, 2016): Salted-SHA1 format: ``` (bleeding-jumbo)run $ cat fail_Salted-SHA1.pw {SSHA}/EExmSfmhQSPHDJaTxwQSdb/uPpzYWx0ZXI=*000000000000000000000000000000000000000000000000000000000 (bleeding-jumbo)run $ ./john fail_Salted-SHA1.pw ================================================================= ==27554==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffeda2f24e4 at pc 0x7f947c5daccf bp 0x7ffeda2f2470 sp 0x7ffeda2f1c18 READ of size 52 at 0x7ffeda2f24e4 thread T0 #0 0x7f947c5dacce (/lib64/libasan.so.3+0x5ecce) #1 0x72a7d1 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:217 #2 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004 #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #8 0x7f947aaf0730 in __libc_start_main (/lib64/libc.so.6+0x20730) #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) Address 0x7ffeda2f24e4 is located in stack of thread T0 at offset 84 in frame #0 0x72a686 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:199 This frame has 1 object(s): [32, 84) 'realcipher' <== Memory access at offset 84 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5ecce) Shadow bytes around the buggy address: 0x10005b456440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005b456450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005b456460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005b456470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005b456480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10005b456490: 00 00 f1 f1 f1 f1 00 00 00 00 00 00[04]f4 f3 f3 0x10005b4564a0: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10005b4564b0: 00 00 00 00 f1 f1 f1 f1 00 f4 f4 f4 f2 f2 f2 f2 0x10005b4564c0: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2 0x10005b4564d0: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f3 f3 f3 f3 0x10005b4564e0: 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==27554==ABORTING ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

o3logon format:

(bleeding-jumbo)run $ cat fail_o3logon.pw 
$o3logon$PASSWORD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999$8CF28B36E4F3D2095729CF59510003BF$3078D7DE44385654CC952A9C56E2659B
(bleeding-jumbo)run $ ./john --format=o3logon fail_o3logon.pw 
=================================================================
==30811==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe3fe45061 at pc 0x7f6b64352acb bp 0x7ffe3fe44ee0 sp 0x7ffe3fe44688
WRITE of size 170 at 0x7ffe3fe45061 thread T0
    #0 0x7f6b64352aca  (/lib64/libasan.so.3+0x5eaca)
    #1 0x6becbe in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:135
    #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #9 0x7f6b62868730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

Address 0x7ffe3fe45061 is located in stack of thread T0 at offset 353 in frame
    #0 0x6bebde in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:121

  This frame has 3 object(s):
    [32, 36) 'extra'
    [96, 160) 'cur_key_mixedcase'
    [192, 353) 'tmp' <== Memory access at offset 353 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5eaca) 
Shadow bytes around the buggy address:
  0x100047fc09b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100047fc09c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100047fc09d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100047fc09e0: f1 f1 f1 f1 04 f4 f4 f4 f2 f2 f2 f2 00 00 00 00
  0x100047fc09f0: 00 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00 00 00
=>0x100047fc0a00: 00 00 00 00 00 00 00 00 00 00 00 00[01]f4 f4 f4
  0x100047fc0a10: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
  0x100047fc0a20: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00
  0x100047fc0a30: 00 00 00 00 f4 f4 f3 f3 f3 f3 00 00 00 00 00 00
  0x100047fc0a40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100047fc0a50: f1 f1 f1 f1 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4
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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==30811==ABORTING
<!-- gh-comment-id:242719330 --> @frank-dittrich commented on GitHub (Aug 26, 2016): o3logon format: ``` (bleeding-jumbo)run $ cat fail_o3logon.pw $o3logon$PASSWORD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999$8CF28B36E4F3D2095729CF59510003BF$3078D7DE44385654CC952A9C56E2659B (bleeding-jumbo)run $ ./john --format=o3logon fail_o3logon.pw ================================================================= ==30811==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe3fe45061 at pc 0x7f6b64352acb bp 0x7ffe3fe44ee0 sp 0x7ffe3fe44688 WRITE of size 170 at 0x7ffe3fe45061 thread T0 #0 0x7f6b64352aca (/lib64/libasan.so.3+0x5eaca) #1 0x6becbe in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:135 #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #9 0x7f6b62868730 in __libc_start_main (/lib64/libc.so.6+0x20730) #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) Address 0x7ffe3fe45061 is located in stack of thread T0 at offset 353 in frame #0 0x6bebde in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:121 This frame has 3 object(s): [32, 36) 'extra' [96, 160) 'cur_key_mixedcase' [192, 353) 'tmp' <== Memory access at offset 353 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5eaca) Shadow bytes around the buggy address: 0x100047fc09b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100047fc09c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100047fc09d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100047fc09e0: f1 f1 f1 f1 04 f4 f4 f4 f2 f2 f2 f2 00 00 00 00 0x100047fc09f0: 00 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00 00 00 =>0x100047fc0a00: 00 00 00 00 00 00 00 00 00 00 00 00[01]f4 f4 f4 0x100047fc0a10: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 0x100047fc0a20: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 0x100047fc0a30: 00 00 00 00 f4 f4 f3 f3 f3 f3 00 00 00 00 00 00 0x100047fc0a40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100047fc0a50: f1 f1 f1 f1 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==30811==ABORTING ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

nsec3:

(bleeding-jumbo)run $ cat fail_nsec3.pw
$NSEC3$100$4141414141414141$8c2d583acbe22616c69bb457e0c2111ced0a6e7799999999999999999999999999999999999999999999999999999999999999999999999999999$example.com.
(bleeding-jumbo)run $ ./john --format=nsec3 fail_nsec3.pw
=================================================================
==31207==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc62d52149 at pc 0x7f6dcc974c21 bp 0x7ffc62d520c0 sp 0x7ffc62d51868
WRITE of size 117 at 0x7ffc62d52149 thread T0
    #0 0x7f6dcc974c20 in __interceptor_strncpy (/lib64/libasan.so.3+0x71c20)
    #1 0x6b62cc in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:187
    #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #9 0x7f6dcae77730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

Address 0x7ffc62d52149 is located in stack of thread T0 at offset 73 in frame
    #0 0x6b5f95 in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:146

  This frame has 3 object(s):
    [32, 73) 'hash'
    [128, 383) 'zone' <== Memory access at offset 73 partially underflows this variable
    [416, 672) 'salt'
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x71c20) in __interceptor_strncpy
Shadow bytes around the buggy address:
  0x10000c5a23d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000c5a23e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000c5a23f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000c5a2400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000c5a2410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x10000c5a2420: f1 f1 f1 f1 00 00 00 00 00[01]f4 f4 f2 f2 f2 f2
  0x10000c5a2430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000c5a2440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07
  0x10000c5a2450: f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000c5a2460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10000c5a2470: 00 00 00 00 f3 f3 f3 f3 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==31207==ABORTING
<!-- gh-comment-id:242720036 --> @frank-dittrich commented on GitHub (Aug 26, 2016): nsec3: ``` (bleeding-jumbo)run $ cat fail_nsec3.pw $NSEC3$100$4141414141414141$8c2d583acbe22616c69bb457e0c2111ced0a6e7799999999999999999999999999999999999999999999999999999999999999999999999999999$example.com. (bleeding-jumbo)run $ ./john --format=nsec3 fail_nsec3.pw ================================================================= ==31207==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc62d52149 at pc 0x7f6dcc974c21 bp 0x7ffc62d520c0 sp 0x7ffc62d51868 WRITE of size 117 at 0x7ffc62d52149 thread T0 #0 0x7f6dcc974c20 in __interceptor_strncpy (/lib64/libasan.so.3+0x71c20) #1 0x6b62cc in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:187 #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #9 0x7f6dcae77730 in __libc_start_main (/lib64/libc.so.6+0x20730) #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) Address 0x7ffc62d52149 is located in stack of thread T0 at offset 73 in frame #0 0x6b5f95 in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:146 This frame has 3 object(s): [32, 73) 'hash' [128, 383) 'zone' <== Memory access at offset 73 partially underflows this variable [416, 672) 'salt' HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x71c20) in __interceptor_strncpy Shadow bytes around the buggy address: 0x10000c5a23d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10000c5a23e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10000c5a23f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10000c5a2400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10000c5a2410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10000c5a2420: f1 f1 f1 f1 00 00 00 00 00[01]f4 f4 f2 f2 f2 f2 0x10000c5a2430: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10000c5a2440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07 0x10000c5a2450: f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 0x10000c5a2460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10000c5a2470: 00 00 00 00 f3 f3 f3 f3 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==31207==ABORTING ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

krb5tgs format:

(bleeding-jumbo)run $ cat fail_krb5tgs.pw 
$krb5tgs$23$*Fist0urs$MYDOMAIN$cifs/panda.com*
(bleeding-jumbo)run $ ./john fail_krb5tgs.pw --format=krb5tgs 
=================================================================
==32058==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400000dfff at pc 0x0000007bda27 bp 0x7ffc29453780 sp 0x7ffc29453770
READ of size 1 at 0x60400000dfff thread T0
    #0 0x7bda26 in strtokm /home/fd/git/JtR/src/misc.c:293
    #1 0x68bfd1 in valid /home/fd/git/JtR/src/krb5_tgs_fmt_plug.c:136
    #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #9 0x7fae9011a730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

0x60400000dfff is located 0 bytes to the right of 47-byte region [0x60400000dfd0,0x60400000dfff)
allocated by thread T0 here:
    #0 0x7fae91c6ce20 in malloc (/lib64/libasan.so.3+0xc6e20)
    #1 0x7fae90181fd9 in strdup (/lib64/libc.so.6+0x87fd9)
    #2 0x7369462a24333223  (<unknown module>)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fd/git/JtR/src/misc.c:293 in strtokm
Shadow bytes around the buggy address:
  0x0c087fff9ba0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c087fff9bf0: fa fa fa fa fa fa fa fa fa fa 00 00 00 00 00[07]
  0x0c087fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==32058==ABORTING
(bleeding-jumbo)run $ 
<!-- gh-comment-id:242721718 --> @frank-dittrich commented on GitHub (Aug 26, 2016): krb5tgs format: ``` (bleeding-jumbo)run $ cat fail_krb5tgs.pw $krb5tgs$23$*Fist0urs$MYDOMAIN$cifs/panda.com* (bleeding-jumbo)run $ ./john fail_krb5tgs.pw --format=krb5tgs ================================================================= ==32058==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400000dfff at pc 0x0000007bda27 bp 0x7ffc29453780 sp 0x7ffc29453770 READ of size 1 at 0x60400000dfff thread T0 #0 0x7bda26 in strtokm /home/fd/git/JtR/src/misc.c:293 #1 0x68bfd1 in valid /home/fd/git/JtR/src/krb5_tgs_fmt_plug.c:136 #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #9 0x7fae9011a730 in __libc_start_main (/lib64/libc.so.6+0x20730) #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) 0x60400000dfff is located 0 bytes to the right of 47-byte region [0x60400000dfd0,0x60400000dfff) allocated by thread T0 here: #0 0x7fae91c6ce20 in malloc (/lib64/libasan.so.3+0xc6e20) #1 0x7fae90181fd9 in strdup (/lib64/libc.so.6+0x87fd9) #2 0x7369462a24333223 (<unknown module>) SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fd/git/JtR/src/misc.c:293 in strtokm Shadow bytes around the buggy address: 0x0c087fff9ba0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c087fff9bf0: fa fa fa fa fa fa fa fa fa fa 00 00 00 00 00[07] 0x0c087fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==32058==ABORTING (bleeding-jumbo)run $ ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

KeePass:

(bleeding-jumbo)run $ cat fail_KeePass.pw 
$keepass$*1*50000*1*1ff21bd79aa8e9c3f439281a4ce6a97b*cfbdb00057ee0c9e889ca9d93b069ab5ae19f78852bc21aae4f60d0d325e0034*c1a7e6138a49a2dcfb3a84afbc1d918b*a704f9d060f0de5a070155d1d5a8727da92f404242cb3aa2b9aa53a145f87474*1*608*c2d3d18e416af56788d1c3e4257da9ce6e5dcad4db012d7422d17b4527bbb2bb994d9db03907ae01cc1565f5fd0729b930c9ee352426c57de5dee7e941e1d6aedeaf2b0e6509819385de9b4dd6a09979b3edfa0959a7186c422031e426f18d295c55ac616aabeec99f89e696be1d585950ef16a94ae610f2449cc3964bb63ec6043ef36c89117bc78e99e5fbf083b48cb84f85a964e8a037018b3afc2cc55fbe7d74cbdb53d5a54bcd202a1d0a342dbf48a8f7a24264cde8d800a506bf134008b1d8d9b8dd80c19511d9f43b3c23b19eb4a7dcf584f80c49961f73dcba3d2d0390a39a683ddcc8771b49cc3c673ea0aa902d075e25bc814608e2e6d1d6218a6379fd677bc5daaa18b6f5a021d2f661338ca8cc3645dc6cddb860af222a5cdb59a5e2a2c1921203344ced4e2154446239f6c1af8c1bace8207e0f519ea9c08db2f5d0bde0416b09ef6c530213e648641ae56c9af9fbdcb0a286cc4de121655697b9eb00c0fd89ed7269c3859eca20e0c7b60be8d2a1323eb915139cf90c55f9cff01a5bdf757e09ee6d64c2de9aec8d3ea42feeb67caf51b9ba1a80b435e271fdb7f9144ca31e41671768b2c5e8adf70245fdf52005de418efbe2a156d19eeb2ed9e97a0ddb133d11bd8655356d9d3edbbdbf9d0db345b2eb2c1f550ce070f5b0f8f8e58a6ffd52ae8089627dc4a0dac4b4846349066bfa0d2f395d2cb3871e57e353d622e0904a9f54a3e4706797d95b34619f792c15ab8efb3ac523becc3023f01aaad169bc08db8d01e2dd22eff8f6b4f7b741d196bc3de466590011e6d5c9703a19c07d96d26fe1ad93d0931454730ee1f3146428a126d1ed02763f827ff4*00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
(bleeding-jumbo)run $ ./john --format=KeePass fail_KeePass.pw 
ASAN:DEADLYSIGNAL
=================================================================
==581==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f9b4947a614 bp 0x000000000000 sp 0x7fff4d0bbcd0 T0)
    #0 0x7f9b4947a613 in __GI_____strtol_l_internal (/lib64/libc.so.6+0x3a613)
    #1 0x7f9b4af31b09 in strtol (/lib64/libasan.so.3+0x45b09)
    #2 0x68097e in atoi /usr/include/stdlib.h:280
    #3 0x68097e in get_salt /home/fd/git/JtR/src/keepass_fmt_plug.c:351
    #4 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004
    #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #10 0x7f9b49460730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x3a613) in __GI_____strtol_l_internal
==581==ABORTING
<!-- gh-comment-id:242722470 --> @frank-dittrich commented on GitHub (Aug 26, 2016): KeePass: ``` (bleeding-jumbo)run $ cat fail_KeePass.pw $keepass$*1*50000*1*1ff21bd79aa8e9c3f439281a4ce6a97b*cfbdb00057ee0c9e889ca9d93b069ab5ae19f78852bc21aae4f60d0d325e0034*c1a7e6138a49a2dcfb3a84afbc1d918b*a704f9d060f0de5a070155d1d5a8727da92f404242cb3aa2b9aa53a145f87474*1*608*c2d3d18e416af56788d1c3e4257da9ce6e5dcad4db012d7422d17b4527bbb2bb994d9db03907ae01cc1565f5fd0729b930c9ee352426c57de5dee7e941e1d6aedeaf2b0e6509819385de9b4dd6a09979b3edfa0959a7186c422031e426f18d295c55ac616aabeec99f89e696be1d585950ef16a94ae610f2449cc3964bb63ec6043ef36c89117bc78e99e5fbf083b48cb84f85a964e8a037018b3afc2cc55fbe7d74cbdb53d5a54bcd202a1d0a342dbf48a8f7a24264cde8d800a506bf134008b1d8d9b8dd80c19511d9f43b3c23b19eb4a7dcf584f80c49961f73dcba3d2d0390a39a683ddcc8771b49cc3c673ea0aa902d075e25bc814608e2e6d1d6218a6379fd677bc5daaa18b6f5a021d2f661338ca8cc3645dc6cddb860af222a5cdb59a5e2a2c1921203344ced4e2154446239f6c1af8c1bace8207e0f519ea9c08db2f5d0bde0416b09ef6c530213e648641ae56c9af9fbdcb0a286cc4de121655697b9eb00c0fd89ed7269c3859eca20e0c7b60be8d2a1323eb915139cf90c55f9cff01a5bdf757e09ee6d64c2de9aec8d3ea42feeb67caf51b9ba1a80b435e271fdb7f9144ca31e41671768b2c5e8adf70245fdf52005de418efbe2a156d19eeb2ed9e97a0ddb133d11bd8655356d9d3edbbdbf9d0db345b2eb2c1f550ce070f5b0f8f8e58a6ffd52ae8089627dc4a0dac4b4846349066bfa0d2f395d2cb3871e57e353d622e0904a9f54a3e4706797d95b34619f792c15ab8efb3ac523becc3023f01aaad169bc08db8d01e2dd22eff8f6b4f7b741d196bc3de466590011e6d5c9703a19c07d96d26fe1ad93d0931454730ee1f3146428a126d1ed02763f827ff4*00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (bleeding-jumbo)run $ ./john --format=KeePass fail_KeePass.pw ASAN:DEADLYSIGNAL ================================================================= ==581==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f9b4947a614 bp 0x000000000000 sp 0x7fff4d0bbcd0 T0) #0 0x7f9b4947a613 in __GI_____strtol_l_internal (/lib64/libc.so.6+0x3a613) #1 0x7f9b4af31b09 in strtol (/lib64/libasan.so.3+0x45b09) #2 0x68097e in atoi /usr/include/stdlib.h:280 #3 0x68097e in get_salt /home/fd/git/JtR/src/keepass_fmt_plug.c:351 #4 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004 #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #10 0x7f9b49460730 in __libc_start_main (/lib64/libc.so.6+0x20730) #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x3a613) in __GI_____strtol_l_internal ==581==ABORTING ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

HMAC-MD5:

(bleeding-jumbo)run $ cat fail_HMAC-MD5.pw 
$cram_md5$PG5vLXJlcGx5QGhhc2hjYXQubmV0Pg99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999==$dXNlciA0NGVhZmQyMmZlNzY2NzBmNmIyODc5MDgxYTdmNWY3MQ==
(bleeding-jumbo)run $ ./john fail_HMAC-MD5.pw --format=HMAC-MD5
=================================================================
==860==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000ef22c0 at pc 0x00000066e570 bp 0x7ffe36062270 sp 0x7ffe36062260
WRITE of size 1 at 0x000000ef22c0 thread T0
    #0 0x66e56f in prepare /home/fd/git/JtR/src/hmacMD5_fmt_plug.c:196
    #1 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804
    #2 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #8 0x7f5f9ff15730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

0x000000ef22c0 is located 32 bytes to the left of global variable 'out' defined in 'hmacMD5_fmt_plug.c:216:14' (0xef22e0) of size 399
0x000000ef22c0 is located 0 bytes to the right of global variable 'out' defined in 'hmacMD5_fmt_plug.c:183:15' (0xef21c0) of size 256
SUMMARY: AddressSanitizer: global-buffer-overflow /home/fd/git/JtR/src/hmacMD5_fmt_plug.c:196 in prepare
Shadow bytes around the buggy address:
  0x0000801d6400: 00 f9 f9 f9 f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9
  0x0000801d6410: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801d6420: 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801d6430: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0000801d6440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0000801d6450: 00 00 00 00 00 00 00 00[f9]f9 f9 f9 00 00 00 00
  0x0000801d6460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d6470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801d6480: 00 00 00 00 00 00 00 00 00 00 00 00 00 07 f9 f9
  0x0000801d6490: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801d64a0: 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==860==ABORTING
<!-- gh-comment-id:242723055 --> @frank-dittrich commented on GitHub (Aug 26, 2016): HMAC-MD5: ``` (bleeding-jumbo)run $ cat fail_HMAC-MD5.pw $cram_md5$PG5vLXJlcGx5QGhhc2hjYXQubmV0Pg99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999==$dXNlciA0NGVhZmQyMmZlNzY2NzBmNmIyODc5MDgxYTdmNWY3MQ== (bleeding-jumbo)run $ ./john fail_HMAC-MD5.pw --format=HMAC-MD5 ================================================================= ==860==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000ef22c0 at pc 0x00000066e570 bp 0x7ffe36062270 sp 0x7ffe36062260 WRITE of size 1 at 0x000000ef22c0 thread T0 #0 0x66e56f in prepare /home/fd/git/JtR/src/hmacMD5_fmt_plug.c:196 #1 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804 #2 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #8 0x7f5f9ff15730 in __libc_start_main (/lib64/libc.so.6+0x20730) #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) 0x000000ef22c0 is located 32 bytes to the left of global variable 'out' defined in 'hmacMD5_fmt_plug.c:216:14' (0xef22e0) of size 399 0x000000ef22c0 is located 0 bytes to the right of global variable 'out' defined in 'hmacMD5_fmt_plug.c:183:15' (0xef21c0) of size 256 SUMMARY: AddressSanitizer: global-buffer-overflow /home/fd/git/JtR/src/hmacMD5_fmt_plug.c:196 in prepare Shadow bytes around the buggy address: 0x0000801d6400: 00 f9 f9 f9 f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 0x0000801d6410: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 0x0000801d6420: 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801d6430: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0000801d6440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0000801d6450: 00 00 00 00 00 00 00 00[f9]f9 f9 f9 00 00 00 00 0x0000801d6460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d6470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801d6480: 00 00 00 00 00 00 00 00 00 00 00 00 00 07 f9 f9 0x0000801d6490: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 00 00 00 00 0x0000801d64a0: 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==860==ABORTING ```
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

What is your build? fedora gcc ?

<!-- gh-comment-id:242727885 --> @jfoug commented on GitHub (Aug 26, 2016): What is your build? fedora gcc ?
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

$ ../run/john --list=build-info 
Version: 1.8.0.6-jumbo-1-2557-g4f46956
Build: linux-gnu 64-bit AVX-ac ASan
SIMD: AVX, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1
$JOHN is ../run/
Format interface version: 14
Max. number of reported tunable costs: 3
Rec file version: REC4
Charset file version: CHR3
CHARSET_MIN: 1 (0x01)
CHARSET_MAX: 255 (0xff)
CHARSET_LENGTH: 24
SALT_HASH_SIZE: 1048576
Max. Markov mode level: 400
Max. Markov mode password length: 30
gcc version: 6.1.1
GNU libc version: 2.23 (loaded: 2.23)
Crypto library: OpenSSL
OpenSSL library version: 01000208f
OpenSSL 1.0.2h-fips  3 May 2016
GMP library version: 6.1.1
File locking: fcntl()
fseek(): fseek
ftell(): ftell
fopen(): fopen
memmem(): System's
Built with these debugging options
    ASan (Address Sanitizer debugging)

Fedora 24, kernel 4.6.7-300.fc24.x86_64

$ gcc --version
gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)
<!-- gh-comment-id:242728134 --> @frank-dittrich commented on GitHub (Aug 26, 2016): ``` $ ../run/john --list=build-info Version: 1.8.0.6-jumbo-1-2557-g4f46956 Build: linux-gnu 64-bit AVX-ac ASan SIMD: AVX, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1 $JOHN is ../run/ Format interface version: 14 Max. number of reported tunable costs: 3 Rec file version: REC4 Charset file version: CHR3 CHARSET_MIN: 1 (0x01) CHARSET_MAX: 255 (0xff) CHARSET_LENGTH: 24 SALT_HASH_SIZE: 1048576 Max. Markov mode level: 400 Max. Markov mode password length: 30 gcc version: 6.1.1 GNU libc version: 2.23 (loaded: 2.23) Crypto library: OpenSSL OpenSSL library version: 01000208f OpenSSL 1.0.2h-fips 3 May 2016 GMP library version: 6.1.1 File locking: fcntl() fseek(): fseek ftell(): ftell fopen(): fopen memmem(): System's Built with these debugging options ASan (Address Sanitizer debugging) ``` Fedora 24, kernel 4.6.7-300.fc24.x86_64 ``` $ gcc --version gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3) ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

PEM format:

(bleeding-jumbo)run $ cat fail_PEM.pw 
$PEM$1$1$029375ebb44d8c3f$2047$3c7dbbee4df5863e$1224$
(bleeding-jumbo)run $ ./john fail_PEM.pw --format=PEM                 
ASAN:DEADLYSIGNAL
=================================================================
==7046==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7efe6a9d1296 bp 0x7ffdf3ae1f40 sp 0x7ffdf3ae16b8 T0)
    #0 0x7efe6a9d1295 in __GI_strlen (/lib64/libc.so.6+0x88295)
    #1 0x7efe6c431e2b  (/lib64/libasan.so.3+0x3ce2b)
    #2 0x77640a in _hexlen /home/fd/git/JtR/src/common.c:131
    #3 0x77640a in hexlenl /home/fd/git/JtR/src/common.c:151
    #4 0x6e92fe in valid /home/fd/git/JtR/src/pem_fmt_plug.c:158
    #5 0x7a0595 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #6 0x7a1011 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #7 0x7a2808 in read_file /home/fd/git/JtR/src/loader.c:226
    #8 0x7a5c54 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #9 0x798c9a in john_load /home/fd/git/JtR/src/john.c:1169
    #10 0x79a4c2 in john_init /home/fd/git/JtR/src/john.c:1496
    #11 0x79c310 in main /home/fd/git/JtR/src/john.c:1954
    #12 0x7efe6a969730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #13 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x88295) in __GI_strlen
==7046==ABORTING
<!-- gh-comment-id:242731612 --> @frank-dittrich commented on GitHub (Aug 26, 2016): PEM format: ``` (bleeding-jumbo)run $ cat fail_PEM.pw $PEM$1$1$029375ebb44d8c3f$2047$3c7dbbee4df5863e$1224$ (bleeding-jumbo)run $ ./john fail_PEM.pw --format=PEM ASAN:DEADLYSIGNAL ================================================================= ==7046==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7efe6a9d1296 bp 0x7ffdf3ae1f40 sp 0x7ffdf3ae16b8 T0) #0 0x7efe6a9d1295 in __GI_strlen (/lib64/libc.so.6+0x88295) #1 0x7efe6c431e2b (/lib64/libasan.so.3+0x3ce2b) #2 0x77640a in _hexlen /home/fd/git/JtR/src/common.c:131 #3 0x77640a in hexlenl /home/fd/git/JtR/src/common.c:151 #4 0x6e92fe in valid /home/fd/git/JtR/src/pem_fmt_plug.c:158 #5 0x7a0595 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #6 0x7a1011 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #7 0x7a2808 in read_file /home/fd/git/JtR/src/loader.c:226 #8 0x7a5c54 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #9 0x798c9a in john_load /home/fd/git/JtR/src/john.c:1169 #10 0x79a4c2 in john_init /home/fd/git/JtR/src/john.c:1496 #11 0x79c310 in main /home/fd/git/JtR/src/john.c:1954 #12 0x7efe6a969730 in __libc_start_main (/lib64/libc.so.6+0x20730) #13 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x88295) in __GI_strlen ==7046==ABORTING ```
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

Damn off by 1 error in the _hexlen() function determining if there were any straggler bytes. But the fix simplifies the code making it easier to read. I took the end of buffer detect logic from the original code, (when the function returned an int) so it must have been wrong there also.

<!-- gh-comment-id:242731762 --> @jfoug commented on GitHub (Aug 26, 2016): Damn off by 1 error in the _hexlen() function determining if there were any straggler bytes. But the fix simplifies the code making it easier to read. I took the end of buffer detect logic from the original code, (when the function returned an int) so it must have been wrong there also.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

0b68c6e Please check. All of these should be gone now.

<!-- gh-comment-id:242732105 --> @jfoug commented on GitHub (Aug 26, 2016): 0b68c6e Please check. All of these should be gone now.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

The last one (the PEM) may be a different crash. I will look at that one.

The PEM bug has been a bug in valid and the recent change simply forced it to the surface.

<!-- gh-comment-id:242732810 --> @jfoug commented on GitHub (Aug 26, 2016): The last one (the PEM) may be a different crash. I will look at that one. The PEM bug has been a bug in valid and the recent change simply forced it to the surface.
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

These errors still exist after your hexlen() fix (I used the same files as in the comments above):

./john fail_HMAC-MD5.pw --format=HMAC-MD5
=================================================================
==7530==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000ef22c0 at pc 0x00000066e570 bp 0x7ffc3c9c3a90 sp 0x7ffc3c9c3a80
WRITE of size 1 at 0x000000ef22c0 thread T0
    #0 0x66e56f in prepare /home/fd/git/JtR/src/hmacMD5_fmt_plug.c:196
    #1 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804
    #2 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #8 0x7f96364b8730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)
$ ./john fail_KeePass.pw --format=KeePass
ASAN:DEADLYSIGNAL
=================================================================
==7607==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f90bbfca614 bp 0x000000000000 sp 0x7fff3ffbc6f0 T0)
    #0 0x7f90bbfca613 in __GI_____strtol_l_internal (/lib64/libc.so.6+0x3a613)
    #1 0x7f90bda81b09 in strtol (/lib64/libasan.so.3+0x45b09)
    #2 0x68097e in atoi /usr/include/stdlib.h:280
    #3 0x68097e in get_salt /home/fd/git/JtR/src/keepass_fmt_plug.c:351
    #4 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004
    #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #10 0x7f90bbfb0730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x3a613) in __GI_____strtol_l_internal
==7607==ABORTING
$ ./john fail_PEM.pw --format=PEM
ASAN:DEADLYSIGNAL
=================================================================
==7667==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f6ff1d86296 bp 0x7ffeddfacf80 sp 0x7ffeddfac6f8 T0)
    #0 0x7f6ff1d86295 in __GI_strlen (/lib64/libc.so.6+0x88295)
    #1 0x7f6ff37e6e2b  (/lib64/libasan.so.3+0x3ce2b)
    #2 0x7763fa in _hexlen /home/fd/git/JtR/src/common.c:131
    #3 0x7763fa in hexlenl /home/fd/git/JtR/src/common.c:151
    #4 0x6e92ee in valid /home/fd/git/JtR/src/pem_fmt_plug.c:156
    #5 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #6 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #7 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #8 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #9 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #10 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #11 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #12 0x7f6ff1d1e730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #13 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x88295) in __GI_strlen
==7667==ABORTING
(bleeding-jumbo)run $ ./john fail_krb5tgs.pw --format=krb5tgs 
(bleeding-jumbo)run $ ./john fail_krb5tgs.pw --format=krb5tgs
=================================================================
==7785==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400000dfff at pc 0x0000007bda27 bp 0x7ffd21be76e0 sp 0x7ffd21be76d0
READ of size 1 at 0x60400000dfff thread T0
    #0 0x7bda26 in strtokm /home/fd/git/JtR/src/misc.c:293
    #1 0x68bfd1 in valid /home/fd/git/JtR/src/krb5_tgs_fmt_plug.c:136
    #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #9 0x7f4e511ae730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

0x60400000dfff is located 0 bytes to the right of 47-byte region [0x60400000dfd0,0x60400000dfff)
allocated by thread T0 here:
    #0 0x7f4e52d00e20 in malloc (/lib64/libasan.so.3+0xc6e20)
    #1 0x7f4e51215fd9 in strdup (/lib64/libc.so.6+0x87fd9)
    #2 0x7369462a24333223  (<unknown module>)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fd/git/JtR/src/misc.c:293 in strtokm
Shadow bytes around the buggy address:
  0x0c087fff9ba0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c087fff9bf0: fa fa fa fa fa fa fa fa fa fa 00 00 00 00 00[07]
  0x0c087fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c087fff9c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==7785==ABORTING
(bleeding-jumbo)run $ 
$ ./john fail_nsec3.pw --format=nsec3  
=================================================================
==7810==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff19a8a7e9 at pc 0x7f7043085c21 bp 0x7fff19a8a760 sp 0x7fff19a89f08
WRITE of size 117 at 0x7fff19a8a7e9 thread T0
    #0 0x7f7043085c20 in __interceptor_strncpy (/lib64/libasan.so.3+0x71c20)
    #1 0x6b62cc in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:187
    #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #9 0x7f7041588730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

Address 0x7fff19a8a7e9 is located in stack of thread T0 at offset 73 in frame
    #0 0x6b5f95 in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:146

  This frame has 3 object(s):
    [32, 73) 'hash'
    [128, 383) 'zone' <== Memory access at offset 73 partially underflows this variable
    [416, 672) 'salt'
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x71c20) in __interceptor_strncpy
Shadow bytes around the buggy address:
  0x1000633494a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000633494b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000633494c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000633494d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000633494e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x1000633494f0: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00[01]f4 f4
  0x100063349500: f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00
  0x100063349510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100063349520: 00 00 00 07 f2 f2 f2 f2 00 00 00 00 00 00 00 00
  0x100063349530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100063349540: 00 00 00 00 00 00 00 00 f3 f3 f3 f3 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==7810==ABORTING
$ ./john fail_o3logon.pw --format=o3logon 
=================================================================
==7888==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdc6536671 at pc 0x7f3b56bd3acb bp 0x7ffdc65364f0 sp 0x7ffdc6535c98
WRITE of size 170 at 0x7ffdc6536671 thread T0
    #0 0x7f3b56bd3aca  (/lib64/libasan.so.3+0x5eaca)
    #1 0x6becbe in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:135
    #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807
    #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #9 0x7f3b550e9730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

Address 0x7ffdc6536671 is located in stack of thread T0 at offset 353 in frame
    #0 0x6bebde in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:121

  This frame has 3 object(s):
    [32, 36) 'extra'
    [96, 160) 'cur_key_mixedcase'
    [192, 353) 'tmp' <== Memory access at offset 353 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5eaca) 
Shadow bytes around the buggy address:
  0x100038c9ec70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038c9ec80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038c9ec90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038c9eca0: 00 00 f1 f1 f1 f1 04 f4 f4 f4 f2 f2 f2 f2 00 00
  0x100038c9ecb0: 00 00 00 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00
=>0x100038c9ecc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[01]f4
  0x100038c9ecd0: f4 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00
  0x100038c9ece0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00
  0x100038c9ecf0: 00 00 00 00 00 00 f4 f4 f3 f3 f3 f3 00 00 00 00
  0x100038c9ed00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100038c9ed10: 00 00 f1 f1 f1 f1 00 f4 f4 f4 f2 f2 f2 f2 00 f4
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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==7888==ABORTING
$ ./john fail_Raw-SHA1-AxCrypt.pw --format=Raw-SHA1-AxCrypt
=================================================================
==7957==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f468a9 at pc 0x7efd742aeb32 bp 0x7ffc576fa0b0 sp 0x7ffc576f9840
WRITE of size 42 at 0x000000f468a9 thread T0
    #0 0x7efd742aeb31 in vsprintf (/lib64/libasan.so.3+0x8fb31)
    #1 0x7efd742aed62 in sprintf (/lib64/libasan.so.3+0x8fd62)
    #2 0x71156f in rawsha1_axcrypt_prepare /home/fd/git/JtR/src/rawSHA1_common_plug.c:120
    #3 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804
    #4 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922
    #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #10 0x7efd72793730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

0x000000f468a9 is located 55 bytes to the left of global variable 'out' defined in 'rawSHA1_common_plug.c:94:14' (0xf468e0) of size 34
0x000000f468a9 is located 0 bytes to the right of global variable 'out' defined in 'rawSHA1_common_plug.c:115:14' (0xf46880) of size 41
SUMMARY: AddressSanitizer: global-buffer-overflow (/lib64/libasan.so.3+0x8fb31) in vsprintf
Shadow bytes around the buggy address:
  0x0000801e0cc0: 00 06 f9 f9 f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9
  0x0000801e0cd0: 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9
  0x0000801e0ce0: 00 00 04 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0000801e0cf0: 00 00 00 00 00 00 00 06 f9 f9 f9 f9 00 00 04 f9
  0x0000801e0d00: f9 f9 f9 f9 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9
=>0x0000801e0d10: 00 00 00 00 00[01]f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801e0d20: 02 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9
  0x0000801e0d30: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801e0d40: 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0000801e0d50: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x0000801e0d60: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==7957==ABORTING
(bleeding-jumbo)run $ ./john fail_Salted-SHA1.pw --format=Salted-SHA1
=================================================================
==8017==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe67507aa4 at pc 0x7f0a7f557ccf bp 0x7ffe67507a30 sp 0x7ffe675071d8
READ of size 52 at 0x7ffe67507aa4 thread T0
    #0 0x7f0a7f557cce  (/lib64/libasan.so.3+0x5ecce)
    #1 0x72a7d1 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:217
    #2 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004
    #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #8 0x7f0a7da6d730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

Address 0x7ffe67507aa4 is located in stack of thread T0 at offset 84 in frame
    #0 0x72a686 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:199

  This frame has 1 object(s):
    [32, 84) 'realcipher' <== Memory access at offset 84 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5ecce) 
Shadow bytes around the buggy address:
  0x10004ce98f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10004ce98f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10004ce98f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10004ce98f30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10004ce98f40: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00
=>0x10004ce98f50: 00 00 00 00[04]f4 f3 f3 f3 f3 00 00 00 00 00 00
  0x10004ce98f60: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
  0x10004ce98f70: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2
  0x10004ce98f80: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2
  0x10004ce98f90: 00 f4 f4 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00
  0x10004ce98fa0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==8017==ABORTING
$ ./john fail_whirlpool.pw --format=whirlpool 
=================================================================
==8174==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f55b8c at pc 0x00000040659d bp 0x7ffd436fdb20 sp 0x7ffd436fdb10
READ of size 1 at 0x000000f55b8c thread T0
    #0 0x40659c in strupr /home/fd/git/JtR/src/jumbo.c:308
    #1 0x75f759 in split /home/fd/git/JtR/src/whirlpool_fmt_plug.c:128
    #2 0x7a1463 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:945
    #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226
    #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169
    #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496
    #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954
    #8 0x7f09ec24a730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

0x000000f55b8c is located 52 bytes to the left of global variable 'buf' defined in 'whirlpool_fmt_plug.c:137:4' (0xf55bc0) of size 64
0x000000f55b8c is located 0 bytes to the right of global variable 'out' defined in 'whirlpool_fmt_plug.c:121:14' (0xf55b00) of size 140
SUMMARY: AddressSanitizer: global-buffer-overflow /home/fd/git/JtR/src/jumbo.c:308 in strupr
Shadow bytes around the buggy address:
  0x0000801e2b20: f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9 00 00 00 00
  0x0000801e2b30: 00 00 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2b40: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2b50: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0000801e2b70: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x0000801e2b80: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x0000801e2b90: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801e2ba0: 00 00 00 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
  0x0000801e2bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0000801e2bc0: 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==8174==ABORTING
<!-- gh-comment-id:242734981 --> @frank-dittrich commented on GitHub (Aug 26, 2016): These errors still exist after your hexlen() fix (I used the same files as in the comments above): ``` ./john fail_HMAC-MD5.pw --format=HMAC-MD5 ================================================================= ==7530==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000ef22c0 at pc 0x00000066e570 bp 0x7ffc3c9c3a90 sp 0x7ffc3c9c3a80 WRITE of size 1 at 0x000000ef22c0 thread T0 #0 0x66e56f in prepare /home/fd/git/JtR/src/hmacMD5_fmt_plug.c:196 #1 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804 #2 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #8 0x7f96364b8730 in __libc_start_main (/lib64/libc.so.6+0x20730) #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) ``` ``` $ ./john fail_KeePass.pw --format=KeePass ASAN:DEADLYSIGNAL ================================================================= ==7607==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f90bbfca614 bp 0x000000000000 sp 0x7fff3ffbc6f0 T0) #0 0x7f90bbfca613 in __GI_____strtol_l_internal (/lib64/libc.so.6+0x3a613) #1 0x7f90bda81b09 in strtol (/lib64/libasan.so.3+0x45b09) #2 0x68097e in atoi /usr/include/stdlib.h:280 #3 0x68097e in get_salt /home/fd/git/JtR/src/keepass_fmt_plug.c:351 #4 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004 #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #10 0x7f90bbfb0730 in __libc_start_main (/lib64/libc.so.6+0x20730) #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x3a613) in __GI_____strtol_l_internal ==7607==ABORTING ``` ``` $ ./john fail_PEM.pw --format=PEM ASAN:DEADLYSIGNAL ================================================================= ==7667==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f6ff1d86296 bp 0x7ffeddfacf80 sp 0x7ffeddfac6f8 T0) #0 0x7f6ff1d86295 in __GI_strlen (/lib64/libc.so.6+0x88295) #1 0x7f6ff37e6e2b (/lib64/libasan.so.3+0x3ce2b) #2 0x7763fa in _hexlen /home/fd/git/JtR/src/common.c:131 #3 0x7763fa in hexlenl /home/fd/git/JtR/src/common.c:151 #4 0x6e92ee in valid /home/fd/git/JtR/src/pem_fmt_plug.c:156 #5 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #6 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #7 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #8 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #9 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #10 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #11 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #12 0x7f6ff1d1e730 in __libc_start_main (/lib64/libc.so.6+0x20730) #13 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x88295) in __GI_strlen ==7667==ABORTING ``` ``` (bleeding-jumbo)run $ ./john fail_krb5tgs.pw --format=krb5tgs (bleeding-jumbo)run $ ./john fail_krb5tgs.pw --format=krb5tgs ================================================================= ==7785==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400000dfff at pc 0x0000007bda27 bp 0x7ffd21be76e0 sp 0x7ffd21be76d0 READ of size 1 at 0x60400000dfff thread T0 #0 0x7bda26 in strtokm /home/fd/git/JtR/src/misc.c:293 #1 0x68bfd1 in valid /home/fd/git/JtR/src/krb5_tgs_fmt_plug.c:136 #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #9 0x7f4e511ae730 in __libc_start_main (/lib64/libc.so.6+0x20730) #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) 0x60400000dfff is located 0 bytes to the right of 47-byte region [0x60400000dfd0,0x60400000dfff) allocated by thread T0 here: #0 0x7f4e52d00e20 in malloc (/lib64/libasan.so.3+0xc6e20) #1 0x7f4e51215fd9 in strdup (/lib64/libc.so.6+0x87fd9) #2 0x7369462a24333223 (<unknown module>) SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fd/git/JtR/src/misc.c:293 in strtokm Shadow bytes around the buggy address: 0x0c087fff9ba0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c087fff9bf0: fa fa fa fa fa fa fa fa fa fa 00 00 00 00 00[07] 0x0c087fff9c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff9c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==7785==ABORTING (bleeding-jumbo)run $ ``` ``` $ ./john fail_nsec3.pw --format=nsec3 ================================================================= ==7810==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff19a8a7e9 at pc 0x7f7043085c21 bp 0x7fff19a8a760 sp 0x7fff19a89f08 WRITE of size 117 at 0x7fff19a8a7e9 thread T0 #0 0x7f7043085c20 in __interceptor_strncpy (/lib64/libasan.so.3+0x71c20) #1 0x6b62cc in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:187 #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #9 0x7f7041588730 in __libc_start_main (/lib64/libc.so.6+0x20730) #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) Address 0x7fff19a8a7e9 is located in stack of thread T0 at offset 73 in frame #0 0x6b5f95 in valid /home/fd/git/JtR/src/nsec3_fmt_plug.c:146 This frame has 3 object(s): [32, 73) 'hash' [128, 383) 'zone' <== Memory access at offset 73 partially underflows this variable [416, 672) 'salt' HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x71c20) in __interceptor_strncpy Shadow bytes around the buggy address: 0x1000633494a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000633494b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000633494c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000633494d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1000633494e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x1000633494f0: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00[01]f4 f4 0x100063349500: f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 0x100063349510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100063349520: 00 00 00 07 f2 f2 f2 f2 00 00 00 00 00 00 00 00 0x100063349530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100063349540: 00 00 00 00 00 00 00 00 f3 f3 f3 f3 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==7810==ABORTING ``` ``` $ ./john fail_o3logon.pw --format=o3logon ================================================================= ==7888==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdc6536671 at pc 0x7f3b56bd3acb bp 0x7ffdc65364f0 sp 0x7ffdc6535c98 WRITE of size 170 at 0x7ffdc6536671 thread T0 #0 0x7f3b56bd3aca (/lib64/libasan.so.3+0x5eaca) #1 0x6becbe in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:135 #2 0x7a0585 in ldr_split_line /home/fd/git/JtR/src/loader.c:807 #3 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #4 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #5 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #6 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #7 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #8 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #9 0x7f3b550e9730 in __libc_start_main (/lib64/libc.so.6+0x20730) #10 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) Address 0x7ffdc6536671 is located in stack of thread T0 at offset 353 in frame #0 0x6bebde in valid /home/fd/git/JtR/src/o3logon_fmt_plug.c:121 This frame has 3 object(s): [32, 36) 'extra' [96, 160) 'cur_key_mixedcase' [192, 353) 'tmp' <== Memory access at offset 353 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5eaca) Shadow bytes around the buggy address: 0x100038c9ec70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100038c9ec80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100038c9ec90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100038c9eca0: 00 00 f1 f1 f1 f1 04 f4 f4 f4 f2 f2 f2 f2 00 00 0x100038c9ecb0: 00 00 00 00 00 00 f2 f2 f2 f2 00 00 00 00 00 00 =>0x100038c9ecc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[01]f4 0x100038c9ecd0: f4 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 0x100038c9ece0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 0x100038c9ecf0: 00 00 00 00 00 00 f4 f4 f3 f3 f3 f3 00 00 00 00 0x100038c9ed00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100038c9ed10: 00 00 f1 f1 f1 f1 00 f4 f4 f4 f2 f2 f2 f2 00 f4 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==7888==ABORTING ``` ``` $ ./john fail_Raw-SHA1-AxCrypt.pw --format=Raw-SHA1-AxCrypt ================================================================= ==7957==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f468a9 at pc 0x7efd742aeb32 bp 0x7ffc576fa0b0 sp 0x7ffc576f9840 WRITE of size 42 at 0x000000f468a9 thread T0 #0 0x7efd742aeb31 in vsprintf (/lib64/libasan.so.3+0x8fb31) #1 0x7efd742aed62 in sprintf (/lib64/libasan.so.3+0x8fd62) #2 0x71156f in rawsha1_axcrypt_prepare /home/fd/git/JtR/src/rawSHA1_common_plug.c:120 #3 0x7a0556 in ldr_split_line /home/fd/git/JtR/src/loader.c:804 #4 0x7a1001 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:922 #5 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #6 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #7 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #8 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #9 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #10 0x7efd72793730 in __libc_start_main (/lib64/libc.so.6+0x20730) #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) 0x000000f468a9 is located 55 bytes to the left of global variable 'out' defined in 'rawSHA1_common_plug.c:94:14' (0xf468e0) of size 34 0x000000f468a9 is located 0 bytes to the right of global variable 'out' defined in 'rawSHA1_common_plug.c:115:14' (0xf46880) of size 41 SUMMARY: AddressSanitizer: global-buffer-overflow (/lib64/libasan.so.3+0x8fb31) in vsprintf Shadow bytes around the buggy address: 0x0000801e0cc0: 00 06 f9 f9 f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 0x0000801e0cd0: 00 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 0x0000801e0ce0: 00 00 04 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0000801e0cf0: 00 00 00 00 00 00 00 06 f9 f9 f9 f9 00 00 04 f9 0x0000801e0d00: f9 f9 f9 f9 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 =>0x0000801e0d10: 00 00 00 00 00[01]f9 f9 f9 f9 f9 f9 00 00 00 00 0x0000801e0d20: 02 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 02 f9 f9 f9 0x0000801e0d30: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 00 00 0x0000801e0d40: 00 00 00 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0000801e0d50: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 0x0000801e0d60: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==7957==ABORTING ``` ``` (bleeding-jumbo)run $ ./john fail_Salted-SHA1.pw --format=Salted-SHA1 ================================================================= ==8017==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe67507aa4 at pc 0x7f0a7f557ccf bp 0x7ffe67507a30 sp 0x7ffe675071d8 READ of size 52 at 0x7ffe67507aa4 thread T0 #0 0x7f0a7f557cce (/lib64/libasan.so.3+0x5ecce) #1 0x72a7d1 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:217 #2 0x7a16b8 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004 #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #8 0x7f0a7da6d730 in __libc_start_main (/lib64/libc.so.6+0x20730) #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) Address 0x7ffe67507aa4 is located in stack of thread T0 at offset 84 in frame #0 0x72a686 in get_salt /home/fd/git/JtR/src/salted_sha1_fmt_plug.c:199 This frame has 1 object(s): [32, 84) 'realcipher' <== Memory access at offset 84 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.3+0x5ecce) Shadow bytes around the buggy address: 0x10004ce98f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10004ce98f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10004ce98f20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10004ce98f30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10004ce98f40: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 =>0x10004ce98f50: 00 00 00 00[04]f4 f3 f3 f3 f3 00 00 00 00 00 00 0x10004ce98f60: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 0x10004ce98f70: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2 0x10004ce98f80: 00 f4 f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2 0x10004ce98f90: 00 f4 f4 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00 0x10004ce98fa0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==8017==ABORTING ``` ``` $ ./john fail_whirlpool.pw --format=whirlpool ================================================================= ==8174==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000f55b8c at pc 0x00000040659d bp 0x7ffd436fdb20 sp 0x7ffd436fdb10 READ of size 1 at 0x000000f55b8c thread T0 #0 0x40659c in strupr /home/fd/git/JtR/src/jumbo.c:308 #1 0x75f759 in split /home/fd/git/JtR/src/whirlpool_fmt_plug.c:128 #2 0x7a1463 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:945 #3 0x7a27f8 in read_file /home/fd/git/JtR/src/loader.c:226 #4 0x7a5c44 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #5 0x798c8a in john_load /home/fd/git/JtR/src/john.c:1169 #6 0x79a4b2 in john_init /home/fd/git/JtR/src/john.c:1496 #7 0x79c300 in main /home/fd/git/JtR/src/john.c:1954 #8 0x7f09ec24a730 in __libc_start_main (/lib64/libc.so.6+0x20730) #9 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) 0x000000f55b8c is located 52 bytes to the left of global variable 'buf' defined in 'whirlpool_fmt_plug.c:137:4' (0xf55bc0) of size 64 0x000000f55b8c is located 0 bytes to the right of global variable 'out' defined in 'whirlpool_fmt_plug.c:121:14' (0xf55b00) of size 140 SUMMARY: AddressSanitizer: global-buffer-overflow /home/fd/git/JtR/src/jumbo.c:308 in strupr Shadow bytes around the buggy address: 0x0000801e2b20: f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9 00 00 00 00 0x0000801e2b30: 00 00 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801e2b40: 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801e2b50: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 0x0000801e2b60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0000801e2b70: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x0000801e2b80: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 0x0000801e2b90: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801e2ba0: 00 00 00 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 0x0000801e2bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0000801e2bc0: 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==8174==ABORTING ```
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

7f063db is pem fix.

I will look at others. NOTE, the pem bug was there all along. The more strict hexlen functions made it show up.

<!-- gh-comment-id:242736344 --> @jfoug commented on GitHub (Aug 26, 2016): 7f063db is pem fix. I will look at others. NOTE, the pem bug was there all along. The more strict hexlen functions made it show up.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

I think a lot of these have nothing to do with the hexlen?() changes, but you must have found a new method of really testing valid better ;)

<!-- gh-comment-id:242759270 --> @jfoug commented on GitHub (Aug 26, 2016): I think a lot of these have nothing to do with the hexlen?() changes, but you must have found a new method of really testing valid better ;)
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

I have all of these handled. Note, I am not sure about whirlpool. I could not replicate, but will check in what I have, and we can test more if needed.

<!-- gh-comment-id:242770545 --> @jfoug commented on GitHub (Aug 26, 2016): I have all of these handled. Note, I am not sure about whirlpool. I could not replicate, but will check in what I have, and we can test more if needed.
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

Still failing:

$ ./john --format=KeePass fail_KeePass.pw 
ASAN:DEADLYSIGNAL
=================================================================
==2752==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fc3fbbe2614 bp 0x000000000000 sp 0x7ffc5871bda0 T0)
    #0 0x7fc3fbbe2613 in __GI_____strtol_l_internal (/lib64/libc.so.6+0x3a613)
    #1 0x7fc3fd699b09 in strtol (/lib64/libasan.so.3+0x45b09)
    #2 0x6809d9 in atoi /usr/include/stdlib.h:280
    #3 0x6809d9 in get_salt /home/fd/git/JtR/src/keepass_fmt_plug.c:351
    #4 0x7a1937 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004
    #5 0x7a2a77 in read_file /home/fd/git/JtR/src/loader.c:226
    #6 0x7a5ec3 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115
    #7 0x798f09 in john_load /home/fd/git/JtR/src/john.c:1169
    #8 0x79a731 in john_init /home/fd/git/JtR/src/john.c:1496
    #9 0x79c57f in main /home/fd/git/JtR/src/john.c:1954
    #10 0x7fc3fbbc8730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x3a613) in __GI_____strtol_l_internal
==2752==ABORTING

All the others are fixed. Thanks!

<!-- gh-comment-id:242780935 --> @frank-dittrich commented on GitHub (Aug 26, 2016): Still failing: ``` $ ./john --format=KeePass fail_KeePass.pw ASAN:DEADLYSIGNAL ================================================================= ==2752==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fc3fbbe2614 bp 0x000000000000 sp 0x7ffc5871bda0 T0) #0 0x7fc3fbbe2613 in __GI_____strtol_l_internal (/lib64/libc.so.6+0x3a613) #1 0x7fc3fd699b09 in strtol (/lib64/libasan.so.3+0x45b09) #2 0x6809d9 in atoi /usr/include/stdlib.h:280 #3 0x6809d9 in get_salt /home/fd/git/JtR/src/keepass_fmt_plug.c:351 #4 0x7a1937 in ldr_load_pw_line /home/fd/git/JtR/src/loader.c:1004 #5 0x7a2a77 in read_file /home/fd/git/JtR/src/loader.c:226 #6 0x7a5ec3 in ldr_load_pw_file /home/fd/git/JtR/src/loader.c:1115 #7 0x798f09 in john_load /home/fd/git/JtR/src/john.c:1169 #8 0x79a731 in john_init /home/fd/git/JtR/src/john.c:1496 #9 0x79c57f in main /home/fd/git/JtR/src/john.c:1954 #10 0x7fc3fbbc8730 in __libc_start_main (/lib64/libc.so.6+0x20730) #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib64/libc.so.6+0x3a613) in __GI_____strtol_l_internal ==2752==ABORTING ``` All the others are fixed. Thanks!
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

Oops, I missed that one. Let me get it. Did you still have an issue with whirlpool? I could not get it to fail.

<!-- gh-comment-id:242782637 --> @jfoug commented on GitHub (Aug 26, 2016): Oops, I missed that one. Let me get it. Did you still have an issue with whirlpool? I could not get it to fail.
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

I have a fix for KeePass.

Whirlpool is OK now.

<!-- gh-comment-id:242782801 --> @frank-dittrich commented on GitHub (Aug 26, 2016): I have a fix for KeePass. Whirlpool is OK now.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

What method did you use to find these? Most of them are NOT new ones, but were latent waiting for proper bogus data.

<!-- gh-comment-id:242782819 --> @jfoug commented on GitHub (Aug 26, 2016): What method did you use to find these? Most of them are NOT new ones, but were latent waiting for proper bogus data.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

Ok, check in keepass

<!-- gh-comment-id:242782873 --> @jfoug commented on GitHub (Aug 26, 2016): Ok, check in keepass
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

So far my keepass fix looks like this:

diff --git a/src/keepass_fmt_plug.c b/src/keepass_fmt_plug.c
index eeeb285..3f3ed16 100644
--- a/src/keepass_fmt_plug.c
+++ b/src/keepass_fmt_plug.c
@@ -260,10 +260,14 @@ static int valid(char *ciphertext, struct fmt_main *self)
                p = strtokm(NULL, "*");
                // keyfile handling
                if (p) {
+                       if(!isdec(p))
+                               goto err;
                        res = atoi(p);
                        if (res == 1) {
                                if ((p = strtokm(NULL, "*")) == NULL)
                                        goto err;
+                               if(!isdec(p))
+                                       goto err;
                                res = atoi(p);
                                if ((p = strtokm(NULL, "*")) == NULL)
                                        goto err;
@@ -281,10 +285,14 @@ static int valid(char *ciphertext, struct fmt_main *self)
                p = strtokm(NULL, "*");
                // keyfile handling
                if (p) {
+                       if (!isdec(p))
+                               goto err;
                        res = atoi(p);
                        if (res == 1) {
                                if ((p = strtokm(NULL, "*")) == NULL)
                                        goto err;
+                               if (!isdec(p))
+                                       goto err;
                                res = atoi(p);
                                if ((p = strtokm(NULL, "*")) == NULL)
                                        goto err;

--test works, the fail_KeePass.pw doesn't contain any valid hashes.

But I think there's another error. There are 2 occurrences of

                               if (res != 64 &&  strlen(p) != 64)
                                        goto err;

and I think it should be if (res != 64 || strlen(p) != 64).

Will change and repeat my tests.
After committing the changes, I'll describe my approach to find these bugs.

<!-- gh-comment-id:242783784 --> @frank-dittrich commented on GitHub (Aug 26, 2016): So far my keepass fix looks like this: ``` diff --git a/src/keepass_fmt_plug.c b/src/keepass_fmt_plug.c index eeeb285..3f3ed16 100644 --- a/src/keepass_fmt_plug.c +++ b/src/keepass_fmt_plug.c @@ -260,10 +260,14 @@ static int valid(char *ciphertext, struct fmt_main *self) p = strtokm(NULL, "*"); // keyfile handling if (p) { + if(!isdec(p)) + goto err; res = atoi(p); if (res == 1) { if ((p = strtokm(NULL, "*")) == NULL) goto err; + if(!isdec(p)) + goto err; res = atoi(p); if ((p = strtokm(NULL, "*")) == NULL) goto err; @@ -281,10 +285,14 @@ static int valid(char *ciphertext, struct fmt_main *self) p = strtokm(NULL, "*"); // keyfile handling if (p) { + if (!isdec(p)) + goto err; res = atoi(p); if (res == 1) { if ((p = strtokm(NULL, "*")) == NULL) goto err; + if (!isdec(p)) + goto err; res = atoi(p); if ((p = strtokm(NULL, "*")) == NULL) goto err; ``` --test works, the fail_KeePass.pw doesn't contain any valid hashes. But I think there's another error. There are 2 occurrences of ``` if (res != 64 && strlen(p) != 64) goto err; ``` and I think it should be `if (res != 64 || strlen(p) != 64)`. Will change and repeat my tests. After committing the changes, I'll describe my approach to find these bugs.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

The problem with keypass is that there are no test vectors that excercise this. So I am not 100% sure about your 'fixes'.

The big problem I see, is there are the 'if' statements if (res == 1) { } where there is no else. Likely, it should fail if the if is not right, BUT we need to dig in to find out what the proper route is.

Your isdec is not safe. What if the value is 2 ?

<!-- gh-comment-id:242786890 --> @jfoug commented on GitHub (Aug 26, 2016): The problem with keypass is that there are no test vectors that excercise this. So I am not 100% sure about your 'fixes'. The big problem I see, is there are the 'if' statements if (res == 1) { } where there is no else. Likely, it should fail if the if is not right, BUT we need to dig in to find out what the proper route is. Your isdec is not safe. What if the value is 2 ?
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

The isdec is not really needed, since we test a specific value for the return. I think something like this is what is needed, BUT since I have no real test vectors, I can not say for sure:

        if (p) {
            res = atoi(p);
            if (res == 1) {
                if ((p = strtokm(NULL, "*")) == NULL)
                    goto err;
                res = atoi(p);
                if ((p = strtokm(NULL, "*")) == NULL)
                    goto err;
                if (res != 64 &&  strlen(p) != 64)
                    goto err;
            }
+           else
+                   goto err;
        }
<!-- gh-comment-id:242787396 --> @jfoug commented on GitHub (Aug 26, 2016): The isdec is not really needed, since we test a specific value for the return. I think something like this is what is needed, BUT since I have no real test vectors, I can not say for sure: ``` diff if (p) { res = atoi(p); if (res == 1) { if ((p = strtokm(NULL, "*")) == NULL) goto err; res = atoi(p); if ((p = strtokm(NULL, "*")) == NULL) goto err; if (res != 64 && strlen(p) != 64) goto err; } + else + goto err; } ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

By adding isdec() I only wanted to avoid problems caused by undefined behaviour when calling atoi() with extra large integers...

<!-- gh-comment-id:242787726 --> @frank-dittrich commented on GitHub (Aug 26, 2016): By adding isdec() I only wanted to avoid problems caused by undefined behaviour when calling atoi() with extra large integers...
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

@jfoug If you think some of my changes are wrong or not good enough, please go ahead and adjust keepass.

Now that the other ASan errors are fixed, I'll try to find new errors in those formats that failed earlier.

<!-- gh-comment-id:242788653 --> @frank-dittrich commented on GitHub (Aug 26, 2016): @jfoug If you think some of my changes are wrong or not good enough, please go ahead and adjust keepass. Now that the other ASan errors are fixed, I'll try to find new errors in those formats that failed earlier.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

This is isdec()

int isdec(const char *q)
{
    char buf[24];
    int x = atoi(q);
    sprintf(buf, "%d", x);
    return !strcmp(q,buf) && *q != '-';
}

So it still calls atoi() AND sprintf. It is a pretty costly function. When we have the pointer, call atoi() in the valid, and then test for specific values, if the data is NOT the proper integer, then all is fine. The only possible issue would be testing for 0 (or -1), that 'might' be cause for issue, where a bogus value could give us one of those.

<!-- gh-comment-id:242788840 --> @jfoug commented on GitHub (Aug 26, 2016): This is isdec() ``` c int isdec(const char *q) { char buf[24]; int x = atoi(q); sprintf(buf, "%d", x); return !strcmp(q,buf) && *q != '-'; } ``` So it still calls atoi() AND sprintf. It is a pretty costly function. When we have the pointer, call atoi() in the valid, and then test for specific values, if the data is NOT the proper integer, then all is fine. The only possible issue would be testing for 0 (or -1), that 'might' be cause for issue, where a bogus value could give us one of those.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

I still think in keepass we need to figure out what the PROPER thing to do is when those if(res==1) {} tests fail. I think that is the problem. Right now, the code just falls through, and happily returns 1.

<!-- gh-comment-id:242789110 --> @jfoug commented on GitHub (Aug 26, 2016): I still think in keepass we need to figure out what the PROPER thing to do is when those if(res==1) {} tests fail. I think that is the problem. Right now, the code just falls through, and happily returns 1.
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

New o3logon format error:

(bleeding-jumbo)run $ cat fail_o3logon.pw 
$o3logon$PASSWORD9$8CF28B36E4F3D2095729CF59510003BF$
(bleeding-jumbo)run $ ./john fail_o3logon.pw 
Using default input encoding: UTF-8
Loaded 1 password hash (o3logon, Oracle O3LOGON protocol [SHA1 DES 32/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
=================================================================
==5351==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff8098d26c at pc 0x0000006bf900 bp 0x7fff8098d180 sp 0x7fff8098d170
READ of size 4 at 0x7fff8098d26c thread T0
    #0 0x6bf8ff in ORACLE_TNS_Decrypt_Password_9i /home/fd/git/JtR/src/o3logon_fmt_plug.c:266
    #1 0x6bfbd0 in crypt_all /home/fd/git/JtR/src/o3logon_fmt_plug.c:309
    #2 0x78220a in crk_password_loop /home/fd/git/JtR/src/cracker.c:790
    #3 0x7837d5 in crk_salt_loop /home/fd/git/JtR/src/cracker.c:955
    #4 0x783b3a in crk_process_key /home/fd/git/JtR/src/cracker.c:1007
    #5 0x7db317 in do_wordlist_crack /home/fd/git/JtR/src/wordlist.c:1392
    #6 0x76ed8d in do_wordlist_pass /home/fd/git/JtR/src/batch.c:38
    #7 0x76eec4 in do_batch_crack /home/fd/git/JtR/src/batch.c:58
    #8 0x79bcc1 in john_run /home/fd/git/JtR/src/john.c:1724
    #9 0x79c6fe in main /home/fd/git/JtR/src/john.c:1967
    #10 0x7fad2c416730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8)

Address 0x7fff8098d26c is located in stack of thread T0 at offset 188 in frame
    #0 0x6bf689 in ORACLE_TNS_Decrypt_Password_9i /home/fd/git/JtR/src/o3logon_fmt_plug.c:254

  This frame has 3 object(s):
    [32, 48) 'sesskey'
    [96, 160) 'triple_des_key'
    [192, 448) 'obfuscated' <== Memory access at offset 188 underflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/fd/git/JtR/src/o3logon_fmt_plug.c:266 in ORACLE_TNS_Decrypt_Password_9i
Shadow bytes around the buggy address:
  0x1000701299f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100070129a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100070129a10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100070129a20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100070129a30: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 f4 f4 f2 f2
=>0x100070129a40: f2 f2 00 00 00 00 00 00 00 00 f2 f2 f2[f2]00 00
  0x100070129a50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100070129a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3
  0x100070129a70: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
  0x100070129a80: f1 f1 00 f4 f4 f4 f2 f2 f2 f2 00 00 00 00 00 00
  0x100070129a90: 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  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
==5351==ABORTING
<!-- gh-comment-id:242789141 --> @frank-dittrich commented on GitHub (Aug 26, 2016): New o3logon format error: ``` (bleeding-jumbo)run $ cat fail_o3logon.pw $o3logon$PASSWORD9$8CF28B36E4F3D2095729CF59510003BF$ (bleeding-jumbo)run $ ./john fail_o3logon.pw Using default input encoding: UTF-8 Loaded 1 password hash (o3logon, Oracle O3LOGON protocol [SHA1 DES 32/64]) Press 'q' or Ctrl-C to abort, almost any other key for status ================================================================= ==5351==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff8098d26c at pc 0x0000006bf900 bp 0x7fff8098d180 sp 0x7fff8098d170 READ of size 4 at 0x7fff8098d26c thread T0 #0 0x6bf8ff in ORACLE_TNS_Decrypt_Password_9i /home/fd/git/JtR/src/o3logon_fmt_plug.c:266 #1 0x6bfbd0 in crypt_all /home/fd/git/JtR/src/o3logon_fmt_plug.c:309 #2 0x78220a in crk_password_loop /home/fd/git/JtR/src/cracker.c:790 #3 0x7837d5 in crk_salt_loop /home/fd/git/JtR/src/cracker.c:955 #4 0x783b3a in crk_process_key /home/fd/git/JtR/src/cracker.c:1007 #5 0x7db317 in do_wordlist_crack /home/fd/git/JtR/src/wordlist.c:1392 #6 0x76ed8d in do_wordlist_pass /home/fd/git/JtR/src/batch.c:38 #7 0x76eec4 in do_batch_crack /home/fd/git/JtR/src/batch.c:58 #8 0x79bcc1 in john_run /home/fd/git/JtR/src/john.c:1724 #9 0x79c6fe in main /home/fd/git/JtR/src/john.c:1967 #10 0x7fad2c416730 in __libc_start_main (/lib64/libc.so.6+0x20730) #11 0x405df8 in _start (/home/fd/git/JtR/run/john+0x405df8) Address 0x7fff8098d26c is located in stack of thread T0 at offset 188 in frame #0 0x6bf689 in ORACLE_TNS_Decrypt_Password_9i /home/fd/git/JtR/src/o3logon_fmt_plug.c:254 This frame has 3 object(s): [32, 48) 'sesskey' [96, 160) 'triple_des_key' [192, 448) 'obfuscated' <== Memory access at offset 188 underflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow /home/fd/git/JtR/src/o3logon_fmt_plug.c:266 in ORACLE_TNS_Decrypt_Password_9i Shadow bytes around the buggy address: 0x1000701299f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100070129a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100070129a10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100070129a20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100070129a30: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 f4 f4 f2 f2 =>0x100070129a40: f2 f2 00 00 00 00 00 00 00 00 f2 f2 f2[f2]00 00 0x100070129a50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x100070129a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 0x100070129a70: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 0x100070129a80: f1 f1 00 f4 f4 f4 f2 f2 f2 f2 00 00 00 00 00 00 0x100070129a90: 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==5351==ABORTING ```
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

@jfoug You are right, valid() should fail for cases we don't handle. May be print a warning once per run?

<!-- gh-comment-id:242789607 --> @frank-dittrich commented on GitHub (Aug 26, 2016): @jfoug You are right, valid() should fail for cases we don't handle. May be print a warning once per run?
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

I am just going to handle the else clauses, with a failure. The only issue I have is 'could' there be some version 2, or 3 ??? But I guess we will have to handle that when we can. We really should get some better data here for the ST values. @kholia do you know of any data that we could add to the ST strings for keepass?

<!-- gh-comment-id:242790434 --> @jfoug commented on GitHub (Aug 26, 2016): I am just going to handle the else clauses, with a failure. The only issue I have is 'could' there be some version 2, or 3 ??? But I guess we will have to handle that when we can. We really should get some better data here for the ST values. @kholia do you know of any data that we could add to the ST strings for keepass?
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

Can you explain your method of finding these. Seems to hit a lot of formats. It looks like you pull fields off, but also possibly leave the delimiter trailing, etc. Looks like a damn good test.

<!-- gh-comment-id:242795752 --> @jfoug commented on GitHub (Aug 26, 2016): Can you explain your method of finding these. Seems to hit a lot of formats. It looks like you pull fields off, but also possibly leave the delimiter trailing, etc. Looks like a damn good test.
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

It looks like many of these formats are 'newer'. Probably since the last time you and others fuzzed the hell out of the formats looking for asan problems. Some of these triggered with the new hexlen?() changes, but others were simply asan overflows and even actual SEGV cores waiting for the right bogus data to trip up the validation function.

<!-- gh-comment-id:242796590 --> @jfoug commented on GitHub (Aug 26, 2016): It looks like many of these formats are 'newer'. Probably since the last time you and others fuzzed the hell out of the formats looking for asan problems. Some of these triggered with the new hexlen?() changes, but others were simply asan overflows and even actual SEGV cores waiting for the right bogus data to trip up the validation function.
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

@jfoug basically I use 2 different strategies when fuzzing john formats.

The first is based on a "primitive fuzzer for john hashes" which Alexander Cherepanov published in john-dev mailing list in April, 2013.

Openwall still has his message, but without attachments:
http://openwall.com/lists/john-dev/2013/04/29/2

The ezmlm response I got when sending a mail to john-dev-help didn't list any command to retrieve all mailing list messages of a certain date, and I didn't want to retrieve header info of tons of message, just to learn the particular message number...

gmane.org seems to be down.

But marc.info still has that message:

https://marc.info/?l=john-dev&m=136719502025109&w=2

It includes the 2 attachments, fuzzer.sh and fuzz.pl.

The idea of fuzzer.sh was to search the source code for all sample hashes and store them in a file tests.pw. (Nowadays you have ./john --list=format-tests which can be used instead.)

A second step is then to apply some "mangling" steps to the hashes collected in tests.pw and create a file fuzzed.pw.

That "mangling" is done with fuzz.pl.

My version of fuzz.pl is almost unchanged, compared to Alexander's original code.
The diff is:

40c40
< for $sep ('*', '$') {
---
> for $sep ('*', '$', '#') {

Some formats use '#' as a separator, so adding '#' helped mangling the individual substrings in such hashes.

formats.l contains the list of all formats that you want to fuzz.
If formats.l doesn't exist, fuzzer.sh creates it using ./john --list=format-details | cut -f 1.

The fuzzed.pw file is tested against each format, formats with an exit code != 0 are stored in fails.l, together with the exit code.

Finally, for each format in fails.l, fuzzer.sh then tries to create a smaller sample file which still results in the same exit code.

Ideally, you should end up with a single "hash" which causes john to fail (segfault / ASan error, whatever).
(Sometimes you end up with a hash of length >= 10000. Then I just look at the hash and try to manually reduce the length of a certain substring, so that I can post a sample hash of reasonable length.)

For complex hashes with many separators, fuzz.pl will create many lines in fuzzed.pw.

So, testing each format against a fuzzed.pw out of all test hashes doesn't make much sense.

Instead, I slightly changed fuzzer.sh to skip generating tests.pw if it exists, to skip generating fuzzed.pw if it exists, skip generating formats.l if it exists.

I also added --session=fuzz --nolog --pot=fuzz.pot.
(The original version would write into john.pot and rm john.pot after each test. Not good.)

<!-- gh-comment-id:242824924 --> @frank-dittrich commented on GitHub (Aug 26, 2016): @jfoug basically I use 2 different strategies when fuzzing john formats. The first is based on a "primitive fuzzer for john hashes" which Alexander Cherepanov published in john-dev mailing list in April, 2013. Openwall still has his message, but without attachments: http://openwall.com/lists/john-dev/2013/04/29/2 The ezmlm response I got when sending a mail to john-dev-help didn't list any command to retrieve all mailing list messages of a certain date, and I didn't want to retrieve header info of tons of message, just to learn the particular message number... gmane.org seems to be down. But marc.info still has that message: https://marc.info/?l=john-dev&m=136719502025109&w=2 It includes the 2 attachments, fuzzer.sh and fuzz.pl. The idea of fuzzer.sh was to search the source code for all sample hashes and store them in a file tests.pw. (Nowadays you have ./john --list=format-tests which can be used instead.) A second step is then to apply some "mangling" steps to the hashes collected in tests.pw and create a file fuzzed.pw. That "mangling" is done with fuzz.pl. My version of fuzz.pl is almost unchanged, compared to Alexander's original code. The diff is: ``` 40c40 < for $sep ('*', '$') { --- > for $sep ('*', '$', '#') { ``` Some formats use '#' as a separator, so adding `'#'` helped mangling the individual substrings in such hashes. formats.l contains the list of all formats that you want to fuzz. If formats.l doesn't exist, fuzzer.sh creates it using `./john --list=format-details | cut -f 1`. The fuzzed.pw file is tested against each format, formats with an exit code != 0 are stored in fails.l, together with the exit code. Finally, for each format in fails.l, fuzzer.sh then tries to create a smaller sample file which still results in the same exit code. Ideally, you should end up with a single "hash" which causes john to fail (segfault / ASan error, whatever). (Sometimes you end up with a hash of length >= 10000. Then I just look at the hash and try to manually reduce the length of a certain substring, so that I can post a sample hash of reasonable length.) For complex hashes with many separators, fuzz.pl will create many lines in fuzzed.pw. So, testing each format against a fuzzed.pw out of all test hashes doesn't make much sense. Instead, I slightly changed fuzzer.sh to skip generating tests.pw if it exists, to skip generating fuzzed.pw if it exists, skip generating formats.l if it exists. I also added --session=fuzz --nolog --pot=fuzz.pot. (The original version would write into john.pot and rm john.pot after each test. Not good.)
Author
Owner

@jfoug commented on GitHub (Aug 26, 2016):

So, do you just think these were formats that never had gotten fuzzed up to now? (other than the issues caused by the off-by-one error in hexlen?() functions)

<!-- gh-comment-id:242826206 --> @jfoug commented on GitHub (Aug 26, 2016): So, do you just think these were formats that never had gotten fuzzed up to now? (other than the issues caused by the off-by-one error in hexlen?() functions)
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

Problems with that kind of fuzzing can occur if fuzz.pl mangled an iteration count field.
Then you might have several hashes with huge iteration counts, so that ./john --max-run-time=1 will not stop, and the process will be killed by the ulimit.

The original fuzzer.sh had

(ulimit -t 10; "$dir/run/john" --max-run-time=1 --format="$format" fuzzed.pw)

That was much too short for some formats, so I increased the value.
Nevertheless, when I think a certain format just "hangs" due to high iteration count, I just kill john.

For those formats, I will start ./john --test and look at the reported cost values.

Then, I'll just repeat the exercise for those individual formats, but add a parameter --cost=-12000 to ./fuzzer.sh.
That parameter gets passed to john, so john will ignore (otherwise valid) hashes with unreasonably high iteration counts...

So, this is the command I run in the end:

$ for f in `./john --list=format-details |cut -f 1 |tac`; do echo $f; echo $f > formats.l; rm fails.l; rm fuzzed.pw 2> /dev/null; ./john --list=format-tests --format=$f|cut -f 3 |LC_ALL=C sort -u > tests.pw; ./fuzzer.sh  ; done
Warning: SAP-B format should never be UTF-8.
Use --target-encoding=iso-8859-1 or whatever is applicable.
crypt
tests.pw already exists
5 tests.pw
Fuzzing hashes...
174 fuzzed.pw
formats.l already exists
1 formats.l
Running fuzzed hashes through john...
>> john: crypt
1 crypt
Minimizing samples for failed formats..
>> Minimizing: crypt for HUP (1 - 1)
Failed to minimize (got 0 instead of 1).
dummy
tests.pw already exists
5 tests.pw
Fuzzing hashes...
196 fuzzed.pw
formats.l already exists
1 formats.l
Running fuzzed hashes through john...
>> john: dummy
1 dummy
Minimizing samples for failed formats..
>> Minimizing: dummy for HUP (1 - 1)
Failed to minimize (got 0 instead of 1).
NT-old
tests.pw already exists
43 tests.pw
Fuzzing hashes...
1972 fuzzed.pw
formats.l already exists
1 formats.l
Running fuzzed hashes through john...
>> john: NT-old
1 NT-old
Minimizing samples for failed formats..
>> Minimizing: NT-old for HUP (1 - 1)
^C986 ^C
493 ^C^C
247 ^C
124 ^C
62 ^C
31 ^C
16 .0^C
8 .0^C
4 .0.0.0.0.0^C

The last lines indicate tests which I interrupted.
Minimizing samples for failed formats will look somewhat similar.

<!-- gh-comment-id:242827222 --> @frank-dittrich commented on GitHub (Aug 26, 2016): Problems with that kind of fuzzing can occur if fuzz.pl mangled an iteration count field. Then you might have several hashes with huge iteration counts, so that ./john --max-run-time=1 will not stop, and the process will be killed by the ulimit. The original fuzzer.sh had ``` (ulimit -t 10; "$dir/run/john" --max-run-time=1 --format="$format" fuzzed.pw) ``` That was much too short for some formats, so I increased the value. Nevertheless, when I think a certain format just "hangs" due to high iteration count, I just kill john. For those formats, I will start `./john --test` and look at the reported cost values. Then, I'll just repeat the exercise for those individual formats, but add a parameter --cost=-12000 to ./fuzzer.sh. That parameter gets passed to john, so john will ignore (otherwise valid) hashes with unreasonably high iteration counts... So, this is the command I run in the end: ``` $ for f in `./john --list=format-details |cut -f 1 |tac`; do echo $f; echo $f > formats.l; rm fails.l; rm fuzzed.pw 2> /dev/null; ./john --list=format-tests --format=$f|cut -f 3 |LC_ALL=C sort -u > tests.pw; ./fuzzer.sh ; done Warning: SAP-B format should never be UTF-8. Use --target-encoding=iso-8859-1 or whatever is applicable. crypt tests.pw already exists 5 tests.pw Fuzzing hashes... 174 fuzzed.pw formats.l already exists 1 formats.l Running fuzzed hashes through john... >> john: crypt 1 crypt Minimizing samples for failed formats.. >> Minimizing: crypt for HUP (1 - 1) Failed to minimize (got 0 instead of 1). dummy tests.pw already exists 5 tests.pw Fuzzing hashes... 196 fuzzed.pw formats.l already exists 1 formats.l Running fuzzed hashes through john... >> john: dummy 1 dummy Minimizing samples for failed formats.. >> Minimizing: dummy for HUP (1 - 1) Failed to minimize (got 0 instead of 1). NT-old tests.pw already exists 43 tests.pw Fuzzing hashes... 1972 fuzzed.pw formats.l already exists 1 formats.l Running fuzzed hashes through john... >> john: NT-old 1 NT-old Minimizing samples for failed formats.. >> Minimizing: NT-old for HUP (1 - 1) ^C986 ^C 493 ^C^C 247 ^C 124 ^C 62 ^C 31 ^C 16 .0^C 8 .0^C 4 .0.0.0.0.0^C ``` The last lines indicate tests which I interrupted. Minimizing samples for failed formats will look somewhat similar.
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

The other approach I used in the past was american fuzzy lop https://github.com/mirrorer/afl

To find problems, you have to use an ASan build, even though afl doesn't recommend it.
(May be it would be better to test 32bit ASan builds, even on 64bit systems.)

To improve performance, I copy all the needed stuff into a tmpfs mounted on /run/user/1000, use --skip-self-tests and --nolog etc.

The files which afl generates often contain non-printable characters, so they have to be converted to base64 when creating a new issue on github.

afl could probably also be used to test some of the john symlinks.

<!-- gh-comment-id:242829061 --> @frank-dittrich commented on GitHub (Aug 26, 2016): The other approach I used in the past was american fuzzy lop https://github.com/mirrorer/afl To find problems, you have to use an ASan build, even though afl doesn't recommend it. (May be it would be better to test 32bit ASan builds, even on 64bit systems.) To improve performance, I copy all the needed stuff into a tmpfs mounted on /run/user/1000, use --skip-self-tests and --nolog etc. The files which afl generates often contain non-printable characters, so they have to be converted to base64 when creating a new issue on github. afl could probably also be used to test some of the john symlinks.
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

So, do you just think these were formats that never had gotten fuzzed up to now? (other than the issues caused by the off-by-one error in hexlen?() functions)

Yes, I think that most of the formats which had errors were relatively new (committed after the last systematic fuzzing) or were affected by some (buggy) core changes.

The original Raw-SHA1-AxCrypt format was moved to unused in January, 2016, because rawSHA1_fmt_plug.c was changed to support that format as well.

whirlpool is from 2013, not sure why there were new errors. (At least some of them don't appear to be related to the hexlen() changes.)

Salted-SHA1 is even older. Not sure what broke this format recently. I am sure I must have fuzzed this one in the past.

o3logon and nsec3 are new.

krb5_tgs_fmt_plug.c is from September, 2015. The last systematic fuzzing could have been earlier.

keepass_fmt_plug.c os older. hexlen() changes caused problems, but may be last time I didn't ignore the huge iteration counts using the --cost= option, and simply gave up fuzzing this format.

HMAC-MD5 is older, but had recent changes (SOURCE_HASH).

PEM is from October, 2015, and also had recent changes (SOURCE_BIN).

<!-- gh-comment-id:242834485 --> @frank-dittrich commented on GitHub (Aug 26, 2016): > So, do you just think these were formats that never had gotten fuzzed up to now? (other than the issues caused by the off-by-one error in hexlen?() functions) Yes, I think that most of the formats which had errors were relatively new (committed after the last systematic fuzzing) or were affected by some (buggy) core changes. The original Raw-SHA1-AxCrypt format was moved to unused in January, 2016, because rawSHA1_fmt_plug.c was changed to support that format as well. whirlpool is from 2013, not sure why there were new errors. (At least some of them don't appear to be related to the hexlen() changes.) Salted-SHA1 is even older. Not sure what broke this format recently. I am sure I must have fuzzed this one in the past. o3logon and nsec3 are new. krb5_tgs_fmt_plug.c is from September, 2015. The last systematic fuzzing could have been earlier. keepass_fmt_plug.c os older. hexlen() changes caused problems, but may be last time I didn't ignore the huge iteration counts using the --cost= option, and simply gave up fuzzing this format. HMAC-MD5 is older, but had recent changes ($SOURCE_HASH$). PEM is from October, 2015, and also had recent changes ($SOURCE_BIN$).
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

@jfoug regarding the fuzzing, you asked more or less the same question in 2014:
https://github.com/magnumripper/JohnTheRipper/issues/894#issuecomment-66991582

And I answered it here:
https://github.com/magnumripper/JohnTheRipper/issues/894#issuecomment-66993517

<!-- gh-comment-id:242838704 --> @frank-dittrich commented on GitHub (Aug 26, 2016): @jfoug regarding the fuzzing, you asked more or less the same question in 2014: https://github.com/magnumripper/JohnTheRipper/issues/894#issuecomment-66991582 And I answered it here: https://github.com/magnumripper/JohnTheRipper/issues/894#issuecomment-66993517
Author
Owner

@frank-dittrich commented on GitHub (Aug 26, 2016):

@jfoug BTW I only tested CPU formats. So may be similar tests are needed for GPU formats.
Not sure when I'll find the time to do this.

<!-- gh-comment-id:242840703 --> @frank-dittrich commented on GitHub (Aug 26, 2016): @jfoug BTW I only tested CPU formats. So may be similar tests are needed for GPU formats. Not sure when I'll find the time to do this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1495
No description provided.