Commit Graph

314 Commits

Author SHA1 Message Date
feitoi bd0f382622 Stop attack when nack code is SETUP_LOCKED and last_msg is M1
Improve the commit #2db7ca59, solution to treat the ISPs that had vulnerable
routers in the past opted to "fix" them by simply ending WPS transaction
sending an WSC_NACK with reason code 0x000F after receive M2.
With -L option continue attack ignoring the stop.
2023-07-19 12:33:36 +01:00
feitoi 4091bf2b31 Replace obsolete ualarm, setitimer with timer_settime 2022-02-11 00:01:01 -03:00
feitoi db98ba5a04 fix -p option using new way
There is a very rare error with using the -p option.
It only happens when re-attack the AP already cracked,
specifying only the first half of PIN cracked and
answer yes for Restore previous session.

Taking advantage of the bug fix, functions jump_p1_queue() and
jump_p2_queue() were used to insert the specified PIN into current index.
2022-02-01 14:58:08 -03:00
feitoi a2002d7add wash: get rid of the checksum of bssid's cached
this is no longer needed, as the 3 interesting states (see prev
commit) are now modeled as flags in the seen_list.
2022-01-31 12:13:53 +00:00
feitoi 0cbb0fb38f wash: always print in both modes when AP status changes
there are 3 cases which trigger a reprint in both json and regular
mode:

- AP lock status changes
- AP PBC status changes
- AP deactivates or activates WPS completely
  (WPS fields in probe response are either present or lacking)

in case of PBC status change, the field "WPS version" is temporarily
used to print "PBC" instead of the version number.
2022-01-31 12:07:36 +00:00
feitoi 8053864a5f wash: fix behaviour when AP cache is full
the old behaviour, which was changed recently, was to just not print
anything anymore when the internal cache of 512 APs was full.
b7c1d0e0ca changed that to print everything
after the list was full.

a better way is to just clean the list when this happens and start
over, to prevent excessive spam in the output.
2022-01-31 12:05:12 +00:00
rofl0r 36e5b16cde libwps: make parse_wps_tag static and rename it 2022-01-25 21:04:25 +00:00
rofl0r b7c1d0e0ca wash: in json mode, print a line whenever an AP's WPS status changes
this makes it possible to e.g. realize when the WPS button was pushed,
in such a case additional fields appear in a probe response, or when
the AP went to locked state. we only do this on probe response packets.

additionally, if we exhausted the maximum number of bssid's cached
(currently 512), default to print anything not in the list.
the previous behaviour was to silently ignore any APs after the list
was full.
2022-01-25 19:32:47 +00:00
rofl0r a668362986 wash: add support for device_password_id in json mode
this field, if present, and having the value 0x0004 indicates that
the push button method was activated.
ref: https://github.com/wiire-a/pixiewps/issues/107
2022-01-25 18:15:56 +00:00
rofl0r fa3fc51a5a wash: add support for selected_registrar_config_methods in json
this field seems to only be set when the WPS button was pushed.
ref: https://github.com/wiire-a/pixiewps/issues/107
2022-01-25 18:02:37 +00:00
feitoi 2db7ca5935 stop attack when nack code is SETUP_LOCKED 2022-01-25 15:12:10 +00:00
feitoi 8ab068a9a7 cracker: change the type of variable pin_count from float to int 2022-01-25 15:12:10 +00:00
feitoi d6c931c26c got timeout instead of an M5 when cracking second half, so retry 2021-05-19 00:42:05 -03:00
feitoi 387678d71b exchange.c: Check the reason code for received NACK message (FAKE NACK) 2021-05-17 06:42:50 -03:00
feitoi 4b921d1d0c exchange.c: Print the reason code of NACK message 2021-05-16 19:39:38 -03:00
rofl0r 0c299e9f67 macchanger: increment entire mac, not just last byte 2021-04-30 15:21:54 +01:00
feitoi f575031605 improve upon the algorithm used in macchanger
Change the last bytes of the MAC Address and preventing
the changed byte from being 0 and or 255.
2021-04-29 19:50:00 -03:00
Andreas Nilsen a3a018e277 README: document new MAC changer option
also add some missing stuff like UTF8 and '--output-file' not being mentioned
on 'Wash Usage' and 'Reaver Usage'.

