Compare commits

..

1 Commits

Author SHA1 Message Date
Romuald Conty
776fb11aaf
Revert "Fixed readme compiling options" 2018-01-31 18:30:12 +01:00
11 changed files with 76 additions and 140 deletions

View File

@ -7,7 +7,10 @@ Please note MFOC is able to recover keys from target only if it have a known key
# Build from source # Build from source
``` ```
autoreconf -is libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
./configure ./configure
make && sudo make install make && sudo make install
``` ```

6
debian/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
autoreconf.after
autoreconf.before
files
mfoc.debhelper.log
mfoc.substvars
mfoc/

68
debian/changelog vendored
View File

@ -1,67 +1,17 @@
mfoc (0.10.7+git20180724-1) unstable; urgency=medium mfoc (0.10.5-0) unstable; urgency=low
* New upstream version 0.10.7+git20180724 * New upstream release
-- Samuel Henrique <samueloph@debian.org> Tue, 24 Jul 2018 01:19:50 -0300 -- Romuald Conty <romuald@libnfc.org> Thu, 14 Feb 2013 21:16:42 +0100
mfoc (0.10.7+git20150512-0kali1) kali; urgency=medium mfoc (0.10.4-0) unstable; urgency=low
* Import upstream (Closes: 0002240) * New upstream release
* Update debian files: watch, copyright
* Use debhelper 9
-- Sophie Brun <sophie@freexian.com> Tue, 12 May 2015 12:05:24 +0200 -- Romuald Conty <romuald@libnfc.org> Sun, 20 Jan 2013 15:58:42 +0100
mfoc (0.10.7-0kali2) kali; urgency=low mfoc (0.10.2pre3.1-0) unstable; urgency=low
* Updated watch file * Initial package
-- Mati Aharoni <muts@kali.org> Sun, 12 Jan 2014 18:06:21 -0500 -- Thomas Hood <jdthood@gmail.com> Wed, 18 May 2011 12:00:00 +0200
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
View File

@ -1 +1 @@
11 9

21
debian/control vendored
View File

@ -1,18 +1,17 @@
Source: mfoc Source: mfoc
Section: utils Section: utils
Priority: optional Priority: extra
Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org> Maintainer: Thomas Hood <jdthood@gmail.com>
Uploaders: Samuel Henrique <samueloph@debian.org> Build-Depends: debhelper (>=9), dh-autoreconf, libnfc-dev (>= 1.7.0~rc1), pkg-config
Build-Depends: debhelper (>= 11), libnfc-dev, pkg-config Standards-Version: 3.9.4
Standards-Version: 4.1.5 Homepage: http://code.google.com/p/mfoc/
Homepage: https://github.com/nfc-tools/mfoc Vcs-Git: http://code.google.com/p/mfoc/
Vcs-Browser: https://salsa.debian.org/pkg-security-team/mfoc Vcs-Browser: http://code.google.com/p/mfoc/source/browse/
Vcs-Git: https://salsa.debian.org/pkg-security-team/mfoc.git
Package: mfoc Package: mfoc
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}
Description: MIFARE Classic offline cracker Description: MIFARE Classic offline cracker
This package includes the mfoc program which cracks the MFOC is an open source implementation of "offline nested" attack. It
encryption keys of the MIFARE Classic chip and dumps the helps to recove keys from MIFARE Classic tags and dump content to a
chip's memory contents to a file. file.

75
debian/copyright vendored
View File

@ -1,59 +1,11 @@
Format: http://dep.debian.net/deps/dep5 Format: http://dep.debian.net/deps/dep5
Upstream-Name: MFOC Upstream-Name: MFOC
Source: https://github.com/nfc-tools/mfoc Source: http://nfc-tools.googlecode.com/svn/trunk/mfoc
Files: * Files: *
Copyright: 2009 Norbert Szetei Copyright: 2009 Norbert Szetei, Pavol Luptak
2009 Pavol Luptak 2010 Micahal Boska, Romuald Conty
2010 Micahal Boska 2011 Romuald Conty
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+ License: GPL-2+
This package is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -71,3 +23,22 @@ License: GPL-2+
On Debian systems, the complete text of the GNU General Public On Debian systems, the complete text of the GNU General Public
License version 2 can be found in "/usr/share/common-licenses/GPL-2". 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
View File

