phantbn / reaver-wps

Automatically exported from code.google.com/p/reaver-wps
0 stars 0 forks source link

SEGV when invoking --help #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

---
./reaver --help

Reaver v1.0 WiFi Protected Setup Attack Tool
Copyright (c) 2011, Tactical Network Solutions, Craig Heffner 
<cheffner@tacnetso                                                              
               l.com>

Segmentation fault

---

want me to recompile with symbols and run it with gdb ?

Original issue reported on code.google.com by slawek.r...@gmail.com on 29 Dec 2011 at 7:06

GoogleCodeExporter commented 9 years ago
It crashes for other (all?) valid long options. For example:

./reaver --interface mon0

Reaver v1.0 WiFi Protected Setup Attack Tool
Copyright (c) 2011, Tactical Network Solutions, Craig Heffner 
<cheffner@tacnetsol.com>

Segmentation fault

It seems to crash in libc. This is the trace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7615734 in __strncmp_sse2 () from /lib/libc.so.6
(gdb) backtrace
#0  0x00007ffff7615734 in __strncmp_sse2 () from /lib/libc.so.6
#1  0x00007ffff7655261 in _getopt_internal_r () from /lib/libc.so.6
#2  0x00007ffff7655f4b in _getopt_internal () from /lib/libc.so.6
#3  0x00007ffff7655fd3 in getopt_long () from /lib/libc.so.6
#4  0x0000000000403b8e in process_arguments (argc=2, argv=0x7fffffffe868) at 
argsparser.c:53
#5  0x00000000004026eb in main (argc=2, argv=0x7fffffffe868) at wpscrack.c:33

Original comment by cos...@linux-geek.org on 29 Dec 2011 at 8:54

GoogleCodeExporter commented 9 years ago
I don't have any issues with long options in Ubuntu 10.04. Can you give more 
info on what Linux distros/kernels you are running and your GCC versions? If 
it's an issue with libc there's not much I can do there, but I would be 
surprised if libc segfaults on all long options...

Original comment by cheff...@tacnetsol.com on 29 Dec 2011 at 10:54

GoogleCodeExporter commented 9 years ago
gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: 
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/gcc-4.5.3/configure --prefix=/usr 
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3 
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include 
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3 
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/man 
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/info 
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4 
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec 
--disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls 
--without-included-gettext --with-system-zlib --disable-werror 
--enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp 
--enable-esp --enable-libgomp 
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/python 
--enable-checking=release --disable-libgcj --enable-languages=c,c++ 
--enable-shared --enable-threads=posix --enable-__cxa_atexit 
--enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ 
--with-pkgversion='Gentoo Hardened 4.5.3-r1 p1.0, pie-0.4.5'
Thread model: posix
gcc version 4.5.3 (Gentoo Hardened 4.5.3-r1 p1.0, pie-0.4.5)
hiv ~ # uname -r
3.0.0-kvmguest

Gentoo GNU/Linux 3.0 (KVM guest) x64

maybe this depends on arch ? x86/x64 

Original comment by slawek.r...@gmail.com on 29 Dec 2011 at 11:38

GoogleCodeExporter commented 9 years ago
I'm using:
* Arch Linux
* kernel Linux 3.1.5-1-ARCH #1 SMP PREEMPT x86_64
* gcc version 4.6.2 20111125 (prerelease) (GCC) 

Original comment by cos...@linux-geek.org on 29 Dec 2011 at 11:41

GoogleCodeExporter commented 9 years ago
Found something. It works ok if argsparser.c is compiled without 
'-fpack-struct'.

Original comment by cos...@linux-geek.org on 29 Dec 2011 at 11:44

GoogleCodeExporter commented 9 years ago
Thanks cosmin, I should have suspected this; ran in to something similar a 
while ago. I just checked in an updated Makefile and configure script that 
remove -fpack-struct from argsparser.c.

Original comment by cheff...@tacnetsol.com on 29 Dec 2011 at 1:09