2019/09/26 ver1.3.1: MFCUK (fully encrypted) can determine whether a vulnerability can be tested. If it is judged that there is no vulnerability in the card, it will not execute the program to avoid getting stuck in the dead cycle.

This commit is contained in:
DXL
2019-09-26 18:19:09 +08:00
parent 2bd73754c1
commit 626dee1dce
1167 changed files with 7541 additions and 2970 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ android {
//单元测试的支持
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
//版本号,整形
versionCode 3
versionCode 4
//版本名称,字符串!
versionName "1.3"
versionName "1.3.1"
}
//构建的类型,发布版和测试版
buildTypes {
@@ -2,16 +2,53 @@ package cn.rrg.rdv.activities.px53x;
import android.content.DialogInterface;
import android.content.Intent;
import androidx.appcompat.app.AlertDialog;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import cn.dxl.common.util.ViewUtil;
import cn.dxl.common.widget.ToastUtil;
import cn.rrg.console.define.ICommandTools;
import cn.rrg.console.define.ICommandType;
import cn.rrg.natives.MfcukTools;
import cn.rrg.natives.PN53XTagLeaksAdapter;
import cn.rrg.rdv.R;
import cn.rrg.rdv.implement.EntryICommandType;
public class MfcukConsoleActivity extends PN53XConsoleActivity {
private AlertDialog checkTipsDialog;
private TextView txtMsgView;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
checkTipsDialog = new AlertDialog.Builder(context).create();
checkTipsDialog.setTitle(R.string.tips);
View continer = ViewUtil.inflate(context, R.layout.dialog_working_msg);
txtMsgView = continer.findViewById(R.id.text1);
txtMsgView.setText(R.string.msg_working_darkside_check);
checkTipsDialog.setView(continer);
checkTipsDialog.setCancelable(false);
}
private void showWorkingDialog(boolean show) {
runOnUiThread(new Runnable() {
@Override
public void run() {
if (show)
checkTipsDialog.show();
else
checkTipsDialog.dismiss();
}
});
}
@Override
protected View getCommandGUI() {
return null;
@@ -39,6 +76,24 @@ public class MfcukConsoleActivity extends PN53XConsoleActivity {
@Override
protected int startTest(ICommandTools cmd) {
showWorkingDialog(true);
// Judge if there is have a nack loophole
if (!new PN53XTagLeaksAdapter().isDarksideSupported()) {
showWorkingDialog(false);
// darkside no supported.
runOnUiThread(new Runnable() {
@Override
public void run() {
new AlertDialog.Builder(context)
.setTitle(R.string.tips)
.setMessage(getString(R.string.msg_darkside_no_supported)).show();
}
});
return -1;
} else {
showWorkingDialog(false);
ToastUtil.show(context, getString(R.string.msg_darkside_support), false);
}
mDefaultCMD = "mfcuk -C -R 0:A -w -v 2";
return super.startTest(cmd);
}
+3
View File
@@ -323,5 +323,8 @@
<string name="msg_special_tag">Found chinese magic tag.</string>
<string name="msg_normal_tag_found">Found normal tag.</string>
<string name="sector_line">Sector</string>
<string name="msg_darkside_no_supported">Cards do not support Darkside vulnerability (MFCUK, full encryption) testing. Replace the card or use the Nested vulnerability (MFOC, semi-encryption) testing tool, or the Hardnested vulnerability (high-intensity Nested vulnerability) testing tool, or sniff.</string>
<string name="msg_working_darkside_check">Checking whether the card supports Darkside</string>
<string name="msg_darkside_support">The card supports Darkside</string>
</resources>
+3
View File
@@ -319,5 +319,8 @@
<string name="msg_special_tag">发现特殊的后门UID标签!</string>
<string name="msg_normal_tag_found">发现普通的标签!</string>
<string name="sector_line">扇 区</string>
<string name="msg_darkside_no_supported">卡片不支持Darkside漏洞(MFCUK、全加密)测试,请更换卡片或者使用Nested漏洞(MFOC、半加密)测试工具,或者Hardnested漏洞(高强度的Nested漏洞)测试工具,或者嗅探。</string>
<string name="msg_working_darkside_check">正在检查该卡片是否支持Darkside</string>
<string name="msg_darkside_support">该卡片支持Darkside漏洞</string>
</resources>
+3
View File
@@ -322,5 +322,8 @@
<string name="msg_special_tag">Found chinese magic tag.</string>
<string name="msg_normal_tag_found">Found normal tag.</string>
<string name="sector_line">Sector</string>
<string name="msg_darkside_no_supported">Cards do not support Darkside vulnerability (MFCUK, full encryption) testing. Replace the card or use the Nested vulnerability (MFOC, semi-encryption) testing tool, or the Hardnested vulnerability (high-intensity Nested vulnerability) testing tool, or sniff.</string>
<string name="msg_working_darkside_check">Checking whether the card supports Darkside</string>
<string name="msg_darkside_support">The card supports Darkside</string>
</resources>
@@ -32,6 +32,7 @@ public class SppHasBlock extends AbsBluetoothSpp {
@Override
public int write(byte[] sendMsg, int offset, int length, int timeout) throws IOException {
setThreadPriority();
if (outputStream == null) return -1;
outputStream.write(sendMsg, offset, length - offset);
outputStream.flush();
@@ -40,6 +41,7 @@ public class SppHasBlock extends AbsBluetoothSpp {
@Override
public int read(byte[] recvMsg, int offset, int length, int timeout) throws IOException {
setThreadPriority();
if (inputStream == null) return -1;
long start = System.currentTimeMillis();
while (inputStream.available() < (length - offset)) {
@@ -59,4 +61,8 @@ public class SppHasBlock extends AbsBluetoothSpp {
public int getUniqueId() {
return UNIQUE_ID;
}
private void setThreadPriority() {
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
}
}
Binary file not shown.
+5
View File
@@ -0,0 +1,5 @@
# ninja log v5
1 341 591194423 CMakeFiles/crapto1.dir/crapto1.c.o 2ae20ff9d3de30c2
4 356 591194423 CMakeFiles/crapto1.dir/crypto1.c.o 208a3418496fca92
6 485 591194424 CMakeFiles/crapto1.dir/main.c.o 1902701a56f595ff
485 811 591194424 D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/build/intermediates/cmake/debug/obj/x86/libcrapto1.so ac668822d378730a
@@ -0,0 +1,7 @@
Executable : C:\Users\DXL\android-sdk\cmake\3.10.2.4988404\bin\ninja.exe
arguments :
-C
D:\Developer\AndroidStudioProject\RFID-Tools\crapto1\.cxx\cmake\debug\x86
crapto1
jvmArgs :
@@ -0,0 +1,29 @@
ninja: Entering directory `D:\Developer\AndroidStudioProject\RFID-Tools\crapto1\.cxx\cmake\debug\x86'
[1/4] Building C object CMakeFiles/crapto1.dir/crapto1.c.o
D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/src/main/cpp/crapto1.c:103:47: warning: '&' within '^' [-Wbitwise-op-parentheses]
o_head[1] |= parity(*e_head ^ *o_head & LF_POLY_ODD);
~ ~~~~~~~~^~~~~~~~~~~~~
D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/src/main/cpp/crapto1.c:103:47: note: place parentheses around the '&' expression to silence this warning
o_head[1] |= parity(*e_head ^ *o_head & LF_POLY_ODD);
~~~~~~~~^~~~~~~~~~~~~
D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/src/main/cpp/crapto1.c:119:19: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (e = recover(o_tail--, o, oks, e_tail--, e, eks, rem))
~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/src/main/cpp/crapto1.c:119:19: note: place parentheses around the assignment to silence this warning
if (e = recover(o_tail--, o, oks, e_tail--, e, eks, rem))
^
( )
D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/src/main/cpp/crapto1.c:119:19: note: use '==' to turn this assignment into an equality comparison
if (e = recover(o_tail--, o, oks, e_tail--, e, eks, rem))
^
==
D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/src/main/cpp/crapto1.c:213:41: warning: '&' within '^' [-Wbitwise-op-parentheses]
cmb = cmb >> 1 ^ -(cmb & 1) & MAGIX2;
~ ~~~~~~~~~~~^~~~~~~~
D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/src/main/cpp/crapto1.c:213:41: note: place parentheses around the '&' expression to silence this warning
cmb = cmb >> 1 ^ -(cmb & 1) & MAGIX2;
~~~~~~~~~~~^~~~~~~~
3 warnings generated.
[2/4] Building C object CMakeFiles/crapto1.dir/crypto1.c.o
[3/4] Building C object CMakeFiles/crapto1.dir/main.c.o
[4/4] Linking C shared library D:\Developer\AndroidStudioProject\RFID-Tools\crapto1\build\intermediates\cmake\debug\obj\x86\libcrapto1.so
@@ -5,7 +5,6 @@
"sdkFolder": "C:\\Users\\DXL\\android-sdk",
"isNativeCompilerSettingsCacheEnabled": false,
"isBuildOnlyTargetAbiEnabled": true,
"ideBuildTargetAbi": "arm64-v8a,armeabi-v7a,armeabi",
"splitsAbiFilterSet": [],
"intermediatesFolder": "D:\\Developer\\AndroidStudioProject\\RFID-Tools\\crapto1\\build\\intermediates",
"gradleModulePathName": ":crapto1",
@@ -42,8 +41,10 @@
"gradleBuildOutputFolder": "D:\\Developer\\AndroidStudioProject\\RFID-Tools\\crapto1\\.cxx\\cxx\\release",
"isDebuggableEnabled": false,
"validAbiList": [
"ARMEABI_V7A",
"ARM64_V8A",
"ARMEABI_V7A"
"X86",
"X86_64"
],
"buildTargetSet": []
},
@@ -3,14 +3,6 @@
"level": "INFO",
"message": "Start JSON generation. Platform version: 18 min SDK version: arm64-v8a"
},
{
"level": "INFO",
"message": "Trying to locate CMake in local SDK repository."
},
{
"level": "INFO",
"message": "- CMake found in SDK at \u0027C:\\Users\\DXL\\android-sdk\\cmake\\3.10.2.4988404\u0027 had version \u00273.10.2\u0027"
},
{
"level": "INFO",
"message": "JSON \u0027D:\\Developer\\AndroidStudioProject\\RFID-Tools\\crapto1\\.cxx\\cmake\\release\\arm64-v8a\\android_gradle_build.json\u0027 was up-to-date"
@@ -5,7 +5,6 @@
"sdkFolder": "C:\\Users\\DXL\\android-sdk",
"isNativeCompilerSettingsCacheEnabled": false,
"isBuildOnlyTargetAbiEnabled": true,
"ideBuildTargetAbi": "arm64-v8a,armeabi-v7a,armeabi",
"splitsAbiFilterSet": [],
"intermediatesFolder": "D:\\Developer\\AndroidStudioProject\\RFID-Tools\\crapto1\\build\\intermediates",
"gradleModulePathName": ":crapto1",
@@ -42,8 +41,10 @@
"gradleBuildOutputFolder": "D:\\Developer\\AndroidStudioProject\\RFID-Tools\\crapto1\\.cxx\\cxx\\release",
"isDebuggableEnabled": false,
"validAbiList": [
"ARMEABI_V7A",
"ARM64_V8A",
"ARMEABI_V7A"
"X86",
"X86_64"
],
"buildTargetSet": []
},
@@ -3,6 +3,14 @@
"level": "INFO",
"message": "Start JSON generation. Platform version: 18 min SDK version: armeabi-v7a"
},
{
"level": "INFO",
"message": "Trying to locate CMake in local SDK repository."
},
{
"level": "INFO",
"message": "- CMake found in SDK at \u0027C:\\Users\\DXL\\android-sdk\\cmake\\3.10.2.4988404\u0027 had version \u00273.10.2\u0027"
},
{
"level": "INFO",
"message": "JSON \u0027D:\\Developer\\AndroidStudioProject\\RFID-Tools\\crapto1\\.cxx\\cmake\\release\\armeabi-v7a\\android_gradle_build.json\u0027 was up-to-date"
Binary file not shown.
+4 -4
View File
@@ -1,5 +1,5 @@
# ninja log v5
6 929 590655335 CMakeFiles/crapto1.dir/main.c.o abf70ed363b89f4b
4 1021 590655335 CMakeFiles/crapto1.dir/crypto1.c.o a9c0c0eff8c6d3e3
1 1117 590655336 CMakeFiles/crapto1.dir/crapto1.c.o 3210260d95a136fd
1117 2065 590655336 D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/build/intermediates/cmake/release/obj/x86/libcrapto1.so 9a1b8bb9e21a38f4
2 482 591194925 CMakeFiles/crapto1.dir/crypto1.c.o a9c0c0eff8c6d3e3
3 518 591194925 CMakeFiles/crapto1.dir/main.c.o abf70ed363b89f4b
0 522 591194925 CMakeFiles/crapto1.dir/crapto1.c.o 3210260d95a136fd
522 1201 591194926 D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/build/intermediates/cmake/release/obj/x86/libcrapto1.so 9a1b8bb9e21a38f4

Some files were not shown because too many files have changed in this diff Show More