Tuesday, March 11, 2014

Hack A fingerprint …. Mission Accomplished





Firstly let's know the basics :) :

Fingerprints are the tiny ridges, whorls and valley patterns on the tip of each finger. They form from pressure on a baby's tiny, No two people have been found to have the same fingerprints -- they are totally unique. There's a one in 64 billion chance that your fingerprint will match up exactly with someone else's.

Fingerprints are even more unique than DNA, the genetic material in each of our cells. Although identical twins can share the same DNA -- or at least most of it -- they can't have the same fingerprints.

Fingerprinting is one form of biometrics, a science that uses people's physical characteristics to identify them. Fingerprints are ideal for this purpose because they're inexpensive to collect and analyze, and they never change, even as people age.

Crime Scene Scenario
 
let your mind free , imagine :D .. you are a criminal investigator like Kudo Shinichi ( great animation I think you should watch it
:) )
let's go …..

With respect to a crime scene .. what about fingerprint impressions ???

at a crime scene involves three different types of fingerprint impressions: latent, patent, and plastic.
 A latent print is not visible to the naked eye, which means a person must process the scene and enhance the latent print using black powder or chemicals.
A patent print is visible without processing and includes fingerprints left in blood, oil, and dirt.
A plastic print is a three-dimensional impression where the friction ridge skin of the finger sinks into a surface, such as window caulk.
 
Fingerprint Patterns :

Once fingerprints have been located at a crime scene, either the item is collected or the print is powdered and lifted using tape or a fingerprint lifter. The recovered print is then identified as one of the three main categories of prints : Loop , Arch and Whorl .


Loop :

A loop is a pattern in which the ridges of the print enter on one side, curve in the middle, and exit out the same side. The loop is the most common type of fingerprint pattern and can be sub classified as either an ulnar loop or a radial loop. An ulnar loop has the opening of the ridges pointing toward the little finger of the hand, which is closest to the ulna bone of the forearm. A radial loop has the opening of the ridges pointing toward the thumb of the hand, which is closest to the radial bone of the forearm .

Arch :
An arch is a pattern in which the ridges enter on one side of the print and exit out the opposite side with a slight rise in the center. The arch can be sub classified as either a plain arch or a tented arch. A plain arch has a slight rise in the center of the print, as opposed to a tented arch, which has a very steep rise in the center of the print.

Whorl :

A whorl is a pattern in which the ridges have a circular or swirled center. A whorl can be sub classified as a plain whorl, a central pocket loop whorl, a double loop whorl, or an accidental whorl.


FINGERPRINT 10-PRINT CARD :

Inked prints are patent or visible to the naked eye due to the fact that reproduction of the friction ridge skin is completed using black printers’ ink. An inked fingerprint card is completed by law enforcement at the time of arrest, for employment applications ,and for pistol permits. The fingerprint card or 10-print card is arranged into three sections: information, rolled impressions, and plain impressions. The information section on the card contains relevant data regarding the person being printed and the individual completing the card. The rolled impression portion of the card contains 10 individual fingers rolled from nail to nail. The plain or flat impression portion of the card contains the 10fingerprints placed directly onto the card .A fingerprint card is arranged by right hand over left hand ,always starting at the right thumb and moving through to the right little and then left thumb to left little. When rolling a fingerprint, the investigator should have a firm hold of the hand or finger of the individual and start with finger#1, right thumb and work through to finger #10, left little. Each finger should be checked for proper ink distribution and rolled from one side to the other side. Never roll back and forth because this will cause a distortion of the ridge detail .



Then you need Fingerprint Processing :

In order to visualize latent prints at a crime scene, the crime scene technician must use fingerprint powder and a fingerprint brush to dust the areas where suspected fingerprints are located. When a darkened fingerprint is exposed with the brush-and-powder technique, the fingerprint can then be lifted as evidence and saved for future comparisons at the crime laboratory. All enhanced fingerprints at crime scenes should be saved even if you cannot determine the pattern type with the naked eye. That's a small guide in some details : Here .


Fingerprint Scanner :

Fingerscanning, also called fingerprint scanning, is the process of electronically obtaining and storing human fingerprints. The digital image obtained by such scanning is called a finger image. In some texts, the terms fingerprinting and fingerprint are used, but technically, these terms refer to traditional ink-and-paper processes and images.


Finally Hacking Apple touch ID :D :

iPhone 5S fingerprint sensor hacked by Germany's Chaos Computer Club


                                




After These long introduction with great information some are important and other for further reading . this is practical approach for what we have red but you will face problems like labs , tools and more but i think we can even determine fingerprints and extract it for anything we want 3:) .. I won't say this is for educational purpose only but sharing is caring .. knowledge is a flow and I'm not an expert  :) :)



Thursday, March 6, 2014

Hard Disk Drive in depth



Firstly what's hard disk drive ?


A hard disk drive (HDD) is a nonvolatile storage device that stores data on a magnetic disk .


Nonvolatile means that data remains after computer is switched off . Data is written on the disk by magnetizing particles within a magnetic material in a pattern that represents the data. The hard disk is able to read back this data by detecting the magnetic patterns created during the write process .



Main Parts Hard disk at a glance :

 HDD have two main parts : PCB ( Printed Circuit Board ) and HDA ( Head and disk assembly ) .

 -->PCB :

any PCB have green mask , copper tracks , core i.e ( fiber glass ) , Components and solder to join components with skeleton PCB . 

in our case HDD : there are number of ICS as Buffer Ram , MCU ( Microcontroller Unit ) , Rom Chip and Motor Driver  also some components like Ceramic Capacitors , SMT Coils , Motor Contacts , Head Stack Contacts and Interface like P-ATA , S-ATA …etc. 

