Commit Graph

314 Commits

Author SHA1 Message Date
rofl0r ad43c22c0c argsparser: group non-option args together 2017-12-15 17:37:44 +00:00
rofl0r 40d3cb6666 reaver: activate -n behaviour by default and obsolete the switch
most APs are conforming to the standard and send a NACK as expected
when the pin is wrong, but reaver defaulted to assuming the opposite.
this could cause reaver to wrongly assume a correct pin is incorrect
in non-optimal network conditions.

the old default behaviour to treat a timeout as NACK can be accessed
using the new -J / --timeout-is-nack switch.

closes #122
2017-12-15 17:25:08 +00:00
rofl0r d3516833de do_wps_exchange: reorder code for unknown packets for debugging
having the switch only dealing with non-UNKNOWN packets makes it possible
to set a breakpoint on it without dealing with non-interesting stuff.
also cleaning up some whitespace mess.
2017-12-12 20:13:52 +00:00
rofl0r 59d097a327 add support for QoS data packets
some APs, after having 802.11n HT caps replayed in the association,
embed the EAP frames inside QoS data packets, rather than ordinary
data packets. this fixes an issue introduced with
c7652bae8d .
2017-12-12 19:12:44 +00:00
rofl0r eef2e6c07e process_packet(): fine-tune is_packet_for_us()
it slipped my attention during previous refactoring that is_packet_for_us
actually checked 2 things: whether its a valid data packet and whether
its for us. split it into 2 funcs.
2017-12-12 17:43:48 +00:00
rofl0r f2df799ad9 process_packet(): remove last indent level 2017-12-12 17:24:18 +00:00
rofl0r 817eba4a91 process_packet(): another indent level removed 2017-12-12 17:20:26 +00:00
rofl0r e694ae9545 process_packet(): and yet another indent level removed 2017-12-12 17:16:38 +00:00
rofl0r 6e71d784e1 process_packet(): and yet another indent level 2017-12-12 17:12:54 +00:00
rofl0r b5f8907e80 process_packet(): remove yet another indent level 2017-12-12 17:08:12 +00:00
rofl0r b88c089c17 process_packet(): remove another indent level 2017-12-12 17:05:23 +00:00
rofl0r e12645b1ac process_packet(): remove one indent level 2017-12-12 16:55:04 +00:00
rofl0r c7652bae8d association: replay AP 802.11n HT capabilities
some overly pedantic APs require association requests to have
a wireless N "HT capabilities" tag.

json data of one affected model follows:
"wps_manufacturer" : "TP-LINK",
"wps_model_name" : "TL-WR1043ND",
"wps_model_number" : "1.0",
"wps_device_name" : "Wireless Router TL-WR1043ND",
"wps_serial" : "1.0"

as reported in #175.

in preliminary tests no regressions with other routers have been
found, but it may turn out that this change breaks compatibility
to some other models and may need more in-depth study of the subject
and some adjustements.
2017-12-09 22:55:33 +00:00
rofl0r 05706c3d62 add possibility to send broadcast probe request
not used yet
2017-12-06 23:08:01 +00:00
rofl0r 321cf81092 debug mode: print when we send packets 2017-12-06 23:05:52 +00:00
rofl0r 09c7e684d4 association: remove B bit from supported tags
this seems to be what wpa_supplicant does, too.
2017-12-06 22:18:58 +00:00
rofl0r 9a6084ad94 associate(): remove bogus casts 2017-12-05 20:53:00 +00:00
rofl0r 7d4153bb83 fix pcap_activate() regression
introduced in bdd420d7fe

some embedded linux devices are not compatible to rfmon setting.

also improve error messages.
2017-12-04 01:20:22 +00:00
rofl0r a571beacb9 parse_wps_tag: exit on bad data rather than invoking UB 2017-12-03 22:27:48 +00:00
rofl0r fef935386f factor out cprintf.h 2017-12-03 22:26:55 +00:00
rofl0r 1381ee2d9b re-enable FCS validation
FCS was disabled in 31cd6da1c4
due to wrong premise that it's not needed, when in fact it was just
too annoying having the terminal spammed with error messages using
a RALINK chipset.

now i turned off the terminal message, but turned the validation back
on. i implemented a new FCS check based on the field in the radiotap
header, as @alex-chan did when he submitted his OS X support patch,
however in a clean fashion, and used for any OS.

the reason this is needed on OSX is that they have very poor drivers
that sometimes submit only half packets, but with the BAD_FCS flag
set, which caused memory corruption and segfaults.

i assume the bad fcs check doesnt kick in now nearly as often as it
did when we disabled the check.
2017-12-03 22:10:48 +00:00
rofl0r 164672f689 update outdated parts of radiotap.h with kernel 4.9.13's version
the version in wpa_supplicant was too old for our purposes.
2017-12-03 22:00:10 +00:00
rofl0r 7045de8fc1 switch RSSI code to use my own radiotap_flags.h
the code was developed for macgeiger[0] and allows comfortable lookup
of all the radiotap fields.
since i plan to use more of them soon, i want a generic solution rather
than reinventing the wheel on every spot.

[0] https://github.com/rofl0r/macgeiger
2017-12-03 21:22:11 +00:00
rofl0r dd8d72c4cc radiotap.h: update to wpa_supplicant 2.5 2017-12-03 19:19:15 +00:00
alex-chan 3da3223705 capture_init(): re-add hackjob APPLE code
as originally submitted in 7c6c67b445
2017-12-03 19:07:09 +00:00
alex-chan 1848d714fe change_channel(): re-add apple hackjob code
as originally submitted in 7c6c67b445
2017-12-03 16:30:15 +00:00
rofl0r 67134f5662 configure: add -Werror-unknown-warning-option
this is needed so the other warning flags we test raise an error and
we can detect whether they're supported.
2017-12-03 16:11:43 +00:00
rofl0r bdd420d7fe MAC COMPAT: use pcap_next_ex and pcap_create for capture interface
based on the original patch 7c6c67b445
from alex-chan.

