43 Commits

Author SHA1 Message Date
rofl0r
99f5271908 reaver: make -Z an alias for -K
the previous -K option automatically used the PIN found by pixie,
and tried to use it to retrieve the WPA key from the router.
there was a specific flag -Z to be used together with -K to suppress
this behaviour.
since this feature is currently not implemented, we just alias -Z to
-K for the time being.
2017-06-20 22:59:36 +01:00
rofl0r
7cd2298e29 disable a few more annoying warnings 2017-06-20 21:36:09 +01:00
rofl0r
d45603cac4 common.h: silence warning about redefinition of __bitwise 2017-06-20 21:36:02 +01:00
rofl0r
a6ac0dedba libwps.c: fix OOB read found by GCC
libwps/libwps.c: In function 'parse_wps_tag':
libwps/libwps.c:89:65: warning: iteration 16 invokes undefined behavior [-Waggressive-loop-optimizations]
    el = get_wps_data_element(wps_ie_data, wps_data_len, elements[i], &el_len);
                                                         ~~~~~~~~^~~
libwps/libwps.c:86:3: note: within this loop
2017-06-20 21:23:44 +01:00
rofl0r
f78f896ad9 preliminary support for pixiedust attack
the values for the attack are taken from where the original t6x
change had them, but everything else is heavily refactored and
should be easy to trace back and improve to use different means
of executing the attack (i.e. use the pixiewps code directly rather
than starting it as an external command).
2017-03-31 00:26:03 +01:00
rofl0r
01cec27597 configure: regenerate with autoconf 2.69 2017-01-20 03:14:06 +00:00
rofl0r
1fd59a4c59 make bssid signed to mute warnings 2017-01-20 02:48:43 +00:00
rofl0r
46ccf2e268 remove usage of sqlite db
the following changes were merged into one

- remove get_db_ssid()

this seems to be one of the 2 only functions left that actually use
the sqlite db. it was used as a convenience function to look up
the ssid from the database when it was not found in a beacon.

- remove "auto-detect settings" feature

the purpose of this feature was to save the settings used for
attacking a specific AP, but i suppose it was almost universally
unused in the past because
1) most APs lock you out for an eternity after 3 wrong tries
2) those that don't you'll probably crack anyway with your first run.
3) most ppl are used to a workflow that add all the required command
   line arguments anyway
4) all automated tools add all the required command line arguments
   anyway.

so this is basically an almost-always unused lazy-ass switch that's
unheard of in most other programs, and as the only remaining feature
depending on sqlite, requiring sqlite installed just for this feature
is a heavy price to pay.

- remove unused function update_history

there's no functionality anymore that uses sql, so we dont need to
update the db anymore either.

- remove unused function get() from sql.c
2017-01-20 02:39:17 +00:00
rofl0r
62feac0367 make configuration_directory_exists() static
it's only used in session.c, so making it static allows the compiler to
inline it, or drop it entirely if it's unused.
while we're at it, simplify the code.
2017-01-20 02:24:27 +00:00
rofl0r
a3b840ec28 add a new configure switch --enable-savetocurrent for session saving
traditionally reaver saved session files (*.wpc) into a global directory
in /etc, which has disadvantages for some users (especially embedded ones).
for them it is better if reaver saves its files into the current directory.
we now make it possible for them to enable this behavior by specifying
--enable-savetocurrent when they build reaver.
this new flag is not enabled by default, so in a standard scenario reaver
will still use the old behavior.

