fix: hf mf mifare - populate keylist (#568)
authorIceman <iceman@iuse.se>
Thu, 8 Feb 2018 03:15:42 +0000 (04:15 +0100)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Thu, 8 Feb 2018 03:15:42 +0000 (04:15 +0100)
This will solve the long running of the attack, since all candidate keys will be tested.

client/mifarehost.c

index a01d3b5f0485bf43b6b0087bc40a81b357edf9de..2bd21077e9b6ba5cd23c276445cccc809f3dbf04 100644 (file)
@@ -201,9 +201,9 @@ int mfDarkside(uint64_t *key)
                        int size = keycount - i > max_keys ? max_keys : keycount - i;\r
                        for (int j = 0; j < size; j++) {\r
                                if (par_list == 0) {\r
                        int size = keycount - i > max_keys ? max_keys : keycount - i;\r
                        for (int j = 0; j < size; j++) {\r
                                if (par_list == 0) {\r
-                                       num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock);\r
+                                       num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock+(j*6));\r
                                } else {\r
                                } else {\r
-                                       num_to_bytes(keylist[i*max_keys + j], 6, keyBlock);\r
+                                       num_to_bytes(keylist[i*max_keys + j], 6, keyBlock+(j*6));\r
                                }\r
                        }\r
                        if (!mfCheckKeys(0, 0, false, size, keyBlock, key)) {\r
                                }\r
                        }\r
                        if (!mfCheckKeys(0, 0, false, size, keyBlock, key)) {\r
Impressum, Datenschutz