Repository: rfidtool/ESP-RFID-Tool
Branch: master
Commit: b0bb4cc692af
Files: 25
Total size: 153.9 KB
Directory structure:
gitextract_t2rxqmyl/
├── .gitignore
├── Connector-Adapter-Options/
│ ├── Punchdown-Adapter-1/
│ │ ├── BOM
│ │ └── Image-Credits.txt
│ ├── Punchdown-Adapter-2/
│ │ ├── BOM
│ │ └── Image-Credits.txt
│ └── README.md
├── Images/
│ └── README.md
├── Installation-Schematics/
│ └── README.md
├── Keypad/
│ └── README.md
├── LICENSE
├── Magstripe/
│ ├── README.md
│ └── aba-decode.php
├── README.md
└── Source Code/
└── esprfidtool/
├── HelpText.h
├── LICENSE
├── License.h
├── WiegandNG.cpp
├── WiegandNG.h
├── aba2str.h
├── api.h
├── api_server.h
├── esprfidtool.ino
├── pinSEND.h
├── strrev.h
└── version.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*bin
================================================
FILE: Connector-Adapter-Options/Punchdown-Adapter-1/BOM
================================================
Choose the wire gauge, purchase (2) of the "2 WAY" terminals and purchase the appropriate punch down tool.
The combination of parts below are currently untested.
Tool Punch Down Tool Hand Tools ASSEMBLY BIT INSUL DIA 1.60; Mfr. #: 069176701602000 ; Mouser Part #: 581-069176701602000
Choose your targets wiring size below.
* I found that you can abuse a 20AWG connector to accept from 24-20AWG wire, an 18AWG connector would not skin 24AWG wire in my tests.
Research is still ongoing regarding an officially recommended connector.
18AWG IDC Punch Down Block
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
20AWG IDC Punch Down Block *
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
22AWG IDC Punch Down
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
24AWG IDC Punch Down
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
================================================
FILE: Connector-Adapter-Options/Punchdown-Adapter-1/Image-Credits.txt
================================================
PCB renders generated using https://pcbs.io.
================================================
FILE: Connector-Adapter-Options/Punchdown-Adapter-2/BOM
================================================
Choose the wire gauge, purchase (2) of the "2 WAY" terminals and purchase the appropriate punch down tool.
The combination of parts below are currently untested.
Tool Punch Down Tool Hand Tools ASSEMBLY BIT INSUL DIA 1.60; Mfr. #: 069176701602000 ; Mouser Part #: 581-069176701602000
Choose your targets wiring size below.
* I found that you can abuse a 20AWG connector to accept from 24-20AWG wire, an 18AWG connector would not skin 24AWG wire in my tests.
Research is still ongoing regarding an officially recommended connector.
18AWG IDC Punch Down Block
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
20AWG IDC Punch Down Block *
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
22AWG IDC Punch Down
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
24AWG IDC Punch Down
(D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
(+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
================================================
FILE: Connector-Adapter-Options/Punchdown-Adapter-2/Image-Credits.txt
================================================
PCB renders generated using https://pcbs.io.
================================================
FILE: Connector-Adapter-Options/README.md
================================================
## Connector Options
### Standard Screwdown Connection


### Gray Wire Nuts 22-16AWG

##### Note: For 24AWG you need to twist the wires and fold them over once to obtain a secure connection or use smaller wire nuts(They make a 24-18AWG which is perfect but color varies). Gray Wire Nuts are common though and can be found in most hardware stores.
### Screwdown to T-Taps (Wire Splices)
#### T-Tap Example 1

* Uxcell T-Tap Male Insulated Wire Terminal Quick Connector Combo Set 10 Piece, Red
* by Uxcell
[$6.82 on Amazon](http://a.co/6joYNzS)
##### Note: These may require a light squeeze on the connector with pliers to cut past the insulation properly. Links are not suggested brands but simply examples.
#### T-Tap Example 2
* Brightfour Quick Wire Splice Connector-T type 1 Pin solderless- Compatible with 22 - 20 AWG Cable for Some Tight-fitting Automotive Uses
* by Brightfour
[$8.44 on Amazon](http://a.co/bAw7Fdw)
##### Note: These may require a light squeeze on the connector with pliers to cut past the insulation properly. Links are not suggested brands but simply examples.
### Screwdown to Punchdown Adapter
##### PCB renders generated using https://pcbs.io.
#### Side by Side
* [Gerber File](Punchdown-Adapter-1/punchdown-adapter-Gerber.zip)
* [BOM File](Punchdown-Adapter-1/BOM)
* [Order PCB](https://pcbs.io/share/4KXmA)

 
#### Perpendicular
* [Gerber File](Punchdown-Adapter-2/punchdown-adapter2-Gerber.zip)
* [BOM File](Punchdown-Adapter-2/BOM)
* [Order PCB](https://pcbs.io/share/zy0jg)
The image pictured below is a custom build with the programming header removed, and the screwdown block replaced by a 4 pin header which was soldered in place and then broken off once the adapter was added on. I easily performed all of these modifications by hand using both a soldering iron and hot air rework station.

 
================================================
FILE: Images/README.md
================================================




================================================
FILE: Installation-Schematics/README.md
================================================





================================================
FILE: Keypad/README.md
================================================

================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) [2018] [Corey Harding]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Magstripe/README.md
================================================
## ABA Encoding
Wiegand Magstripe Readers Tested:
* HID 3110-6445 Magstripe Pass-Through Reader
* set to rotary position B (Raw Data - All Bits Wiegand)
* HID multiCLASS RM40 iCLASS/Magstripe Reader 6220CKN000B
* purchase a reader with the last digit B in item # (ex: 6220CKN000**B**)
RFID-Tool Specific Settings
* set buffer size to 256 bits or greater
See [aba-decode.php](aba-decode.php) script for converting binary card data to ascii (Script by: AndrewMohawk)
* Command Line: /usr/bin/php aba-decode.php 1101000001100000100011001001001010101101111000001010011101101111100010
* Web: https://www.LegacySecurityGroup.com/aba-decode.php
Binary:
5 bits
Little Endian Format
LRC(Longitudinal Redundancy Check):
Count # of set bits(1's) in column
EVEN = 0
ODD = 1
Track 2 Debit/Credit Card Format(for example, as I could not find actual magstripe access control cards):
;1234567890123456=YYMMSSSDDDDDDDDDDDDDD?*
; = Start Sentinel
1234567890123456 = 16 Digit Card #
= = End Card #
YY = Expiration Year
MM = Expiration Month
SSS = Service Code (As Understood From Wikipedia: "201" means chip required, "101" means no chip, be sure to recalculate the LRC if changing, it is not advised to experiment here without knowing the laws involved)
DDDDDDDDDDDDDD = Discretionary Data
? = End Sentinel
*=LRC
Binary Reference:
11010 ; - Start Sentinel
00001 0
10000 1
01000 2
11001 3
00100 4
10101 5
01101 6
11100 7
00010 8
10011 9
00111 <
01110 >
01011 :
10110 = - End Card Number
11111 ? - End Sentinel
00010 LRC
================================================
FILE: Magstripe/aba-decode.php
================================================
<?php
/*
USAGE:
Command Line: /usr/bin/php aba-decode.php 1101000001100000100011001001001010101101111000001010011101101111100010
Web: www.LegacySecurityGroup.com/aba-decode.php?binary=1101000001100000100011001001001010101101111000001010011101101111100010
*/
/* Decode Track 2 data from binary */
if (defined('STDIN')) {
$binary = filter_var($argv[1], FILTER_SANITIZE_NUMBER_INT);
define( "LINEBREAK", PHP_EOL);
} else {
if(isset($_POST['submit'])) {
$binary = filter_input(INPUT_POST, 'binary', FILTER_SANITIZE_NUMBER_INT);
}
else {
$binary = filter_input(INPUT_GET, 'binary', FILTER_SANITIZE_NUMBER_INT);
}
define( "LINEBREAK", "<br>");
}
if (empty($binary)) {
$binary = "1101000001100000100011001001001010101101111000001010011101101111100010";
}
echo "https://github.com/rfidtool/ESP-RFID-Tool/blob/master/Magstripe/aba-decode.php" . LINEBREAK;
echo "For converting Track 2 Magstripe ABA Binary data to ASCII" . LINEBREAK . LINEBREAK;
echo "Original script by: AndrewMohawk" . LINEBREAK;
// andrew@andrewmohawk.com
echo "http://www.andrewmohawk.com" . LINEBREAK . LINEBREAK;
echo "Modified slightly by: Corey Harding" . LINEBREAK;
echo "www.LegacySecurityGroup.com / www.Exploit.Agency" . LINEBREAK . LINEBREAK;
if (!defined('STDIN')) {
?>
<html>
<body>
<form action="<?php basename(__FILE__, '.php'); ?>" method="post">
<input type='text' name="binary" value="<?php echo $binary; ?>" />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
<?php
}
// this function by mtroy dot student at gmail dot com taken from http://php.net/manual/en/function.strpos.php
function strpos_r($haystack, $needle)
{
if(strlen($needle) > strlen($haystack))
trigger_error(sprintf("%s: length of argument 2 must be <= argument 1", __FUNCTION__), E_USER_WARNING);
$seeks = array();
while($seek = strrpos($haystack, $needle))
{
array_push($seeks, $seek);
$haystack = substr($haystack, 0, $seek);
}
return $seeks;
}
function processBinary($binary)
{
$AsciiOutput = "";
//find start sentinel
$start_sentinel = strpos($binary,"11010");
if($start_sentinel === false)
{
echo "Could not find start sentinel" . LINEBREAK;
return false;
}
//find end sentinel
$end_sentinel = false;
$end_sentinel = strrpos($binary,"11111");
if(count($end_sentinel) == 0)
{
echo "Could not find end sentinel" . LINEBREAK;
return false;
}
//Lets decode the data:
$bit_length = 5; // 4 bits for data, 1 bit for odd-parity or LRC checking
$data = substr($binary,$start_sentinel,($end_sentinel-$start_sentinel+5));
$currentBits = "";
$currentNum = 0;
$finalString = "";
for($i=0;$i<strlen($data);$i++)
{
if(strlen($currentBits) < $bit_length)
{
$currentBits .= $data[$i];
}
if(strlen($currentBits) == $bit_length)
{
$parityBit = $currentBits[4];
$dataBits = substr($currentBits,0,4);
$asciiChar = 0;
for($x=0;$x<4;$x++)
{
$currentNum += $dataBits[$x];
}
$dec = bindec($dataBits);
$dec = str_pad($dec, 2, "0", STR_PAD_LEFT); // just so output is nice
$asciiChar = chr(bindec(strrev($dataBits))+48); // reverse the binary (since its LSB first) then convert to dec, add 48 and then take it to ASCII
echo "$currentBits - Data ($dataBits) Parity($parityBit) Decimal ($dec) Ascii($asciiChar)";
if(($currentNum + $parityBit) % 2 == false)
{
echo " __ Parity: Invalid";
}
else
{
echo " __ Parity: Valid";
}
$AsciiOutput .= $asciiChar;
echo LINEBREAK;
$currentBits = "";
$currentNum = 0;
}
}
echo LINEBREAK . LINEBREAK . "Total Out (ascii): $AsciiOutput" . LINEBREAK;
}
echo "Decoding " . $binary . LINEBREAK . LINEBREAK;
echo "Trying One way:" . LINEBREAK . LINEBREAK;
if (processBinary($binary) == false)
{
//reverse.
echo LINEBREAK . LINEBREAK;
echo "Trying The Reverse:" . LINEBREAK . LINEBREAK;
processBinary(strrev($binary));
}
================================================
FILE: README.md
================================================
# ESP-RFID-Tool
By Corey Harding

Official website:
* www.rfid-tool.com

April Brother is currently manufacturing this hardware and it can be purchased direct from China from their
* Official Store: https://blog.aprbrother.com/product/esp-rfid-tool
* AliExpress Store: https://www.aliexpress.com/item/ESP-RFID-Tool/32850151497.html
* Tindie Store: https://www.tindie.com/products/aprbrother/esp-rfid-tool/
Third Party Distributors:
* Hacker Warehouse(USA): https://hackerwarehouse.com/product/esp-rfid-tool/
Video Demos of Capturing Credentials using various technologies that utilize a Wiegand Interface:
* Performing a REPLAY ATTACK using the Experimental TX feature: https://youtu.be/u1y7UZpup9I
* Brute forcing PIN codes using the Experimental TX feature: https://youtu.be/OZCaypGBVv4
* Portable HID 5375 Long Range RFID Reader: https://youtu.be/B86926CHImE
* HID 5355 RFID/Keypad Reader: https://youtu.be/ojIpcY8Y3KQ
* HID multiCLASS RM40 RFID/Magstripe Reader: https://youtu.be/9OccRaLxXg8
* HID multiCLASS RFID Reader: https://youtu.be/2sCLkpuxAks
* RFID/Biometric/Keypad with Electronic Deadbolt: https://youtu.be/0o8r_ufRrFo
Firmware:
* Official
* ESP-RFID-Tool: https://github.com/rfidtool/ESP-RFID-Tool/releases
* Releases >=1.1.0 are compiled with esp8266 board manager package 2.4.1
* Releases < 1.1.0 are compiled with esp8266 board manager package 2.3.0
* Unofficial
* Port of Tastic RFID Thief: https://github.com/exploitagency/ESP-RFID-Thief/releases
## Intended use cases
* Security researchers performing red team assessments.
* Capturing card values to later be cloned.
* Replaying raw binary captures.*(see note below)
* Fuzzing access control systems.*(see note below)
* Brute forcing PIN codes.*(see note below)
* Denial of Service mode.*(see note below)
* To create a standalone device for capturing credentials or testing badges and or card readers without the need for a Wiegand Controller.
* Add a battery and a card reader to make the unit portable.
* Add a benchtop power supply to use for testing hardware.
* Installers troubleshooting issues with a card reader, the data lines, or even testing for a faulty card.
* Useful for merchants or surplus resellers who are testing if access control equipment is functional.
* Hobbyist experimenting with various systems that utilize a Wiegand Interface.
* Simulating an access control system using multiple units of ESP-RFID-Tool.
* RFID-Tool is not intended to be used in any unlawful manner.
## What is it?
A universal data logger that captures the raw binary data from a standard 5V Wiegand Interface. The device is capable of logging the credentials for access control systems or nearly any device that utilizes a Wiegand Interface such as RFID card readers, pin pads, magnetic stripe systems, barcode, and even some biometric readers. Wiegand Interfaces also do not have to be limited to just access control systems. The main target group for this device is 26-37bit HID cards. For known card types both the binary and hexadecimal data is displayed directly in the log file for easy badge identification and also in case a clone of a card may be needed. For unknown card types only the raw binary data is shown.
## How do you install it?
The device may be installed directly into an existing system drawing its power from the preexisting wiring or it can also be used to turn a reader into a standalone portable unit for data logging when a battery is added. Wiring is simple and consists of 4 wires, (+), (-), D0(Green), and D1(White). The device is capable of operating on voltages ranging from around 4.5V up to a maximum of 12v. Commonly found voltages are 12V and 5V. **(See Installation Notes Below)
## How do you access the logs?
Access to the log files and various settings is provided via a web based interface. The device has WiFi capabilities and can be set up to spawn its own access point or set to connect to an existing network. In the event you get locked out of the web interface you can bridge the J3 jumper on power up or while resetting the device to regain access without losing your log files.
## I want to know a little more...
The hardware is based on an ESP12 WiFi chip with a full TCP/IP stack and Microcontroller Unit. The software is open source licensed under the MIT License and will be released the day the product is launched. The software will reside in this GitHub repo so it may be reviewed by the community. We will accept various pull requests from the community after being reviewed if it improves the value of the device for others. The software was written in the Arduino IDE so both hobbyist and professionals will have no issue modifying the code if they so choose. A Wiegand Interface operates using 3 wires, a ground, Data0, and Data1. A zero is sent when D0 goes low and a one is sent when D1 goes low, the other line remains high during this time. The timing is 40uS from low to high on a line with 2mS between bits. The software logs this binary output to a file and if the device thinks it is a known card format the preamble is guessed(not sent by card reader but it is the same for all cards of a specific format, our primary target is 26-37bit HID cards) and both the raw binary and hexadecimal data is logged. For unkown card formats only the raw binary output is logged with no guess at the preamble and without showing the data in hexadecimal format to prevent confusion. If you know what kind of card was captured, simply look up the preamble and add it to the beginning of the binary then typically convert it to hexadecimal format to make a clone of a card. It is possible the card is actually an unknown format and the preamble was guessed incorrectly with the device thinking it was a known card format(the guess is based on the bit count output by the reader), if this is the case in the log file there is a literal space in the binary between the preamble and the card data, simply ignore the preamble. When replaying a captured credential*(see note below) you do not include the preamble as that is not output by the card reader but instead you only replay*(see note below) the actual card data as output from the reader. You only need to worry about the preamble if making a clone of a card. The primary function of this device is for logging the raw binary data as output from a Wiegand Interface. You can read from 1 bit all the way up to 4,096 bits. The default buffer setting only allows 52 bits and must be manually increased from the settings page accessible from the web interface.
## *Experimental TX Mode
The device was made with minimal hardware to keep costs extremely low and in reach of hobbyist and also so security professionals can buy multiple units and also use them without the fear of losing a unit. This being said there are no level shifters on the board.(It is possible that in the future a PRO version may be released) This means that with the current hardware the device can work with a 3V3 Wiegand Interface as well as a 5V Wiegand interface because the hardware operates at 3V3 and is also 5V tolerant. The drawback of this is that not all 5V Wiegand controllers are guaranteed to be triggered when replaying or fuzzing data because only 3V3 is output from the device. There is also a risk when the device is in TX mode and the output goes low for 40uS, if the device were to also receive data during this time there will be a short. For this reason be sure that absoulutely no cards are being scanned while the device is in TX mode. The device does not go into TX mode until you press on a form submit button and as soon as the data is done being transmitted it goes back into listening mode. For the reasons above TX mode is for experimental use only and was designed primarily for easily debugging the software when making changes.(two units were tied together)
**Use transmit mode at your own risk, it is not officially supported. Consider it a bonus in the software.**
## **Installation Notes
[Click here for wiring diagrams](Installation-Schematics/README.md)
[Click here to see connector options](/Connector-Adapter-Options/README.md)
* Make sure the reader outputs data in the Wiegand format
* Connect D0 on device to D0 on reader
* Connect D1 on device to D1 on reader
* Connect + on device to + on reader
* Connect - on device to - on reader
* The ESP-RFID-Tool accepts 4.5-12v but you must also be sure to supply enough voltage and current to power your reader if creating a standalone or portable unit.
* SAFETY: It has come to my attention that the voltage regulator used on the commercially available units that you may find for sale is different than the voltage regulator I originally chose for this project. Also due to global chip shortages and the possibility of manufacturers substituting components I am downgrading the absolute maximum voltage rating to 12v as in you may be stressing the unit to its limits at this voltage and extra care should be taken. Most of my smaller portable prototypes ran at around 9v(x6 AA Batteries) and I found this to be more than adequate, remember that you can always power your reader and the RFID-Tool unit separately if needed and I suggest supplying your project with the lowest possible voltage that you can get away with. In fact, I have found multiple readers that run just fine at less than the recommended voltage. Note that I did not notice a significant range increase in my original testing between supplying 12v and 24v to my reader(I do not recommend this as I tend to abuse the specs for what I am testing, and I was using a different voltage regulator in my prototype). Also be advised that most commonly used batteries produce more than the commonly stated nominal voltage at a full charge. It may also be a good idea to apply a heatsink to your voltage regulator especially if you notice that the unit runs hot at your chosen voltage. It is also never recommended to leave your device unattended. Please be safe and take all necessary safety precautions when testing your setup.
* OPTIONAL: Connect 4.5-12v battery into the same + and -(only if building a portable unit, do not add a battery if implanting device into an existing installation, or if you do use a battery do not connect the + wire from the existing installation to your device, only tie in the GND -)
* NOTE: At a minimum D0, D1, and GND(-) must be connected to the reader for proper function, no matter the power source.
* Configure settings
* See Below
## Making Sense of the Binary Data
[Keypads](Keypad/README.md)
[Magstripe/ABA Format](Magstripe/README.md)
## Flashing Firmware
OPTION 1: OTA via the Web Interface:
* Download one of the latest releases from
* https://github.com/rfidtool/ESP-RFID-Tool/releases
* Login to the device's admin panel and upgrade the firmware.
OPTION 2: Arduino IDE:
* Use the ESP Flasher R4 by April Brother:
* https://blog.aprbrother.com/product/esp-flasher-r4
* Clone/download the source.
* Add these libraries:
* ArduinoJson library 5.13.1 by Benoit Blanchon
* https://github.com/bblanchon/ArduinoJson
* ESP8266FtpServer.h
* https://github.com/exploitagency/esp8266FTPServer/tree/feature/bbx10_speedup
* Choose the board NodeMCU 1.0.
* Upload.
## Software Help
### Accessing ESP-RFID-Tool Web Interface
SSID: "ESP-RFID-Tool"
URL: http://192.168.1.1
### Configure ESP-RFID-Tool
#### Default credentials to access the configuration page:
* Username: "admin"
* Password: "rfidtool"
#### Default credentials for ftp server:
* Username: "ftp-admin"
* Password: "rfidtool"
#### WiFi Configuration:
Network Type:
* Access Point Mode: Create a standalone access point(No Internet Connectivity-Requires Close Proximity)
* Join Existing Network: Join an existing network(Possible Internet Connectivity-Could use Device Remotely)
Hidden: Choose whether or not to use a hidden SSID when creating an access point
SSID: SSID of the access point to create or of the network you are choosing to join
Password: Password of the access point which you wish to create or of the network you are choosing to join
Channel: Channel of the access point you are creating
IP: IP to set for device
Gateway: Gateway to use, make it the same as ESP-RFID-Tool's IP if an access point or the same as the router if joining a network
Subnet: Typically set to 255.255.255.0
#### Web Interface Administration Settings:
Username: Username to configure/upgrade ESP-RFID-Tool
Password: Password to configure/upgrade ESP-RFID-Tool
FTP Server Settings:
Note: Supports Passive(PASV) Mode Only!
* Enabled: Turn FTP Server ON
* Disabled: Turn FTP Server OFF
Username: Username to login to ftp server
Password: Password to login to ftp server
Power LED:
* Enabled: Turn ON Power LED
* Disabled: Turn OFF Power LED
RFID Capture Log:
Useful to change this value to differentiate between facilities during various security assessments.
File Name: File name to save captured RFID tags to for the current security assessment.
#### List Exfiltrated Data
Displays all log files containing RFID tag captures.
#### Format File System
This will erase the contents of the SPIFFS file system including ALL RFID tag captures.
Formatting may take up to 90 seconds.
All current settings will be retained unless you reboot your device during this process.
#### Upgrade ESP-RFID-Tool Firmware
Authenticate using your username and password set in the configuration page.
Default credentials to access the firmware upgrade page:
* Username: "admin"
* Password: "rfidtool"
Select "Browse" choose the new firmware to be uploaded and then click "Upgrade".
You will need to manually reset the device upon the browser alerting you that the upgrade was successful.
#### Jumpers
* J1: Bridge to reset the board(your FTDI doesn't have a reset button?)
* J2: Cut the trace to disable DTR pin after programming then use it as an additional IO(continue updating firmware via web interface)
* J3: Bridge this during a power cycle to restore default configuration without losing your log files.
#### Restore Default Settings
* Option 1: Go to settings under web interface and choose restore default configuration.
* Option 2: Bridge J3 before booting the device. (Either before powering on or bridge it and reset the device)
* Option 3: Connect via serial(9600 baud) and send the command "ResetDefaultConfig:" without quotes.
## History
I pushed the design for the original prototype to GitHub back in September of 2016 albeit under a different repo. I was using an Adafruit Feather Huzzah running some code that I had modified porting the Tastic RFID Thief(by Fran Brown from Bishop Fox) to the ESP12S chip. At the time no sort of Wiegand logger existed offering WiFi capabilities and providing an easy to use web interface for accessing the log files.(I could not find one so I created it) During the second evolution of the project I decided to design dedicated hardware and I lightly upgraded the software. It was open source hardware and it was out there on GitHub but still not easily available to the masses. Not everyone is confident in surface mount soldering and even for me it was time consuming assembling boards for personal use. It was then that I realized there is a need for an affordable device like mine to be mass produced so anyone that has a legitimate for need one can have access to it. During the third stage I redesigned both the software and the hardware and decided to contact April Brother to see about them manufacturing it and selling it for a fair price. That is when ESP-RFID-Tool was born.
## Licensing Information
Created by Corey Harding
https://github.com/rfidtool/ESP-RFID-Tool
ESP-RFID-Tool software is licensed under the MIT License
#### Libraries/borrowed code being used
##### Arduino and ESP8266 core libraries
* Typically: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
* Assorted Authors
##### ArduinoJson.h
* The MIT License (MIT)
* Copyright (c) 2014-2017 Benoit BLANCHON
##### ESP8266FtpServer.h
* GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
* Originally by nailbuster, later modified by bbx10 and apullin
##### WiegandNG.h
* GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
* JP Liew
##### Wiegand Preamble Calculator Code
* No License Specified
* Fran Brown of Bishop Fox
##### strrev.h
* Custom License(see file)
* Copyright (c) 2007 Dmitry Xmelkov
##### aba-decode.py
* No License Specified
* Andrew MacPherson(andrewmohawk)
================================================
FILE: Source Code/esprfidtool/HelpText.h
================================================
const char HelpText[] PROGMEM = R"=====(
<!DOCTYPE HTML>
<html>
<head><title>ESP-RFID-Tool Help Page</title></head>
<body>
<a href="/"><- BACK TO INDEX</a><br><br>
-----<br>
HELP<br>
-----<br>
<br>
ESP-RFID-Tool<br>
<br>
Created by Corey Harding<br>
www.LegacySecurityGroup.com / www.Exploit.Agency<br>
<a href="https://github.com/rfidtool/ESP-RFID-Tool">https://github.com/rfidtool/ESP-RFID-Tool</a> - See Link for Updated Firmware or for more detailed Help<br>
<br>
The ESP-RFID-Tool is a tool created for logging Wiegand data and also for testing devices that contain a Wiegand Interface. The primary target group is 26-37bit HID Cards but it will also work with most devices that output Wiegand data. ESP-RFID-Tool can be combined with a RFID reader and a battery to create a portable standalone RFID badge logger, it can also be integrated into existing systems without the need for a battery and instead drawing its power directly from the wiring in the existing installation. The ESP-RFID-Tool can read the data from any device that contains a Wiegand Interface and outputs data from 1 bit long up to 4,096 bits long, although anything other than 26-37bit is experimental. The ESP-RFID-Tool is not even limited to RFID technologies, many other devices also contain a Wiegand Interface as it is an access control system standard, this includes pin pads(keypad), magnetic stripe(magstripe), there are even non access control related devices that utilize a Wiegand Interface.<br>
<br>
The ESP-RFID-Tool software is distributed under the MIT License. The license and copyright notice can not be removed and must be distributed alongside all future copies of the software.<br>
<br>
-----<br>
Accessing ESP-RFID-Tool Web Interface<br>
-----<br>
<br>
SSID: "ESP-RFID-Tool"<br>
URL: http://192.168.1.1<br>
<br>
-----<br>
Configure ESP-RFID-Tool<br>
-----<br>
<br>
Default credentials to access the configuration page:<br>
Username: "admin"<br>
Password: "rfidtool"<br>
<br>
Default credentials for ftp server:<br>
Username: "ftp-admin"<br>
Password: "rfidtool"<br>
<br>
WiFi Configuration:<br>
<br>
Network Type:<br>
Access Point Mode: Create a standalone access point(No Internet Connectivity-Requires Close Proximity)<br>
Join Existing Network: Join an existing network(Possible Internet Connectivity-Could use Device Remotely)<br>
<br>
Hidden: Choose whether or not to use a hidden SSID when creating an access point<br>
<br>
SSID: SSID of the access point to create or of the network you are choosing to join<br>
Password: Password of the access point which you wish to create or of the network you are choosing to join<br>
Channel: Channel of the access point you are creating<br>
<br>
IP: IP to set for device<br>
Gateway: Gateway to use, make it the same as ESP-RFID-Tool's IP if an access point or the same as the router if joining a network<br>
Subnet: Typically set to 255.255.255.0<br>
<br>
Web Interface Administration Settings:<br>
<br>
Username: Username to configure/upgrade ESP-RFID-Tool<br>
Password: Password to configure/upgrade ESP-RFID-Tool<br>
<br>
FTP Server Settings:<br>
<br>
Note: Supports Passive(PASV) Mode Only!<br>
Enabled: Turn FTP Server ON<br>
Disabled: Turn FTP Server OFF<br>
Username: Username to login to ftp server<br>
Password: Password to login to ftp server<br>
<br>
Power LED:<br>
<br>
Enabled: Turn ON Power LED<br>
Disabled: Turn OFF Power LED<br>
<br>
RFID Capture Log:<br>
<br>
Useful to change this value to differentiate between facilities during various security assessments.<br>
File Name: File name to save captured RFID tags to for the current security assessment.<br>
<br>
-----<br>
List Exfiltrated Data<br>
-----<br>
<br>
Displays all log files containing RFID tag captures.<br>
<br>
-----<br>
Format File System<br>
-----<br>
<br>
This will erase the contents of the SPIFFS file system including ALL RFID tag captures.<br>
Formatting may take up to 90 seconds.<br>
All current settings will be retained unless you reboot your device during this process.<br>
<br>
-----<br>
Upgrade ESP-RFID-Tool Firmware<br>
-----<br>
<br>
Authenticate using your username and password set in the configuration page.<br>
<br>
Default credentials to access the firmware upgrade page:<br>
Username: "admin"<br>
Password: "rfidtool"<br>
<br>
Select "Browse" choose the new firmware to be uploaded and then click "Upgrade".<br>
<br>
You will need to manually reset the device upon the browser alerting you that the upgrade was successful.<br>
<br>
-----<br>
Licensing Information<br>
-----<br>
<br>
Created by Corey Harding<br>
https://github.com/rfidtool/ESP-RFID-Tool<br>
ESP-RFID-Tool software is licensed under the MIT License<br>
/*<br>
MIT License<br>
<br>
Copyright (c) [2018] [Corey Harding]<br>
<br>
Permission is hereby granted, free of charge, to any person obtaining a copy<br>
of this software and associated documentation files (the "Software"), to deal<br>
in the Software without restriction, including without limitation the rights<br>
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br>
copies of the Software, and to permit persons to whom the Software is<br>
furnished to do so, subject to the following conditions:<br>
<br>
The above copyright notice and this permission notice shall be included in all<br>
copies or substantial portions of the Software.<br>
<br>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br>
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br>
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br>
SOFTWARE.<br>
*/<br><br>
<a href="/license">Click here for additional licensing information</a>
</body>
</html>
)=====";
================================================
FILE: Source Code/esprfidtool/LICENSE
================================================
SOFTWARE LICENSE
MIT License
Copyright (c) [2018] [Corey Harding]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Source Code/esprfidtool/License.h
================================================
const char License[] PROGMEM = R"=====(
<!DOCTYPE HTML>
<html>
<head><title>ESP-RFID-Tool Licensing Page</title></head>
<body>
<a href="/"><- BACK TO INDEX</a><br><br>
<pre>
ESP-RFID-Tool by Corey Harding: https://www.LegacySecurityGroup.com
Code available at: https://github.com/rfidtool/ESP-RFID-Tool
ESP-RFID-Tool Hardware was created by Corey Harding
ESP-RFID-Tool Software is licensed under the MIT License
/*
MIT License
Copyright (c) [2018] [Corey Harding]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
Core libraries used:
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2005-2013 Arduino Team. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
ESP8266WiFi.h - esp8266 Wifi support.
Based on WiFi.h from Arduino WiFi shield library.
Copyright (c) 2011-2014 Arduino. All right reserved.
Modified by Ivan Grokhotkov, December 2014
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
WiFiClient.h - Library for Arduino Wifi shield.
Copyright (c) 2011-2014 Arduino. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Modified by Ivan Grokhotkov, December 2014 - esp8266 support
*/
/*
ESP8266WebServer.h - Dead simple web-server.
Supports only one simultaneous client, knows how to handle GET and POST.
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
*/
/*
Esp8266httpupdateserver.h No license information available.
*/
/*
ESP8266mDNS.h
ESP8266 Multicast DNS (port of CC3000 Multicast DNS library)
Version 1.1
Copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)
Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)
This is a simple implementation of multicast DNS query support for an Arduino
running on ESP8266 chip. Only support for resolving address queries is currently
implemented.
License (MIT license):
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
FS.h - file system wrapper
Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
ArduinoJson.h
The MIT License (MIT)
---------------------
Copyright (c) 2014-2017 Benoit BLANCHON
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/*
ESP8266FtpServer.h - by nailbuster, later modified by bbx10 and apullin
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
https://github.com/apullin/esp8266FTPServer/blob/feature/bbx10_speedup/LICENSE
*/
/*
WiegandNG.h by JP Liew
https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino
GNU LGPL License 2.1
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library 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 Lesser General Public License for
more details.
*/
/*
Wiegand Preamble Calculator Code from the Tastic RFID Thief byFran Brown of Bishop Fox
https://www.bishopfox.com/resources/tools/rfid-hacking/attack-tools/
*/
/*
Original source for aba-decode.py by Andrew MacPherson(andrewmohawk)
https://andrewmohawk.com/2012/05/29/magnetic-stripes-part-1/
https://pastebin.com/h9eVqRxz
*/
/*
strrev.h by Dmitry Xmelkov
Copyright (c) 2007 Dmitry Xmelkov
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of the copyright holders nor the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
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 OWNER 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.
*/
This is not a comprehensive list, these "Core Libraries" may depend on additional
libraries, more information can be obtained by viewing the source code of the main libraries.
</pre>
</body>
</html>
)=====";
================================================
FILE: Source Code/esprfidtool/WiegandNG.cpp
================================================
#include "WiegandNG.h"
// pcintbranch
volatile unsigned long WiegandNG::_lastPulseTime; // time last bit pulse received
volatile unsigned int WiegandNG::_bitCounted; // number of bits arrived at Interrupt pins
volatile unsigned char *WiegandNG::_buffer; // buffer for data retention
unsigned int WiegandNG::_bufferSize; // memory (bytes) allocated for buffer
void shift_left(volatile unsigned char *ar, int size, int shift)
{
while (shift--) { // for each bit to shift ...
int carry = 0; // clear the initial carry bit.
int lastElement = size-1;
for (int i = 0; i < size; i++) { // for each element of the array, from low byte to high byte
if (i!=lastElement) {
// condition ? valueIfTrue : valueIfFalse
carry = (ar[i+1] & 0x80) ? 1 : 0;
ar[i] = carry | (ar[i]<<1);
}
else {
ar[i] <<=1;
}
}
}
}
void WiegandNG::clear() { // reset variables to start new capture
_bitCounted=0;
_lastPulseTime = millis();
memset((unsigned char *)_buffer,0,_bufferSize);
interrupts(); // allow interrupt
}
void WiegandNG::pause() {
noInterrupts(); // disable interrupt so that user can process data
}
volatile unsigned char * WiegandNG::getRawData() {
return _buffer; // return pointer of the buffer
}
unsigned int WiegandNG::getPacketGap() {
return _packetGap;
}
unsigned int WiegandNG::getBitAllocated() {
return _bitAllocated;
}
unsigned int WiegandNG::getBitCounted() {
return _bitCounted;
}
unsigned int WiegandNG::getBufferSize() {
return _bufferSize;
}
bool WiegandNG::available() {
bool ret=false;
noInterrupts();
unsigned long tempLastPulseTime = _lastPulseTime;
interrupts();
unsigned long sysTick = millis();
// if ((sysTick - _lastPulseTime) > _packetGap) { // _packetGap (ms) laps
if ((sysTick - tempLastPulseTime) > _packetGap) { // _packetGap (ms) laps
if(_bitCounted>0) { // bits found, must have data, return true
/*if(_bitCounted<8) {
Serial.print(_bitCounted);
Serial.print(", ");
Serial.print(sysTick);
Serial.print(", ");
Serial.print(_lastPulseTime);
Serial.print(",");
Serial.println(tempLastPulseTime);
}*/
ret=true;
}
else
{
_lastPulseTime = millis();
}
}
return ret;
}
void WiegandNG::ReadD0 () {
_bitCounted++; // increment bit count for Interrupt connected to D0
shift_left(_buffer,_bufferSize,1); // shift 0 into buffer
_lastPulseTime = millis(); // keep track of time last wiegand bit received
}
void WiegandNG::ReadD1() {
_bitCounted++; // increment bit count for Interrupt connected to D1
if (_bitCounted > (_bufferSize * 8)) {
_bitCounted=0; // overflowed,
} else {
shift_left(_buffer,_bufferSize,1); // shift 1 into buffer
_buffer[_bufferSize-1] |=1; // set last bit 1
_lastPulseTime = millis(); // keep track of time last wiegand bit received
}
}
bool WiegandNG::begin(unsigned int allocateBits, unsigned int packetGap) {
bool ret;
// newer versions of Arduino provide pin to interrupt mapping
ret=begin(2, 3, allocateBits, packetGap);
return ret;
}
bool WiegandNG::begin(uint8_t pinD0, uint8_t pinD1, unsigned int allocateBits, unsigned int packetGap) {
if (_buffer != NULL) {
delete [] _buffer;
}
_packetGap = packetGap;
_bitAllocated = allocateBits;
_bufferSize=(_bitAllocated/8); // calculate the number of bytes required to store wiegand bits
if((_bitAllocated % 8) >0) _bufferSize++; // add 1 extra byte to cater for bits that are not divisible by 8
_buffer = new unsigned char [_bufferSize]; // allocate memory for buffer
if(_buffer == NULL) return false; // not enough memory, return false
clear();
pinMode(pinD0, INPUT); // set D0 pin as input
pinMode(pinD1, INPUT); // set D1 pin as input
attachInterrupt(digitalPinToInterrupt(pinD0), ReadD0, FALLING); // hardware interrupt - high to low pulse
attachInterrupt(digitalPinToInterrupt(pinD1), ReadD1, FALLING); // hardware interrupt - high to low pulse
return true;
}
WiegandNG::WiegandNG() {
}
WiegandNG::~WiegandNG() {
if (_buffer != NULL) {
delete [] _buffer;
}
}
================================================
FILE: Source Code/esprfidtool/WiegandNG.h
================================================
#ifndef _WIEGAND_NG_H
#define _WIEGAND_NG_H
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
class WiegandNG {
private:
static void ReadD0();
static void ReadD1();
static volatile unsigned long _lastPulseTime; // time last bits received
static volatile unsigned int _bitCounted; // number of bits arrived at Interrupt pins
static unsigned int _bufferSize; // memory (bytes) allocated for buffer
unsigned int _bitAllocated; // wiegand bits required
unsigned int _packetGap; // gap between wiegand packet in millisecond
static volatile unsigned char * _buffer; // buffer for data retention
public:
bool begin(unsigned int bits, unsigned int packetGap=25); // default packetGap is 25ms
bool begin(uint8_t pinD0, uint8_t pinD1, unsigned int bits, unsigned int packetGap);
bool available();
void clear();
void pause();
unsigned int getBitCounted();
unsigned int getBitAllocated();
unsigned int getBufferSize();
unsigned int getPacketGap();
volatile unsigned char *getRawData();
WiegandNG();
~WiegandNG();
};
#endif
================================================
FILE: Source Code/esprfidtool/aba2str.h
================================================
String aba2str (String magstripe, int magStart, int magEnd, String swipeDirection) {
//f.println(String()+"Start pos:"+magStart);
//f.println(String()+"Start pos:"+magEnd);
String ABA="";
String aba2str="";
int magCount=abs(magEnd-magStart);
//f.println(String()+"magCount:"+magCount);
aba2str=(String()+"\"Cleaned\" Binary:"+magstripe.substring(magStart,magEnd)+"\n");
aba2str+=(String()+" * Possible "+swipeDirection+" Card Data\(ASCII\):");
while (magCount>0) {
ABA=magstripe.substring(magStart,magStart+4);
if (ABA=="1101") {aba2str+=(";");}
else if (ABA=="0000") {aba2str+=("0");}
else if (ABA=="1000") {aba2str+=("1");}
else if (ABA=="0100") {aba2str+=("2");}
else if (ABA=="1100") {aba2str+=("3");}
else if (ABA=="0010") {aba2str+=("4");}
else if (ABA=="1010") {aba2str+=("5");}
else if (ABA=="0110") {aba2str+=("6");}
else if (ABA=="1110") {aba2str+=("7");}
else if (ABA=="0001") {aba2str+=("8");}
else if (ABA=="1001") {aba2str+=("9");}
else if (ABA=="0011") {aba2str+=("<");}
else if (ABA=="0111") {aba2str+=(">");}
else if (ABA=="0101") {aba2str+=(":");}
else if (ABA=="1011") {aba2str+=("=");}
else if (ABA=="1111") {aba2str+=("?");}
else {aba2str+=("_UNKNOWN-CHARACTER_");}
magStart=magStart+5;
magCount=magCount-5;
}
return aba2str;
}
================================================
FILE: Source Code/esprfidtool/api.h
================================================
void apiTX(String apiBIN, int apipulsewidth, int apidatainterval, int wait) {
wg.pause();
digitalWrite(DATA0, HIGH);
pinMode(DATA0,OUTPUT);
digitalWrite(DATA1, HIGH);
pinMode(DATA1,OUTPUT);
for (int i=0; i<=apiBIN.length(); i++) {
if (apiBIN.charAt(i) == '0') {
digitalWrite(DATA0, LOW);
delayMicroseconds(apipulsewidth);
digitalWrite(DATA0, HIGH);
}
else if (apiBIN.charAt(i) == '1') {
digitalWrite(DATA1, LOW);
delayMicroseconds(apipulsewidth);
digitalWrite(DATA1, HIGH);
}
if (apiBIN.charAt(i) == ',') {
delayMicroseconds(wait);
}
else {
delayMicroseconds(apidatainterval);
}
}
apiBIN="";
pinMode(DATA0, INPUT);
pinMode(DATA1, INPUT);
wg.clear();
}
void apiinfo(int prettify) {
FSInfo fs_info;
SPIFFS.info(fs_info);
String total;
total=fs_info.totalBytes;
String used;
used=fs_info.usedBytes;
String freespace;
freespace=fs_info.totalBytes-fs_info.usedBytes;
const size_t bufferSize = JSON_ARRAY_SIZE(5) + JSON_OBJECT_SIZE(3);
DynamicJsonBuffer jsonAPIbuffer(bufferSize);
JsonObject& apilog = jsonAPIbuffer.createObject();
apilog["Device"] = "ESP-RFID-Tool";
apilog["Firmware"] = version;
apilog["API"] = APIversion;
JsonObject& apifs = apilog.createNestedObject("File System");
apifs["Total Space"]=total;
apifs["Used Space"]=used;
apifs["Free Space"]=freespace;
apilog["Free Memory"] = String(ESP.getFreeHeap(),DEC);
String API_Response="";
if (prettify==1) {
apilog.prettyPrintTo(API_Response);
}
else {
apilog.printTo(API_Response);
}
server.send(200, "application/json", API_Response);
delay(50);
jsonAPIbuffer.clear();
}
void apilistlogs(int prettify) {
Dir dir = SPIFFS.openDir("/");
String FileList = "";
int logcount=0;
while (dir.next()) {
File f = dir.openFile("r");
String FileName = dir.fileName();
if((!FileName.startsWith("/payloads/"))&&(!FileName.startsWith("/esploit.json"))&&(!FileName.startsWith("/esportal.json"))&&(!FileName.startsWith("/esprfidtool.json"))&&(!FileName.startsWith("/config.json"))) {
logcount++;
}
f.close();
}
const size_t bufferSize = JSON_ARRAY_SIZE(5) + JSON_OBJECT_SIZE(1);
DynamicJsonBuffer jsonAPIbuffer(bufferSize);
JsonObject& apilog = jsonAPIbuffer.createObject();
apilog["Device"] = "ESP-RFID-Tool";
apilog["Firmware"] = version;
apilog["API"] = APIversion;
apilog["Log Count"] = logcount;
int currentlog=0;
Dir dir2ndrun = SPIFFS.openDir("/");
while (dir2ndrun.next()) {
File f = dir2ndrun.openFile("r");
String FileName = dir2ndrun.fileName();
if ((!FileName.startsWith("/payloads/"))&&(!FileName.startsWith("/esploit.json"))&&(!FileName.startsWith("/esportal.json"))&&(!FileName.startsWith("/esprfidtool.json"))&&(!FileName.startsWith("/config.json"))) {
currentlog++;
FileName.remove(0,1);
JsonObject& apilistlogs = apilog.createNestedObject(String(currentlog));
apilistlogs["File Name"]=FileName;
}
f.close();
}
String API_Response="";
if (prettify==1) {
apilog.prettyPrintTo(API_Response);
}
else {
apilog.printTo(API_Response);
}
server.send(200, "application/json", API_Response);
delay(50);
jsonAPIbuffer.clear();
}
void apilog(String logfile,int prettify) {
File f = SPIFFS.open(String()+"/"+logfile, "r");
if (!f) {
server.send(200, "application/json", "Log file not found");
delay(50);
}
else {
int apiCAPTUREcount=0;
while(f.available()) {
String line = f.readStringUntil('\n');
if(line.indexOf(",Binary:") > 0) {
apiCAPTUREcount++;
int firstIndex = line.indexOf(",Binary:");
int secondIndex = line.indexOf(",", firstIndex + 1);
String binaryCaptureLINE=line.substring(firstIndex+8, secondIndex);
}
}
f.close();
const size_t bufferSize = JSON_ARRAY_SIZE(6) + JSON_OBJECT_SIZE(4);
DynamicJsonBuffer jsonAPIbuffer(bufferSize);
JsonObject& apilog = jsonAPIbuffer.createObject();
apilog["Device"] = "ESP-RFID-Tool";
apilog["Firmware"] = version;
apilog["API"] = APIversion;
apilog["Log File"] = logfile;
apilog["Captures"] = apiCAPTUREcount;
int apiCURRENTcapture=0;
File f = SPIFFS.open(String()+"/"+logfile, "r");
while(f.available()) {
String line = f.readStringUntil('\n');
if(line.indexOf(",Binary:") > 0) {
apiCURRENTcapture++;
int firstIndex = line.indexOf(",Binary:");
int secondIndex = line.indexOf(",", firstIndex + 1);
String binaryCaptureLINE=line.substring(firstIndex+8, secondIndex);
if ( binaryCaptureLINE.indexOf(" ") > 0 ) {
binaryCaptureLINE=binaryCaptureLINE.substring(binaryCaptureLINE.indexOf(" ")+1);
}
binaryCaptureLINE.replace("\r","");
JsonObject& apiCURRENTcaptureOBJECT = apilog.createNestedObject(String(apiCURRENTcapture));
apiCURRENTcaptureOBJECT["Bit Count"]=binaryCaptureLINE.length();
apiCURRENTcaptureOBJECT["Binary"]=binaryCaptureLINE;
if(line.indexOf(",HEX:") > 0) {
int hfirstIndex = line.indexOf(",HEX:");
int hsecondIndex = line.indexOf(",", hfirstIndex + 1);
String hexCURRENT=line.substring(hfirstIndex+5, hsecondIndex);
hexCURRENT.replace("\r","");
apiCURRENTcaptureOBJECT["Hexadecimal"]=hexCURRENT;
}
if(line.indexOf(",Keypad Code:") > 0) {
int kfirstIndex = line.indexOf(",Keypad Code:");
int ksecondIndex = line.indexOf(",", kfirstIndex + 1);
String pinCURRENT=line.substring(kfirstIndex+13, ksecondIndex);
pinCURRENT.replace("\r","");
apiCURRENTcaptureOBJECT["Keypad Press"]=pinCURRENT;
}
}
}
f.close();
String API_Response="";
if (prettify==1) {
apilog.prettyPrintTo(API_Response);
}
else {
apilog.printTo(API_Response);
}
server.send(200, "application/json", API_Response);
delay(50);
jsonAPIbuffer.clear();
}
}
================================================
FILE: Source Code/esprfidtool/api_server.h
================================================
server.on("/api/tx/bin", [](){
String api_binary="";
int api_pulsewidth=txdelayus;
int api_datainterval=(txdelayms*1000);
int prettify=0;
int api_wait=100000;
if (server.hasArg("binary")) {
api_binary=(server.arg("binary"));
}
if (server.hasArg("pulsewidth")) {
api_pulsewidth=(server.arg("pulsewidth").toInt());
}
if (server.hasArg("interval")) {
api_datainterval=(server.arg("interval").toInt());
}
if (server.hasArg("wait")) {
api_wait=(server.arg("wait").toInt());
}
if (server.hasArg("prettify")) {
prettify=1;
}
const size_t bufferSize = JSON_ARRAY_SIZE(4) + JSON_OBJECT_SIZE(5);
DynamicJsonBuffer jsonAPIbuffer(bufferSize);
JsonObject& apitxbin = jsonAPIbuffer.createObject();
apitxbin["Device"] = "ESP-RFID-Tool";
apitxbin["Firmware"] = version;
apitxbin["API"] = APIversion;
JsonObject& apitxbinary = apitxbin.createNestedObject("Transmission");
int commacount=0;
for (int commalook=0; commalook<=api_binary.length(); commalook++) {
if (api_binary.charAt(commalook)==',') {
commacount++;
}
}
apitxbinary["Bit Count"]=api_binary.length()-commacount;
apitxbinary["Binary"]=api_binary;
apitxbinary["Wiegand Data Pulse Width"]=String()+api_pulsewidth+"us";
apitxbinary["Wiegand Data Interval"]=String()+api_datainterval+"us";
apitxbinary["Delay Between Packets"]=String()+api_wait+"us";
if (api_binary=="") {
server.send(200, "text/html", F(
"Binary to tx not specified.<br>"
"<small>Usage: [server]/api/tx/bin?binary=[binary]&pulsewidth=[delay_us]&interval=[delay_us]&wait=[delay_us_between_packets]</small><br>"
"<small>Use commas to separate the binary for transmitting multiple packets(useful for sending multiple keypresses for imitating keypads)</small><br>"
"<small>Example to TX Pin Code 1337# waiting 100,000us between packets(keypresses): /api/tx/bin?binary=11100001,11000011,11000011,10000111,01001011&wait=100000&prettify=1</small><br>"
));
}
else {
String API_Response="";
if (prettify==1) {
apitxbin.prettyPrintTo(API_Response);
}
else {
apitxbin.printTo(API_Response);
}
server.send(200, "application/json", API_Response);
delay(50);
jsonAPIbuffer.clear();
apiTX(api_binary,api_pulsewidth,api_datainterval,api_wait);
}
});
server.on("/api/help", [](){
String apihelpHTML=String()+F(
"<a href=\"/\"><- BACK TO INDEX</a><br><br>"
"<b>API Version: "
)+APIversion+F(
"</b><br><br>"
"<b><a href=\"/api/info?prettify=1\">/api/info</a></b><br>"
"<small>Usage: [server]/api/info</small><br>"
"<br>"
"<b><a href=\"/api/viewlog?logfile="
)+logname+F(
"&prettify=1\">/api/viewlog</a></b><br>"
"<small>Usage: [server]/api/viewlog?logfile=[log.txt]</small><br>"
"<br>"
"<b><a href=\"/api/listlogs?prettify=1\">/api/listlogs</a></b><br>"
"<small>Usage: [server]/api/listlogs</small><br>"
"<br>"
"<b><a href=\"/api/tx/bin?binary=0001&pulsewidth=40&interval=2000&prettify=1\">/api/tx/bin</a></b><br>"
"<small>Usage: [server]/api/tx/bin?binary=[binary]&pulsewidth=[delay_us]&interval=[delay_us]&wait=[delay_us_between_packets]</small><br>"
"<small>Use commas to separate the binary for transmitting multiple packets(useful for sending multiple keypresses for imitating keypads)</small><br>"
"<small>Example to TX Pin Code 1337# waiting 100,000us between packets(keypresses): /api/tx/bin?binary=11100001,11000011,11000011,10000111,01001011&wait=100000&prettify=1</small><br>"
"<br>"
"<b>Universal Arguments</b><br>"
"<small>Prettify: [api-url]?[args]<u>&prettify=1</u></small><br>"
);
server.send(200, "text/html", apihelpHTML);
});
server.on("/api/info", [](){
int prettify=0;
if (server.hasArg("prettify")) {
prettify=1;
}
apiinfo(prettify);
});
server.on("/api/listlogs", [](){
int prettify=0;
if (server.hasArg("prettify")) {
prettify=1;
}
apilistlogs(prettify);
});
server.on("/api/viewlog", [](){
int prettify=0;
if (server.hasArg("prettify")) {
prettify=1;
}
if (server.hasArg("logfile")) {
apilog(server.arg("logfile"),prettify);
}
else {
server.send(200, "application/json", F("Usage: [server]/api/viewlog?logfile=[logfile.txt]"));
}
});
================================================
FILE: Source Code/esprfidtool/esprfidtool.ino
================================================
/*
* ESP-RFID-Tool
* by Corey Harding of www.Exploit.Agency / www.LegacySecurityGroup.com
* ESP-RFID-Tool Software is distributed under the MIT License. The license and copyright notice can not be removed and must be distributed alongside all future copies of the software.
* MIT License
Copyright (c) [2018] [Corey Harding]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "HelpText.h"
#include "License.h"
#include "version.h"
#include "strrev.h"
#include "aba2str.h"
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>
#include <ESP8266HTTPUpdateServer.h>
#include <ESP8266mDNS.h>
#include <FS.h>
#include <ArduinoJson.h> // ArduinoJson library 5.11.0 by Benoit Blanchon https://github.com/bblanchon/ArduinoJson
#include <ESP8266FtpServer.h> // https://github.com/exploitagency/esp8266FTPServer/tree/feature/bbx10_speedup
#include <DNSServer.h>
#include <ESP8266mDNS.h>
#define DATA0 14
#define DATA1 12
#define LED_BUILTIN 2
#define RESTORE_DEFAULTS_PIN 4 //GPIO 4
int jumperState = 0; //For restoring default settings
#include "WiegandNG.h" //https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino
// Port for web server
ESP8266WebServer server(80);
ESP8266WebServer httpServer(1337);
ESP8266HTTPUpdateServer httpUpdater;
FtpServer ftpSrv;
const byte DNS_PORT = 53;
DNSServer dnsServer;
HTTPClient http;
const char* update_path = "/update";
int accesspointmode;
char ssid[32];
char password[64];
int channel;
int hidden;
char local_IPstr[16];
char gatewaystr[16];
char subnetstr[16];
char update_username[32];
char update_password[64];
char ftp_username[32];
char ftp_password[64];
int ftpenabled;
int ledenabled;
char logname[31];
unsigned int bufferlength;
unsigned int rxpacketgap;
int txdelayus;
int txdelayms;
int safemode;
int dos=0;
int TXstatus=0;
String pinHTML;
#include "pinSEND.h"
String dataCONVERSION="";
WiegandNG wg;
void LogWiegand(WiegandNG &tempwg) {
volatile unsigned char *buffer=tempwg.getRawData();
unsigned int bufferSize = tempwg.getBufferSize();
unsigned int countedBits = tempwg.getBitCounted();
unsigned int countedBytes = (countedBits/8);
if ((countedBits % 8)>0) countedBytes++;
//unsigned int bitsUsed = countedBytes * 8;
bool binChunk2exists=false;
volatile unsigned long cardChunk1 = 0;
volatile unsigned long cardChunk2 = 0;
volatile unsigned long binChunk2 = 0;
volatile unsigned long binChunk1 = 0;
String binChunk3="";
bool unknown=false;
binChunk2exists=false;
int binChunk2len=0;
int j=0;
for (unsigned int i=bufferSize-countedBytes; i< bufferSize;i++) {
unsigned char bufByte=buffer[i];
for(int x=0; x<8;x++) {
if ( (((bufferSize-i) *8)-x) <= countedBits) {
j++;
if((bufByte & 0x80)) { //write 1
if(j<23) {
binChunk1 = binChunk1 << 1;
binChunk1 |= 1;
}
else if(j<=52) {
binChunk2exists=true;
binChunk2len++;
binChunk2 = binChunk2 << 1;
binChunk2 |= 1;
}
else if(j>52){
binChunk3=binChunk3+"1";
}
}
else { //write 0
if(j<23) {
binChunk1 = binChunk1 << 1;
}
else if(j<=52){
binChunk2exists=true;
binChunk2len++;
binChunk2 = binChunk2 << 1;
}
else if(j>52){
binChunk3=binChunk3+"0";
}
}
}
bufByte<<=1;
}
}
j=0;
switch (countedBits) { //Add the preamble to known cards
case 26:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 2){
bitWrite(cardChunk1, i, 1); // Write preamble 1's to the 13th and 2nd bits
}
else if(i > 2) {
bitWrite(cardChunk1, i, 0); // Write preamble 0's to all other bits above 1
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 20)); // Write remaining bits to cardChunk1 from binChunk1
}
if(i < 20) {
bitWrite(cardChunk2, i + 4, bitRead(binChunk1, i)); // Write the remaining bits of binChunk1 to cardChunk2
}
if(i < 4) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i)); // Write the remaining bit of cardChunk2 with binChunk2 bits
}
}
break;
case 27:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 3){
bitWrite(cardChunk1, i, 1);
}
else if(i > 3) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 19));
}
if(i < 19) {
bitWrite(cardChunk2, i + 5, bitRead(binChunk1, i));
}
if(i < 5) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 28:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 4){
bitWrite(cardChunk1, i, 1);
}
else if(i > 4) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 18));
}
if(i < 18) {
bitWrite(cardChunk2, i + 6, bitRead(binChunk1, i));
}
if(i < 6) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 29:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 5){
bitWrite(cardChunk1, i, 1);
}
else if(i > 5) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 17));
}
if(i < 17) {
bitWrite(cardChunk2, i + 7, bitRead(binChunk1, i));
}
if(i < 7) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 30:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 6){
bitWrite(cardChunk1, i, 1);
}
else if(i > 6) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 16));
}
if(i < 16) {
bitWrite(cardChunk2, i + 8, bitRead(binChunk1, i));
}
if(i < 8) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 31:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 7){
bitWrite(cardChunk1, i, 1);
}
else if(i > 7) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 15));
}
if(i < 15) {
bitWrite(cardChunk2, i + 9, bitRead(binChunk1, i));
}
if(i < 9) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 32:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 8){
bitWrite(cardChunk1, i, 1);
}
else if(i > 8) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 14));
}
if(i < 14) {
bitWrite(cardChunk2, i + 10, bitRead(binChunk1, i));
}
if(i < 10) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 33:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 9){
bitWrite(cardChunk1, i, 1);
}
else if(i > 9) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 13));
}
if(i < 13) {
bitWrite(cardChunk2, i + 11, bitRead(binChunk1, i));
}
if(i < 11) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 34:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 10){
bitWrite(cardChunk1, i, 1);
}
else if(i > 10) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 12));
}
if(i < 12) {
bitWrite(cardChunk2, i + 12, bitRead(binChunk1, i));
}
if(i < 12) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 35:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 11){
bitWrite(cardChunk1, i, 1);
}
else if(i > 11) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 11));
}
if(i < 11) {
bitWrite(cardChunk2, i + 13, bitRead(binChunk1, i));
}
if(i < 13) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 36:
for(int i = 19; i >= 0; i--) {
if(i == 13 || i == 12){
bitWrite(cardChunk1, i, 1);
}
else if(i > 12) {
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 10));
}
if(i < 10) {
bitWrite(cardChunk2, i + 14, bitRead(binChunk1, i));
}
if(i < 14) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
case 37:
for(int i = 19; i >= 0; i--) {
if(i == 13){
bitWrite(cardChunk1, i, 0);
}
else {
bitWrite(cardChunk1, i, bitRead(binChunk1, i + 9));
}
if(i < 9) {
bitWrite(cardChunk2, i + 15, bitRead(binChunk1, i));
}
if(i < 15) {
bitWrite(cardChunk2, i, bitRead(binChunk2, i));
}
}
break;
default: //unknown card
unknown=true;
//String binChunk3 is like cardChunk0
cardChunk1=binChunk2;
cardChunk2=binChunk1;
break;
}
File f = SPIFFS.open("/"+String(logname), "a"); //Open the log in append mode to store capture
int preambleLen;
if (unknown==true && countedBits!=4 && countedBits!=8 && countedBits!=248) {
f.print(F("Unknown "));
preambleLen=0;
}
else {
preambleLen=(44-countedBits);
}
f.print(String()+countedBits+F(" bit card,"));
if (countedBits==4||countedBits==8) {
f.print(F("Possible keypad entry,"));
}
if (countedBits==248) {
f.print(F("possible magstripe card,"));
}
String magstripe="";
if (unknown!=true) {
f.print(String()+preambleLen+F(" bit preamble,"));
}
f.print(F("Binary:"));
//f.print(" "); //debug line
if (binChunk2exists==true && unknown!=true) {
for(int i = (((countedBits+preambleLen)-countedBits)+(countedBits-24)); i--;) {
if (i==((((countedBits+preambleLen)-countedBits)+(countedBits-24))-preambleLen-1) && unknown!=true) {
f.print(" ");
}
f.print(bitRead(cardChunk1, i));
if(i == 0){
break;
}
}
}
if ((countedBits>=24) && unknown!=true) {
for(int i = 24; i--;) {
f.print(bitRead(cardChunk2, i));
if(i == 0){
break;
}
}
}
else if ((countedBits>=23) && unknown==true) {
int i;
if (countedBits>=52) {
i=22;
}
else {
i =(countedBits-binChunk2len);
}
for(i; i--;) {
f.print(bitRead(binChunk1, i));
if (countedBits==248) {
magstripe+=bitRead(binChunk1, i);
}
if(i == 0){
break;
}
}
}
else {
for(int i = countedBits; i--;) {
f.print(bitRead(binChunk1, i));
if(i == 0){
break;
}
}
}
if (binChunk2exists==true && unknown==true) {
int i;
if (countedBits>=52) {
i=30;
}
else {
i=(binChunk2len);
}
for(i; i--;) {
f.print(bitRead(binChunk2, i));
if (countedBits==248) {
magstripe+=bitRead(binChunk2, i);
}
if(i == 0){
break;
}
}
}
if (countedBits>52) {
f.print(binChunk3);
if (countedBits==248) {
magstripe+=binChunk3;
}
}
if (countedBits<=52 && unknown!=true) {
f.print(",HEX:");
if (binChunk2exists==true) {
f.print(cardChunk1, HEX);
}
//f.print(" "); //debug line
f.println(cardChunk2, HEX);
}
else if (countedBits==4||countedBits==8) {
f.print(",Keypad Code:");
if (binChunk1 == 0B0000||binChunk1 == 0b11110000) {
f.print("0");
}
else if (binChunk1 == 0B0001||binChunk1 == 0b11100001) {
f.print("1");
}
else if (binChunk1 == 0B0010||binChunk1 == 0b11010010) {
f.print("2");
}
else if (binChunk1 == 0B0011||binChunk1 == 0b11000011) {
f.print("3");
}
else if (binChunk1 == 0B0100||binChunk1 == 0b10110100) {
f.print("4");
}
else if (binChunk1 == 0B0101||binChunk1 == 0b10100101) {
f.print("5");
}
else if (binChunk1 == 0B0110||binChunk1 == 0b10010110) {
f.print("6");
}
else if (binChunk1 == 0B0111||binChunk1 == 0b10000111) {
f.print("7");
}
else if (binChunk1 == 0B1000||binChunk1 == 0b01111000) {
f.print("8");
}
else if (binChunk1 == 0B1001||binChunk1 == 0b01101001) {
f.print("9");
}
else if (binChunk1 == 0B1010||binChunk1 == 0b01011010) {
f.print("*");
}
else if (binChunk1 == 0B1011||binChunk1 == 0b01001011) {
f.print("#");
}
else if (binChunk1 == 0b1100||binChunk1 == 0b00111100) {
f.print("F1");
}
else if (binChunk1 == 0b1101||binChunk1 == 0b00101101) {
f.print("F2");
}
else if (binChunk1 == 0b1110||binChunk1 == 0b00011110) {
f.print("F3");
}
else if (binChunk1 == 0b1111||binChunk1 == 0b00001111) {
f.print("F4");
}
else {
f.print("?");
}
f.print(",HEX:");
if (countedBits==8) {
char hexCHAR[3];
sprintf(hexCHAR, "%02X", binChunk1);
f.println(hexCHAR);
}
else if (countedBits==4) {
f.println(binChunk1, HEX);
}
}
else if (countedBits==248) {
f.println(",");
}
else {
f.println("");
}
if (countedBits==248) {
int startSentinel=magstripe.indexOf("11010");
int endSentinel=(magstripe.lastIndexOf("11111")+4);
int magStart=0;
int magEnd=1;
//f.print("<pre>");
f.print(" * Trying \"Forward\" Swipe,");
magStart=startSentinel;
magEnd=endSentinel;
f.println(aba2str(magstripe,magStart,magEnd,"\"Forward\" Swipe"));
f.print(" * Trying \"Reverse\" Swipe,");
char magchar[249];
magstripe.toCharArray(magchar,249);
magstripe=String(strrev(magchar));
//f.println(String()+"Reverse: "+magstripe);
magStart=magstripe.indexOf("11010");
magEnd=(magstripe.lastIndexOf("11111")+4);
f.println(aba2str(magstripe,magStart,magEnd,"\"Reverse\" Swipe"));
//f.print("</pre>");
//f.println(String()+F(" * You can verify the data at the following URL: <a target=\"_blank\" href=\"https://www.legacysecuritygroup.com/aba-decode.php?binary=")+magstripe+F("\">https://www.legacysecuritygroup.com/aba-decode.php?binary=")+magstripe+F("</a>"));
}
//Debug
// f.print(F("Free heap:"));
// f.println(ESP.getFreeHeap(),DEC);
unknown=false;
binChunk3="";
binChunk2exists=false;
binChunk1 = 0; binChunk2 = 0;
cardChunk1 = 0; cardChunk2 = 0;
binChunk2len=0;
f.close(); //done
}
#include "api.h"
void settingsPage()
{
if(!server.authenticate(update_username, update_password))
return server.requestAuthentication();
String accesspointmodeyes;
String accesspointmodeno;
if (accesspointmode==1){
accesspointmodeyes=" checked=\"checked\"";
accesspointmodeno="";
}
else {
accesspointmodeyes="";
accesspointmodeno=" checked=\"checked\"";
}
String ftpenabledyes;
String ftpenabledno;
if (ftpenabled==1){
ftpenabledyes=" checked=\"checked\"";
ftpenabledno="";
}
else {
ftpenabledyes="";
ftpenabledno=" checked=\"checked\"";
}
String ledenabledyes;
String ledenabledno;
if (ledenabled==1){
ledenabledyes=" checked=\"checked\"";
ledenabledno="";
}
else {
ledenabledyes="";
ledenabledno=" checked=\"checked\"";
}
String hiddenyes;
String hiddenno;
if (hidden==1){
hiddenyes=" checked=\"checked\"";
hiddenno="";
}
else {
hiddenyes="";
hiddenno=" checked=\"checked\"";
}
String safemodeyes;
String safemodeno;
if (safemode==1){
safemodeyes=" checked=\"checked\"";
safemodeno="";
}
else {
safemodeyes="";
safemodeno=" checked=\"checked\"";
}
server.send(200, "text/html",
String()+
F(
"<!DOCTYPE HTML>"
"<html>"
"<head>"
"<meta name = \"viewport\" content = \"width = device-width, initial-scale = 1.0, maximum-scale = 1.0, user-scalable=0\">"
"<title>ESP-RFID-Tool Settings</title>"
"<style>"
"\"body { background-color: #808080; font-family: Arial, Helvetica, Sans-Serif; Color: #000000; }\""
"</style>"
"</head>"
"<body>"
"<a href=\"/\"><- BACK TO INDEX</a><br><br>"
"<h1>ESP-RFID-Tool Settings</h1>"
"<a href=\"/restoredefaults\"><button>Restore Default Configuration</button></a>"
"<hr>"
"<FORM action=\"/settings\" id=\"configuration\" method=\"post\">"
"<P>"
"<b>WiFi Configuration:</b><br><br>"
"<b>Network Type</b><br>"
)+
F("Access Point Mode: <INPUT type=\"radio\" name=\"accesspointmode\" value=\"1\"")+accesspointmodeyes+F("><br>"
"Join Existing Network: <INPUT type=\"radio\" name=\"accesspointmode\" value=\"0\"")+accesspointmodeno+F("><br><br>"
"<b>Hidden<br></b>"
"Yes <INPUT type=\"radio\" name=\"hidden\" value=\"1\"")+hiddenyes+F("><br>"
"No <INPUT type=\"radio\" name=\"hidden\" value=\"0\"")+hiddenno+F("><br><br>"
"SSID: <input type=\"text\" name=\"ssid\" value=\"")+ssid+F("\" maxlength=\"31\" size=\"31\"><br>"
"Password: <input type=\"password\" name=\"password\" value=\"")+password+F("\" maxlength=\"64\" size=\"31\"><br>"
"Channel: <select name=\"channel\" form=\"configuration\"><option value=\"")+channel+"\" selected>"+channel+F("</option><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option><option value=\"11\">11</option><option value=\"12\">12</option><option value=\"13\">13</option><option value=\"14\">14</option></select><br><br>"
"IP: <input type=\"text\" name=\"local_IPstr\" value=\"")+local_IPstr+F("\" maxlength=\"16\" size=\"31\"><br>"
"Gateway: <input type=\"text\" name=\"gatewaystr\" value=\"")+gatewaystr+F("\" maxlength=\"16\" size=\"31\"><br>"
"Subnet: <input type=\"text\" name=\"subnetstr\" value=\"")+subnetstr+F("\" maxlength=\"16\" size=\"31\"><br><br>"
"<hr>"
"<b>Web Interface Administration Settings:</b><br><br>"
"Username: <input type=\"text\" name=\"update_username\" value=\"")+update_username+F("\" maxlength=\"31\" size=\"31\"><br>"
"Password: <input type=\"password\" name=\"update_password\" value=\"")+update_password+F("\" maxlength=\"64\" size=\"31\"><br><br>"
"<hr>"
"<b>FTP Server Settings</b><br>"
"<small>Changes require a reboot.</small><br>"
"Enabled <INPUT type=\"radio\" name=\"ftpenabled\" value=\"1\"")+ftpenabledyes+F("><br>"
"Disabled <INPUT type=\"radio\" name=\"ftpenabled\" value=\"0\"")+ftpenabledno+F("><br>"
"FTP Username: <input type=\"text\" name=\"ftp_username\" value=\"")+ftp_username+F("\" maxlength=\"31\" size=\"31\"><br>"
"FTP Password: <input type=\"password\" name=\"ftp_password\" value=\"")+ftp_password+F("\" maxlength=\"64\" size=\"31\"><br><br>"
"<hr>"
"<b>Power LED:</b><br>"
"<small>Changes require a reboot.</small><br>"
"Enabled <INPUT type=\"radio\" name=\"ledenabled\" value=\"1\"")+ledenabledyes+F("><br>"
"Disabled <INPUT type=\"radio\" name=\"ledenabled\" value=\"0\"")+ledenabledno+F("><br><br>"
"<hr>"
"<b>RFID Capture Log:</b><br>"
"<small>Useful to change this value to differentiate between facilities during various security assessments.</small><br>"
"File Name: <input type=\"text\" name=\"logname\" value=\"")+logname+F("\" maxlength=\"30\" size=\"31\"><br>"
"<hr>"
"<b>Experimental Settings:</b><br>"
"<small>Changes require a reboot.</small><br>"
"<small>Default Buffer Length is 256 bits with an allowed range of 52-4096 bits."
"<br>Default Experimental TX mode timing is 40us Wiegand Data Pulse Width and a 2ms Wiegand Data Interval with an allowed range of 0-1000."
"<br>Changing these settings may result in unstable performance.</small><br>"
"Wiegand RX Buffer Length: <input type=\"number\" name=\"bufferlength\" value=\"")+bufferlength+F("\" maxlength=\"30\" size=\"31\" min=\"52\" max=\"4096\"> bit(s)<br>"
"Wiegand RX Packet Length: <input type=\"number\" name=\"rxpacketgap\" value=\"")+rxpacketgap+F("\" maxlength=\"30\" size=\"31\" min=\"1\" max=\"4096\"> millisecond(s)<br>"
"Experimental TX Wiegand Data Pulse Width: <input type=\"number\" name=\"txdelayus\" value=\"")+txdelayus+F("\" maxlength=\"30\" size=\"31\" min=\"0\" max=\"1000\"> microsecond(s)<br>"
"Experimental TX Wiegand Data Interval: <input type=\"number\" name=\"txdelayms\" value=\"")+txdelayms+F("\" maxlength=\"30\" size=\"31\" min=\"0\" max=\"1000\"> millisecond(s)<br>"
"<hr>"
"<b>Safe Mode:</b><br>"
"<small>Enable to reboot the device after every capture.<br>Disable to avoid missing quick consecutive captures such as keypad entries.</small><br>"
"Enabled <INPUT type=\"radio\" name=\"safemode\" value=\"1\"")+safemodeyes+F("><br>"
"Disabled <INPUT type=\"radio\" name=\"safemode\" value=\"0\"")+safemodeno+F("><br><br>"
"<hr>"
"<INPUT type=\"radio\" name=\"SETTINGS\" value=\"1\" hidden=\"1\" checked=\"checked\">"
"<INPUT type=\"submit\" value=\"Apply Settings\">"
"</FORM>"
"<br><a href=\"/reboot\"><button>Reboot Device</button></a>"
"</P>"
"</body>"
"</html>"
)
);
}
void handleSettings()
{
if (server.hasArg("SETTINGS")) {
handleSubmitSettings();
}
else {
settingsPage();
}
}
void returnFail(String msg)
{
server.sendHeader("Connection", "close");
server.sendHeader("Access-Control-Allow-Origin", "*");
server.send(500, "text/plain", msg + "\r\n");
}
void handleSubmitSettings()
{
String SETTINGSvalue;
if (!server.hasArg("SETTINGS")) return returnFail("BAD ARGS");
SETTINGSvalue = server.arg("SETTINGS");
accesspointmode = server.arg("accesspointmode").toInt();
server.arg("ssid").toCharArray(ssid, 32);
server.arg("password").toCharArray(password, 64);
channel = server.arg("channel").toInt();
hidden = server.arg("hidden").toInt();
server.arg("local_IPstr").toCharArray(local_IPstr, 16);
server.arg("gatewaystr").toCharArray(gatewaystr, 16);
server.arg("subnetstr").toCharArray(subnetstr, 16);
server.arg("update_username").toCharArray(update_username, 32);
server.arg("update_password").toCharArray(update_password, 64);
server.arg("ftp_username").toCharArray(ftp_username, 32);
server.arg("ftp_password").toCharArray(ftp_password, 64);
ftpenabled = server.arg("ftpenabled").toInt();
ledenabled = server.arg("ledenabled").toInt();
server.arg("logname").toCharArray(logname, 31);
bufferlength = server.arg("bufferlength").toInt();
rxpacketgap = server.arg("rxpacketgap").toInt();
txdelayus = server.arg("txdelayus").toInt();
txdelayms = server.arg("txdelayms").toInt();
safemode = server.arg("safemode").toInt();
if (SETTINGSvalue == "1") {
saveConfig();
server.send(200, "text/html", F("<a href=\"/\"><- BACK TO INDEX</a><br><br><a href=\"/reboot\"><button>Reboot Device</button></a><br><br>Settings have been saved.<br>Some setting may require manually rebooting before taking effect.<br>If network configuration has changed then be sure to connect to the new network first in order to access the web interface."));
delay(50);
loadConfig();
}
else if (SETTINGSvalue == "0") {
settingsPage();
}
else {
returnFail("Bad SETTINGS value");
}
}
bool loadDefaults() {
StaticJsonBuffer<500> jsonBuffer;
JsonObject& json = jsonBuffer.createObject();
json["version"] = version;
json["accesspointmode"] = "1";
json["ssid"] = "ESP-RFID-Tool";
json["password"] = "";
json["channel"] = "6";
json["hidden"] = "0";
json["local_IP"] = "192.168.1.1";
json["gateway"] = "192.168.1.1";
json["subnet"] = "255.255.255.0";
json["update_username"] = "admin";
json["update_password"] = "rfidtool";
json["ftp_username"] = "ftp-admin";
json["ftp_password"] = "rfidtool";
json["ftpenabled"] = "0";
json["ledenabled"] = "1";
json["logname"] = "log.txt";
json["bufferlength"] = "256";
json["rxpacketgap"] = "15";
json["txdelayus"] = "40";
json["txdelayms"] = "2";
json["safemode"] = "0";
File configFile = SPIFFS.open("/esprfidtool.json", "w");
json.printTo(configFile);
configFile.close();
jsonBuffer.clear();
loadConfig();
}
bool loadConfig() {
File configFile = SPIFFS.open("/esprfidtool.json", "r");
if (!configFile) {
delay(3500);
loadDefaults();
}
size_t size = configFile.size();
std::unique_ptr<char[]> buf(new char[size]);
configFile.readBytes(buf.get(), size);
StaticJsonBuffer<500> jsonBuffer;
JsonObject& json = jsonBuffer.parseObject(buf.get());
if (!json["version"]) {
delay(3500);
loadDefaults();
ESP.restart();
}
//Resets config to factory defaults on an update.
if (json["version"]!=version) {
delay(3500);
loadDefaults();
ESP.restart();
}
strcpy(ssid, (const char*)json["ssid"]);
strcpy(password, (const char*)json["password"]);
channel = json["channel"];
hidden = json["hidden"];
accesspointmode = json["accesspointmode"];
strcpy(local_IPstr, (const char*)json["local_IP"]);
strcpy(gatewaystr, (const char*)json["gateway"]);
strcpy(subnetstr, (const char*)json["subnet"]);
strcpy(update_username, (const char*)json["update_username"]);
strcpy(update_password, (const char*)json["update_password"]);
strcpy(ftp_username, (const char*)json["ftp_username"]);
strcpy(ftp_password, (const char*)json["ftp_password"]);
ftpenabled = json["ftpenabled"];
ledenabled = json["ledenabled"];
strcpy(logname, (const char*)json["logname"]);
bufferlength = json["bufferlength"];
rxpacketgap = json["rxpacketgap"];
txdelayus = json["txdelayus"];
txdelayms = json["txdelayms"];
safemode = json["safemode"];
IPAddress local_IP;
local_IP.fromString(local_IPstr);
IPAddress gateway;
gateway.fromString(gatewaystr);
IPAddress subnet;
subnet.fromString(subnetstr);
/*
Serial.println(accesspointmode);
Serial.println(ssid);
Serial.println(password);
Serial.println(channel);
Serial.println(hidden);
Serial.println(local_IP);
Serial.println(gateway);
Serial.println(subnet);
*/
WiFi.persistent(false);
//ESP.eraseConfig();
// Determine if set to Access point mode
if (accesspointmode == 1) {
WiFi.disconnect(true);
WiFi.mode(WIFI_AP);
// Serial.print("Starting Access Point ... ");
// Serial.println(WiFi.softAP(ssid, password, channel, hidden) ? "Success" : "Failed!");
WiFi.softAP(ssid, password, channel, hidden);
// Serial.print("Setting up Network Configuration ... ");
// Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Success" : "Failed!");
WiFi.softAPConfig(local_IP, gateway, subnet);
// WiFi.reconnect();
// Serial.print("IP address = ");
// Serial.println(WiFi.softAPIP());
}
// or Join existing network
else if (accesspointmode != 1) {
WiFi.disconnect(true);
WiFi.mode(WIFI_STA);
// Serial.print("Setting up Network Configuration ... ");
WiFi.config(local_IP, gateway, subnet);
// WiFi.config(local_IP, gateway, subnet);
// Serial.print("Connecting to network ... ");
// WiFi.begin(ssid, password);
WiFi.begin(ssid, password);
WiFi.reconnect();
// Serial.print("IP address = ");
// Serial.println(WiFi.localIP());
}
configFile.close();
jsonBuffer.clear();
return true;
}
bool saveConfig() {
StaticJsonBuffer<500> jsonBuffer;
JsonObject& json = jsonBuffer.createObject();
json["version"] = version;
json["accesspointmode"] = accesspointmode;
json["ssid"] = ssid;
json["password"] = password;
json["channel"] = channel;
json["hidden"] = hidden;
json["local_IP"] = local_IPstr;
json["gateway"] = gatewaystr;
json["subnet"] = subnetstr;
json["update_username"] = update_username;
json["update_password"] = update_password;
json["ftp_username"] = ftp_username;
json["ftp_password"] = ftp_password;
json["ftpenabled"] = ftpenabled;
json["ledenabled"] = ledenabled;
json["logname"] = logname;
json["bufferlength"] = bufferlength;
json["rxpacketgap"] = rxpacketgap;
json["txdelayus"] = txdelayus;
json["txdelayms"] = txdelayms;
json["safemode"] = safemode;
File configFile = SPIFFS.open("/esprfidtool.json", "w");
json.printTo(configFile);
configFile.close();
jsonBuffer.clear();
return true;
}
File fsUploadFile;
String webString;
void ListLogs(){
String directory;
directory="/";
FSInfo fs_info;
SPIFFS.info(fs_info);
String total;
total=fs_info.totalBytes;
String used;
used=fs_info.usedBytes;
String freespace;
freespace=fs_info.totalBytes-fs_info.usedBytes;
Dir dir = SPIFFS.openDir(directory);
String FileList = String()+F("<a href=\"/\"><- BACK TO INDEX</a><br><br>File System Info Calculated in Bytes<br><b>Total:</b> ")+total+" <b>Free:</b> "+freespace+" "+" <b>Used:</b> "+used+"<br><br><small>NOTE: Larger log files will need to be downloaded instead of viewed from the browser.</small><br><table border='1'><tr><td><b>Display File Contents</b></td><td><b>Size in Bytes</b></td><td><b>Download File</b></td><td><b>Delete File</b></td></tr>";
while (dir.next()) {
String FileName = dir.fileName();
File f = dir.openFile("r");
FileList += " ";
if((!FileName.startsWith("/payloads/"))&&(!FileName.startsWith("/esploit.json"))&&(!FileName.startsWith("/esportal.json"))&&(!FileName.startsWith("/esprfidtool.json"))&&(!FileName.startsWith("/config.json"))) FileList += "<tr><td><a href=\"/viewlog?payload="+FileName+"\">"+FileName+"</a></td>"+"<td>"+f.size()+"</td><td><a href=\""+FileName+"\"><button>Download File</button></td><td><a href=\"/deletelog?payload="+FileName+"\"><button>Delete File</button></td></tr>";
f.close();
}
FileList += "</table>";
server.send(200, "text/html", FileList);
}
bool RawFile(String rawfile) {
if (SPIFFS.exists(rawfile)) {
if(!server.authenticate(update_username, update_password)){
server.requestAuthentication();}
File file = SPIFFS.open(rawfile, "r");
size_t sent = server.streamFile(file, "application/octet-stream");
file.close();
return true;
}
return false;
}
void ViewLog(){
webString="";
String payload;
String ShowPL;
payload += server.arg(0);
File f = SPIFFS.open(payload, "r");
String webString = f.readString();
f.close();
ShowPL = String()+F(
"<html><head></head><body>"
"<a href=\"/\"><- BACK TO INDEX</a><br><br>"
"<a href=\"/logs\">List Exfiltrated Data</a> - <a href=\"/experimental\">Experimental TX Mode</a> - <a href=\"/data-convert\">Data Conversion Tools</a><br><br>"
"<FORM action=\"/api/tx/bin\" id=\"api_tx\" method=\"get\" target=\"_blank\">"
"<small>Binary: </small><INPUT form=\"api_tx\" type=\"text\" name=\"binary\" value=\"\" pattern=\"[01,]{1,}\" required title=\"Allowed characters(0,1,\",\"), must not be empty\" minlength=\"1\" size=\"52\"> "
"<INPUT form=\"api_tx\" type=\"submit\" value=\"Transmit\"><br>"
"<small>Pulse Width: </small><INPUT form=\"api_tx\" type=\"number\" name=\"pulsewidth\" value=\"40\" minlength=\"1\" min=\"0\" size=\"8\"><small>us</small> "
"<small>Data Interval: </small><INPUT form=\"api_tx\" type=\"number\" name=\"interval\" value=\"2000\" minlength=\"1\" min=\"0\" size=\"8\"><small>us</small> "
"<small>Delay Between Packets: </small><INPUT form=\"api_tx\" type=\"number\" name=\"wait\" value=\"100000\" minlength=\"1\" min=\"0\" size=\"8\"><small>us</small><br>"
"<INPUT form=\"api_tx\" type=\"hidden\" name=\"prettify\" id=\"prettify\" value=\"1\">"
"</FORM>"
"<small>Use commas to separate the binary for transmitting multiple packets(useful for sending multiple keypresses for imitating keypads)</small><br>"
"<hr>"
"<a href=\"")+payload+F("\"><button>Download File</button><a><small> - </small><a href=\"/deletelog?payload=")+payload+F("\"><button>Delete File</button></a>"
"<pre>")
+payload+
F("\n"
"Note: Preambles shown are only a guess based on card length and may not be accurate for every card format.\n"
"-----\n")
+webString+
F("</pre></body></html>")
;
webString="";
server.send(200, "text/html", ShowPL);
}
// Start Networking
void setup() {
Serial.begin(9600);
Serial.println(F("....."));
Serial.println(String()+F("ESP-RFID-Tool v")+version);
//SPIFFS.format();
SPIFFS.begin();
//loadDefaults(); //uncomment to restore default settings if double reset fails for some reason
//Jump RESTORE_DEFAULTS_PIN to GND while powering on device to reset the device to factory defaults
pinMode(RESTORE_DEFAULTS_PIN, INPUT_PULLUP);
jumperState = digitalRead(RESTORE_DEFAULTS_PIN);
if (jumperState == LOW) {
Serial.println(String()+F("Pin ")+RESTORE_DEFAULTS_PIN+F("Grounded"));
Serial.println(F("Loading default config..."));
loadDefaults();
}
loadConfig();
if(!wg.begin(DATA0,DATA1,bufferlength,rxpacketgap)) {
Serial.println(F("Could not begin Wiegand logging,"));
Serial.println(F("Out of memory!"));
}
//Set up Web Pages
server.on("/",[]() {
FSInfo fs_info;
SPIFFS.info(fs_info);
String total;
total=fs_info.totalBytes;
String used;
used=fs_info.usedBytes;
String freespace;
freespace=fs_info.totalBytes-fs_info.usedBytes;
server.send(200, "text/html", String()+F("<html><body><b>ESP-RFID-Tool v")+version+F("</b><br>"
"<img width='86' height='86' src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3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YuMzQ3NTIsLTEwLjIzMzE4IC0yNC41ODM5OCwtMTIuMTc1NzgyIC0zLjc0ODg2LC0wLjg4NDE3NCAtNy43NDU4OCwtMS4zMDk3MDYgLTExLjgzOTg1LC0xLjMxMDU0NiB6IG0gLTEuNTUyNzMsLTE1LjkwMjM0NCBjIC0xMC43MTM4MywwLjA0MDk4IC0yMS41MjcwNSwyLjMwNjg4NyAtMzEuNjYyMTEsNi45MDIzNDQgLTYuNjU3MjYsMy4wMTg1MTkgLTE3LjMxNjQ1LDEwLjE2OTY2NSAtMjAuNTkzNzUsMTMuODE0NDUzIC0xLjgxNDEsMi4wMTc1NDkgLTEuODIxNDcsMi4yMDk0MDYgLTAuMTYyMTEsNC4wNDI5NjggMS43MDM1OCwxLjg4MjQzMiAxLjg3OTQzLDEuODE0MTg4IDcuOTA0MywtMy4wNTY2NCAyNS44MTI4MSwtMjAuODY4Mzk3IDYzLjc4MjM0LC0yMS4wNTQwNTQgODguNjQ0NTMsLTAuNDMzNTk0IGwgNS40ODA0Nyw0LjU0Njg3NSAyLjAxOTUzLC0yLjA0Njg3NSAyLjAxNzU4LC0yLjA0ODgyOCAtNC41LC0zLjg3MzA0NyBDIDIxNC40NDk0NSwzNy4yODk5MDcgMTk2Ljg2ODExLDMxLjE3Nzc5NiAxNzkuMDExNzIsMzEuMjQ2MDk0IFoiIC8+CiAgPC9nPgo8L3N2Zz4K'><br><i>"
"by Corey Harding<br>"
"www.RFID-Tool.com<br>"
"www.LegacySecurityGroup.com / www.Exploit.Agency</i><br>"
"-----<br>"
"File System Info Calculated in Bytes<br>"
"<b>Total:</b> ")+total+" <b>Free:</b> "+freespace+" "+" <b>Used:</b> "+used+F("<br>-----<br>"
"<a href=\"/logs\">List Exfiltrated Data</a><br>-<br>"
"<a href=\"/experimental\">Experimental TX Mode</a><br>-<br>"
"<a href=\"/data-convert\">Data Conversion Tools</a><br>-<br>"
"<a href=\"/settings\">Configure Settings</a><br>-<br>"
"<a href=\"/format\">Format File System</a><br>-<br>"
"<a href=\"/firmware\">Upgrade Firmware</a><br>-<br>"
"<a href=\"/api/help\">API Info</a><br>-<br>"
"<a href=\"/help\">Help</a>"
"</body></html>"));
});
server.onNotFound([]() {
if (!RawFile(server.uri()))
server.send(404, "text/plain", F("Error 404 File Not Found"));
});
server.on("/settings", handleSettings);
server.on("/firmware", [](){
server.send(200, "text/html", String()+F("<html><body style=\"height: 100%;\"><a href=\"/\"><- BACK TO INDEX</a><br><br>Open Arduino IDE.<br>Pull down \"Sketch\" Menu then select \"Export Compiled Binary\".<br>On this page click \"Browse\", select the binary you exported earlier, then click \"Update\".<br>You may need to manually reboot the device to reconnect.<br><iframe style =\"border: 0; height: 100%;\" src=\"http://")+local_IPstr+F(":1337/update\"><a href=\"http://")+local_IPstr+F(":1337/update\">Click here to Upload Firmware</a></iframe></body></html>"));
});
server.on("/restoredefaults", [](){
server.send(200, "text/html", F("<html><body>This will restore the device to the default configuration.<br><br>Are you sure?<br><br><a href=\"/restoredefaults/yes\">YES</a> - <a href=\"/\">NO</a></body></html>"));
});
server.on("/restoredefaults/yes", [](){
if(!server.authenticate(update_username, update_password))
return server.requestAuthentication();
server.send(200, "text/html", F("<a href=\"/\"><- BACK TO INDEX</a><br><br>Network<br>---<br>SSID: <b>ESP-RFID-Tool</b><br><br>Administration<br>---<br>USER: <b>admin</b> PASS: <b>rfidtool</b>"));
delay(50);
loadDefaults();
ESP.restart();
});
server.on("/deletelog", [](){
String deletelog;
deletelog += server.arg(0);
server.send(200, "text/html", String()+F("<html><body>This will delete the file: ")+deletelog+F(".<br><br>Are you sure?<br><br><a href=\"/deletelog/yes?payload=")+deletelog+F("\">YES</a> - <a href=\"/\">NO</a></body></html>"));
});
server.on("/viewlog", ViewLog);
server.on("/deletelog/yes", [](){
if(!server.authenticate(update_username, update_password))
return server.requestAuthentication();
String deletelog;
deletelog += server.arg(0);
if (!deletelog.startsWith("/payloads/")) server.send(200, "text/html", String()+F("<a href=\"/\"><- BACK TO INDEX</a><br><br><a href=\"/logs\">List Exfiltrated Data</a><br><br>Deleting file: ")+deletelog);
delay(50);
SPIFFS.remove(deletelog);
});
server.on("/format", [](){
server.send(200, "text/html", F("<html><body><a href=\"/\"><- BACK TO INDEX</a><br><br>This will reformat the SPIFFS File System.<br><br>Are you sure?<br><br><a href=\"/format/yes\">YES</a> - <a href=\"/\">NO</a></body></html>"));
});
server.on("/logs", ListLogs);
server.on("/reboot", [](){
if(!server.authenticate(update_username, update_password))
return server.requestAuthentication();
server.send(200, "text/html", F("<a href=\"/\"><- BACK TO INDEX</a><br><br>Rebooting Device..."));
delay(50);
ESP.restart();
});
server.on("/format/yes", [](){
if(!server.authenticate(update_username, update_password))
return server.requestAuthentication();
server.send(200, "text/html", F("<a href=\"/\"><- BACK TO INDEX</a><br><br>Formatting file system: This may take up to 90 seconds"));
delay(50);
// Serial.print("Formatting file system...");
SPIFFS.format();
// Serial.println(" Success");
saveConfig();
});
server.on("/help", []() {
server.send_P(200, "text/html", HelpText);
});
server.on("/license", []() {
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("<br><br>");
String hexTEMP="";
int binCOUNT=(bin2hexBUFFlen-1);
for (int currentBINpos=0; currentBINpos<binCOUNT; currentBINpos=currentBINpos+4) {
char hexCHAR[2];
char tempNIBBLE[5];
strncpy(tempNIBBLE, &bin2hexCHAR[currentBINpos], 4);
tempNIBBLE[4]='\0';
sprintf(hexCHAR, "%X", (strtol(tempNIBBLE, NULL, 2)));
hexTEMP+=hexCHAR;
}
dataCONVERSION+=String()+F("Hexadecimal: ")+hexTEMP+F("<br><small>You may want to drop the leading zero(if there is one) and if your cloning software does not handle it for you.</small><br><br>");
hexTEMP="";
dataCONVERSION+=F("<br><br>");
bin2hexBUFFlen=0;
}
if (server.hasArg("hex2binHTML")) {
int hex2binBUFFlen=(((server.arg("hex2binHTML")).length())+1);
char hex2binCHAR[hex2binBUFFlen];
(server.arg("hex2binHTML")).toCharArray(hex2binCHAR,hex2binBUFFlen);
dataCONVERSION+=String()+F("Hexadecimal: ")+hex2binCHAR+F("<br><br>");
String binTEMP="";
int charCOUNT=(hex2binBUFFlen-1);
for (int currentHEXpos=0; currentHEXpos<charCOUNT; currentHEXpos++) {
char binCHAR[5];
char tempHEX[2];
strncpy(tempHEX, &hex2binCHAR[currentHEXpos], 1);
tempHEX[1]='\0';
int decimal=(unsigned char)strtoul(tempHEX, NULL, 16);
itoa(decimal,binCHAR,2);
while (strlen(binCHAR) < 4) {
char *dup;
sprintf(binCHAR,"%s%s","0",(dup=strdup(binCHAR)));
free(dup);
}
binTEMP+=binCHAR;
}
dataCONVERSION+=String()+F("Binary: ")+binTEMP+F("<br><br>");
binTEMP="";
dataCONVERSION+=F("<br><br>");
hex2binBUFFlen=0;
}
if (server.hasArg("abaHTML")) {
String abaHTML=(server.arg("abaHTML"));
dataCONVERSION="Trying \"Forward\" Swipe<br>";
dataCONVERSION+=("Forward Binary:"+abaHTML+"<br>");
int abaStart=abaHTML.indexOf("11010");
int abaEnd=(abaHTML.lastIndexOf("11111")+4);
dataCONVERSION+=aba2str(abaHTML,abaStart,abaEnd,"\"Forward\" Swipe");
dataCONVERSION+=" * Trying \"Reverse\" Swipe<br>";
int abaBUFFlen=((abaHTML.length())+1);
char abachar[abaBUFFlen];
abaHTML.toCharArray(abachar,abaBUFFlen);
abaHTML=String(strrev(abachar));
dataCONVERSION+=("Reversed Binary:"+abaHTML+"<br>");
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:<br><a target=\"_blank\" href=\"https://www.legacysecuritygroup.com/aba-decode.php?binary=")+abaHTML+F("\">https://www.legacysecuritygroup.com/aba-decode.php?binary=")+abaHTML+F("</a>"));
dataCONVERSION.replace("*", "<br><br>");
dataCONVERSION.replace(":", ": ");
abaHTML="";
abaStart=0;
abaEnd=0;
}
server.send(200, "text/html", String()+F(
"<a href=\"/\"><- BACK TO INDEX</a><br><br>")
+dataCONVERSION+
F(
"<hr>"
"<FORM action=\"/data-convert\" id=\"aba2ascii\" method=\"post\">"
"<b>Convert ABA Binary Data to ASCII:</b><br>"
"<INPUT form=\"aba2ascii\" type=\"text\" name=\"abaHTML\" value=\"\" pattern=\"[0-1]{1,}\" required title=\"Only 0's & 1's allowed, must not be empty\" minlength=\"1\" size=\"52\"><br>"
"<INPUT form=\"aba2ascii\" type=\"submit\" value=\"Convert\"><br>"
"</FORM>"
"<br>"
"<FORM action=\"/data-convert\" id=\"bin2hex\" method=\"post\">"
"<b>Convert Binary Data to Hexadecimal:</b><br>"
"<small>For use with card cloning, typically includes both the preamble and card data(binary before and after the space in log).</small><br>"
"<INPUT form=\"bin2hex\" type=\"text\" name=\"bin2hexHTML\" value=\"\" pattern=\"[0-1]{1,}\" required title=\"Only 0's & 1's allowed, no spaces allowed, must not be empty\" minlength=\"1\" size=\"52\"><br>"
"<INPUT form=\"bin2hex\" type=\"submit\" value=\"Convert\"><br>"
"</FORM>"
"<br>"
"<FORM action=\"/data-convert\" id=\"hex2bin\" method=\"post\">"
"<b>Convert Hexadecimal Data to Binary:</b><br>"
"<small>In some situations you may want to add a leading zero to pad the output to come up with the correct number of bits.</small><br>"
"<INPUT form=\"hex2bin\" type=\"text\" name=\"hex2binHTML\" value=\"\" pattern=\"[0-9a-fA-F]{1,}\" required title=\"Only characters 0-9 A-F a-f allowed, no spaces allowed, must not be empty\" minlength=\"1\" size=\"52\"><br>"
"<INPUT form=\"hex2bin\" type=\"submit\" value=\"Convert\"><br>"
"</FORM>"
)
);
dataCONVERSION="";
});
#include "api_server.h"
server.on("/stoptx", [](){
server.send(200, "text/html", F("<html><body>This will kill any ongoing transmissions.<br><br>Are you sure?<br><br><a href=\"/stoptx/yes\">YES</a> - <a href=\"/\">NO</a></body></html>"));
});
server.on("/stoptx/yes", [](){
TXstatus=0;
server.send(200, "text/html", F("<a href=\"/\"><- BACK TO INDEX</a><br><br><a href=\"/experimental\"><- BACK TO EXPERIMENTAL TX MODE</a><br><br>All transmissions have been stopped."));
});
server.on("/experimental", [](){
String experimentalStatus="Awaiting Instructions";
if (server.hasArg("pinHTML")||server.hasArg("bruteEND")) {
pinHTML=server.arg("pinHTML");
int pinBITS=server.arg("pinBITS").toInt();
int pinHTMLDELAY=server.arg("pinHTMLDELAY").toInt();
int bruteforcing;
int brutePAD=(server.arg("bruteSTART").length());
if (server.hasArg("bruteSTART")) {
bruteforcing=1;
}
else {
bruteforcing=0;
}
TXstatus=1;
wg.pause();
digitalWrite(DATA0, HIGH);
pinMode(DATA0,OUTPUT);
digitalWrite(DATA1, HIGH);
pinMode(DATA1,OUTPUT);
pinHTML.replace("F1","C");
pinHTML.replace("F2","D");
pinHTML.replace("F3","E");
pinHTML.replace("F4","F");
experimentalStatus=String()+"Transmitting "+pinBITS+"bit Wiegand Format PIN: "+pinHTML+" with a "+pinHTMLDELAY+"ms delay between \"keypresses\"";
delay(50);
int bruteSTART;
int bruteEND;
if (server.hasArg("bruteSTART")) {
bruteSTART=server.arg("bruteSTART").toInt();
}
else {
bruteSTART=0;
}
if (server.hasArg("bruteEND")) {
bruteEND=server.arg("bruteEND").toInt();
}
else {
bruteEND=0;
}
if (server.hasArg("bruteSTART")) {
server.send(200, "text/html", String()+"<a href=\"/\"><- BACK TO INDEX</a><br><br><a href=\"/experimental\"><- BACK TO EXPERIMENTAL TX MODE</a><br><br>Brute forcing "+pinBITS+"bit Wiegand Format PIN from "+(server.arg("bruteSTART"))+" to "+(server.arg("bruteEND"))+" with a "+pinHTMLDELAY+"ms delay between \"keypresses\"<br>This may take a while, your device will be busy until the sequence has been completely transmitted!<br>Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish.<br>You can view if the brute force attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"<br><br><a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>");
delay(50);
}
String bruteSTARTchar="";
String bruteENDchar="";
if (server.hasArg("bruteSTARTchar")&&(server.arg("bruteSTARTchar")!="")) {
bruteSTARTchar=(server.arg("bruteSTARTchar"));
bruteSTARTchar.replace("F1","C");
bruteSTARTchar.replace("F2","D");
bruteSTARTchar.replace("F3","E");
bruteSTARTchar.replace("F4","F");
}
if (server.hasArg("bruteENDchar")&&(server.arg("bruteENDchar")!="")) {
bruteENDchar=(server.arg("bruteENDchar"));
bruteENDchar=(server.arg("bruteENDchar"));
bruteENDchar.replace("F1","C");
bruteENDchar.replace("F2","D");
bruteENDchar.replace("F3","E");
bruteENDchar.replace("F4","F");
}
unsigned long bruteFAILdelay=0;
unsigned long bruteFAILS=0;
int bruteFAILmultiplier=0;
int bruteFAILmultiplierCURRENT=0;
int bruteFAILmultiplierAFTER=0;
int delayAFTERpin=0;
int bruteFAILSmax=0;
bruteFAILSmax=(server.arg("bruteFAILSmax")).toInt();
delayAFTERpin=(server.arg("delayAFTERpin")).toInt();
bruteFAILdelay=(server.arg("bruteFAILdelay")).toInt();
bruteFAILmultiplier=(server.arg("bruteFAILmultiplier")).toInt();
bruteFAILmultiplierAFTER=(server.arg("bruteFAILmultiplierAFTER")).toInt();
for (int brute=bruteSTART; brute<=bruteEND; brute++) {
if (bruteforcing==1) {
pinHTML=String(brute);
while (pinHTML.length()<brutePAD) {
pinHTML="0"+pinHTML;
}
}
if (bruteSTARTchar!="") {
pinHTML=bruteSTARTchar+pinHTML;
}
if (bruteENDchar!="") {
pinHTML=pinHTML+bruteENDchar;
}
for (int i=0; i<=pinHTML.length(); i++) {
if (pinHTML.charAt(i) == '0') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0000");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"11110000");
}
}
else if (pinHTML.charAt(i) == '1') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0001");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"11100001");
}
}
else if (pinHTML.charAt(i) == '2') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0010");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"11010010");
}
}
else if (pinHTML.charAt(i) == '3') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0011");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"11000011");
}
}
else if (pinHTML.charAt(i) == '4') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0100");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"10110100");
}
}
else if (pinHTML.charAt(i) == '5') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0101");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"10100101");
}
}
else if (pinHTML.charAt(i) == '6') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0110");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"10010110");
}
}
else if (pinHTML.charAt(i) == '7') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"0111");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"10000111");
}
}
else if (pinHTML.charAt(i) == '8') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1000");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"01111000");
}
}
else if (pinHTML.charAt(i) == '9') {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1001");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"01101001");
}
}
else if ((pinHTML.charAt(i) == '*')||(pinHTML.charAt(i) == 'A')) {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1010");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"01011010");
}
}
else if ((pinHTML.charAt(i) == '#')||(pinHTML.charAt(i) == 'B')) {
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1011");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"01001011");
}
}
else if (pinHTML.charAt(i) == 'C') { //F1
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1100");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"00111100");
}
}
else if (pinHTML.charAt(i) == 'D') { //F2
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1101");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"00101101");
}
}
else if (pinHTML.charAt(i) == 'E') { //F3
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1110");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"00011110");
}
}
else if (pinHTML.charAt(i) == 'F') { //F4
if (pinBITS==4) {
pinSEND(pinHTMLDELAY,"1111");
}
else if (pinBITS==8) {
pinSEND(pinHTMLDELAY,"00001111");
}
}
}
server.handleClient();
if (TXstatus!=1) {
break;
}
bruteFAILS++;
if (bruteFAILS>=4294967000) {
bruteFAILS=(4294966000);
}
if (bruteFAILdelay>=4294967000) {
bruteFAILdelay=(4294966000);
}
if (bruteFAILmultiplier!=0) {
bruteFAILmultiplierCURRENT++;
if (bruteFAILmultiplierCURRENT>=bruteFAILmultiplierAFTER) {
bruteFAILmultiplierCURRENT=0;
bruteFAILdelay=(bruteFAILdelay*bruteFAILmultiplier);
}
}
if ((bruteFAILS>=bruteFAILSmax)&&(bruteFAILSmax!=0)) {
delay(bruteFAILdelay*1000);
}
else {
delay(delayAFTERpin);
}
}
pinMode(DATA0, INPUT);
pinMode(DATA1, INPUT);
wg.clear();
pinHTML="";
pinHTMLDELAY=100;
TXstatus=0;
bruteforcing=0;
brutePAD=0;
bruteSTARTchar="";
bruteENDchar="";
bruteFAILdelay=0;
bruteFAILS=0;
bruteFAILmultiplier=0;
bruteFAILmultiplierCURRENT=0;
bruteFAILmultiplierAFTER=0;
delayAFTERpin=0;
bruteFAILSmax=0;
}
if (server.hasArg("binHTML")) {
String binHTML=server.arg("binHTML");
wg.pause();
digitalWrite(DATA0, HIGH);
pinMode(DATA0,OUTPUT);
digitalWrite(DATA1, HIGH);
pinMode(DATA1,OUTPUT);
for (int i=0; i<=binHTML.length(); i++) {
if (binHTML.charAt(i) == '0') {
digitalWrite(DATA0, LOW);
delayMicroseconds(txdelayus);
digitalWrite(DATA0, HIGH);
}
else if (binHTML.charAt(i) == '1') {
digitalWrite(DATA1, LOW);
delayMicroseconds(txdelayus);
digitalWrite(DATA1, HIGH);
}
delay(txdelayms);
}
pinMode(DATA0, INPUT);
pinMode(DATA1, INPUT);
wg.clear();
experimentalStatus=String()+"Transmitting Binary: "+binHTML;
binHTML="";
}
if (server.arg("fuzzType")=="simultaneous") {
int fuzzTimes=0;
dos=0;
if ((server.arg("fuzzTimes"))=="dos") {
dos=1;
server.send(200, "text/html", String()+
"<a href=\"/\"><- BACK TO INDEX</a><br><br>"
"<a href=\"/experimental\"><- BACK TO EXPERIMENTAL TX MODE</a><br><br>"
"Denial of Service mode active.<br>Transmitting D0 and D1 bits simultaneously until stopped."
"<br>This may take a while, your device will be busy until the sequence has been completely transmitted!"
"<br>Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish.<br>"
"You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"<br><br>"
"<a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>");
delay(50);
}
else {
fuzzTimes=server.arg("fuzzTimes").toInt();
server.send(200, "text/html", String()+
"<a href=\"/\"><- BACK TO INDEX</a><br><br>"
"<a href=\"/experimental\"><- BACK TO EXPERIMENTAL TX MODE</a><br><br>"
"Transmitting D0 and D1 bits simultaneously "+fuzzTimes+" times."
"<br>This may take a while, your device will be busy until the sequence has been completely transmitted!"
"<br>Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish.<br>"
"You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"<br><br>"
"<a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>");
delay(50);
}
wg.pause();
digitalWrite(DATA0, HIGH);
pinMode(DATA0,OUTPUT);
digitalWrite(DATA1, HIGH);
pinMode(DATA1,OUTPUT);
TXstatus=1;
for (int i=0; i<=fuzzTimes || dos==1; i++) {
digitalWrite(DATA0, LOW);
digitalWrite(DATA1, LOW);
delayMicroseconds(txdelayus);
digitalWrite(DATA0, HIGH);
digitalWrite(DATA1, HIGH);
delay(txdelayms);
server.handleClient();
if (TXstatus!=1) {
break;
}
}
pinMode(DATA0, INPUT);
pinMode(DATA1, INPUT);
wg.clear();
TXstatus=0;
dos=0;
//experimentalStatus=String()+"Transmitting D0 and D1 bits simultaneously "+fuzzTimes+" times.";
}
if (server.arg("fuzzType")=="alternating") {
int fuzzTimes=0;
dos=0;
if ((server.arg("fuzzTimes"))=="dos") {
dos=1;
server.send(200, "text/html", String()+
"<a href=\"/\"><- BACK TO INDEX</a><br><br>"
"<a href=\"/experimental\"><- BACK TO EXPERIMENTAL TX MODE</a><br><br>"
"Denial of Service mode active.<br>Transmitting bits alternating between D0 and D1 until stopped."
"<br>This may take a while, your device will be busy until the sequence has been completely transmitted!"
"<br>Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish.<br>"
"You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"<br><br>"
"<a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>");
delay(50);
}
else {
fuzzTimes=server.arg("fuzzTimes").toInt();
server.send(200, "text/html", String()+
"<a href=\"/\"><- BACK TO INDEX</a><br><br>"
"<a href=\"/experimental\"><- BACK TO EXPERIMENTAL TX MODE</a><br><br>"
"Transmitting "+fuzzTimes+" bits alternating between D0 and D1."
"<br>This may take a while, your device will be busy until the sequence has been completely transmitted!"
"<br>Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish.<br>"
"You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"<br><br>"
"<a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>");
delay(50);
}
wg.pause();
digitalWrite(DATA0, HIGH);
pinMode(DATA0,OUTPUT);
digitalWrite(DATA1, HIGH);
pinMode(DATA1,OUTPUT);
String binALT="";
TXstatus=1;
for (int i=0; i<fuzzTimes || dos==1; i++) {
if (i%2==0) {
digitalWrite(DATA0, LOW);
delayMicroseconds(txdelayus);
digitalWrite(DATA0, HIGH);
binALT=binALT+"0";
}
else {
digitalWrite(DATA1, LOW);
delayMicroseconds(txdelayus);
digitalWrite(DATA1, HIGH);
binALT=binALT+"1";
}
delay(txdelayms);
server.handleClient();
if (TXstatus!=1) {
break;
}
}
pinMode(DATA0, INPUT);
pinMode(DATA1, INPUT);
wg.clear();
TXstatus=0;
dos=0;
//experimentalStatus=String()+"Transmitting alternating bits: "+binALT;
binALT="";
}
if (server.arg("pushType")=="Ground") {
Serial.end();
digitalWrite(3,LOW);
pinMode(3,OUTPUT);
delay(server.arg("pushTime").toInt());
pinMode(3,INPUT);
Serial.begin(9600);
experimentalStatus=String()+"Grounding \"Push to Open\" wire for "+(server.arg("pushTime").toInt())+"ms.";
}
if (server.arg("pushType")=="High") {
Serial.end();
digitalWrite(3,HIGH);
pinMode(3,OUTPUT);
delay(server.arg("pushTime").toInt());
pinMode(3,INPUT);
Serial.begin(9600);
experimentalStatus=String()+"Outputting 3.3V on \"Push to Open\" wire for "+(server.arg("pushTime").toInt())+"ms.";
}
String activeTX="";
if (TXstatus==1) {
if (pinHTML!="") {
String currentPIN=pinHTML;
activeTX="Brute forcing PIN: "+currentPIN+"<br><a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>";
currentPIN="";
}
else if (dos==1) {
activeTX="Denial of Service mode active...<br><a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>";
}
else {
activeTX="Transmitting...<br><a href=\"/stoptx\"><button>STOP CURRENT TRANSMISSION</button></a>";
}
}
else {
activeTX="INACTIVE<br><button>NOTHING TO STOP</button>";
}
server.send(200, "text/html",
String()+
F(
"<!DOCTYPE HTML>"
"<html>"
"<head>"
"<title>Experimental TX Mode</title>"
"</head>"
"<body>"
)+experimentalStatus+"<br><br>"
+F(
"<b>Transmit Status:</b> ")+activeTX+F("<br><br>"
"<a href=\"/\"><- BACK TO INDEX</a><br>"
"<P>"
"<h1>Experimental TX Mode</h1>"
"<hr>"
"<small>"
"<b>Warning:</b> This mode is highly experimental, use at your own risk!<br>"
"Note: Timings for the Wiegand Data Pulse Width and Wiegand Data Interval may be changed on the settings page."
"</small>"
"<br>"
"<hr>"
"<br>"
"<FORM action=\"/experimental\" id=\"transmitbinary\" method=\"post\">"
"<b>Binary Data:</b><br>"
"<small>Typically no need to include preamble</small><br>"
"<INPUT form=\"transmitbinary\" type=\"text\" name=\"binHTML\" value=\"\" pattern=\"[0-1]{1,}\" required title=\"Only 0's & 1's allowed, must not be empty\" minlength=\"1\" size=\"52\"><br>"
"<INPUT form=\"transmitbinary\" type=\"submit\" value=\"Transmit\"><br>"
"</FORM>"
"<br>"
"<hr>"
"<br>"
"<FORM action=\"/experimental\" id=\"transmitpin\" method=\"post\">"
"<b>Transmit PIN:</b><br>"
"<small>Available keys 0-9, * or A, # or B, F1 or C, F2 or D, F3 or E, F4 or F</small><br>"
"<small>PIN: </small><INPUT form=\"transmitpin\" type=\"text\" name=\"pinHTML\" value=\"\" pattern=\"[0-9*#A-F]{1,}\" required title=\"Available keys 0-9, * or A, # or B, F1 or C, F2 or D, F3 or E, F4 or F, must not be empty\" minlength=\"1\" size=\"52\"><br>"
"<small>Delay between \"keypresses\": </small><INPUT form=\"transmitpin\" type=\"number\" name=\"pinHTMLDELAY\" value=\"100\" minlength=\"1\" min=\"0\" size=\"8\"><small>ms</small><br>"
"<INPUT form=\"transmitpin\" type=\"radio\" name=\"pinBITS\" id=\"pinBITS\" value=\"4\" checked required> <small>4bit Wiegand PIN Format</small> "
"<INPUT form=\"transmitpin\" type=\"radio\" name=\"pinBITS\" id=\"pinBITS\" value=\"8\" required> <small>8bit Wiegand PIN Format</small><br>"
"<INPUT form=\"transmitpin\" type=\"submit\" value=\"Transmit\"><br>"
"</FORM>"
"<br>"
"<hr>"
"<br>"
"<FORM action=\"/experimental\" id=\"brutepin\" method=\"post\">"
"<b>Bruteforce PIN:</b><br>"
"<small>Delay between \"keypresses\": </small><INPUT form=\"brutepin\" type=\"number\" name=\"pinHTMLDELAY\" value=\"3\" minlength=\"1\" min=\"0\" size=\"8\"><small>ms</small><br>"
"<small>Delay between entering complete PINs: </small><INPUT form=\"brutepin\" type=\"number\" name=\"delayAFTERpin\" value=\"0\" minlength=\"1\" min=\"0\" size=\"8\"><small>ms</small><br>"
"<small>PIN begins with character(s): </small><INPUT form=\"brutepin\" type=\"text\" name=\"bruteSTARTchar\" value=\"\" pattern=\"[0-9*#A-F]{0,}\" title=\"Available keys 0-9, * or A, # or B, F1 or C, F2 or D, F3 or E, F4 or F, must not be empty\" size=\"8\"><br>"
"<small>PIN start position: </small><INPUT form=\"brutepin\" type=\"number\" name=\"bruteSTART\" value=\"0000\" minlength=\"1\" min=\"0\" size=\"8\"><br>"
"<small>PIN end position: </small><INPUT form=\"brutepin\" type=\"number\" name=\"bruteEND\" value=\"9999\" minlength=\"1\" min=\"0\" size=\"8\"><br>"
"<small>PIN ends with character(s): </small><INPUT form=\"brutepin\" type=\"text\" name=\"bruteENDchar\" value=\"#\" pattern=\"[0-9*#A-F]{0,}\" title=\"Available keys 0-9, * or A, # or B, F1 or C, F2 or D, F3 or E, F4 or F, must not be empty\" size=\"8\"><br>"
"<small>NOTE: The advanced timing settings listed below override the \"Delay between entering complete PINs\" setting(listed above) when the conditions listed below are met.</small><br>"
"<small>Number of failed PIN attempts(X) before a delay: </small><INPUT form=\"brutepin\" type=\"number\" name=\"bruteFAILSmax\" value=\"0\" minlength=\"1\" min=\"0\" size=\"8\"><br>"
"<small>Delay in seconds(Y) after [X] failed PINs: </small><INPUT form=\"brutepin\" type=\"number\" name=\"bruteFAILdelay\" value=\"0\" minlength=\"1\" min=\"0\" size=\"8\"><small>s</small><br>"
"<small>Multiply delay [Y] by <INPUT form=\"brutepin\" type=\"number\" name=\"bruteFAILmultiplier\" value=\"0\" minlength=\"1\" min=\"0\" size=\"4\"> after every <INPUT form=\"brutepin\" type=\"number\" name=\"bruteFAILmultiplierAFTER\" value=\"0\" minlength=\"1\" min=\"0\" size=\"4\"> failed pin attempts</small><br>"
"<INPUT form=\"brutepin\" type=\"radio\" name=\"pinBITS\" id=\"pinBITS\" value=\"4\" checked required> <small>4bit Wiegand PIN Format</small> "
"<INPUT form=\"brutepin\" type=\"radio\" name=\"pinBITS\" id=\"pinBITS\" value=\"8\" required> <small>8bit Wiegand PIN Format</small><br>"
"<INPUT form=\"brutepin\" type=\"submit\" value=\"Transmit\"></FORM><br>"
"<br>"
"<hr>"
"<br>"
"<b>Fuzzing:</b><br><br>"
"<FORM action=\"/experimental\" id=\"fuzz\" method=\"post\">"
"<b>Number of bits:</b>"
"<INPUT form=\"fuzz\" type=\"number\" name=\"fuzzTimes\" value=\"100\" minlength=\"1\" min=\"1\" max=\"2147483647\" size=\"32\"><br>"
//"<INPUT form=\"fuzz\" type=\"text\" name=\"fuzzTimes\" value=\"\" pattern=\"^[1-9]+[0-9]*$\" required title=\"Must be a number > 0, must not be empty \" minlength=\"1\" size=\"32\"><br>"
"<INPUT form=\"fuzz\" type=\"radio\" name=\"fuzzType\" id=\"simultaneous\" value=\"simultaneous\" required> <small>Transmit a bit simultaneously on D0 and D1 (X bits per each line)</small><br>"
"<INPUT form=\"fuzz\" type=\"radio\" name=\"fuzzType\" id=\"alternating\" value=\"alternating\"> <small>Transmit X bits alternating between D0 and D1 each bit (01010101,etc)</small><br>"
"<INPUT form=\"fuzz\" type=\"submit\" value=\"Fuzz\"><br>"
"</FORM>"
"<br>"
"<hr>"
"<br>"
"<b>Denial Of Service Mode:</b><br><br>"
"<FORM action=\"/experimental\" id=\"dos\" method=\"post\">"
"<b>Type of Attack:</b>"
"<INPUT hidden=\"1\" form=\"dos\" type=\"text\" name=\"fuzzTimes\" value=\"dos\"><br>"
"<INPUT form=\"dos\" type=\"radio\" name=\"fuzzType\" id=\"simultaneous\" value=\"simultaneous\" required> <small>Transmit a bit simultaneously on D0 and D1 until stopped</small><br>"
"<INPUT form=\"dos\" type=\"radio\" name=\"fuzzType\" id=\"alternating\" value=\"alternating\"> <small>Transmit bits alternating between D0 and D1 each bit (01010101,etc) until stopped</small><br>"
"<INPUT form=\"dos\" type=\"submit\" value=\"Start DoS\"><br>"
"</FORM>"
"<br>"
"<hr>"
"<br>"
"<b>Push Button for Door Open:</b><br>"
"<small>Connect \"Push to Open\" wire from the reader to the RX pin(GPIO3) on the programming header on ESP-RFID-Tool.</small><br>"
"<small>Warning! Selecting the wrong trigger signal type may cause damage to the connected hardware.</small><br><br>"
"<FORM action=\"/experimental\" id=\"push\" method=\"post\">"
"<b>Time in ms to push the door open button:</b>"
"<INPUT form=\"push\" type=\"text\" name=\"pushTime\" value=\"50\" pattern=\"^[1-9]+[0-9]*$\" required title=\"Must be a number > 0, must not be empty\" minlength=\"1\" size=\"32\"><br>"
"<b>Does the wire expect a High or Low signal to open the door:</b>"
"<INPUT form=\"push\" type=\"radio\" name=\"pushType\" id=\"Ground\" value=\"Ground\" checked required> <small>Low Signal[Ground]</small> "
"<INPUT form=\"push\" type=\"radio\" name=\"pushType\" id=\"Ground\" value=\"High\" required> <small>High Signal[3.3V]</small><br>"
"<INPUT form=\"push\" type=\"submit\" value=\"Push\"><br>"
"</FORM>"
"<br>"
"<hr>"
"<br>"
"</P>"
"</body>"
"</html>"
)
);
if (server.args()>=1) {
if (safemode==1) {
delay(50);
ESP.restart();
}
}
});
server.begin();
WiFiClient client;
client.setNoDelay(1);
// Serial.println("Web Server Started");
MDNS.begin("ESP");
httpUpdater.setup(&httpServer, update_path, update_username, update_password);
httpServer.begin();
MDNS.addService("http", "tcp", 1337);
if (ftpenabled==1){
ftpSrv.begin(String(ftp_username),String(ftp_password));
}
//Start RFID Reader
pinMode(LED_BUILTIN, OUTPUT); // LED
if (ledenabled==1){
digitalWrite(LED_BUILTIN, LOW);
}
else{
digitalWrite(LED_BUILTIN, HIGH);
}
}
//
//Do It!
///////////////////////////////////////////////////////
// LOOP function
void loop()
{
if (ftpenabled==1){
ftpSrv.handleFTP();
}
server.handleClient();
httpServer.handleClient();
while (Serial.available()) {
String cmd = Serial.readStringUntil(':');
if(cmd == "ResetDefaultConfig"){
loadDefaults();
ESP.restart();
}
}
//Serial.print("Free heap-");
//Serial.println(ESP.getFreeHeap(),DEC);
if(wg.available()) {
wg.pause(); // pause Wiegand pin interrupts
LogWiegand(wg);
wg.clear(); // compulsory to call clear() to enable interrupts for subsequent data
if (safemode==1) {
ESP.restart();
}
}
}
================================================
FILE: Source Code/esprfidtool/pinSEND.h
================================================
void pinSEND(int pinDELAY,String pinBIN) {
for (int i=0; i<=pinBIN.length(); i++) {
if (pinBIN.charAt(i) == '0') {
digitalWrite(DATA0, LOW);
delayMicroseconds(txdelayus);
digitalWrite(DATA0, HIGH);
}
else if (pinBIN.charAt(i) == '1') {
digitalWrite(DATA1, LOW);
delayMicroseconds(txdelayus);
digitalWrite(DATA1, HIGH);
}
delay(txdelayms);
}
yield();
delay(pinDELAY);
pinBIN="";
pinDELAY=100;
}
================================================
FILE: Source Code/esprfidtool/strrev.h
================================================
/* Copyright (c) 2007 Dmitry Xmelkov
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of the copyright holders nor the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
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 OWNER 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.
*/
/* $Id$ */
char * strrev (char *s)
{
char *p1, *p2;
for (p2 = s; *p2; ) p2++;
p1 = s;
while (p1 < p2) {
char c1 = *p1;
char c2 = *--p2;
*p1++ = c2;
*p2 = c1;
}
return s;
}
================================================
FILE: Source Code/esprfidtool/version.h
================================================
String version = "1.2.1";
String APIversion = "1.0.4";
gitextract_t2rxqmyl/
├── .gitignore
├── Connector-Adapter-Options/
│ ├── Punchdown-Adapter-1/
│ │ ├── BOM
│ │ └── Image-Credits.txt
│ ├── Punchdown-Adapter-2/
│ │ ├── BOM
│ │ └── Image-Credits.txt
│ └── README.md
├── Images/
│ └── README.md
├── Installation-Schematics/
│ └── README.md
├── Keypad/
│ └── README.md
├── LICENSE
├── Magstripe/
│ ├── README.md
│ └── aba-decode.php
├── README.md
└── Source Code/
└── esprfidtool/
├── HelpText.h
├── LICENSE
├── License.h
├── WiegandNG.cpp
├── WiegandNG.h
├── aba2str.h
├── api.h
├── api_server.h
├── esprfidtool.ino
├── pinSEND.h
├── strrev.h
└── version.h
SYMBOL INDEX (10 symbols across 6 files)
FILE: Magstripe/aba-decode.php
function strpos_r (line 50) | function strpos_r($haystack, $needle)
function processBinary (line 64) | function processBinary($binary)
FILE: Source Code/esprfidtool/WiegandNG.cpp
function shift_left (line 11) | void shift_left(volatile unsigned char *ar, int size, int shift)
FILE: Source Code/esprfidtool/WiegandNG.h
function class (line 10) | class WiegandNG {
FILE: Source Code/esprfidtool/aba2str.h
function String (line 1) | String aba2str (String magstripe, int magStart, int magEnd, String swipe...
FILE: Source Code/esprfidtool/api.h
function apiTX (line 1) | void apiTX(String apiBIN, int apipulsewidth, int apidatainterval, int wa...
function apiinfo (line 31) | void apiinfo(int prettify) {
function apilistlogs (line 67) | void apilistlogs(int prettify) {
function apilog (line 116) | void apilog(String logfile,int prettify) {
FILE: Source Code/esprfidtool/pinSEND.h
function pinSEND (line 1) | void pinSEND(int pinDELAY,String pinBIN) {
Condensed preview — 25 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (167K chars).
[
{
"path": ".gitignore",
"chars": 4,
"preview": "*bin"
},
{
"path": "Connector-Adapter-Options/Punchdown-Adapter-1/BOM",
"chars": 1859,
"preview": "Choose the wire gauge, purchase (2) of the \"2 WAY\" terminals and purchase the appropriate punch down tool.\nThe combinati"
},
{
"path": "Connector-Adapter-Options/Punchdown-Adapter-1/Image-Credits.txt",
"chars": 44,
"preview": "PCB renders generated using https://pcbs.io."
},
{
"path": "Connector-Adapter-Options/Punchdown-Adapter-2/BOM",
"chars": 1859,
"preview": "Choose the wire gauge, purchase (2) of the \"2 WAY\" terminals and purchase the appropriate punch down tool.\nThe combinati"
},
{
"path": "Connector-Adapter-Options/Punchdown-Adapter-2/Image-Credits.txt",
"chars": 44,
"preview": "PCB renders generated using https://pcbs.io."
},
{
"path": "Connector-Adapter-Options/README.md",
"chars": 2443,
"preview": "## Connector Options \n \n### Standard Screwdown Connection \n \n \n \n \n \n \n![Benchtop-PSU-Standalone]"
},
{
"path": "Keypad/README.md",
"chars": 74,
"preview": " "
},
{
"path": "LICENSE",
"chars": 1074,
"preview": "MIT License\n\nCopyright (c) [2018] [Corey Harding]\n\nPermission is hereby granted, free of charge, to any person obtaining"
},
{
"path": "Magstripe/README.md",
"chars": 1633,
"preview": "## ABA Encoding \n \nWiegand Magstripe Readers Tested: \n* HID 3110-6445 Magstripe Pass-Through Reader \n * set to rota"
},
{
"path": "Magstripe/aba-decode.php",
"chars": 3976,
"preview": "<?php\n\n/*\nUSAGE:\nCommand Line: /usr/bin/php aba-decode.php 1101000001100000100011001001001010101101111000001010011101101"
},
{
"path": "README.md",
"chars": 17013,
"preview": "# ESP-RFID-Tool \nBy Corey Harding \n \n \n \nOfficial website: \n* www.rfid-tool.com "
},
{
"path": "Source Code/esprfidtool/HelpText.h",
"chars": 5962,
"preview": "const char HelpText[] PROGMEM = R\"=====(\n<!DOCTYPE HTML>\n<html>\n<head><title>ESP-RFID-Tool Help Page</title></head>\n<bod"
},
{
"path": "Source Code/esprfidtool/LICENSE",
"chars": 1092,
"preview": "SOFTWARE LICENSE\n\nMIT License\n\nCopyright (c) [2018] [Corey Harding]\n\nPermission is hereby granted, free of charge, to an"
},
{
"path": "Source Code/esprfidtool/License.h",
"chars": 11741,
"preview": "const char License[] PROGMEM = R\"=====(\n<!DOCTYPE HTML>\n<html>\n<head><title>ESP-RFID-Tool Licensing Page</title></head>\n"
},
{
"path": "Source Code/esprfidtool/WiegandNG.cpp",
"chars": 4444,
"preview": "#include \"WiegandNG.h\"\n\n// pcintbranch\n\nvolatile unsigned long WiegandNG::_lastPulseTime; // time last bit pulse recei"
},
{
"path": "Source Code/esprfidtool/WiegandNG.h",
"chars": 1157,
"preview": "#ifndef _WIEGAND_NG_H\n#define _WIEGAND_NG_H\n\n#if defined(ARDUINO) && ARDUINO >= 100\n#include \"Arduino.h\"\n#else\n#include "
},
{
"path": "Source Code/esprfidtool/aba2str.h",
"chars": 1351,
"preview": "String aba2str (String magstripe, int magStart, int magEnd, String swipeDirection) {\n //f.println(String()+\"Start pos:\""
},
{
"path": "Source Code/esprfidtool/api.h",
"chars": 6061,
"preview": "void apiTX(String apiBIN, int apipulsewidth, int apidatainterval, int wait) {\n wg.pause();\n digitalWrite(DATA0, HIGH);"
},
{
"path": "Source Code/esprfidtool/api_server.h",
"chars": 4247,
"preview": "server.on(\"/api/tx/bin\", [](){\n String api_binary=\"\";\n int api_pulsewidth=txdelayus;\n int api_datainterval=(txdelayms"
},
{
"path": "Source Code/esprfidtool/esprfidtool.ino",
"chars": 88770,
"preview": "/*\n * ESP-RFID-Tool\n * by Corey Harding of www.Exploit.Agency / www.LegacySecurityGroup.com\n * ESP-RFID-Tool Software is"
},
{
"path": "Source Code/esprfidtool/pinSEND.h",
"chars": 462,
"preview": "void pinSEND(int pinDELAY,String pinBIN) {\n for (int i=0; i<=pinBIN.length(); i++) {\n if (pinBIN.charAt(i) == '0') {"
},
{
"path": "Source Code/esprfidtool/strrev.h",
"chars": 1788,
"preview": "/* Copyright (c) 2007 Dmitry Xmelkov\n All rights reserved.\n Redistribution and use in source and binary forms, with"
},
{
"path": "Source Code/esprfidtool/version.h",
"chars": 55,
"preview": "String version = \"1.2.1\";\nString APIversion = \"1.0.4\";\n"
}
]
About this extraction
This page contains the full source code of the rfidtool/ESP-RFID-Tool GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 25 files (153.9 KB), approximately 49.8k tokens, and a symbol index with 10 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.