├── .gitignore
├── Connector-Adapter-Options
├── Punchdown-Adapter-1
│ ├── BOM
│ ├── Image-Credits.txt
│ ├── bottom-adapter.png
│ ├── punchdown-adapter-Gerber.zip
│ └── top-adapter.png
├── Punchdown-Adapter-2
│ ├── BOM
│ ├── Image-Credits.txt
│ ├── bottom-adapter2.png
│ ├── punchdown-adapter2-Gerber.zip
│ └── top-adapter2.png
├── README.md
├── pd2-custom.jpg
├── portable-5375.jpg
├── punchdown.jpg
├── screwdown.jpg
├── tsplice1.jpg
└── wirenuts.jpg
├── Images
├── 5355keypad-bin2pin.jpg
├── README.md
├── board.jpg
├── logo.png
├── programmer.jpg
├── webint.png
└── wiring.jpg
├── Installation-Schematics
├── 2-rfid-tool-units.png
├── README.md
├── benchtop-psu.png
├── implant.png
├── portable-standalone.png
└── unsupported-voltages.png
├── 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
/.gitignore:
--------------------------------------------------------------------------------
1 | *bin
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-1/BOM:
--------------------------------------------------------------------------------
1 | Choose the wire gauge, purchase (2) of the "2 WAY" terminals and purchase the appropriate punch down tool.
2 | The combination of parts below are currently untested.
3 |
4 | Tool Punch Down Tool Hand Tools ASSEMBLY BIT INSUL DIA 1.60; Mfr. #: 069176701602000 ; Mouser Part #: 581-069176701602000
5 |
6 | Choose your targets wiring size below.
7 | * 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.
8 | Research is still ongoing regarding an officially recommended connector.
9 |
10 | 18AWG IDC Punch Down Block
11 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
12 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
13 |
14 | 20AWG IDC Punch Down Block *
15 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
16 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
17 |
18 | 22AWG IDC Punch Down
19 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
20 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
21 |
22 | 24AWG IDC Punch Down
23 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
24 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-1/Image-Credits.txt:
--------------------------------------------------------------------------------
1 | PCB renders generated using https://pcbs.io.
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-1/bottom-adapter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/Punchdown-Adapter-1/bottom-adapter.png
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-1/punchdown-adapter-Gerber.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/Punchdown-Adapter-1/punchdown-adapter-Gerber.zip
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-1/top-adapter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/Punchdown-Adapter-1/top-adapter.png
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-2/BOM:
--------------------------------------------------------------------------------
1 | Choose the wire gauge, purchase (2) of the "2 WAY" terminals and purchase the appropriate punch down tool.
2 | The combination of parts below are currently untested.
3 |
4 | Tool Punch Down Tool Hand Tools ASSEMBLY BIT INSUL DIA 1.60; Mfr. #: 069176701602000 ; Mouser Part #: 581-069176701602000
5 |
6 | Choose your targets wiring size below.
7 | * 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.
8 | Research is still ongoing regarding an officially recommended connector.
9 |
10 | 18AWG IDC Punch Down Block
11 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
12 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 18 AWG STRANDED ; Mfr. #: 009176002001006; Mouser Part #: 581-009176002001006
13 |
14 | 20AWG IDC Punch Down Block *
15 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
16 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 20 AWG STRANDED ; Mfr. #: 009176002011006; Mouser Part #: 581-009176002011006
17 |
18 | 22AWG IDC Punch Down
19 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
20 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 22 AWG STRANDED; Mfr. #: 009176002022006; Mouser Part #: 581-009176002022006
21 |
22 | 24AWG IDC Punch Down
23 | (D0),(D1) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
24 | (+),(-) IDC Terminal - 2 way Desc.: 2 WAY WIRE TO BD 24 AWG STRANDED; Mfr. #: 009176002032006; Mouser Part #: 581-009176002032006
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-2/Image-Credits.txt:
--------------------------------------------------------------------------------
1 | PCB renders generated using https://pcbs.io.
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-2/bottom-adapter2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/Punchdown-Adapter-2/bottom-adapter2.png
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-2/punchdown-adapter2-Gerber.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/Punchdown-Adapter-2/punchdown-adapter2-Gerber.zip
--------------------------------------------------------------------------------
/Connector-Adapter-Options/Punchdown-Adapter-2/top-adapter2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/Punchdown-Adapter-2/top-adapter2.png
--------------------------------------------------------------------------------
/Connector-Adapter-Options/README.md:
--------------------------------------------------------------------------------
1 | ## Connector Options
2 |
3 | ### Standard Screwdown Connection
4 | 
5 | 
6 |
7 | ### Gray Wire Nuts 22-16AWG
8 |
9 | 
10 | ##### 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.
11 |
12 | ### Screwdown to T-Taps (Wire Splices)
13 |
14 | #### T-Tap Example 1
15 | 
16 | * Uxcell T-Tap Male Insulated Wire Terminal Quick Connector Combo Set 10 Piece, Red
17 | * by Uxcell
18 | [$6.82 on Amazon](http://a.co/6joYNzS)
19 | ##### 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.
20 |
21 | #### T-Tap Example 2
22 | * Brightfour Quick Wire Splice Connector-T type 1 Pin solderless- Compatible with 22 - 20 AWG Cable for Some Tight-fitting Automotive Uses
23 | * by Brightfour
24 | [$8.44 on Amazon](http://a.co/bAw7Fdw)
25 | ##### 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.
26 |
27 | ### Screwdown to Punchdown Adapter
28 |
29 | ##### PCB renders generated using https://pcbs.io.
30 |
31 | #### Side by Side
32 | * [Gerber File](Punchdown-Adapter-1/punchdown-adapter-Gerber.zip)
33 | * [BOM File](Punchdown-Adapter-1/BOM)
34 | * [Order PCB](https://pcbs.io/share/4KXmA)
35 | 
36 |  
37 |
38 | #### Perpendicular
39 | * [Gerber File](Punchdown-Adapter-2/punchdown-adapter2-Gerber.zip)
40 | * [BOM File](Punchdown-Adapter-2/BOM)
41 | * [Order PCB](https://pcbs.io/share/zy0jg)
42 | 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.
43 | 
44 |  
--------------------------------------------------------------------------------
/Connector-Adapter-Options/pd2-custom.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/pd2-custom.jpg
--------------------------------------------------------------------------------
/Connector-Adapter-Options/portable-5375.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/portable-5375.jpg
--------------------------------------------------------------------------------
/Connector-Adapter-Options/punchdown.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/punchdown.jpg
--------------------------------------------------------------------------------
/Connector-Adapter-Options/screwdown.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/screwdown.jpg
--------------------------------------------------------------------------------
/Connector-Adapter-Options/tsplice1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/tsplice1.jpg
--------------------------------------------------------------------------------
/Connector-Adapter-Options/wirenuts.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Connector-Adapter-Options/wirenuts.jpg
--------------------------------------------------------------------------------
/Images/5355keypad-bin2pin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Images/5355keypad-bin2pin.jpg
--------------------------------------------------------------------------------
/Images/README.md:
--------------------------------------------------------------------------------
1 | 
2 | 
3 | 
4 | 
--------------------------------------------------------------------------------
/Images/board.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Images/board.jpg
--------------------------------------------------------------------------------
/Images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Images/logo.png
--------------------------------------------------------------------------------
/Images/programmer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Images/programmer.jpg
--------------------------------------------------------------------------------
/Images/webint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Images/webint.png
--------------------------------------------------------------------------------
/Images/wiring.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Images/wiring.jpg
--------------------------------------------------------------------------------
/Installation-Schematics/2-rfid-tool-units.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Installation-Schematics/2-rfid-tool-units.png
--------------------------------------------------------------------------------
/Installation-Schematics/README.md:
--------------------------------------------------------------------------------
1 | 
2 | 
3 | 
4 | 
5 | 
--------------------------------------------------------------------------------
/Installation-Schematics/benchtop-psu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Installation-Schematics/benchtop-psu.png
--------------------------------------------------------------------------------
/Installation-Schematics/implant.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Installation-Schematics/implant.png
--------------------------------------------------------------------------------
/Installation-Schematics/portable-standalone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Installation-Schematics/portable-standalone.png
--------------------------------------------------------------------------------
/Installation-Schematics/unsupported-voltages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rfidtool/ESP-RFID-Tool/b0bb4cc692afde31613444595f33b282489bf127/Installation-Schematics/unsupported-voltages.png
--------------------------------------------------------------------------------
/Keypad/README.md:
--------------------------------------------------------------------------------
1 | 
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) [2018] [Corey Harding]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Magstripe/README.md:
--------------------------------------------------------------------------------
1 | ## ABA Encoding
2 |
3 | Wiegand Magstripe Readers Tested:
4 | * HID 3110-6445 Magstripe Pass-Through Reader
5 | * set to rotary position B (Raw Data - All Bits Wiegand)
6 | * HID multiCLASS RM40 iCLASS/Magstripe Reader 6220CKN000B
7 | * purchase a reader with the last digit B in item # (ex: 6220CKN000**B**)
8 |
9 | RFID-Tool Specific Settings
10 | * set buffer size to 256 bits or greater
11 |
12 | See [aba-decode.php](aba-decode.php) script for converting binary card data to ascii (Script by: AndrewMohawk)
13 | * Command Line: /usr/bin/php aba-decode.php 1101000001100000100011001001001010101101111000001010011101101111100010
14 | * Web: https://www.LegacySecurityGroup.com/aba-decode.php
15 |
16 | Binary:
17 | 5 bits
18 | Little Endian Format
19 |
20 | LRC(Longitudinal Redundancy Check):
21 | Count # of set bits(1's) in column
22 | EVEN = 0
23 | ODD = 1
24 |
25 | Track 2 Debit/Credit Card Format(for example, as I could not find actual magstripe access control cards):
26 | ;1234567890123456=YYMMSSSDDDDDDDDDDDDDD?*
27 | ; = Start Sentinel
28 | 1234567890123456 = 16 Digit Card #
29 | = = End Card #
30 | YY = Expiration Year
31 | MM = Expiration Month
32 | 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)
33 | DDDDDDDDDDDDDD = Discretionary Data
34 | ? = End Sentinel
35 | *=LRC
36 |
37 | Binary Reference:
38 | 11010 ; - Start Sentinel
39 | 00001 0
40 | 10000 1
41 | 01000 2
42 | 11001 3
43 | 00100 4
44 | 10101 5
45 | 01101 6
46 | 11100 7
47 | 00010 8
48 | 10011 9
49 | 00111 <
50 | 01110 >
51 | 01011 :
52 | 10110 = - End Card Number
53 | 11111 ? - End Sentinel
54 | 00010 LRC
55 |
--------------------------------------------------------------------------------
/Magstripe/aba-decode.php:
--------------------------------------------------------------------------------
1 | ");
21 | }
22 | if (empty($binary)) {
23 | $binary = "1101000001100000100011001001001010101101111000001010011101101111100010";
24 | }
25 |
26 | echo "https://github.com/rfidtool/ESP-RFID-Tool/blob/master/Magstripe/aba-decode.php" . LINEBREAK;
27 | echo "For converting Track 2 Magstripe ABA Binary data to ASCII" . LINEBREAK . LINEBREAK;
28 |
29 | echo "Original script by: AndrewMohawk" . LINEBREAK;
30 | // andrew@andrewmohawk.com
31 | echo "http://www.andrewmohawk.com" . LINEBREAK . LINEBREAK;
32 |
33 | echo "Modified slightly by: Corey Harding" . LINEBREAK;
34 | echo "www.LegacySecurityGroup.com / www.Exploit.Agency" . LINEBREAK . LINEBREAK;
35 |
36 | if (!defined('STDIN')) {
37 | ?>
38 |
39 |
40 |
44 |
45 |
46 | strlen($haystack))
53 | trigger_error(sprintf("%s: length of argument 2 must be <= argument 1", __FUNCTION__), E_USER_WARNING);
54 |
55 | $seeks = array();
56 | while($seek = strrpos($haystack, $needle))
57 | {
58 | array_push($seeks, $seek);
59 | $haystack = substr($haystack, 0, $seek);
60 | }
61 | return $seeks;
62 | }
63 |
64 | function processBinary($binary)
65 | {
66 | $AsciiOutput = "";
67 |
68 | //find start sentinel
69 | $start_sentinel = strpos($binary,"11010");
70 | if($start_sentinel === false)
71 | {
72 | echo "Could not find start sentinel" . LINEBREAK;
73 | return false;
74 | }
75 |
76 | //find end sentinel
77 | $end_sentinel = false;
78 | $end_sentinel = strrpos($binary,"11111");
79 | if(count($end_sentinel) == 0)
80 | {
81 | echo "Could not find end sentinel" . LINEBREAK;
82 | return false;
83 | }
84 |
85 | //Lets decode the data:
86 | $bit_length = 5; // 4 bits for data, 1 bit for odd-parity or LRC checking
87 |
88 |
89 | $data = substr($binary,$start_sentinel,($end_sentinel-$start_sentinel+5));
90 |
91 | $currentBits = "";
92 | $currentNum = 0;
93 | $finalString = "";
94 |
95 | for($i=0;$i=1.1.0 are compiled with esp8266 board manager package 2.4.1
31 | * Releases < 1.1.0 are compiled with esp8266 board manager package 2.3.0
32 | * Unofficial
33 | * Port of Tastic RFID Thief: https://github.com/exploitagency/ESP-RFID-Thief/releases
34 |
35 | ## Intended use cases
36 | * Security researchers performing red team assessments.
37 | * Capturing card values to later be cloned.
38 | * Replaying raw binary captures.*(see note below)
39 | * Fuzzing access control systems.*(see note below)
40 | * Brute forcing PIN codes.*(see note below)
41 | * Denial of Service mode.*(see note below)
42 | * To create a standalone device for capturing credentials or testing badges and or card readers without the need for a Wiegand Controller.
43 | * Add a battery and a card reader to make the unit portable.
44 | * Add a benchtop power supply to use for testing hardware.
45 | * Installers troubleshooting issues with a card reader, the data lines, or even testing for a faulty card.
46 | * Useful for merchants or surplus resellers who are testing if access control equipment is functional.
47 | * Hobbyist experimenting with various systems that utilize a Wiegand Interface.
48 | * Simulating an access control system using multiple units of ESP-RFID-Tool.
49 | * RFID-Tool is not intended to be used in any unlawful manner.
50 |
51 | ## What is it?
52 | 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.
53 |
54 | ## How do you install it?
55 | 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)
56 |
57 | ## How do you access the logs?
58 | 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.
59 |
60 | ## I want to know a little more...
61 | 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.
62 |
63 | ## *Experimental TX Mode
64 | 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)
65 | **Use transmit mode at your own risk, it is not officially supported. Consider it a bonus in the software.**
66 |
67 | ## **Installation Notes
68 | [Click here for wiring diagrams](Installation-Schematics/README.md)
69 | [Click here to see connector options](/Connector-Adapter-Options/README.md)
70 | * Make sure the reader outputs data in the Wiegand format
71 | * Connect D0 on device to D0 on reader
72 | * Connect D1 on device to D1 on reader
73 | * Connect + on device to + on reader
74 | * Connect - on device to - on reader
75 | * 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.
76 | * 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.
77 | * 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 -)
78 | * NOTE: At a minimum D0, D1, and GND(-) must be connected to the reader for proper function, no matter the power source.
79 | * Configure settings
80 | * See Below
81 |
82 | ## Making Sense of the Binary Data
83 | [Keypads](Keypad/README.md)
84 | [Magstripe/ABA Format](Magstripe/README.md)
85 |
86 | ## Flashing Firmware
87 | OPTION 1: OTA via the Web Interface:
88 | * Download one of the latest releases from
89 | * https://github.com/rfidtool/ESP-RFID-Tool/releases
90 | * Login to the device's admin panel and upgrade the firmware.
91 |
92 | OPTION 2: Arduino IDE:
93 | * Use the ESP Flasher R4 by April Brother:
94 | * https://blog.aprbrother.com/product/esp-flasher-r4
95 | * Clone/download the source.
96 | * Add these libraries:
97 | * ArduinoJson library 5.13.1 by Benoit Blanchon
98 | * https://github.com/bblanchon/ArduinoJson
99 | * ESP8266FtpServer.h
100 | * https://github.com/exploitagency/esp8266FTPServer/tree/feature/bbx10_speedup
101 | * Choose the board NodeMCU 1.0.
102 | * Upload.
103 |
104 | ## Software Help
105 |
106 | ### Accessing ESP-RFID-Tool Web Interface
107 |
108 | SSID: "ESP-RFID-Tool"
109 | URL: http://192.168.1.1
110 |
111 | ### Configure ESP-RFID-Tool
112 |
113 | #### Default credentials to access the configuration page:
114 | * Username: "admin"
115 | * Password: "rfidtool"
116 |
117 | #### Default credentials for ftp server:
118 | * Username: "ftp-admin"
119 | * Password: "rfidtool"
120 |
121 | #### WiFi Configuration:
122 |
123 | Network Type:
124 | * Access Point Mode: Create a standalone access point(No Internet Connectivity-Requires Close Proximity)
125 | * Join Existing Network: Join an existing network(Possible Internet Connectivity-Could use Device Remotely)
126 |
127 | Hidden: Choose whether or not to use a hidden SSID when creating an access point
128 |
129 | SSID: SSID of the access point to create or of the network you are choosing to join
130 | Password: Password of the access point which you wish to create or of the network you are choosing to join
131 | Channel: Channel of the access point you are creating
132 |
133 | IP: IP to set for device
134 | 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
135 | Subnet: Typically set to 255.255.255.0
136 |
137 | #### Web Interface Administration Settings:
138 |
139 | Username: Username to configure/upgrade ESP-RFID-Tool
140 | Password: Password to configure/upgrade ESP-RFID-Tool
141 |
142 | FTP Server Settings:
143 |
144 | Note: Supports Passive(PASV) Mode Only!
145 | * Enabled: Turn FTP Server ON
146 | * Disabled: Turn FTP Server OFF
147 | Username: Username to login to ftp server
148 | Password: Password to login to ftp server
149 |
150 | Power LED:
151 |
152 | * Enabled: Turn ON Power LED
153 | * Disabled: Turn OFF Power LED
154 |
155 | RFID Capture Log:
156 |
157 | Useful to change this value to differentiate between facilities during various security assessments.
158 | File Name: File name to save captured RFID tags to for the current security assessment.
159 |
160 | #### List Exfiltrated Data
161 |
162 | Displays all log files containing RFID tag captures.
163 |
164 | #### Format File System
165 |
166 | This will erase the contents of the SPIFFS file system including ALL RFID tag captures.
167 | Formatting may take up to 90 seconds.
168 | All current settings will be retained unless you reboot your device during this process.
169 |
170 | #### Upgrade ESP-RFID-Tool Firmware
171 |
172 | Authenticate using your username and password set in the configuration page.
173 |
174 | Default credentials to access the firmware upgrade page:
175 | * Username: "admin"
176 | * Password: "rfidtool"
177 |
178 | Select "Browse" choose the new firmware to be uploaded and then click "Upgrade".
179 |
180 | You will need to manually reset the device upon the browser alerting you that the upgrade was successful.
181 |
182 | #### Jumpers
183 |
184 | * J1: Bridge to reset the board(your FTDI doesn't have a reset button?)
185 | * J2: Cut the trace to disable DTR pin after programming then use it as an additional IO(continue updating firmware via web interface)
186 | * J3: Bridge this during a power cycle to restore default configuration without losing your log files.
187 |
188 | #### Restore Default Settings
189 |
190 | * Option 1: Go to settings under web interface and choose restore default configuration.
191 | * Option 2: Bridge J3 before booting the device. (Either before powering on or bridge it and reset the device)
192 | * Option 3: Connect via serial(9600 baud) and send the command "ResetDefaultConfig:" without quotes.
193 |
194 | ## History
195 | 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.
196 |
197 | ## Licensing Information
198 |
199 | Created by Corey Harding
200 | https://github.com/rfidtool/ESP-RFID-Tool
201 | ESP-RFID-Tool software is licensed under the MIT License
202 |
203 | #### Libraries/borrowed code being used
204 |
205 | ##### Arduino and ESP8266 core libraries
206 | * Typically: GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
207 | * Assorted Authors
208 |
209 | ##### ArduinoJson.h
210 | * The MIT License (MIT)
211 | * Copyright (c) 2014-2017 Benoit BLANCHON
212 |
213 | ##### ESP8266FtpServer.h
214 | * GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
215 | * Originally by nailbuster, later modified by bbx10 and apullin
216 |
217 | ##### WiegandNG.h
218 | * GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
219 | * JP Liew
220 |
221 | ##### Wiegand Preamble Calculator Code
222 | * No License Specified
223 | * Fran Brown of Bishop Fox
224 |
225 | ##### strrev.h
226 | * Custom License(see file)
227 | * Copyright (c) 2007 Dmitry Xmelkov
228 |
229 | ##### aba-decode.py
230 | * No License Specified
231 | * Andrew MacPherson(andrewmohawk)
232 |
--------------------------------------------------------------------------------
/Source Code/esprfidtool/HelpText.h:
--------------------------------------------------------------------------------
1 | const char HelpText[] PROGMEM = R"=====(
2 |
3 |
4 | ESP-RFID-Tool Help Page
5 |
6 | <- BACK TO INDEX
7 | -----
8 | HELP
9 | -----
10 |
11 | ESP-RFID-Tool
12 |
13 | Created by Corey Harding
14 | www.LegacySecurityGroup.com / www.Exploit.Agency
15 | https://github.com/rfidtool/ESP-RFID-Tool - See Link for Updated Firmware or for more detailed Help
16 |
17 | 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.
18 |
19 | 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.
20 |
21 | -----
22 | Accessing ESP-RFID-Tool Web Interface
23 | -----
24 |
25 | SSID: "ESP-RFID-Tool"
26 | URL: http://192.168.1.1
27 |
28 | -----
29 | Configure ESP-RFID-Tool
30 | -----
31 |
32 | Default credentials to access the configuration page:
33 | Username: "admin"
34 | Password: "rfidtool"
35 |
36 | Default credentials for ftp server:
37 | Username: "ftp-admin"
38 | Password: "rfidtool"
39 |
40 | WiFi Configuration:
41 |
42 | Network Type:
43 | Access Point Mode: Create a standalone access point(No Internet Connectivity-Requires Close Proximity)
44 | Join Existing Network: Join an existing network(Possible Internet Connectivity-Could use Device Remotely)
45 |
46 | Hidden: Choose whether or not to use a hidden SSID when creating an access point
47 |
48 | SSID: SSID of the access point to create or of the network you are choosing to join
49 | Password: Password of the access point which you wish to create or of the network you are choosing to join
50 | Channel: Channel of the access point you are creating
51 |
52 | IP: IP to set for device
53 | 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
54 | Subnet: Typically set to 255.255.255.0
55 |
56 | Web Interface Administration Settings:
57 |
58 | Username: Username to configure/upgrade ESP-RFID-Tool
59 | Password: Password to configure/upgrade ESP-RFID-Tool
60 |
61 | FTP Server Settings:
62 |
63 | Note: Supports Passive(PASV) Mode Only!
64 | Enabled: Turn FTP Server ON
65 | Disabled: Turn FTP Server OFF
66 | Username: Username to login to ftp server
67 | Password: Password to login to ftp server
68 |
69 | Power LED:
70 |
71 | Enabled: Turn ON Power LED
72 | Disabled: Turn OFF Power LED
73 |
74 | RFID Capture Log:
75 |
76 | Useful to change this value to differentiate between facilities during various security assessments.
77 | File Name: File name to save captured RFID tags to for the current security assessment.
78 |
79 | -----
80 | List Exfiltrated Data
81 | -----
82 |
83 | Displays all log files containing RFID tag captures.
84 |
85 | -----
86 | Format File System
87 | -----
88 |
89 | This will erase the contents of the SPIFFS file system including ALL RFID tag captures.
90 | Formatting may take up to 90 seconds.
91 | All current settings will be retained unless you reboot your device during this process.
92 |
93 | -----
94 | Upgrade ESP-RFID-Tool Firmware
95 | -----
96 |
97 | Authenticate using your username and password set in the configuration page.
98 |
99 | Default credentials to access the firmware upgrade page:
100 | Username: "admin"
101 | Password: "rfidtool"
102 |
103 | Select "Browse" choose the new firmware to be uploaded and then click "Upgrade".
104 |
105 | You will need to manually reset the device upon the browser alerting you that the upgrade was successful.
106 |
107 | -----
108 | Licensing Information
109 | -----
110 |
111 | Created by Corey Harding
112 | https://github.com/rfidtool/ESP-RFID-Tool
113 | ESP-RFID-Tool software is licensed under the MIT License
114 | /*
115 | MIT License
116 |
117 | Copyright (c) [2018] [Corey Harding]
118 |
119 | Permission is hereby granted, free of charge, to any person obtaining a copy
120 | of this software and associated documentation files (the "Software"), to deal
121 | in the Software without restriction, including without limitation the rights
122 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
123 | copies of the Software, and to permit persons to whom the Software is
124 | furnished to do so, subject to the following conditions:
125 |
126 | The above copyright notice and this permission notice shall be included in all
127 | copies or substantial portions of the Software.
128 |
129 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
130 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
132 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
133 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
135 | SOFTWARE.
136 | */
137 | Click here for additional licensing information
138 |
139 |
140 | )=====";
141 |
--------------------------------------------------------------------------------
/Source Code/esprfidtool/LICENSE:
--------------------------------------------------------------------------------
1 | SOFTWARE LICENSE
2 |
3 | MIT License
4 |
5 | Copyright (c) [2018] [Corey Harding]
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
24 |
--------------------------------------------------------------------------------
/Source Code/esprfidtool/License.h:
--------------------------------------------------------------------------------
1 | const char License[] PROGMEM = R"=====(
2 |
3 |
4 | ESP-RFID-Tool Licensing Page
5 |
6 | <- BACK TO INDEX
7 |
8 | ESP-RFID-Tool by Corey Harding: https://www.LegacySecurityGroup.com
9 | Code available at: https://github.com/rfidtool/ESP-RFID-Tool
10 |
11 | ESP-RFID-Tool Hardware was created by Corey Harding
12 | ESP-RFID-Tool Software is licensed under the MIT License
13 | /*
14 | MIT License
15 |
16 | Copyright (c) [2018] [Corey Harding]
17 |
18 | Permission is hereby granted, free of charge, to any person obtaining a copy
19 | of this software and associated documentation files (the "Software"), to deal
20 | in the Software without restriction, including without limitation the rights
21 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22 | copies of the Software, and to permit persons to whom the Software is
23 | furnished to do so, subject to the following conditions:
24 |
25 | The above copyright notice and this permission notice shall be included in all
26 | copies or substantial portions of the Software.
27 |
28 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 | SOFTWARE.
35 | */
36 |
37 | Core libraries used:
38 |
39 | /*
40 | Arduino.h - Main include file for the Arduino SDK
41 | Copyright (c) 2005-2013 Arduino Team. All right reserved.
42 | This library is free software; you can redistribute it and/or
43 | modify it under the terms of the GNU Lesser General Public
44 | License as published by the Free Software Foundation; either
45 | version 2.1 of the License, or (at your option) any later version.
46 | This library is distributed in the hope that it will be useful,
47 | but WITHOUT ANY WARRANTY; without even the implied warranty of
48 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
49 | Lesser General Public License for more details.
50 | You should have received a copy of the GNU Lesser General Public
51 | License along with this library; if not, write to the Free Software
52 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
53 | */
54 |
55 | /*
56 | ESP8266WiFi.h - esp8266 Wifi support.
57 | Based on WiFi.h from Arduino WiFi shield library.
58 | Copyright (c) 2011-2014 Arduino. All right reserved.
59 | Modified by Ivan Grokhotkov, December 2014
60 | This library is free software; you can redistribute it and/or
61 | modify it under the terms of the GNU Lesser General Public
62 | License as published by the Free Software Foundation; either
63 | version 2.1 of the License, or (at your option) any later version.
64 | This library is distributed in the hope that it will be useful,
65 | but WITHOUT ANY WARRANTY; without even the implied warranty of
66 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
67 | Lesser General Public License for more details.
68 | You should have received a copy of the GNU Lesser General Public
69 | License along with this library; if not, write to the Free Software
70 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
71 | */
72 |
73 | /*
74 | WiFiClient.h - Library for Arduino Wifi shield.
75 | Copyright (c) 2011-2014 Arduino. All right reserved.
76 | This library is free software; you can redistribute it and/or
77 | modify it under the terms of the GNU Lesser General Public
78 | License as published by the Free Software Foundation; either
79 | version 2.1 of the License, or (at your option) any later version.
80 | This library is distributed in the hope that it will be useful,
81 | but WITHOUT ANY WARRANTY; without even the implied warranty of
82 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
83 | Lesser General Public License for more details.
84 | You should have received a copy of the GNU Lesser General Public
85 | License along with this library; if not, write to the Free Software
86 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
87 | Modified by Ivan Grokhotkov, December 2014 - esp8266 support
88 | */
89 |
90 | /*
91 | ESP8266WebServer.h - Dead simple web-server.
92 | Supports only one simultaneous client, knows how to handle GET and POST.
93 | Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
94 | This library is free software; you can redistribute it and/or
95 | modify it under the terms of the GNU Lesser General Public
96 | License as published by the Free Software Foundation; either
97 | version 2.1 of the License, or (at your option) any later version.
98 | This library is distributed in the hope that it will be useful,
99 | but WITHOUT ANY WARRANTY; without even the implied warranty of
100 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
101 | Lesser General Public License for more details.
102 | You should have received a copy of the GNU Lesser General Public
103 | License along with this library; if not, write to the Free Software
104 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
105 | Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
106 | */
107 |
108 | /*
109 | Esp8266httpupdateserver.h No license information available.
110 | */
111 |
112 | /*
113 | ESP8266mDNS.h
114 | ESP8266 Multicast DNS (port of CC3000 Multicast DNS library)
115 | Version 1.1
116 | Copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
117 | ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)
118 | Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)
119 | This is a simple implementation of multicast DNS query support for an Arduino
120 | running on ESP8266 chip. Only support for resolving address queries is currently
121 | implemented.
122 | License (MIT license):
123 | Permission is hereby granted, free of charge, to any person obtaining a copy
124 | of this software and associated documentation files (the "Software"), to deal
125 | in the Software without restriction, including without limitation the rights
126 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
127 | copies of the Software, and to permit persons to whom the Software is
128 | furnished to do so, subject to the following conditions:
129 | The above copyright notice and this permission notice shall be included in
130 | all copies or substantial portions of the Software.
131 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
132 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
133 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
134 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
135 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
136 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
137 | THE SOFTWARE.
138 | */
139 |
140 | /*
141 | FS.h - file system wrapper
142 | Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
143 | This file is part of the esp8266 core for Arduino environment.
144 | This library is free software; you can redistribute it and/or
145 | modify it under the terms of the GNU Lesser General Public
146 | License as published by the Free Software Foundation; either
147 | version 2.1 of the License, or (at your option) any later version.
148 | This library is distributed in the hope that it will be useful,
149 | but WITHOUT ANY WARRANTY; without even the implied warranty of
150 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
151 | Lesser General Public License for more details.
152 | You should have received a copy of the GNU Lesser General Public
153 | License along with this library; if not, write to the Free Software
154 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
155 | */
156 |
157 | /*
158 | ArduinoJson.h
159 | The MIT License (MIT)
160 | ---------------------
161 |
162 | Copyright (c) 2014-2017 Benoit BLANCHON
163 |
164 | Permission is hereby granted, free of charge, to any person obtaining a copy
165 | of this software and associated documentation files (the "Software"), to deal
166 | in the Software without restriction, including without limitation the rights
167 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
168 | copies of the Software, and to permit persons to whom the Software is
169 | furnished to do so, subject to the following conditions:
170 |
171 | The above copyright notice and this permission notice shall be included in all
172 | copies or substantial portions of the Software.
173 |
174 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
176 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
177 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
178 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
179 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
180 | SOFTWARE.
181 | */
182 |
183 | /*
184 | ESP8266FtpServer.h - by nailbuster, later modified by bbx10 and apullin
185 | GNU LESSER GENERAL PUBLIC LICENSE
186 | Version 2.1, February 1999
187 | https://github.com/apullin/esp8266FTPServer/blob/feature/bbx10_speedup/LICENSE
188 | */
189 |
190 | /*
191 | WiegandNG.h by JP Liew
192 | https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino
193 | GNU LGPL License 2.1
194 |
195 | This library is free software; you can redistribute it and/or modify it under
196 | the terms of the GNU Lesser General Public License as published by the
197 | Free Software Foundation; either version 2.1 of the License, or (at your option)
198 | any later version.
199 |
200 | This library is distributed in the hope that it will be useful, but
201 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
202 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
203 | more details.
204 | */
205 |
206 | /*
207 | Wiegand Preamble Calculator Code from the Tastic RFID Thief byFran Brown of Bishop Fox
208 | https://www.bishopfox.com/resources/tools/rfid-hacking/attack-tools/
209 | */
210 |
211 | /*
212 | Original source for aba-decode.py by Andrew MacPherson(andrewmohawk)
213 | https://andrewmohawk.com/2012/05/29/magnetic-stripes-part-1/
214 | https://pastebin.com/h9eVqRxz
215 | */
216 |
217 | /*
218 | strrev.h by Dmitry Xmelkov
219 | Copyright (c) 2007 Dmitry Xmelkov
220 | All rights reserved.
221 | Redistribution and use in source and binary forms, with or without
222 | modification, are permitted provided that the following conditions are met:
223 | * Redistributions of source code must retain the above copyright
224 | notice, this list of conditions and the following disclaimer.
225 | * Redistributions in binary form must reproduce the above copyright
226 | notice, this list of conditions and the following disclaimer in
227 | the documentation and/or other materials provided with the
228 | distribution.
229 | * Neither the name of the copyright holders nor the names of
230 | contributors may be used to endorse or promote products derived
231 | from this software without specific prior written permission.
232 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
233 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
234 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
235 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
236 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
237 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
238 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
239 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
240 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
241 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
242 | POSSIBILITY OF SUCH DAMAGE.
243 | */
244 |
245 | This is not a comprehensive list, these "Core Libraries" may depend on additional
246 | libraries, more information can be obtained by viewing the source code of the main libraries.
247 |
"
1022 | ""
1030 | "Use commas to separate the binary for transmitting multiple packets(useful for sending multiple keypresses for imitating keypads) "
1031 | ""
1032 | " - "
1033 | "
")
1034 | +payload+
1035 | F("\n"
1036 | "Note: Preambles shown are only a guess based on card length and may not be accurate for every card format.\n"
1037 | "-----\n")
1038 | +webString+
1039 | F("
Open Arduino IDE. Pull down \"Sketch\" Menu then select \"Export Compiled Binary\". On this page click \"Browse\", select the binary you exported earlier, then click \"Update\". You may need to manually reboot the device to reconnect. "));
1109 | });
1110 |
1111 | server.on("/restoredefaults", [](){
1112 | server.send(200, "text/html", F("This will restore the device to the default configuration.
Are you sure?
YES - NO"));
1113 | });
1114 |
1115 | server.on("/restoredefaults/yes", [](){
1116 | if(!server.authenticate(update_username, update_password))
1117 | return server.requestAuthentication();
1118 | server.send(200, "text/html", F("<- BACK TO INDEX
");
1184 |
1185 | String hexTEMP="";
1186 |
1187 | int binCOUNT=(bin2hexBUFFlen-1);
1188 | for (int currentBINpos=0; currentBINposYou may want to drop the leading zero(if there is one) and if your cloning software does not handle it for you.
Brute forcing "+pinBITS+"bit Wiegand Format PIN from "+(server.arg("bruteSTART"))+" to "+(server.arg("bruteEND"))+" with a "+pinHTMLDELAY+"ms delay between \"keypresses\" This may take a while, your device will be busy until the sequence has been completely transmitted! Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish. 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\"
"
1629 | "Denial of Service mode active. Transmitting D0 and D1 bits simultaneously until stopped."
1630 | " This may take a while, your device will be busy until the sequence has been completely transmitted!"
1631 | " Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish. "
1632 | "You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"
"
1633 | "");
1634 | delay(50);
1635 | }
1636 | else {
1637 | fuzzTimes=server.arg("fuzzTimes").toInt();
1638 | server.send(200, "text/html", String()+
1639 | "<- BACK TO INDEX
"
1641 | "Transmitting D0 and D1 bits simultaneously "+fuzzTimes+" times."
1642 | " This may take a while, your device will be busy until the sequence has been completely transmitted!"
1643 | " Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish. "
1644 | "You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"
"
1688 | "Denial of Service mode active. Transmitting bits alternating between D0 and D1 until stopped."
1689 | " This may take a while, your device will be busy until the sequence has been completely transmitted!"
1690 | " Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish. "
1691 | "You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"
"
1692 | "");
1693 | delay(50);
1694 | }
1695 | else {
1696 | fuzzTimes=server.arg("fuzzTimes").toInt();
1697 | server.send(200, "text/html", String()+
1698 | "<- BACK TO INDEX
"
1700 | "Transmitting "+fuzzTimes+" bits alternating between D0 and D1."
1701 | " This may take a while, your device will be busy until the sequence has been completely transmitted!"
1702 | " Please \"STOP CURRENT TRANSMISSION\" before attempting to use your device or simply wait for the transmission to finish. "
1703 | "You can view if the fuzzing attempt has completed by returning to the Experimental TX page and checking the status located under \"Transmit Status\"
"
1864 | ""
1871 | " "
1872 | ""
1873 | " "
1874 | "Push Button for Door Open: "
1875 | "Connect \"Push to Open\" wire from the reader to the RX pin(GPIO3) on the programming header on ESP-RFID-Tool. "
1876 | "Warning! Selecting the wrong trigger signal type may cause damage to the connected hardware.
"
1877 | ""
1885 | " "
1886 | ""
1887 | " "
1888 | ""
1889 | ""
1890 | ""
1891 | )
1892 | );
1893 |
1894 | if (server.args()>=1) {
1895 | if (safemode==1) {
1896 | delay(50);
1897 | ESP.restart();
1898 | }
1899 | }
1900 |
1901 | });
1902 |
1903 | server.begin();
1904 | WiFiClient client;
1905 | client.setNoDelay(1);
1906 |
1907 | // Serial.println("Web Server Started");
1908 |
1909 | MDNS.begin("ESP");
1910 |
1911 | httpUpdater.setup(&httpServer, update_path, update_username, update_password);
1912 | httpServer.begin();
1913 |
1914 | MDNS.addService("http", "tcp", 1337);
1915 |
1916 | if (ftpenabled==1){
1917 | ftpSrv.begin(String(ftp_username),String(ftp_password));
1918 | }
1919 |
1920 | //Start RFID Reader
1921 | pinMode(LED_BUILTIN, OUTPUT); // LED
1922 | if (ledenabled==1){
1923 | digitalWrite(LED_BUILTIN, LOW);
1924 | }
1925 | else{
1926 | digitalWrite(LED_BUILTIN, HIGH);
1927 | }
1928 |
1929 | }
1930 | //
1931 |
1932 | //Do It!
1933 |
1934 | ///////////////////////////////////////////////////////
1935 | // LOOP function
1936 | void loop()
1937 | {
1938 | if (ftpenabled==1){
1939 | ftpSrv.handleFTP();
1940 | }
1941 | server.handleClient();
1942 | httpServer.handleClient();
1943 | while (Serial.available()) {
1944 | String cmd = Serial.readStringUntil(':');
1945 | if(cmd == "ResetDefaultConfig"){
1946 | loadDefaults();
1947 | ESP.restart();
1948 | }
1949 | }
1950 |
1951 | //Serial.print("Free heap-");
1952 | //Serial.println(ESP.getFreeHeap(),DEC);
1953 |
1954 | if(wg.available()) {
1955 | wg.pause(); // pause Wiegand pin interrupts
1956 | LogWiegand(wg);
1957 | wg.clear(); // compulsory to call clear() to enable interrupts for subsequent data
1958 | if (safemode==1) {
1959 | ESP.restart();
1960 | }
1961 | }
1962 |
1963 | }
1964 |
--------------------------------------------------------------------------------
/Source Code/esprfidtool/pinSEND.h:
--------------------------------------------------------------------------------
1 | void pinSEND(int pinDELAY,String pinBIN) {
2 | for (int i=0; i<=pinBIN.length(); i++) {
3 | if (pinBIN.charAt(i) == '0') {
4 | digitalWrite(DATA0, LOW);
5 | delayMicroseconds(txdelayus);
6 | digitalWrite(DATA0, HIGH);
7 | }
8 | else if (pinBIN.charAt(i) == '1') {
9 | digitalWrite(DATA1, LOW);
10 | delayMicroseconds(txdelayus);
11 | digitalWrite(DATA1, HIGH);
12 | }
13 | delay(txdelayms);
14 | }
15 | yield();
16 | delay(pinDELAY);
17 | pinBIN="";
18 | pinDELAY=100;
19 | }
20 |
--------------------------------------------------------------------------------
/Source Code/esprfidtool/strrev.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2007 Dmitry Xmelkov
2 | All rights reserved.
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are met:
5 | * Redistributions of source code must retain the above copyright
6 | notice, this list of conditions and the following disclaimer.
7 | * Redistributions in binary form must reproduce the above copyright
8 | notice, this list of conditions and the following disclaimer in
9 | the documentation and/or other materials provided with the
10 | distribution.
11 | * Neither the name of the copyright holders nor the names of
12 | contributors may be used to endorse or promote products derived
13 | from this software without specific prior written permission.
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | POSSIBILITY OF SUCH DAMAGE.
25 | */
26 |
27 | /* $Id$ */
28 | char * strrev (char *s)
29 | {
30 | char *p1, *p2;
31 |
32 | for (p2 = s; *p2; ) p2++;
33 | p1 = s;
34 | while (p1 < p2) {
35 | char c1 = *p1;
36 | char c2 = *--p2;
37 | *p1++ = c2;
38 | *p2 = c1;
39 | }
40 | return s;
41 | }
42 |
--------------------------------------------------------------------------------
/Source Code/esprfidtool/version.h:
--------------------------------------------------------------------------------
1 | String version = "1.2.1";
2 | String APIversion = "1.0.4";
3 |
--------------------------------------------------------------------------------