Skip to content

Commit 626dee1

Browse files
committed
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.
1 parent 2bd7375 commit 626dee1

File tree

1,167 files changed

+7529
-2958
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,167 files changed

+7529
-2958
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ android {
2525
//单元测试的支持
2626
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2727
//版本号,整形
28-
versionCode 3
28+
versionCode 4
2929
//版本名称,字符串!
30-
versionName "1.3"
30+
versionName "1.3.1"
3131
}
3232
//构建的类型,发布版和测试版
3333
buildTypes {

app/src/main/java/cn/rrg/rdv/activities/px53x/MfcukConsoleActivity.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,53 @@
22

33
import android.content.DialogInterface;
44
import android.content.Intent;
5+
6+
import androidx.annotation.Nullable;
57
import androidx.appcompat.app.AlertDialog;
8+
9+
import android.os.Bundle;
610
import android.view.View;
11+
import android.widget.TextView;
712

13+
import cn.dxl.common.util.ViewUtil;
14+
import cn.dxl.common.widget.ToastUtil;
815
import cn.rrg.console.define.ICommandTools;
916
import cn.rrg.console.define.ICommandType;
1017
import cn.rrg.natives.MfcukTools;
18+
import cn.rrg.natives.PN53XTagLeaksAdapter;
19+
import cn.rrg.rdv.R;
1120
import cn.rrg.rdv.implement.EntryICommandType;
1221

1322
public class MfcukConsoleActivity extends PN53XConsoleActivity {
1423

24+
private AlertDialog checkTipsDialog;
25+
private TextView txtMsgView;
26+
27+
@Override
28+
protected void onCreate(@Nullable Bundle savedInstanceState) {
29+
super.onCreate(savedInstanceState);
30+
31+
checkTipsDialog = new AlertDialog.Builder(context).create();
32+
checkTipsDialog.setTitle(R.string.tips);
33+
View continer = ViewUtil.inflate(context, R.layout.dialog_working_msg);
34+
txtMsgView = continer.findViewById(R.id.text1);
35+
txtMsgView.setText(R.string.msg_working_darkside_check);
36+
checkTipsDialog.setView(continer);
37+
checkTipsDialog.setCancelable(false);
38+
}
39+
40+
private void showWorkingDialog(boolean show) {
41+
runOnUiThread(new Runnable() {
42+
@Override
43+
public void run() {
44+
if (show)
45+
checkTipsDialog.show();
46+
else
47+
checkTipsDialog.dismiss();
48+
}
49+
});
50+
}
51+
1552
@Override
1653
protected View getCommandGUI() {
1754
return null;
@@ -39,6 +76,24 @@ public String parseKey(String output) {
3976

4077
@Override
4178
protected int startTest(ICommandTools cmd) {
79+
showWorkingDialog(true);
80+
// Judge if there is have a nack loophole
81+
if (!new PN53XTagLeaksAdapter().isDarksideSupported()) {
82+
showWorkingDialog(false);
83+
// darkside no supported.
84+
runOnUiThread(new Runnable() {
85+
@Override
86+
public void run() {
87+
new AlertDialog.Builder(context)
88+
.setTitle(R.string.tips)
89+
.setMessage(getString(R.string.msg_darkside_no_supported)).show();
90+
}
91+
});
92+
return -1;
93+
} else {
94+
showWorkingDialog(false);
95+
ToastUtil.show(context, getString(R.string.msg_darkside_support), false);
96+
}
4297
mDefaultCMD = "mfcuk -C -R 0:A -w -v 2";
4398
return super.startTest(cmd);
4499
}

app/src/main/res/values-en/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,5 +323,8 @@
323323
<string name="msg_special_tag">Found chinese magic tag.</string>
324324
<string name="msg_normal_tag_found">Found normal tag.</string>
325325
<string name="sector_line">Sector</string>
326+
<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>
327+
<string name="msg_working_darkside_check">Checking whether the card supports Darkside</string>
328+
<string name="msg_darkside_support">The card supports Darkside</string>
326329

327330
</resources>

app/src/main/res/values-zh/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,8 @@
319319
<string name="msg_special_tag">发现特殊的后门UID标签!</string>
320320
<string name="msg_normal_tag_found">发现普通的标签!</string>
321321
<string name="sector_line">扇 区</string>
322+
<string name="msg_darkside_no_supported">卡片不支持Darkside漏洞(MFCUK、全加密)测试,请更换卡片或者使用Nested漏洞(MFOC、半加密)测试工具,或者Hardnested漏洞(高强度的Nested漏洞)测试工具,或者嗅探。</string>
323+
<string name="msg_working_darkside_check">正在检查该卡片是否支持Darkside</string>
324+
<string name="msg_darkside_support">该卡片支持Darkside漏洞</string>
322325

323326
</resources>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,5 +322,8 @@
322322
<string name="msg_special_tag">Found chinese magic tag.</string>
323323
<string name="msg_normal_tag_found">Found normal tag.</string>
324324
<string name="sector_line">Sector</string>
325+
<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>
326+
<string name="msg_working_darkside_check">Checking whether the card supports Darkside</string>
327+
<string name="msg_darkside_support">The card supports Darkside</string>
325328

326329
</resources>

commapping/src/main/java/cn/rrg/com/SppHasBlock.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public static SppHasBlock get() {
3232

3333
@Override
3434
public int write(byte[] sendMsg, int offset, int length, int timeout) throws IOException {
35+
setThreadPriority();
3536
if (outputStream == null) return -1;
3637
outputStream.write(sendMsg, offset, length - offset);
3738
outputStream.flush();
@@ -40,6 +41,7 @@ public int write(byte[] sendMsg, int offset, int length, int timeout) throws IOE
4041

4142
@Override
4243
public int read(byte[] recvMsg, int offset, int length, int timeout) throws IOException {
44+
setThreadPriority();
4345
if (inputStream == null) return -1;
4446
long start = System.currentTimeMillis();
4547
while (inputStream.available() < (length - offset)) {
@@ -59,4 +61,8 @@ public int read(byte[] recvMsg, int offset, int length, int timeout) throws IOEx
5961
public int getUniqueId() {
6062
return UNIQUE_ID;
6163
}
64+
65+
private void setThreadPriority() {
66+
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
67+
}
6268
}
7.31 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ninja log v5
2+
1 341 591194423 CMakeFiles/crapto1.dir/crapto1.c.o 2ae20ff9d3de30c2
3+
4 356 591194423 CMakeFiles/crapto1.dir/crypto1.c.o 208a3418496fca92
4+
6 485 591194424 CMakeFiles/crapto1.dir/main.c.o 1902701a56f595ff
5+
485 811 591194424 D:/Developer/AndroidStudioProject/RFID-Tools/crapto1/build/intermediates/cmake/debug/obj/x86/libcrapto1.so ac668822d378730a
16.3 KB
Binary file not shown.
8.41 KB
Binary file not shown.

0 commit comments

Comments
 (0)