Signed-off-by: Andreas Nilsen <adde88@gmail.com>
2021-04-15 23:16:52 +01:00
Gabriel Rodrigues Couto 3f633f5621 add MAC changer option
Original author: Gabriel Rodrigues Couto <gabrielrcouto@gmail.com>
Patch created by: Andreas Nilsen <adde88@gmail.com>

Signed-off-by: Andreas Nilsen <adde88@gmail.com>
2021-04-15 23:16:32 +01:00
Guy Harris 2d6e537e60 Improve error reporting.
The return value of pcap_activate() is:

	0, if activation succeeded, with no warnings;
	a non-zero positive number, if activation succeded with a
	    warning - the number is a PCAP_WARNING_ indication of the
	    warning;
	a negative number, if activation failed - the number is a
	    PCAP_ERROR_ indication of the error.

We should not treat non-zero positive numbers as errors.  (Printing a
warning might be useful.)

We should treat non-zero negative numbers as errors, and translate it to
an error message using libpcap's own pcap_statustostr(), rather than
attempting to duplicate its mapping ourselves, as new error codes may
appear in the future, and using pcap_statustostr() future-proofs us
against that.  In addition, if the error is PCAP_ERROR, we should report
the return value of pcap_geterr(handle), as that will provide additional
information about that "generic" error.
2020-08-14 18:29:33 -07:00
rofl0r 4316c2659a reassociate(): fix bug
bug was introduced in 488f2e7186.
the second call to the new function was always meant to use 1 as parameter,
but i typo'ed. thanks to @1yura for the patch.