while at it, we simplified the surrounding code a bit (merged duplicate code
into a single function, removed dynamic allocation and surrounding boilerplate).
2017-01-20 02:21:51 +00:00
Paul Fertser
6f25bb3a0c Use the current directory for storing and loading sessions
This allows the user to always explicitely choose (by changing the
current directory before launching the program) where the session
files should go. Useful e.g. to avoid hogging the precious space on
embedded devices, just cd /tmp before starting the app.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2017-01-20 02:15:12 +00:00
rofl0r
31cd6da1c4 remove wash -C flag due to popular demand and default to ignore FCS errors
we now default to ignoring FCS errors, so there's no need anymore toa
set it explicitly.
the rationale for defaulting to ignoring FCS is that this is required
for compatibilty with ralink USB chips as pointed out by @kcdtv.
the maintainers did not deem it necessary to keep it as a no-op flag
for backwards compatibility, so let's just remove it.
2017-01-20 02:09:00 +00:00
rofl0r
0acc8f3aa2 wash: remove craig's email address from header to fit into 80 chars
for someone interested, the email can still be found in documents,
source code copyright headers, and other means.
2017-01-20 01:58:09 +00:00
rofl0r
e4bbf7d93d wash: fit output into 80-char wide terminal
the standard unix terminal is 80 characters wide (for example when you
open a new xterm, it will be 80 chars).
wash was very wasteful in its usage and wrapped the output of the header around,
and all ESSIDs that were longer than about 10 chars would be displayed in the
next line. fix it by making the words in the header columns slimmer and
shrinking the whitespace between the columns.
2017-01-20 01:58:09 +00:00
rofl0r
8a5139f268 session: remove bogus typecasts 2017-01-20 01:58:09 +00:00
rofl0r
c54c66d5da misc.c: fix mac2str() usage with zero delim
when mac2str() was used with 0 as delim, the intended effect was to
use no delimiter at all, instead of (as i assumed) to literally write
a zero byte into the stream.
2017-01-20 01:58:09 +00:00
rofl0r
498d4b7ff1 misc.c: replace mac2str() code
code was inefficient, ugly, and buggy (pointer to pointer where pointer is
required, warning was muted with a typecast).

TODO: fix all callers to provide an output buffer on the stack, so we can
avoid allocating heap mem.
2017-01-20 01:58:09 +00:00
rofl0r
2bf4106fc0 libwps.c: rewrite hex2str()
the original code was horrible *and* wrong, so replace it with a
correct version (hint: if you need a typecast to mute warnings you're
probably having a bug there).
2017-01-20 01:58:08 +00:00
rofl0r
8ce4bcef28 globule.c: remove bogus typecasts 2017-01-20 01:58:08 +00:00
rofl0r
2893408944 configure[.ac]:get rid of -ldl
linking to libdl is only needed when you dlsym and dlopen tricks,
and reaver doesn't.
since FreeBSD doesn't have a libdl, this caused a compile error there.
2017-01-20 01:58:08 +00:00
rofl0r
30cdacbff1 clean up lwe's use of linux kernel headers
linux headers tend to be very broken for usage in userspace,
especially when they're using linux/types.h.
clean up the mess by using stdint.h types.
this may be sufficient that the code can be compiled on *BSD.
2017-01-20 01:58:08 +00:00
rofl0r
99be0de798 wash laundry without sql
the sqlite dependency was a thorn in my eye since the beginning,
since sqlite is in fact a quite bloated library[0] (despite its name).
especially wash depending on it IMO doesn't make sense at all; all
the information it needs to gather is much better kept in RAM temporarily
and abandoned after quitting.
also my computer's HDD LED used to blink like wild when doing a wash scan
since it wrote into the db for every freaking beacon on the wire.
checking out reaver's db with the sqlite3 command line utility revealed
that there is no info of any importance whatsoever stored in it, not even
WPS manufacturer information, PLUS it is highly unlikely that anyone will
ever look into that DB (except maybe the feds after confiscating your computer).

[0] https://devsonacid.wordpress.com/2013/09/25/sqlites-anal-gamation/
2017-01-20 01:58:08 +00:00
rofl0r
7dbc116865 str2mac: essid parameter needs to be char*
the essid is an ascii string so unsigned char doesnt make sense -
and it was only used in 2 places with an ugly typecast since the
input string was a char* anyway.
2017-01-20 01:58:08 +00:00
rofl0r
f980078837 Makefile: properly document deps
previously the objects in wps and libwps were built with an indepent
Makefile, so the top-level Makefile was unaware of any dependencies.
also the object files for wash and reaver were just passed as a glob directly
to the compiler invocation, circumventing the make dependency graph.

advantages of the new approach:
- wash and reaver can be build independently (for example `make wash`)
using only the object files that are actually used.
- objects of wps and libwps subdirs are now built with the same set of CFLAGS
 etc than those in the TLD.
- dependencies are tracked in a fine-grained fashion, so if you change a .c
file and run make, that file will actually get recompiled.
previously you had to manually remove that C files' object file.
- eventually higher build speeds at parallel compilation levels (for example
 make -j4) since make now has better knowledge about deps.
