glv2 / bruteforce-salted-openssl

Try to find the password of a file that was encrypted with the 'openssl' command.
Other
211 stars 54 forks source link

Segfault on "-v" reporting option, version 1.4.0 #8

Closed RayOfLight1 closed 7 years ago

RayOfLight1 commented 7 years ago

From multiple tries trying to execute it:

[ 3180.271576] bruteforce-salt[27835]: segfault at 30 ip 00007f8276b99cb1 sp 00007ffe6604c810 error 4 in libc-2.23.so[7f8276aeb000+18f000]
[ 3207.350588] bruteforce-salt[9422]: segfault at 30 ip 00007f32a9b14cb1 sp 00007ffc8bbe5590 error 4 in libc-2.23.so[7f32a9a66000+18f000]
[ 3269.301142] bruteforce-salt[29315]: segfault at 30 ip 00007f30edec8cb1 sp 00007ffe8cd8f3d0 error 4 in libc-2.23.so[7f30ede1a000+18f000]
[ 3277.950932] bruteforce-salt[8141]: segfault at 30 ip 00007fe6e5d1bcb1 sp 00007ffc0e97b890 error 4 in libc-2.23.so[7fe6e5c6d000+18f000]
[ 3289.636518] bruteforce-salt[17753]: segfault at 30 ip 00007f115dec4cb1 sp 00007ffe476db790 error 4 in libc-2.23.so[7f115de16000+18f000]
[ 3315.260163] bruteforce-salt[12651]: segfault at 30 ip 00007fb547fd0cb1 sp 00007ffc2ca150d0 error 4 in libc-2.23.so[7fb547f22000+18f000]
[ 3334.709804] bruteforce-salt[18591]: segfault at 30 ip 00007f0ffbd90cb1 sp 00007ffd70c194d0 error 4 in libc-2.23.so[7f0ffbce2000+18f000]
[ 3343.803518] bruteforce-salt[18769]: segfault at 30 ip 00007ffb24a69cb1 sp 00007fff6d9b6050 error 4 in libc-2.23.so[7ffb249bb000+18f000]
[ 3354.690838] bruteforce-salt[18970]: segfault at 30 ip 00007f5e5e755cb1 sp 00007ffd7fed1b90 error 4 in libc-2.23.so[7f5e5e6a7000+18f000]
[ 3387.785988] bruteforce-salt[19423]: segfault at 30 ip 00007fd0fe5c0cb1 sp 00007fff6fea78d0 error 4 in libc-2.23.so[7fd0fe512000+18f000]
[ 3692.947123] bruteforce-salt[23474]: segfault at 30 ip 00007f0e3a867cb1 sp 00007fffa856ebe0 error 4 in libc-2.23.so[7f0e3a7b9000+18f000]

I have eventually made it work without the -v option, I'm on amd64 btw.

RayOfLight1 commented 7 years ago

after reading further, sending an USR1 produces the same problem :(

glv2 commented 7 years ago

Could you try running it in gdb and get the stack trace with bt after the segfault error occurs? It should help determining where the error comes from.

RayOfLight1 commented 7 years ago

I haven't used gdb for a while, so bear with me:

Single stepping until exit from function pthread_join,
which has no line number information.

Thread 1 "bruteforce-salt" received signal SIGSEGV, Segmentation fault.
0x00007feaee60ccb1 in ?? () from /lib64/libc.so.6
(gdb) where
#0  0x00007feaee60ccb1 in ?? () from /lib64/libc.so.6
#1  0x00007feaee60ec76 in strftime_l () from /lib64/libc.so.6
#2  0x0000000000402bed in handle_signal ()
#3  \<signal handler called>
#4  0x00007feaeec0260b in pthread_join () from /lib64/libpthread.so.0
#5  0x0000000000402012 in main ()

the code for the -v seems quite simple, the "strftime_l()" looks like the biggest clue.

glv2 commented 7 years ago

I added checks for time functions (commit 932616e0e71623ac8f628411346cac8dd3bb3b33). Could you compile the current master branch on your machine and see if the error still occurs?

RayOfLight1 commented 7 years ago

I've tried with -v 1 and with SIGUSR1 and works perfectly, I'm off to see what magic you've done! :)