addressing #303
2020-07-12 16:52:08 +01:00
rofl0r 7a0f1ce677 release 1.6.6 2020-03-16 16:42:21 +00:00
Christian Bremvåg eebc0e97a7 logfilter.py: add support for python3 (#299) 2020-01-20 22:46:57 +00:00
rofl0r a7b390853b add experimental new command line switch -u
as it is experimental, it is not yet being advertised in the
usage output.

the switch runs pixiewps with the -u uptime switch.
it is not actually a switch for pixiewps itself, but for
pixie-wrapper, which can use the timestamp for faster attacks
on hardcoded reset-dates in routers (in case the first regular
pixiewps pass fails).
2019-10-30 03:29:53 +00:00
rofl0r cc550c473b save router's uptime 2019-10-30 03:14:35 +00:00
rofl0r 14b2cf73d4 80211.c: simplify is_target()
is_target() had a confusing check for NULL_MAC: if the bssid
was set to it, it would return true.

the purpose of that is that wash by default isn't targetting a
specific bssid, so a target check needs to always succeed under
these circumstances. however it also allows to specify a specific
bssid, thus the is_target check.
the other site calling the function was from reaver code, which
always has the bssid set.
therefore i factored the null mac check out to the single site
it's needed, in wpsmon.c, which immediately makes the meaning
of both the check and the function much clearer.
2019-10-30 02:19:07 +00:00
rofl0r 2b8db02472 80211.c: clean up duplicate beacon parsing code 2019-10-30 02:09:34 +00:00
rofl0r 567430f71b pixie: fix logic for wpc file update
reordering the code so we can safely exit after a pixie attack,
while having the wpc file updated. this prevents reaver from
retry-ing the pixiewps-found pin when the submission fails.
this allows the user to take a break and try it some minutes later
with -p manually, so he can circumvent time-based lock counters.
2019-10-29 23:31:21 +00:00
feitoi 1bcb0dd260 fix .wpc file when pixiewps attack is successful 2019-10-29 23:31:21 +00:00
feitoi 03dbc8fac9 new functions to sort the valid PIN into current p1 and p2 index 2019-10-29 23:31:15 +00:00
rofl0r eec6a89701 pixiewps mode: implement automatic cracking and proper NACK usage
a couple routers started turning WPS off after a pixie attack.
research showed this happens only with reaver, not oneshot, so it's
either a defensive mechanism against reaver itself, or simply against
non-compliant WPS implementations.
as @feitoi pointed out, the best way to deal with that is to send
WSC NACK.

however, we can just as well continue the session if pixiewps succeeded
in a certain timeframe, and inject the found pin into the running
WPS transaction.

the new logic now works as follows:
pixiewps is started in a thread, which processes its output. if the
pin was cracked successfully during the normal transaction timeout
interval (-t parameter), reaver will try to inject the found pin.
if pixiewps fails, NACK is sent and the program terminated.
if we hit the timeout while pixiewps runs, we send NACK, but let
the pixiewps program running in the background until it terminates,
so the full output becomes visible, and finally terminate the program.

the thread is necessary because reading from the pixiewps process handle
is a blocking operation, and even if we'd detect a timeout, we still
couldn't get the main thread to interrupt its current read operation to
send the NACK immediately (and we can't do it from a SIGALRM signal
handler, because sending the NACK involves a lot of memory allocations
and other non-async-safe operations).

fixes #291
2019-10-29 23:31:03 +00:00
rofl0r 01432621e4 fix compatibility with GCC 4.4
that specific compiler chokes on duplicate typedefs, while newer ones
do not.

closes #293
2019-10-29 14:11:51 +00:00
rofl0r 49bdddbba9 introduce method to stop cprintf from printing 2019-10-25 05:08:32 +01:00
rofl0r 9a64a705fa pixie mode: default to -g 1 2019-10-23 01:04:48 +01:00
rofl0r 4abde23a5e default to -g 1 when passing -p
if someone *really* needs bruteforcing after passing a pin, he
can add -g 99999999 to his commandline (needs to come after -p XXX).
2019-10-23 01:01:57 +01:00
rofl0r 620b757de4 parse_static_pin: remove impossible branch 2019-10-23 00:59:49 +01:00
feitoi acfc3ddabe decrease definition of EAPOL_START_MAX_TRIES (#290)
this improves performance of brute-force attacks.
2019-10-08 04:01:37 +01:00
rofl0r 6f1c14f80d remove duplicate definition of FAKE_RADIO_TAP_HEADER
following up on 23dcc42cd1, and adding
a comment for why the functions dealing with it exist in 2 versions.
2019-10-05 18:30:35 +01:00
rofl0r d5e2c820d3 wash: remove usage of pcap-based packet filtering
instead, we filter out unwanted packets ourselves, which allows us to record
a full packet capture with --output-file option.
2019-10-05 17:21:27 +01:00
rofl0r 4b51249bd7 --output-file: save all packets received by the pcap driver
previously only packets with bad FCS were saved.
2019-10-05 16:09:52 +01:00
rofl0r 53e7855196 wash: implement -O output option too 2019-10-05 16:08:39 +01:00
rofl0r 37de8c8822 print message when we get EAP_FAILURE 2019-06-21 22:54:50 +01:00
rofl0r 916f63e579 don't go into endless loop when AP has WPS turned off
encountered an AP that turned off WPS completely after a couple
NACK-interrupted attempts.
reaver then went into an endless loop trying to figure out whether
it is locked.
2019-06-21 22:54:50 +01:00
feitoi 1a1c1f8e7a session.c: remove unnecessary type cast 2019-05-14 08:08:14 -03:00
feitoi 7e519fed18 wash: fix calculation of attack progress 2019-05-13 00:14:40 -03:00
rofl0r 75c8e7be61 cracker: whitespace cleanup 2019-05-12 23:26:35 +01:00
rofl0r 231df4a616 cracker: remove indent level 2019-05-12 23:23:20 +01:00
rofl0r c6baab313d restore_session: and another indent layer 2019-05-12 23:07:55 +01:00
rofl0r 9db8bb69f6 restore_session: remove yet one more indent layer 2019-05-12 23:06:39 +01:00
rofl0r 113f12fe26 restore_session: remove one more indent layer 2019-05-12 23:05:26 +01:00