2017-01-20 01:58:08 +00:00
rofl0r
205891362b do not warn about unused funcs 2017-01-20 01:58:08 +00:00
rofl0r
8d89451439 wps.h: ssid is actually a string
so using unsigned char makes no sense there - fixes some warnings.
2017-01-20 01:58:08 +00:00
rofl0r
ab24a33c5a iwlib.h: remove inline directive for iw_get_ext/iw_set_ext
these caused a warning on newer compilers that inlining doesn't make
sense there.
2017-01-20 01:58:08 +00:00
rofl0r
e12c2e61ae md5-internal.c: fix bogus memset
the author's intention was to overwrite the entire md5 context
for security purposes to avoid information leaks; however it overwrote
only the first sizeof(void*) chars.
fixes a warning by newer compilers.
2017-01-20 01:58:08 +00:00
rofl0r
225e0f3a42 wash: new feature --all (shows all aps)
wash is a pretty nice scanner for WLANs, so it's nice if it can be
used to show all APs, not just those with WPS on.
2017-01-20 01:58:08 +00:00
rofl0r
4cd204bb80 crypto: build with -fno-strict-aliasing
this warning here

md5-internal.c:186:5: warning:
dereferencing type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]

is serious UB and as such may lead to all kinds of evil compiler behaviour.
fix it by sacrificing a little bit of performance and disabling the
strict aliasing optimization.
2017-01-20 01:58:08 +00:00
rofl0r
8ad1cbec28 wps_registrar.c: fix UB passing size_t to variadic func expecting int 2017-01-20 01:58:08 +00:00
rofl0r
136259ccb4 wps_dev_attr.c: add missing include for mac2str 2017-01-20 00:09:06 +00:00
rofl0r
d5e38f2cde wps/Makefile: add -Wall
the build system is completely bogus; all of the subdirs are
compiled with their own (or in this case, no) CFLAGS.
as a quick workaround add -Wall, so we can at least find obvious
errors.
2017-01-20 00:08:09 +00:00
Paul Fertser
e671b44cbd wpscrack: big-endian fixes
This should fix access to the radiotap, 802.11, LLC/SNAP and WFA
headers' fields. Run-time tested on an ar71xx BE system.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2017-01-19 23:51:15 +00:00
rofl0r
8977bdf66e Makefile: support DESTDIR 2017-01-19 23:38:57 +00:00
cheffner@tacnetsol.com
284eaadc1b Fixed probe request bug in wash.
git-svn-id: http://reaver-wps.googlecode.com/svn/trunk@113 027a3e96-2d37-f1c0-85d6-5ce5a08386c2
2017-01-19 23:32:45 +00:00
xhe
01a86e45fb fix-memory-corruption(#88) 2017-01-19 23:26:46 +00:00
rofl0r
d559537b70 libwps.h: fix build error due to usage of u_char
libwps.h:50:1: error: unknown type name 'u_char'
2017-01-19 23:21:51 +00:00
rofl0r
994ae46282 add .gitignore 2017-01-19 23:19:33 +00:00
rofl0r
3b347ca014 Revert "import changes from t6x first commit vs vanilla reaver 1.4"
This reverts commit a095561f66b72899e51199a01097999cafeac7c6.

This brings us back to vanilla reaver 1.4, but with t6x' work properly
documented in the commit history.
2017-01-19 23:13:40 +00:00
rofl0r
a095561f66 import changes from t6x first commit vs vanilla reaver 1.4
whitespace changes have been omitted. unfortunately, the entire source
code of reaver is completely inconsistent in its usage of whitespace.
some parts are indented with tabs, others with spaces.
t6x' first commit was similarly inconsistent, and it changed *a lot*
of whitespace. would i have imported the whitespace changes as well,
it would be very hard to see what has changed, without usage of tools.

as the patch is very intrusive and added a number of bugs (for example
breaks option -g as found here:
https://github.com/t6x/reaver-wps-fork-t6x/issues/50#issuecomment-273802361 )
we add this commit only for documentary purposes and will revert it in
the follow-up commit, with the intention to study the changes and
forward-port only the necessary changes to implement the pixiedust
attack, and leave the bugs behind.
2017-01-19 23:09:58 +00:00
rofl0r
de276e88c4 rollback to vanilla reaver 1.4
the repo in this state is now 100% identical to reaver 1.4 tarball
http://reaver-wps.googlecode.com/files/reaver-1.4.tar.gz
with sha512sum 59f2d6f8aa6228988ce5d1c102d9a48b2a23e582ff3d9afe39d7c9717b7e4be059362fdd21a3e5f5d59948df1a7616acdaa6df20f139e9c5aa9bd673f764dfbc
2017-01-19 22:53:49 +00:00
root
f52c553bbf First commit 2015-04-11 12:44:09 -04:00