136 Commits

Author SHA1 Message Date
wiire-a
ff0beef1b2 Updated usage, deprecated -S 2017-11-25 21:55:24 +01:00
wiire-a
d29099449e Removed print of N1 if not found 2017-11-25 21:10:47 +01:00
wiire-a
c7a237e3a2 Added .gitignore 2017-11-25 17:33:08 +01:00
wiire-a
962383d50e Updated README 2017-11-25 13:05:45 +01:00
wiire-a
462cf4e1d3 Updated man page 2017-11-24 19:40:49 +01:00
wiire-a
f734149af2 Switched to compile-time endianness detection 2017-11-24 18:48:40 +01:00
wiire-a
ee43785c68 Adopted consistent code style 2017-11-23 20:04:07 +01:00
wiire-a
fd6f4a28e2
Merge pull request #68 from binarymaster/master
Allow to set seed up to 0x7FFFFFFF
2017-11-22 19:50:28 +01:00
Stas'M
5159a6971b Allow to set seed end to 0x7FFFFFFF 2017-11-22 21:48:16 +03:00
wiire-a
b8c4636d98 Fixed #67
Fixed issue of non-termination when using 01/1970 (Unix epoch -> 0) as
ending point on Windows.

Thanks to @rofl0r for fixing it.
2017-11-19 16:17:57 +01:00
wiire-a
6082da892b Added print of every seed in every mode 2017-11-19 12:17:23 +01:00
wiire-a
455ccbae9c Fixed wrong type variable 2017-11-19 12:15:42 +01:00
wiire-a
249ed725b9 Updated README 2017-11-18 23:36:00 +01:00
wiire-a
e1f3bbe466 Updated man page 2017-11-18 23:35:16 +01:00
wiire-a
c21e8b061c Fixed new PRNG false positive issue 2017-11-18 23:33:09 +01:00
rofl0r
7db5fd84f9 implement parallel cracking for ralink
since we already had realtek parallelized, let's do the same for
ralink too.

this commit is the result of a collaborative effort between
@wiire-a and myself.
2017-11-18 22:35:26 +00:00
wiire-a
14ad43fa6d Added crack of pin with -7
The two hashes (-s and -z) and -5 must be supplied.
2017-11-16 22:24:13 +01:00
wiire-a
7474c547eb Shrunk output format
The output has been shrunk to fit in 80 columns. To do so the colon ':'
has been removed as a byte separator. Moreover, some names (mostly the
keys), have been shortened. The WPS pin tag has been left unchanged
(except for a couple of spaces in between).
2017-11-16 22:21:06 +01:00
wiire-a
06ce5c870c Fixed redundant memcpy of E-S1 and E-S2 2017-11-16 14:43:27 +01:00
wiire-a
edd5d30b4c Added another simpler glibc PRNG
With these changes I was able to get a 9% increase in speed on my
laptop.
2017-11-16 14:38:45 +01:00
wiire-a
ceea7143cb Implemented faster glibc random function
The glibc random function has been rewritten is a simpler manner which
should make it faster to execute. Possibly up to a x2 increase in speed.
2017-11-15 19:14:28 +01:00
wiire-a
8b7b4b3172 Updated copyright information 2017-11-15 19:06:56 +01:00
wiire-a
4109810199 Print program version on stdout
All the other information is still printed on stderr. The idea to print
them on separate streams was to make it easier from wrappers to get the
version discarding all the other information, however this was never the
case until now.
2017-11-15 13:09:25 +01:00
wiire-a
c47b51baf0 Fixed previous commit 2017-11-15 13:02:56 +01:00
wiire-a
e265a62b1d Improved auto mode detection 2017-11-15 13:01:25 +01:00
wiire-a
6bdf8e8f37 Fixed a few warnings
Warnings were found with GCC, Clang and Cppcheck.
2017-11-13 12:23:44 +01:00
wiire-a
81301b7e71 Fixed potential integer overflow
The variable 'i' was of type uint_fast8_t which most compiler typedef as
unsigned char or uint8_t which both (in C99) can hold a number between 0
and 255. This could cause an integer overflow when seed was found in
mode 3 but the the program was unsuccessful to recover the PIN within
the first 255 tries of the first time window set in the future.

