From d223854c717934dfc098eff9574109db77dce8fd Mon Sep 17 00:00:00 2001 From: Corey Harding Date: Sun, 11 Mar 2018 20:07:44 -0400 Subject: [PATCH] Release v1.1.2 - Add Data Conversion Tools * Add ABA to ASCII conversion * Add Binary to HEX conversion --- README.md | 2 +- Source Code/esprfidtool/esprfidtool.ino | 89 ++++++++++++++++++++++++- Source Code/esprfidtool/version.h | 2 +- 3 files changed, 88 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 74c1b61..4257272 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ The device was made with minimal hardware to keep costs extremely low and in rea ## Making Sense of the Binary Data [Keypads](Keypad/README.md) -[Magstripe](Magstripe/README.md) +[Magstripe/ABA Format](Magstripe/README.md) ## Flashing Firmware From Web Interface: diff --git a/Source Code/esprfidtool/esprfidtool.ino b/Source Code/esprfidtool/esprfidtool.ino index 3e043a5..91660e5 100644 --- a/Source Code/esprfidtool/esprfidtool.ino +++ b/Source Code/esprfidtool/esprfidtool.ino @@ -82,6 +82,8 @@ String pinHTML; #include "pinSEND.h" +String dataCONVERSION=""; + WiegandNG wg; void LogWiegand(WiegandNG tempwg) { @@ -554,7 +556,7 @@ void LogWiegand(WiegandNG tempwg) { f.println(aba2str(magstripe,magStart,magEnd,"\"Reverse\" Swipe")); //f.print(""); - f.println(String()+F(" * You can verify the data at the following URL: https://www.legacysecuritygroup.com/aba-decode.php?binary=")+magstripe+F("")); + //f.println(String()+F(" * You can verify the data at the following URL: https://www.legacysecuritygroup.com/aba-decode.php?binary=")+magstripe+F("")); } //Debug @@ -971,7 +973,7 @@ void ViewLog(){ File f = SPIFFS.open(payload, "r"); String webString = f.readString(); f.close(); - ShowPL = String()+F("<- BACK TO INDEX

List Exfiltrated Data - Experimental TX Mode

-

Note: Preambles shown are only a guess based on card length and may not be accurate for every card format.
"+payload+"\n-----\n"+webString+"
"; + ShowPL = String()+F("<- BACK TO INDEX

List Exfiltrated Data - Experimental TX Mode - Data Conversion Tools

-

Note: Preambles shown are only a guess based on card length and may not be accurate for every card format.
"+payload+"\n-----\n"+webString+"
"; webString=""; server.send(200, "text/html", ShowPL); } @@ -1013,7 +1015,7 @@ void setup() { used=fs_info.usedBytes; String freespace; freespace=fs_info.totalBytes-fs_info.usedBytes; - server.send(200, "text/html", String()+F("ESP-RFID-Tool v")+version+F("

by Corey Harding
www.RFID-Tool.com
www.LegacySecurityGroup.com / www.Exploit.Agency

-----
File System Info Calculated in Bytes
Total: ")+total+" Free: "+freespace+" "+" Used: "+used+F("
-----
List Exfiltrated Data
-
Experimental TX Mode
-
Configure Settings
-
Format File System
-
Upgrade Firmware
-
Help")); + server.send(200, "text/html", String()+F("ESP-RFID-Tool v")+version+F("

by Corey Harding
www.RFID-Tool.com
www.LegacySecurityGroup.com / www.Exploit.Agency

-----
File System Info Calculated in Bytes
Total: ")+total+" Free: "+freespace+" "+" Used: "+used+F("
-----
List Exfiltrated Data
-
Experimental TX Mode
-
Data Conversion Tools
-
Configure Settings
-
Format File System
-
Upgrade Firmware
-
Help")); }); server.onNotFound([]() { @@ -1090,6 +1092,87 @@ void setup() { server.send_P(200, "text/html", License); }); + server.on("/data-convert", [](){ + + if (server.hasArg("bin2hexHTML")) { + + int bin2hexBUFFlen=(((server.arg("bin2hexHTML")).length())+1); + char bin2hexCHAR[bin2hexBUFFlen]; + (server.arg("bin2hexHTML")).toCharArray(bin2hexCHAR,bin2hexBUFFlen); + + dataCONVERSION+=String()+F("Binary:")+bin2hexCHAR+F("

"); + + String hexTEMP=""; + + int binCOUNT=(bin2hexBUFFlen-1); + for (int currentBINpos=0; currentBINposYou may want to drop the leading zero(if there is one) and if your cloning software does not handle it for you.

"); + hexTEMP=""; + + dataCONVERSION+=F("

"); + + bin2hexBUFFlen=0; + } + + if (server.hasArg("abaHTML")) { + String abaHTML=(server.arg("abaHTML")); + + dataCONVERSION="Trying \"Forward\" Swipe
"; + dataCONVERSION+=("Forward Binary:"+abaHTML+"
"); + int abaStart=abaHTML.indexOf("11010"); + int abaEnd=(abaHTML.lastIndexOf("11111")+4); + dataCONVERSION+=aba2str(abaHTML,abaStart,abaEnd,"\"Forward\" Swipe"); + + dataCONVERSION+=" * Trying \"Reverse\" Swipe
"; + int abaBUFFlen=((abaHTML.length())+1); + char abachar[abaBUFFlen]; + abaHTML.toCharArray(abachar,abaBUFFlen); + abaHTML=String(strrev(abachar)); + dataCONVERSION+=("Reversed Binary:"+abaHTML+"
"); + abaStart=abaHTML.indexOf("11010"); + abaEnd=(abaHTML.lastIndexOf("11111")+4); + dataCONVERSION+=aba2str(abaHTML,abaStart,abaEnd,"\"Reverse\" Swipe"); + + //dataCONVERSION+=(String()+F(" * You can verify the data at the following URL:
https://www.legacysecuritygroup.com/aba-decode.php?binary=")+abaHTML+F("")); + dataCONVERSION.replace("*", "

"); + dataCONVERSION.replace(":", ": "); + + abaHTML=""; + abaStart=0; + abaEnd=0; + } + + server.send(200, "text/html", String()+F( + "<- BACK TO INDEX

") + +dataCONVERSION+ + F( + "
" + "
" + "Convert ABA Binary Data to ASCII:
" + "
" + "
" + "
" + "
" + "
" + "Convert Binary Data to HEX:
" + "For use with card cloning, typically includes both the preamble and card data(binary before and after the space in log).
" + "
" + "
" + "
" + ) + ); + + dataCONVERSION=""; + }); + server.on("/stoptx", [](){ server.send(200, "text/html", F("This will kill any ongoing transmissions.

Are you sure?

YES - NO")); }); diff --git a/Source Code/esprfidtool/version.h b/Source Code/esprfidtool/version.h index 1f6660f..fb6fcae 100644 --- a/Source Code/esprfidtool/version.h +++ b/Source Code/esprfidtool/version.h @@ -1 +1 @@ -String version = "1.1.1337"; +String version = "1.1.2";