without using this method, mac user get:
error: failed to compile packet filter

since this code works too on other platforms, there's no reason to put
it under ugly #ifdef APPLE's as the original patch did.
2017-12-03 16:07:32 +00:00
alex-chan 6553632be6 replace read_iface_mac for apple with version from reaver 1.5.3
original commit to reaver 7c6c67b445

source:https://docs.google.com/file/d/0B3tHnfnS08GyVUNSNFl5bHdEN1k/edit

the one i've copied from the internets was buggy and caused a crash...
2017-12-03 14:52:54 +00:00
rofl0r ffc0957d30 use -Wno-unused-but-set-variable only if compiler knows it
since APPLE's clang warns about it on every file.
2017-12-03 14:22:53 +00:00
rofl0r 98c162d198 session.c: fix bogus compare
found by clang:
session.c:288:35: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                                        if(!essid || strlen(essid) < 0)
                                                                     ~~~~~~~~~~~~~ ^ ~
2017-12-03 14:10:22 +00:00
rofl0r 30ff372c09 fix warning when compiling with clang
lwe/iwlib.c:387:8: warning: explicitly assigning value of variable of type 'char **' to itself [-Wself-assign]
  args = args; count = count;
  ~~~~ ^ ~~~~
lwe/iwlib.c:387:22: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign]
  args = args; count = count;
               ~~~~~ ^ ~~~~~
lwe/iwlib.c:1558:9: warning: explicitly assigning value of variable of type 'const char *' to itself [-Wself-assign]
  input = input; key = key;
  ~~~~~ ^ ~~~~~
lwe/iwlib.c:1558:22: warning: explicitly assigning value of variable of type 'unsigned char *' to itself [-Wself-assign]
  input = input; key = key;
                 ~~~ ^ ~~~
2017-12-03 14:00:25 +00:00
rofl0r 1db526c07e fix iface.c build on apple 2017-12-03 13:46:04 +00:00
rofl0r 1e8dc829c2 add install.sh script from musl to fix make install on MAC
MAC's install program has gratuitous differences, and they refuse
to add the handy -D option.
2017-12-03 13:42:14 +00:00
Eyal Shapira a8960cf44d WPS: Fix nonce comparisons
Multiple memcmps of nonces were actually comparing only the first byte
instead of all 16 bytes. [Bug 462]

Signed-hostap: Eyal Shapira <eyal@wizery.com>
intended-for: hostap-1
(cherry picked from commit b4e9e2659b97865f7950ae467a3d828b768c78de)

Note from @rofl0r
cherry-picked this patch from [0] even though it probably doesn't affect
codepaths used by reaver in order to mute warnings from clang.

[0] https://w1.fi/cgit/hostap-1/commit/src/wps/wps_registrar.c?id=9ce7f1974e1a685b1c0b1112e322bbe20ed0212b
2017-12-03 13:28:12 +00:00
rofl0r ae2e295932 fix permissions of code in src/wps 2017-12-03 13:16:05 +00:00
rofl0r 8f07f09fe1 fix typo in base64.h found by clang 2017-12-03 13:08:19 +00:00
rofl0r 2e0e6922b3 wash: sanitize display of ESSID 2017-12-01 17:59:15 +00:00
rofl0r 01ddd91a23 implement new option -6 (repeat m6)
under specific circumstances, a known router model sends M5 several
times even after it received M6, and will not proceed unless M6 is
sent again.
2017-12-01 17:14:52 +00:00
rofl0r 7e1733e641 improve quantenna detection
it seems some devices only send a 30-byte long tag containing the
vendor OUI, unlike all other chip vendors.
2017-11-30 15:55:37 +00:00
kcdtv 9471485b77 vendor.c add oui for quantenna
add support for Quantenna chipset detection in wash
2017-11-28 18:38:24 +00:00
rofl0r e3772a53ac fix build on freebsd. closes #82 2017-11-26 17:26:58 +00:00
rofl0r 01054aefca freebsd build: fix second struct iwreq member too 2017-11-26 16:24:18 +00:00
rofl0r 7e1e187ac6 use full name for struct iwreq members, fixing freebsd build
addressing #82
2017-11-26 16:21:23 +00:00
rofl0r 664a4b3275 fix unportable use of asm/byteorder.h
closes #145
2017-11-26 14:22:17 +00:00
kcdtv 0bec6e8190
Delete test
This file is a *wpc file pattern for testing purpose, it has no use.
2017-11-07 11:09:14 +01:00
rofl0r 7fc42e5a76 prevent delayed auth_ok messages from resending association requests
some APs send several authentication success messages in a burst,
and our associate_recv_loop, when waiting for an association response,
would return when getting such a packet, and immediately try to send
another assoc request until MAX_TRIES was hit, and then restarting
the whole dance again with a deauth packet.
2017-11-07 00:35:51 +00:00
rofl0r b84b4d5ff6 fix once and for all bogus authentication/association logic
this time, we encountered cases where due to the brainbending logic
in this code reaver thought we were associated when we weren't -
in fact, we didnt even get an auth reply.
2017-11-07 00:21:41 +00:00
rofl0r 03ba435b19 release 1.6.3 2017-11-03 22:23:49 +00:00
rofl0r c53f7febca wash: use wlan0mon in usage text 2017-11-03 21:27:57 +00:00