@ -1,8 +1,16 @@
#!/usr/bin/make -f #!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all # -*- 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.
%: # Uncomment this to turn on verbose mode.
dh $@ #export DH_VERBOSE=1
override_dh_installchangelogs: override_dh_installchangelogs:
dh_installchangelogs ChangeLog dh_installchangelogs ChangeLog
%:
dh $@ --with autoreconf

8
debian/watch vendored
View File

@ -1,3 +1,7 @@
version=4 # 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
https://github.com/nfc-tools/mfoc/tags/ .*/mfoc-(.*)\.tar\.gz

View File

@ -285,7 +285,6 @@ int main(int argc, char *const argv[])
case 0x01: case 0x01:
case 0x08: case 0x08:
case 0x88: case 0x88:
case 0x19:
if (get_rats_is_2k(t, r)) { if (get_rats_is_2k(t, r)) {
printf("Found Mifare Plus 2k tag\n"); printf("Found Mifare Plus 2k tag\n");
t.num_sectors = NR_TRAILERS_2k; t.num_sectors = NR_TRAILERS_2k;
@ -754,7 +753,7 @@ error:
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
void usage(FILE *stream, int code) void usage(FILE *stream, int errno)
{ {
fprintf(stream, "Usage: mfoc [-h] [-k key] [-f file] ... [-P probnum] [-T tolerance] [-O output]\n"); fprintf(stream, "Usage: mfoc [-h] [-k key] [-f file] ... [-P probnum] [-T tolerance] [-O output]\n");
fprintf(stream, "\n"); fprintf(stream, "\n");
@ -777,7 +776,7 @@ void usage(FILE *stream, int code)
fprintf(stream, "\n"); fprintf(stream, "\n");
fprintf(stream, "This is mfoc version %s.\n", PACKAGE_VERSION); fprintf(stream, "This is mfoc version %s.\n", PACKAGE_VERSION);
fprintf(stream, "For more information, run: 'man mfoc'.\n"); fprintf(stream, "For more information, run: 'man mfoc'.\n");
exit(code); exit(errno);
} }
void mf_init(mfreader *r) void mf_init(mfreader *r)
@ -911,7 +910,7 @@ get_rats_is_2k(mftag t, mfreader r)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (res >= 10) { if (res >= 10) {
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]); 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]);
return ((abtRx[5] == 0xc1) && (abtRx[6] == 0x05) return ((abtRx[5] == 0xc1) && (abtRx[6] == 0x05)
&& (abtRx[7] == 0x2f) && (abtRx[8] == 0x2f) && (abtRx[7] == 0x2f) && (abtRx[8] == 0x2f)
&& ((t.nt.nti.nai.abtAtqa[1] & 0x02) == 0x00)); && ((t.nt.nti.nai.abtAtqa[1] & 0x02) == 0x00));

View File

@ -82,7 +82,7 @@ typedef struct {
} countKeys; } countKeys;
void usage(FILE *stream, int code); void usage(FILE *stream, int errno);
void mf_init(mfreader *r); void mf_init(mfreader *r);
void mf_configure(nfc_device *pdi); void mf_configure(nfc_device *pdi);
void mf_select_tag(nfc_device *pdi, nfc_target *pnt); void mf_select_tag(nfc_device *pdi, nfc_target *pnt);

View File

@ -32,14 +32,10 @@
#endif #endif
#ifdef SLRE_DEBUG #ifdef SLRE_DEBUG
# ifndef DBG
#define DBG(x) printf x #define DBG(x) printf x
# endif
#else #else
# ifndef DBG
#define DBG(x) #define DBG(x)
#endif #endif
#endif
struct bracket_pair { struct bracket_pair {
const char *ptr; /* Points to the first char after '(' in regex */ const char *ptr; /* Points to the first char after '(' in regex */