nullcon 2011 - Penetration Testing a Biometric System


Published on

Penetration Testing a Biometric System by Rahul Sasi

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

nullcon 2011 - Penetration Testing a Biometric System

  1. 1. A Garage for Hackers and Security Professionals Penetration Testing Biometric System A Penetration Testers Guide to Finger Print Authentication [FB1H2S aka Rahul Sasi] http://www.Garage4Hackers.comPresented @ NullCon International Conference 2011
  2. 2. A Garage for Hackers and Security ProfessionalsAbstract: This paper act as a guide explaining the necessity of including Biometric-Devices in the scope of a network audit and the procedures that could be used forSecurity auditing one such system. The paper explains both local and remote attacks andthe procedures to carry out vulnerability detection, exploitation and reporting.Introduction: Biometric Fingerprint system is rapidly developing and the no of Biometricsystems deployed is increasing day by day along with the amount of vital information itis holding. And this brings the necessity of including these devices on to the list ofdevices subjected to a Penetration Testing/Security Auditing.Biometric Fingerprint systems have several advantages over classical methods based onpassword and ID cards. These systems are considered effective and fast. The advantagesof this system over traditional systems are very high. In spite of the many advantagesbiometric systems got few draw-backs like a)Your finger print is not a secret eg: any onecould have a copy of your finger print b) it‟s a onetime password once stolen cannot bereset to a new value. Furthermore the different attack vectors of a biometric system arenumbered and mentioned in diagram. MIPS Fingerprint Processor Fingerprint Matcher Authentication Internal Database 1) Sensor 2) USB Data Manager + 3) Remote IP Management IP Based Remote Management Back End Desktop/Server 4) Back End Database (Mssql, Mysql, Excel) 5) Finger Print Manager (Admin Interface) Remote Computer
  3. 3. A Garage for Hackers and Security ProfessionalsDiagram fb1_01 explains the various possible points of attack, and these would be theareas this research would be concentrating on. On basis of the attack methodology wehave categorized the attacks into Local and Remote attacks.Local Attacks: 1) Finger Print Sensor 2) USB Data ManagerRemote Attacks: 3) Remote IP Management 4) Back End Database 5) Finger Print Manager (Admin Interface)The above mentioned architecture and attacking vectors would be same for all Biometricimplementation. Biometric Finger print scanners application are varied and we willdiscuss on the following deployments, Biometric Attendance Management System used to automate a reliable attendance managing system. Biometric Finger print guarded doors, implemented for keyless secure access to doors. Attendance Management System Door Controlling System
  4. 4. A Garage for Hackers and Security Professionals Biometrics: The Non Technical part:Local Attack: Finger print sensorFinger print scanners read input using two methodologies:1) Optical scanner2) Capacitance scannerOptical Scanner are most widely used ones and the main part of it are the CCD[chargecoupled device ], these are simply an array of light-sensitive diodes called photosites,which generate an electrical signal in response to light photons. Each photosite records apixel, a tiny dot representing the light that hit that spot. Collectively, the light and darkpixels form an image of the scanned finger print. So the theory says that if a similarimage of finger print is placed in front the scanner we would be able to bypass them. Thistheory is practically not easy as the problems we would have to face would be thevalidation of the machine in order to differentiate between a real and valid image bychecking the average pixel darkness, or the overall values in a small sample by rejectingthe scan if the overall image is too dark or too light. One part of this paper would bereproducing two dimensional images of a fingerprint.Capacitance Scannerswork on the principle of capacitance. It relies on the properties offlesh and air to measure differences in capacitance on the scanner when the finger isplaced upon the scanner. Certain systems along with capacitance checks blood flow,temperature, and even simulate human sweat.One advantage of capacitance scanners over optical scanners is the fact that thecapacitance scanner requires a three-dimensional print, whereas an optical scanner needs
  5. 5. A Garage for Hackers and Security Professionalsa two dimensional only. This makes the capacitance scanners more difficult to deceive.However, if one could recreate a three-dimensional representation of a print, then onecould theoretically “trick” the scanner into falsely authenticating a user.The objective of the first section is to try by-passing these devices by steeling and cloningthe fingerprint. And later these clones would be modified into three dimensional and twodimensional dummy s that could be used to see the above mentions vulnerabilities existor not.This above mentioned approaches are practically not easy as the problems we would haveto face would be the validation of the machine in order to differentiate between a real andvalid image by checking the average pixel darkness, or the overall values in a smallsample by rejecting the scan if the overall image is too dark or too light. .
  6. 6. A Garage for Hackers and Security ProfessionalsLocal attacks:Detailed methodology: Penetration Testing a Biometric device.This section will explain the methodologies in order to recreate a fingerprint for trickingthese systems. Attacks like this were seen in videos that were spreading over the internetby using a Photostat or image of the fingerprint. The issue we would be facing would bethe protection mechanism the systems have employed in order to prevent against suchattacks. Enough with the theoretical part let‟s move on to some action.Objective: To bypass a finger print guarded door or to fake a finger print attendancesystem.Targets: Finger print guarded confidential room.Scenario: Here our target would be a finger print guarded door where only the Manager isallowed access using his fingerprint.Bypassing a Finger print guarded door or attacking and faking an attendance system. Thefirst attack would not get the cooperation of user but in the second on we could. So I willtalk about the first case, as same methodology could be used in second scenario too. Firststep would be to obtain victim‟s fingerprint that could later be used to recreate a dummyfingerprint. Human fingers have friction ridges. And there are eccrine glands thatproduce natural secretion of sweat on the fingers. So there would be the Impressions offingerprints left behind on surface when touched. What causes the fingerprint is a veryimportant factor, because recreating a fingerprint form few substances only would yieldgood results. Below is an image of a finger print impression caught on a glass table.Finger Print Logger: Finger Impression on Glass Table
  7. 7. A Garage for Hackers and Security ProfessionalsInstead of going after cups and bottles my idea here is to build a logger, a setup that couldlog fingerprints when the victim logs in using the biometric machine. A traditionalBiometric sensor looks like this. Finger Print Sensor Area: Logger is placed hereIt‟s possible to place a transparent plastic cover on top of sensor and, whenever the victimlogs in his impression would be on the plastic, the authentication would take place andlater plastic could be removed and reproduced.Refraction:The problems we would have to face in the above procedure are refraction, refractiveindex of the material we place on top of the sensor matters, as we have to maintainstealth. Why refractive index because when light passes form one media to another otherit may also change its propagation direction [Refraction] in proportion to the refractiveindex and the sensor won‟t be able to understand the distorted image and login won‟t takeplace.
  8. 8. A Garage for Hackers and Security Professionals This would create suspicion. So our logger would be build using a thin transparent sheetplaced on top of an OHP sheet cut out, in order to hold it stern.Building the logger:Equipments needed: OHP sheets and thin transparent plastic sheet. 1) Cut out a piece of OHP sheet with approximate size of Finger print sensor 2) Cut equal piece of transparent thin plastic sheet. 3) Make a U shaped cut out on the OHP sheet piece. 4) Wrap the thin plastic on top of the U shaped cut out and logger is ready. Fig_01 Fig_02 Fig_03 Fig_04
  9. 9. A Garage for Hackers and Security ProfessionalsAn alternative is to find a thin OHP sheet film and directly use it as the logger.Placing the logger: 1) Make sure you are able to reach the biometric guarded door. 2) Slide in the logger into the sensor region make sure no parts of our logger sticks out. 3) Wait for the victim to log into using his valid finger print. 4) Remove the logger and store it in a small box, now we have a valid finger print with us. Dig fb1_01 Dig fb1_02 Dig fb1_03
  10. 10. A Garage for Hackers and Security ProfessionalsWorking of Sensors and Detection Algorithms:Before trying to recreate the fake finger print the few points to be noted are that, thesensors scans the image and compares it with an internal database of stored images. Theimage matching is done based on few specific branches and loops at specific points. Itcould also count specific ridges from one point to another building a unique pattern formatching. There are few special points which are practically unique for all finger printsand the scanner image matching algorithms uses the same points for detection. So thepoint is. We have to take extra care at these regions (dig) when reproducing the fakefinger print. In the below mention diagrams diagram fb1_01 shows how a finger printimpression would be stored in the database of the matcher, fb1_02 show the regions thatthe scanner considers when the matching is done, and fb1_03 shows the special pointswhich all the comparing algorithms consider in matching algorithms. Dig fb1_ 01 Dig fb1_02 Dig fb1_03Reproducing a Fake Finger print:Equipments needed: Finger print powder, cello tape, light brush, a good lab with suitablelighting to recreate the dummy. 1) Apply finger print powder and brush the obtained impression so that the powder will stick to the fringes (dig: fb1_03). 2) Once the fringes are visible brush out the unwanted powder. 3) Lift the finer print using a cello tape form the plastic surface and you have a 2D fake finger print. 4) For building a 3D impression, apply fevicol to the lifted finger print and allow it to cool.
  11. 11. A Garage for Hackers and Security Professionals 5) Remove the fevicol layer once it‟s set and that will give you a 3D dummy finger print. Dig fb1_01 Dig fb1_02 Dig fb1_03 Dig fb1_04 Dig fb1_05
  12. 12. A Garage for Hackers and Security ProfessionalsOnly optical scanners were tested and the above mentioned methods worked on a fewsystems with less effort, the output is directly proportional to the quality of dummy fingerprint you are able to obtain.Local Attack: USB Data Manager.Objective: To steel sensitive information stored on the device like employee details,employee salary details, and other confidential details of the employees.Targets: Finger print attendance monitoring system placed at the door of yourorganization.Biometrics devices have inbuilt data storage, were it stores the Finger prints and userinformation. Unlike other data sources these Biometric devices are not kept in a protectedarea instead kept at building entry or other unrestricted places where they could be easilyaccessed. Basically all the Biometric systems come with a USB support in order todownload and upload finger prints and other log detail to and from the device. A normalUSB dongle could be used to download data from the device. Most of the devices do nothave any sort of protection mechanism employed to prevent data theft, and those whichuses password protection often is deployed with default password. So if the attackercould walk to the system with a USB Pen drive then he would be able to copy all thedata. Data includes employee personal information, finger prints, time they logged in andother sensitive information. I have gathered and listed commonly used devices defaultpassword. Dig fb1_ Dig fb1_ [Videos Added]
  13. 13. A Garage for Hackers and Security Professionals Biometrics: The Technical part:Remote Attack: The attack vectors. Biometric System 1 Biometric System 2 UDP/ TCP Switch UDP/TCP DB Admin Biometric Admin Interface/Data Base Biometric Server Uses of remote management Upload / Download logs Manage add users to the Biometric system Fb1This would be the basic architecture of an IP based remote management protocol of thesesystems.
  14. 14. A Garage for Hackers and Security ProfessionalsSo here the attack points would be as follows, 1) IP implementation for data transfer 2) Biometric Management Servers 3) Biometric Admin/Interface (Web Based and Desktop based ) 4) Back end Database 5) Man In The Middle AttacksThe attacks would be as follows:  IP implementation for data transfer:The following implementation on the MIPS is used for remotely administrating thebiometric devices. An IP stack would be there in the MIPS that would allow users toquery the biometric system and extract and add information on to device. A GUI programwould be there in the back end that is authenticated to manage these devices. Therewould be a back end database also, that holds all the information‟s about the employeesincluding the salary there attendance and a lot other information. So another way ofhacking the biometrics would be to hack these implementations.This is implemented on the Biometric hardware MIPS, most of the devices use UDP forremotely managing the devices. UDP itself makes it vulnerable for many attacks. Authentication Biometric Device ADMIN GUI Admin Program
  15. 15. A Garage for Hackers and Security ProfessionalsThe remote administration capability of this device lets biometric servers to authenticateto it and manage remotely. So our primary check should be on this authenticationprocedure. How the authentication is implemented on the MIPS device. We are completely unaware of the authentication mechanism used as the program isembedded in the Biometric MIPS device. Sniffing network traffic and analyzing thepackets work, but the device communicates to the server only when initiated, and itwould be weekly or monthly. So the chance of getting an output out of that is limited.Solution: The admin application knows everything about the remote device so if we couldget a copy of that application it will tell us everything we want. We could analyze theauthentication mechanism, database configuration, and the commands to communicate tothese devices. Let‟s move forward with a live example.Scenario: Attacking the remote management protocol of Biometric device.Situation: The remote administration implementation is unknown.Foot printing: The label on the Biometric device will reveal which company has marketedor build that product. Device vendor nameMy Attack Methodology: Example Attack, “Basic for all systems”Information Gathering: So a visit to the company‟s website reveals that company sellsbiometric products and could find links to user manual. Site also provides link to theapplication that is used to manage the devices remotely. So download a copy of theapplication and we are done with phase one.
  16. 16. A Garage for Hackers and Security ProfessionalsReverse Engineering the Application to extract the commands:The current application is built in .Net C#, so „refelector‟ would be the right choice fordisassembling, we will have to deal with the same scenario in all the cases, languageswill vary so as the dissemblers.The preliminary analysis revealed the Port the device use to communicate and alsoinformation about the database settings and password files. A detailed analysis show thealgorithm embedded in Biometric device. It is possible to retrieve the commands tointeract with the system too.TCP/IP communication details:Now the communication methodology of the remote biometric device is clear from theabove analysis. The system uses UDP for communication on port 4370.Further analysison a COM object gave idea about the device communication commands and the importlibrary which handles all the administrative tasks. We also could find information aboutthe firmware and detection algorithm used on the hardware.
  17. 17. A Garage for Hackers and Security ProfessionalsExport Table of COM object.Analyzing that Object gives all the list of all necessary commands needed tocommunicate with the Device. IDA was used for dissembling. These function calls verywell explain the possibility of things that you could do on the remote device, functionsinclude remotely shutting down the device to uploading a new user and finger print. Sonext step would be is to extract the commands. Once we have extracted enoughinformation about the device it would be possible for us to recreate the communicationand attack the device directly. And example code is as follows.Code to set the language on device was as follows:
  18. 18. A Garage for Hackers and Security ProfessionalsHence the device managing software‟s would act as a RFC for the unknown protocol weare gone deal with.Formatted command that were extracted from the application:Conclusion: 1) It‟s possible to extract the data communication protocol and commands the remote devices use from the management software‟s. 2) The remote application act as an RFC to the unknown protocol providing with everything we want.  Auditing Back End DatabaseAs the Database is more critical and more vulnerable to attack, a check on these wouldalso yield good output. It‟s possible to get a lot of info about were the data basecredentials are saved and all form the remote management software. An analysis of thecurrent product reveled the Managing server data base password file and the encryptionkey details.Local database Password file and Encryption Key hard coded.
  19. 19. A Garage for Hackers and Security ProfessionalsConclusion:1) And from every managing application we would be able to extract these information‟s.2) Most of the times the database password would be left default only.3) Other database audit checks could also be done.  Biometric Admin/Interface (Web Based and Desktop based )Another possible point of attacks are on the admin interface, these are either desktopbased or Web based. Desktop based applications are common and the possible chances tointeract with them require local privileges on the Biometric server. But web based adminpanels could be attacked form outside. So an application check on those modules couldalso get u those data. Detecting Biometric Devices on Network:How to identify these devices?We been discussing about the possible ways of hacking into Biometric device remotely,but the question would be how do we detect these on the network among the many othercomputers and devices. So only if we could spot the remote IP address of these devices,then only we could use the above mention attacks on them. That‟s something to thinkabout. In order to get past that issue I have built an Nmap script that could scan a subnetand spot Biometric MIPS. Currently it‟s capable of spotting majority of the devices. Thescanner has got an inbuilt list of finger print biometric systems and algorithms embeddedso using this we would be able to spot the devices.
  20. 20. A Garage for Hackers and Security ProfessionalsBiometric_Scanner.nse Script Output: Attacking the DeviceNow as we know the device IP address Port used and communication commands wecould try to build custom UDP packets and interact with the device as were not able todetect any authentication on the device. The device was program to any commands. Sothis vulnerability makes it‟s possible for an attacker to connect to the device and retrieveany information and manipulate data.Python Scapy was used to build custom UDP commands and successfully interacted withthe device.Scapy Interacting with Device:
  21. 21. A Garage for Hackers and Security ProfessionalsUDP Packets:The attack worked and the device was responding to the command without anyauthentication.Sniffed data using Wireshark:The vulnerability allowed the attacker to Download, Upload new users and there FingerPrints. So it was possible for the attacker to add new users as a back door to the device.
  22. 22. A Garage for Hackers and Security ProfessionalsSniffed Traffic Showing Employee Details: : Videos | Code | Ppt | Html:Part 1: + Part 2: version: procedure to successfully Pen-Test a biometric device has been explained. The paperclearly explains the necessity to add Bio-metrics devices to the scope of a network auditand the necessary care that has to be ensured on such devices.
  23. 23. A Garage for Hackers and Security ProfessionalsReferences: to: B0Nd,Eberly,Wipu,Neo,Vinnu,prashant(null),sud0,Sagar,rohith,Nishant, atul, r4scal,SmartKD, beenu, d4rkdawn,pk and all Null Members and AH membersSpecial Thanks to: the_empty, 41w4rior, d4rkest, Abishek Dutta, w3bdevil,