This bug was introduced when the constant MODE3_TRIES was increased to
10 minutes (60 * 10 = 600 which is > 255) in commit (d3e4aab).
2017-11-13 11:15:34 +01:00
wiire-a
0b56be18c7
Merge pull request #66 from rofl0r/destdir2
Makefile: add missing DESTDIR
2017-11-11 12:31:05 +01:00
rofl0r
329462e9e8 Makefile: add missing DESTDIR
somehow, this line got overlooked...
2017-11-11 10:48:36 +00:00
wiire-a
0ca5675813 Removed useless headers from random_r.c 2017-11-09 10:23:26 +01:00
wiire-a
d2e7ffaaa1 Removed boilerplate code from random_r.c
Removed all the code non relevant for the current implementation. This
should make a noticeable difference in speed and possibly allow the
compiler to optimize even more.
2017-11-08 21:58:10 +01:00
wiire-a
cb615a1a08 Formatted random_r.c 2017-11-08 21:12:19 +01:00
wiire-a
22f96521fc Switched to stack allocation during multithreading
For better performance.
2017-11-07 21:09:32 +01:00
wiire-a
e760fecda8 Added option -5 and display of secret nonces
This option is used to optionally decrypt ES-1 directly from M5, when
the Enrollee proves to the Registrar to know the PIN. As of right now it
must be used in conjunction with -7. With the introduction of this new
option, the display of ES-2 (and ES-1 when -5 is supplied) has been
added to the output.
2017-11-07 20:53:16 +01:00
wiire-a
60e8db7b93 Fixed random_r redefinition warning
See #64
2017-10-31 14:59:45 +01:00
wiire-a
d3e4aab2e8 Added forward and backward time windows when seed is found (mode 3)
Fixed #63. Added more debug info. Added separate seeds for secret
nonces.
2017-10-31 12:00:54 +01:00
wiire-a
2f1bbbea1d Renamed 'RT/MT' mode to 'RT/MT/CL' 2017-10-29 11:21:40 +01:00
wiire-a
4937d61d40 Fixed CFLAGS typo in Makefile
Introduced in (81d5b4b).
2017-10-25 09:57:00 +02:00
wiire-a
887fbbb33d Merge pull request #62 from rofl0r/makeit
Makefile improvements
2017-10-25 00:15:04 +02:00
rofl0r
c56e689f58 Makefile: use DESTDIR in the conventional way
DESTDIR gets only used in the install target, so prefix doesn't get
cluttered and can be used internally to reference file dependencies.
e.g. if for example a DB would be used, the filename to the DB could
be passed in CPPFLAGS like "-DDBPATH=$(PREFIX)/share/pixiewps.db".
this doesn't happen at the moment, but it's good practice to follow
the conventions.

additionally, remove the "rm" command in the install target - running
`make install` should never ever delete files from user's prefix.
2017-10-24 22:53:29 +01:00
rofl0r
367697a24f Makefile: rename CCFLAGS to CFLAGS
the latter is the standard way of naming it.
it was pretty surprising when doing

    make CFLAGS="-O0 -g"

ended up running `gcc -O0 -g -O3 ...`
2017-10-24 22:44:29 +01:00
wiire-a
2b3dc759f1 Merge pull request #61 from binarymaster/master
Fix compilation in mingw-w64
2017-10-22 14:22:02 +02:00
Stas'M
3fbd36a735 Fix compilation in mingw-w64 2017-10-22 15:17:41 +03:00
wiire-a
e4d1bde5bb Merge pull request #60 from rofl0r/no_attr
Add workaround for mingw toolchains with broken pthread_attr_t support
2017-10-22 13:39:40 +02:00
rofl0r
147a615891 add workaround for mingw toolchains with broken pthread_attr_t support
toolchains from https://sourceforge.net/projects/mingw-w64/ don't
define PTHREAD_STACK_MIN, and when using pthread_attr_t fail due to
internal bugs in their atomics implementation:

   __buildlogicali(_InterlockedAnd, __LONG32, and)
   mingw32/include/psdk_inc/intrin-impl.h:977:1:
   error: static declaration of '_InterlockedAnd' follows non-static declaration

OTOH, they implement pthread support without the need of external DLL's,
so using them might be preferable.
2017-10-22 12:35:37 +01:00
wiire-a
d12f0ea0a2 Added option -7
This option is used to decrypt the field encrypted settings in M7, which
contains the wireless configuration of the AP. This option exploits a
misconfigured crypto library that always generates the same random
number, resulting in always generating the same static Private key (and
Public key). Hence, Diffie-Hellman encryption can be broken and the
passphrase recovered by anyone passively sniffing the air.
2017-10-22 12:04:20 +02:00
wiire-a
9af4c43b73 Added missing frees 2017-10-22 02:45:07 +02:00
wiire-a
537dd74029 Merge pull request #58 from rofl0r/pthread_stack
Set a reasonable stacksize for threads to prevent huge waste with GLIBC
2017-10-15 20:47:17 +02:00
rofl0r
7cad1983da set a reasonable stacksize for threads to prevent huge waste with GLIBC
GLIBC defaults to giving new threads an insanely huge 8MB stack each, which
causes unnecessary memory waste. we set it to a conservative 64KB, even though
we need less than 1KB ourselves, to give sufficient leeway to buffers used
by libc itself when calling out to some of its functions.
2017-10-15 17:53:50 +01:00
wiire-a
6ee757e808 Updated usage screen 2017-10-14 12:03:32 +02:00