MCU : MCU usually consists of Central Processor Unit or CPU which makes all calculations and Read/Write channel - special unit which converts analog signals from heads into digital information during read process and encodes digital information into analog signals when drive needs to write. MCU also has IO ports to control everything on PCB and transmit data through interface.

Motor Driver  or (VCM Controller ) : This fellow is the most power consumption chip on PCB. It controls spindle motor rotation and heads movements. The core of VCM controller can stand working temperature of 100C/212F.


Rom chip : rom which  contains firmware of hard disk . When you apply power on a drive, MCU chip reads content of the flash chip into the memory and starts the code. Without such code drive wouldn't even spin up. Sometimes there is no flash chip on PCB that means content of the flash located inside MCU .  

buffer Ram : Size of the memory defines size of the cache of HDD. you can find such information in data sheet on this HDD . CPU eats some memory to store some firmware modules and as far as we know only Hitachi/IBM drives show real cache size in data sheets for the other drives you can just guess how big is the real cache size .


-->HAD :


HDA has 4 major components :

Spindle , Platter , Head and Actuator






Spindle :A spindle holds one or more platters, it is connected to a motor that spins the platters at a constant revolutions per minute (RPM) .



Platter : A platter is the disk that stores the magnetic patterns. It is made from a nonmagnetic material, usually glass or aluminum, and has a thin coating of magnetic material on both sides.

>> a platter can spin at a speed of 7,200 to 18,000 RPM. The cost of an HDD increases for a higher speed.



Head :The read-write head of an HDD reads data from and writes data to the platters. It detects (when reading) and modifies (when writing) the magnetization of the material immediately underneath it. Information is written to the platter as it rotates at high speed past the selected head.



>> There is one head for each magnetic platter surface on the spindle, these are mounted on a common actuator arm.



 Actuator :An actuator arm moves the heads in an arc across the spinning platters, allowing each head to access the entire data area,similar to the action of the pick-up arm of a record deck.



Another concept must be known is The performance of an HDD which is measured using the following parameters:


Capacity : The number of bytes an HDD can store. The current maximum capacity of an HDD is 4TB.

Data transfer rate : The amount of digital data that can be moved to or from the disk within a given time. It is dependant on the performance of the HDD assembly and the bandwidth of the data path.

• The average data transfer rate ranges between 50-300 MB per second.

Seek time : The time the HDD takes to locate a particular piece of data. The average seek time ranges from 3 to 9 milliseconds .






Some important concepts about Disk Storage system :

The surface of a disk is formatted into invisible concentric bands called tracks, on which data are stored magnetically. A typical 3.5" hard drive may contain thousands of tracks. Moving the read/write heads from one track to another is called seeking. The average seek time is one type of disk speed measurement. Another measurement is RPM (revolutions per minute), typically 7,200 . The outside track of a disk is track 0, and the track numbers increase as you move towards the center.
 


 

A cylinder refer s to all tracks accessible from a single position of the read/write heads .A file is initially stored on a disk using adjacent cylinders.This reduces the amount of movement by the read-write heads.



A sector is a 512-byte portion of a track, as shown in Figure 14-2. Physical sectors are magnetically (invisibly) marked on the disk by the manufacturer, using what is called a low-level format. Sector sizes never change, regardless of the installed operating system. A hard disk may have 63 or more sectors per track.



Physical disk geometry is a way of describing the disk 's structure to make it readable by the system BIOS .It consists of the number of cylinder s per disk,the number of read/write heads per cylinder, and the number of sectors per track.










Fragmentation Over time, as files become more spread out around a disk, they become fragmented.A fragmented file is one whose sectors are no longer located in contiguous areas of the disk. When this happens, the read -write heads have to skip across track s when reading the file's data.This slows down the reading and writing of files, and makes the data more susceptible to errors .



Translation to Logical Sector Numbers Hard disk controllers perform a process called translation,the conversion of physical disk geometry to a logical structure that is understood by the operating system.The controller is usually embedded in firmware,either on the drive itself
or on a separate controller card.After translation,the operating system can work with what are called logical sector numbers.Logical sector numbers are always  numbered sequentially, starting at zero .



 Partitions , volumes , Logical , Extended , Primary …. What are ?
On a typical microcomputer, a single physical hard drive is divided into one or more logical

units named partitions , or volumes . Each formatted partition is represented by a separate drive letter such as C, D, or E, and it can be formatted using one of several file systems .

A drive may contain two types of partitions: primary and extended. Two configurations are possible, depending on whether you want an extended partition:

• Up to three primary partitions and one extended partition.

• Up to four primary partitions and no extended partition.

An extended partition can be divided into an unlimited number of logical partitions.
Each logical partition appears as a separate drive letter. Primary partitions can be made bootable ,whereas logical partitions cannot. It is possible to format each system or logical partition with a different file system .in file system files stored in clusters where a cluster is the smallest unit of space used by a file; it consists of one or more adjacent disk sectors. A file system stores each file as a linked sequence of clusters . The size of a cluster depends on both the type of file system in use and the size of its disk partition.
 

Hint : Using assembly language, you can bypass the operating system completely when accessing data.This can be useful: you might have to store and retrieve data stored in an unconventional format, to recover lost data, or to perform diagnostics on disk hardware .


References : 

1-Assembly Language for Intel-based Computers by Kip Irvine
2- HDD from inside:
Main parts Artem Rubtsov , www.hddscan.com
3-
Hitachi Data Systems at www.hds.com .


Ahmed Hashad Security Researcher @ 701 Labs
Twitter , Facebook