Compare commits
10 commits
809f3bc62c
...
5524dd8af4
Author | SHA1 | Date | |
---|---|---|---|
Davide Depau | 5524dd8af4 | ||
ba072f16f6 | |||
dd0ce5caa6 | |||
987c3dab3a | |||
77db13ef90 | |||
519e475b09 | |||
fa3573cfb6 | |||
c24b6ac572 | |||
593315f7d4 | |||
9fed51206f |
|
@ -7,10 +7,7 @@ Please note MFOC is able to recover keys from target only if it have a known key
|
|||
# Build from source
|
||||
|
||||
```
|
||||
libtoolize --force
|
||||
aclocal
|
||||
autoheader
|
||||
automake --force-missing --add-missing
|
||||
autoreconf -is
|
||||
./configure
|
||||
make && sudo make install
|
||||
```
|
||||
|
|
6
debian/.gitignore
vendored
6
debian/.gitignore
vendored
|
@ -1,6 +0,0 @@
|
|||
autoreconf.after
|
||||
autoreconf.before
|
||||
files
|
||||
mfoc.debhelper.log
|
||||
mfoc.substvars
|
||||
mfoc/
|
68
debian/changelog
vendored
68
debian/changelog
vendored
|
@ -1,17 +1,67 @@
|
|||
mfoc (0.10.5-0) unstable; urgency=low
|
||||
mfoc (0.10.7+git20180724-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* New upstream version 0.10.7+git20180724
|
||||
|
||||
-- Romuald Conty <romuald@libnfc.org> Thu, 14 Feb 2013 21:16:42 +0100
|
||||
-- Samuel Henrique <samueloph@debian.org> Tue, 24 Jul 2018 01:19:50 -0300
|
||||
|
||||
mfoc (0.10.4-0) unstable; urgency=low
|
||||
mfoc (0.10.7+git20150512-0kali1) kali; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* Import upstream (Closes: 0002240)
|
||||
* Update debian files: watch, copyright
|
||||
* Use debhelper 9
|
||||
|
||||
-- Romuald Conty <romuald@libnfc.org> Sun, 20 Jan 2013 15:58:42 +0100
|
||||
-- Sophie Brun <sophie@freexian.com> Tue, 12 May 2015 12:05:24 +0200
|
||||
|
||||
mfoc (0.10.2pre3.1-0) unstable; urgency=low
|
||||
mfoc (0.10.7-0kali2) kali; urgency=low
|
||||
|
||||
* Initial package
|
||||
* Updated watch file
|
||||
|
||||
-- Thomas Hood <jdthood@gmail.com> Wed, 18 May 2011 12:00:00 +0200
|
||||
-- Mati Aharoni <muts@kali.org> Sun, 12 Jan 2014 18:06:21 -0500
|
||||
|
||||
mfoc (0.10.7-0kali1) kali; urgency=low
|
||||
|
||||
* Upstream import
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Tue, 17 Dec 2013 09:12:38 -0500
|
||||
|
||||
mfoc (0.10.6-0kali0) kali; urgency=low
|
||||
|
||||
* Upstream import
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Mon, 19 Aug 2013 10:37:12 -0400
|
||||
|
||||
mfoc (0.10.5-0kali0) kali; urgency=low
|
||||
|
||||
* Upstream import.
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Sun, 24 Mar 2013 05:49:58 -0400
|
||||
|
||||
mfoc (0.10.3-1kali4) kali; urgency=low
|
||||
|
||||
* Removed desktop file
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Sat, 15 Dec 2012 14:23:37 -0500
|
||||
|
||||
mfoc (0.10.3-1kali3) kali; urgency=low
|
||||
|
||||
* Fixed compilation issue
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Tue, 04 Dec 2012 06:43:46 -0500
|
||||
|
||||
mfoc (0.10.3-1kali2) kali; urgency=low
|
||||
|
||||
* Version bump
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Sat, 01 Dec 2012 16:23:29 -0500
|
||||
|
||||
mfoc (0.10.3-1kali1) kali; urgency=low
|
||||
|
||||
* Version bump
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Sat, 01 Dec 2012 16:13:27 -0500
|
||||
|
||||
mfoc (0.10.3-1kali0) kali; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- Mati Aharoni <muts@kali.org> Sat, 01 Dec 2012 13:42:57 -0500
|
||||
|
|
2
debian/compat
vendored
2
debian/compat
vendored
|
@ -1 +1 @@
|
|||
9
|
||||
11
|
||||
|
|
21
debian/control
vendored
21
debian/control
vendored
|
@ -1,17 +1,18 @@
|
|||
Source: mfoc
|
||||
Section: utils
|
||||
Priority: extra
|
||||
Maintainer: Thomas Hood <jdthood@gmail.com>
|
||||
Build-Depends: debhelper (>=9), dh-autoreconf, libnfc-dev (>= 1.7.0~rc1), pkg-config
|
||||
Standards-Version: 3.9.4
|
||||
Homepage: http://code.google.com/p/mfoc/
|
||||
Vcs-Git: http://code.google.com/p/mfoc/
|
||||
Vcs-Browser: http://code.google.com/p/mfoc/source/browse/
|
||||
Priority: optional
|
||||
Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
|
||||
Uploaders: Samuel Henrique <samueloph@debian.org>
|
||||
Build-Depends: debhelper (>= 11), libnfc-dev, pkg-config
|
||||
Standards-Version: 4.1.5
|
||||
Homepage: https://github.com/nfc-tools/mfoc
|
||||
Vcs-Browser: https://salsa.debian.org/pkg-security-team/mfoc
|
||||
Vcs-Git: https://salsa.debian.org/pkg-security-team/mfoc.git
|
||||
|
||||
Package: mfoc
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: MIFARE Classic offline cracker
|
||||
MFOC is an open source implementation of "offline nested" attack. It
|
||||
helps to recove keys from MIFARE Classic tags and dump content to a
|
||||
file.
|
||||
This package includes the mfoc program which cracks the
|
||||
encryption keys of the MIFARE Classic chip and dumps the
|
||||
chip's memory contents to a file.
|
||||
|
|
75
debian/copyright
vendored
75
debian/copyright
vendored
|
@ -1,11 +1,59 @@
|
|||
Format: http://dep.debian.net/deps/dep5
|
||||
Upstream-Name: MFOC
|
||||
Source: http://nfc-tools.googlecode.com/svn/trunk/mfoc
|
||||
Source: https://github.com/nfc-tools/mfoc
|
||||
|
||||
Files: *
|
||||
Copyright: 2009 Norbert Szetei, Pavol Luptak
|
||||
2010 Micahal Boska, Romuald Conty
|
||||
2011 Romuald Conty
|
||||
Copyright: 2009 Norbert Szetei
|
||||
2009 Pavol Luptak
|
||||
2010 Micahal Boska
|
||||
2010-2011 Romuald Conty <romuald@libnfc.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: src/crypto1.c src/crapto1.c src/crapto1.h
|
||||
Copyright: 2008-2009 bla <blapost@gmail.com>
|
||||
License: GPL-2+
|
||||
|
||||
Files: src/slre.c src/slre.h
|
||||
Copyright: 2013 Cesanta Software Limited
|
||||
2004-2013 Sergey Lyubka <valenok@gmail.com>
|
||||
License: GPL-2+
|
||||
|
||||
Files: src/nfc-utils.c src/mifare.c src/mifare.h src/nfc-utils.h
|
||||
Copyright: 2010-2013 Philippe Teuwen
|
||||
2009-2013 Romuald Conty <romuald@libnfc.org>
|
||||
2009 Roel Verdult
|
||||
2012-2013 Ludovic Rousseau <ludovic.rousseau@gmail.com>
|
||||
2010-2012 Romain Tartière <romain.tartiere@gmail.com>
|
||||
License: BSD-2-clause
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
.
|
||||
1) Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
.
|
||||
2 )Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2011 Thomas Hood <jdthood@gmail.com>
|
||||
2012-2014 Mati Aharoni <muts@kali.org>
|
||||
2015 Sophie Brun <sophie@freexian.com
|
||||
2018 Samuel Henrique <samueloph@debian.org>
|
||||
License: GPL-2+
|
||||
|
||||
License: GPL-2+
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -23,22 +71,3 @@ License: GPL-2+
|
|||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2011 Thomas Hood <jdthood@gmail.com>
|
||||
License: GPL-2+
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||
|
|
14
debian/rules
vendored
14
debian/rules
vendored
|
@ -1,16 +1,8 @@
|
|||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_installchangelogs:
|
||||
dh_installchangelogs ChangeLog
|
||||
|
||||
%:
|
||||
dh $@ --with autoreconf
|
||||
|
|
8
debian/watch
vendored
8
debian/watch
vendored
|
@ -1,7 +1,3 @@
|
|||
# See uscan(1) for format
|
||||
|
||||
# Compulsory line, this is a version 3 file
|
||||
version=3
|
||||
|
||||
http://code.google.com/p/mfoc/downloads/list .*/mfoc-(.*).tar.gz
|
||||
version=4
|
||||
|
||||
https://github.com/nfc-tools/mfoc/tags/ .*/mfoc-(.*)\.tar\.gz
|
||||
|
|
29
src/mfoc.c
29
src/mfoc.c
|
@ -96,17 +96,17 @@ int main(int argc, char *const argv[])
|
|||
uint8_t defaultKeys[][6] = {
|
||||
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // Default key (first key used by program if no user defined key)
|
||||
{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5}, // NFCForum MAD key
|
||||
{0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}, // NFCForum content key
|
||||
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Blank key
|
||||
{0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5},
|
||||
{0x4d, 0x3a, 0x99, 0xc3, 0x51, 0xdd},
|
||||
{0x1a, 0x98, 0x2c, 0x7e, 0x45, 0x9a},
|
||||
{0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff},
|
||||
{0x71, 0x4c, 0x5c, 0x88, 0x6e, 0x97},
|
||||
{0x58, 0x7e, 0xe5, 0xf9, 0x35, 0x0f},
|
||||
{0xa0, 0x47, 0x8c, 0xc3, 0x90, 0x91},
|
||||
{0x53, 0x3c, 0xb6, 0xc7, 0x23, 0xf6},
|
||||
{0x8f, 0xd0, 0xa4, 0xf2, 0x56, 0xe9}
|
||||
// {0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7}, // NFCForum content key
|
||||
// {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Blank key
|
||||
// {0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5},
|
||||
// {0x4d, 0x3a, 0x99, 0xc3, 0x51, 0xdd},
|
||||
// {0x1a, 0x98, 0x2c, 0x7e, 0x45, 0x9a},
|
||||
// {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff},
|
||||
// {0x71, 0x4c, 0x5c, 0x88, 0x6e, 0x97},
|
||||
// {0x58, 0x7e, 0xe5, 0xf9, 0x35, 0x0f},
|
||||
// {0xa0, 0x47, 0x8c, 0xc3, 0x90, 0x91},
|
||||
// {0x53, 0x3c, 0xb6, 0xc7, 0x23, 0xf6},
|
||||
// {0x8f, 0xd0, 0xa4, 0xf2, 0x56, 0xe9}
|
||||
|
||||
};
|
||||
|
||||
|
@ -143,7 +143,8 @@ int main(int argc, char *const argv[])
|
|||
switch (ch) {
|
||||
case 'P':
|
||||
// Number of probes
|
||||
if (!(probes = atoi(optarg)) || probes < 1) {
|
||||
probes = atoi(optarg);
|
||||
if (probes < 0) {
|
||||
ERR("The number of probes must be a positive number");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -910,7 +911,7 @@ get_rats_is_2k(mftag t, mfreader r)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (res >= 10) {
|
||||
printf("ATS %02X%02X%02X%02X%02X|%02X%02X%02X%02X\n", res, abtRx[0], abtRx[1], abtRx[2], abtRx[3], abtRx[4], abtRx[5], abtRx[6], abtRx[7], abtRx[8]);
|
||||
printf("ATS %02X%02X%02X%02X%02X|%02X%02X%02X%02X%02X\n", res, abtRx[0], abtRx[1], abtRx[2], abtRx[3], abtRx[4], abtRx[5], abtRx[6], abtRx[7], abtRx[8]);
|
||||
return ((abtRx[5] == 0xc1) && (abtRx[6] == 0x05)
|
||||
&& (abtRx[7] == 0x2f) && (abtRx[8] == 0x2f)
|
||||
&& ((t.nt.nti.nai.abtAtqa[1] & 0x02) == 0x00));
|
||||
|
@ -1059,7 +1060,7 @@ int mf_enhanced_auth(int e_sector, int a_sector, mftag t, mfreader r, denonce *d
|
|||
NtLast = bytes_to_num(Rx, 4) ^ crypto1_word(pcs, bytes_to_num(Rx, 4) ^ t.authuid, 1);
|
||||
|
||||
// Make sure the card is using the known PRNG
|
||||
if (! validate_prng_nonce(NtLast)) {
|
||||
if (true || ! validate_prng_nonce(NtLast)) {
|
||||
printf("Card is not vulnerable to nested attack\n");
|
||||
return -99999;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#define DEFAULT_DIST_NR 15
|
||||
|
||||
// Default number of probes for a key recovery for one sector
|
||||
#define DEFAULT_PROBES_NR 150
|
||||
#define DEFAULT_PROBES_NR 1
|
||||
|
||||
// Number of sets with 32b keys
|
||||
#define DEFAULT_SETS_NR 5
|
||||
|
|
|
@ -32,9 +32,13 @@
|
|||
#endif
|
||||
|
||||
#ifdef SLRE_DEBUG
|
||||
#define DBG(x) printf x
|
||||
# ifndef DBG
|
||||
# define DBG(x) printf x
|
||||
# endif
|
||||
#else
|
||||
#define DBG(x)
|
||||
# ifndef DBG
|
||||
# define DBG(x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct bracket_pair {
|
||||
|
|
Loading…
Reference in a new issue