Contact us in messengers or by phone.

whatsapp telegram viber phone email
+79214188555

How to hack a fingerprint scanner?

root

СисАдмин Форума
Staff member
Full members of NP "MOD"
Joined
Feb 17, 2007
Messages
673
Reaction score
1,013
Points
93
Age
57
How to hack a fingerprint scanner?

fingerprint.jpg


Today we will bring up a very interesting topic. We will talk about whether the fingerprint scanner on the phone can be hacked and how to do it.

Quantity vs quality
Today, Apple puts Touch ID sensors in almost all devices (with the exception of the iPod Touch line), while Android smartphone manufacturers got the opportunity to access the required API only with the release of Android 6.0, which is now running about 15% of devices. Let's try to figure out how secure the fingerprint authentication method is and whether it makes practical sense to use it.

Observing the historical order, we will probably start with Apple.


Touch ID and Secure Enclave: a sweet couple

Once the problem with Apple, already at that time beginning to pay attention to data security, was that the majority of users did not want to protect their own devices in any way. Enter PIN to unlock your phone? It is long and inconvenient. After looking at the situation, Apple decided not to force people to use lock codes, but simply to make the unlocking process as easy as possible. The main idea of the technology Touch ID not at all to make your particular apparatus safer. The idea is to make security convenient and attractive enough for the general public. And the company achieved its goal.

Touch ID Is a unique hardware and software complex, and the word "unique" does not carry an advertising connotation here: each sensor in the production process is configured to work with a specific device. Remember the Error 53 scandal? It was this feature that became a stumbling block that blocked the operation of devices with a fingerprint sensor replaced in artisanal conditions.

vyrCKMjfgNc.jpg


Where are fingerprints stored

It would seem that the need to store fingerprint data as a one-way hash function is obvious, but it only seems to you: developers Htc one max decided that the prints can be stored as pictures in the most common folder in the device's memory. No matter what HTC developers think, Apple engineers did not make such a mistake: the scanned fingerprint is passed through a hash function and stored in the Secure Enclave, a microcomputer protected from outside access. Separately, I note that this data does not go to iCloud and is not transferred to the company's server.

Interestingly, even the one-way hash functions of the fingerprints are encrypted, with the encryption keys being calculated at boot time based on the unique hardware key. (which is also stored inside the Secure Enclave and cannot be retrieved from there) and the lock code that the user enters. The decrypted fingerprint data is stored only in the device's RAM and is never saved to disk. At the same time, the system from time to time deletes the fingerprint data even from the device's RAM, forcing the user to log in using the lock code (which, recall, will give the system the ability to decrypt the fingerprint data and resume the Touch ID sensor).


When and why iOS deletes fingerprint data from RAM

Perhaps the most interesting thing about the security system iOS - this is exactly the question of under what circumstances iOS will delete the fingerprint data from the device's RAM and force the user to re-authorize using the unlock code. But first, let's think, why did Apple even need to periodically delete fingerprints?

The company perfectly understands (and understood three years ago) that any biometric system can be deceived. Yes, Apple has developed excellent fingerprint scanners, which are not as easy to get around as a sensor, for example, on the Samsung Galaxy S5. But it is still possible. After all, the owner can be forced to put his finger on to unlock the phone - only under the American legal system this requires a warrant, which takes time ... after which the phone will delete the fingerprint data from memory and will not allow the device to be unlocked by the fingerprint.

Sounds like a stretch? Does it smell like a conspiracy theory? No, Apple just really didn't like the pressure attempt on the part of law enforcement agencies, in response to which she introduced this measure: Apple adds another rule forcing iPhone and iPad users to employ a passcode to unlock their device.

But let's not be distracted, but let's take a closer look at the conditions under which the system blocks Touch ID and forces you to log in using the lock code. Touch ID turns off and fingerprint data is deleted from the device when any of the following conditions are met:

  • the phone is turned off or rebooted;
  • the user adds the data of one more finger;
  • the phone receives a remote lock command via Find My iPhone;
  • there were five unsuccessful attempts to unlock using fingerprint in a row;
  • the device has never been unlocked within two days;
  • antipolite: more than six days have passed since the last time you entered the lock code, and the device itself has not been unlocked with the Touch ID sensor in the last eight hours.
The meaning of the last point needs to be clarified. According to the PhoneArena website, it "Can complicate the work of law enforcement agencies." I would have expressed myself more confidently, because the last point was introduced immediately after the sensational trial with the terrorist from San Bernardino, when unprecedented pressure was exerted on Apple.

How to bypass the fingerprint scanner

If we are talking about hacking Touch ID, then tricking the sensor is difficult, but possible. To fool modern sensors, you have to create a 3D model of your finger, and from the correct material. On older devices (iPhone 5s, iPad mini 3), bypassing the sensor is much easier. For example, a team of German hackers was able to swipe the iPhone 5s sensor two days after the device hit the market, simply by printing the original fingerprint at 2400 dpi.

But before you start modeling the print, you need to take care of the safety of the data on the device, and also that the print data does not have time "Go bad".

You need to act clearly and quickly:
you have a minimum of time.
  1. So, you got a phone in an unknown state. Don't touch the Touch ID button! If the phone is locked (and it is most likely locked), you will be wasting one in five attempts. Check the status of the device by short pressing the power button.
  2. If the device is blocked, isolate it from external radio networks by placing it in a Faraday cage (at home, an ordinary microwave will perform its role. The microwave is off!). Do not forget to put it on charge, even if an external battery will play its role. All this is done in order to protect the device from the commands under the Find My iPhone protocol, which will allow both remotely locking the device and destroying its contents. (Do you think these measures are obvious? No matter how they are! Science knows at least two sensational cases when police officers allowed remote destruction of data from already confiscated devices.)
  3. But if the device is unlocked, it is in your power to prevent it from locking the screen. To do this, just turn off automatic blocking. (unlike the procedure for removing the lock code, you do not need to enter any code to disable the automatic lock).
  4. If the device has been locked, you have a maximum of 48 hours (actually less) attempts to trick the fingerprint sensor.
  5. Pay attention: all manipulations with the device must be carried out exclusively in an environment protected from radio waves (Wi-Fi networks and cellular networks). Find My iPhone takes a couple of seconds to trigger.
  6. If you managed to trick the fingerprint sensor, disable the automatic screen lock (see point 3). Keep in mind: attempts to add another fingerprint in the settings or change the lock code will not work - for these operations the system will always require you to enter the code.
How to use it?

Let's say you managed to trick the fingerprint sensor. What's next? iOS is a closed system and all device memory will be encrypted. Options?

  • Jailbreak installation: not. To jailbreak a 64-bit iPhone or iPad, you will need to enter the lock code anyway (and in some cases also disable the lock code in the settings).
  • Physical data extraction: You can also try. If the jailbreak is already installed, you will be able to extract most of the data, but you will not be able to decrypt keychain. But if there is no jailbreak, then nothing can be done - to install it you need a lock code.
  • iCloud: possibly. By unlocking your device, you can force it to save a fresh backup to iCloud (Settings -> iCloud -> Backup -> Backup now). Remember, however, that to retrieve this data from the cloud, you will need an Apple ID password, and if two-factor authentication is activated in the account, then access to the second factor (which, however, can be the device under investigation). An important point: you will have to connect the device to Wi-Fi, as a result of which, instead of a backup, a command to block or destroy data may arrive on the device.
  • ITunes Backup: perhaps this is the only thing that can and should be done. The unlocked device easily connects to iTunes, which creates a backup copy of the data on your computer. The rest is a matter of technology. One moment: backup password. If installed, you have to hack it (for example, using Elcomsoft Phone Breaker).
    But if it is not installed, be sure to install your own! The simplest 123 will be enough. You can extract all data from a password-encrypted backup, and everything except the keychain from an unencrypted one. Since the keychain stores all the interesting stuff, it will be very useful to set a temporary password before taking a backup copy.

Outcome

Apple was able to create a complete and very successful protection scheme on the first try. The fingerprint sensor fits well into the overall concept. It is impossible to bypass this protection programmatically, the hacker has very little time for any attempts to deceive the sensor, and the result on new devices is not guaranteed. Definitely - the company achieved its goal.


Fingerprints and Android

Let's move on to exploring fingerprint authentication in Android devices. Having examined a very successful implementation from Apple, let's take a closer look at the state of affairs in the competitors' camp.

Google Android 4.x – 5.1.1: everything is very sad

The first devices with built-in fingerprint sensors began to appear quite a long time ago, back in the days of Android 4.4. Today there are already a lot of them: these are Samsung Galaxy S5, S6, S7, Motorola Moto Z, Sony Xperia Z5, LG G5, Huawei Ascend Mate 7 and subsequent, Meizu Pro 5 - and that's not all. But not every device uses the fingerprint sensor in the right way. This is primarily due to the fact that up to the Android 6.0 version, there was no universal API for fingerprint authentication in the system. No API - there are no formal Compatibility Definition requirements, and, accordingly, there is no certification from Google.

In the complete absence of external control, manufacturers have piled up this ... in a nightmare you will not dream. For example, the HTC One Max developers passed the exam on the course "Android in 21 days" and implemented a wonderful system that stores full copies of fingerprints in a publicly accessible directory in an uncompressed (not to mention encryption) format. Perhaps in the instructions for "Hacking" there is no need for this system. I will only clarify that the data is stored in a file /data/dbgraw.bmp , and for your convenience, access permission is set 0666.


This is not an isolated example. Samsung Galaxy S5 came out with Android 4.4 on board. Soon, hackers managed to gain access to the fingerprint scanner and successfully bypass the protection.

Before the release of the sixth version of Android, manufacturers managed to release a lot of devices to which fingerprint sensors were illiterately attached. Breaking them is not even interesting, before that everything was dull there. It is clear that Google could not tolerate such a situation for a long time. They didn't.

Android 6.0: Fingerprint API and Nexus Imprint

With the release of Android 6.0, Google not only developed its own API for fingerprint authentication, but also updated the Compatibility Definition Document, which all manufacturers who want to certify their devices for installing Google services must follow (this is a very important point, more on that later).

Two reference devices were released at once: Nexus 5X and Nexus 6P. They contain both non-removable encryption of the data section, and the correct implementation of fingerprint sensors, called Nexus Imprint.

ZBgFVRU_XwQ.jpg


So, what does Google require from manufacturers to obtain certification of conformity? Unlike the situation with mandatory encryption on Android 5.0, this time the list of requirements does not allow for double interpretations. Let's translate an excerpt from the official document.

7.3.10. Fingerprint sensor

It is RECOMMENDED to use a fingerprint sensor on devices that can use a screen lock. Requirements for devices equipped with such a sensor and providing API access to third-party developers:

  • It is MANDATORY to declare support for android.hardware.fingerprint.
  • MUST fully implement the fingerprint API from the Android SDK documentation [Resources, 95].
  • MUST have a false positive rate of less than 0.002%.
  • It is STRONGLY RECOMMENDED that the false negative rate is less than 10%, the triggering delay is less than 1 second (for 1 stored print).
  • It is MANDATORY to limit the rate of attempts to a 30 second delay after 5 failed attempts.
  • It is MANDATORY to have hardware secure storage and to verify fingerprints exclusively in the Trusted Execution Environment (TEE) trusted zone or on a dedicated processor with a secure TEE channel. (This burned Samsung S5, which had a problem with a secure communication channel)
  • It is MANDATORY to encrypt the fingerprint data so that it cannot be accessed outside the Trusted Execution Environment (TEE) according to the Android Open Source Project [Resources, 96].
  • It is MANDATORY not to allow adding fingerprints without establishing a trusted chain (user must add or verify PIN / pattern / password via TEE according to Android Open Source).
  • DO NOT ALLOW third-party applications to distinguish between individual prints.
  • It MUST handle the DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT flag correctly.
  • ALL THE ABOVE REQUIREMENTS ARE MANDATORY when upgrading to Android 6.0, and fingerprint data must either be safely migrated or reset.
  • PREFERRED to use the Android Fingerprint icon from the Android Open Source Project.
As you can see, the document does not imply double interpretations. Manufacturers wishing to certify Android 6.0 and higher equipped with fingerprint sensors must meet all requirements. What's more: devices that are updated to Android 6.0 must also meet the new requirements. (and, accordingly, be certified).

Another part of the document provides a requirement to make sure to enable encryption when using a secure screen lock (including fingerprint sensor) ... As you can see, in theory, things are not bad. And what is it really?

aCPLmuQXM8A.jpg


Android Smart Lock

In fact, Android still has a number of gaping security holes that allow not just bypassing, but bypassing all those fingerprints and passwords at once. One of these holes is the Android Smart Lock system, with which you can automatically unlock your phone when some external factors coincide. For example, many users allow automatic unlocking at home, forgetting that the positioning accuracy is far from ideal and the concept of “home” for the phone will cover an 80-meter radius. Many people activate unlocking with a trusted Bluetooth device or turn on pseudo-biometric unlocking based on a picture of a face (it is quite easy to do it by showing a video or 3D model).

Interestingly, there is no need for Smart Lock in the presence of a working fingerprint sensor: the screen in any case turns on and unlocks by pressing one button. Why is there no Compatibility Definition requirement to disable Smart Lock when the fingerprint sensor is active? Riddle. But you can use this system to unlock your device. Just keep in mind that Smart Lock will not be active immediately after the device is restarted; to activate the system, the device will need to be unlocked with a password or pattern at least once.

Our Chinese friends

But what about the numerous Chinese phones that also come with fingerprint sensors? Everything is very different there.

Above, we talked about Google's requirements outlined in the Android Compatibility Document. If a manufacturer wants to certify its devices for installing Google services on them, its device running a specific firmware version must be certified in one of the laboratories.

In China, Google is banned, and many semi-basement manufacturers are not going to bother with unnecessary certifications at all. Yes, you yourself know what kind of firmware devices from China often come with. For the sake of performance, encryption, as a rule, is not enabled even in firmware based on Android 6.0, and the bootloader is not blocked in principle (in the case of MediaTek processors) or can be easily unlocked. Accordingly, there is a fingerprint sensor there or not - does not play the slightest role.

Even if encryption is enabled by the user (unlikely in the case of cheap devices, but still), the user has no guarantee that the fingerprint sensor is correctly integrated. This is especially true for devices that were sold with Android 5 and earlier on board, and received an update to Android 6 later.

There are exceptions to this rule. All international models of Huawei, Lenovo are certified by Google without fail (but this cannot be said about specifically Chinese models). The situation is interesting with LeEco smartphones, which are sold in China and are trying to conquer foreign markets. In the case of LeEco, there are often both purely Chinese and international firmware for the same model. They differ not only in the pre-installed Google Play store, the list of available languages and the presence / absence of "Chinese garbage". In the case of international firmware (India, USA, Russia), the company formally certifies the device for installing Google Play Services.

In particular, in international LeEco firmwares based on Android 6.0 (for example, for Le2 Max), encryption of the data section is activated (and not disabled) - in full compliance with the Android Compatibility Document requirements. This is perceived by many users as an inconvenience, and they are trying to switch from such firmware to something else based on Chinese assemblies, which in the light of the unlocked bootloader completely depreciates the entire security model.

How to hack a fingerprint scanner
Hacking the fingerprint sensor for Android involves simulating a finger that can be used to unlock a smartphone. How detailed and high-quality the imitation should be, what material it is made of, depends on the technology on which the sensor of a particular smartphone model is built.

So, it is useless to try to deceive ultrasonic sensors with a high-resolution print on special conductive paper - but standard capacitive scanners can be outsmarted in this way.

But the ultrasonic sensor is deceived with a finger printed on a 3D printer, and the material does not really matter. Finally, almost any sensor will mistake it for a real patch, made of a thin layer of conductive material and worn over a finger.

rAXxLEBbAos.jpg


Probably, there is no need to mention that you can use the finger of a sleeping, unconscious person or even a corpse to unlock a phone equipped with a fingerprint sensor (the police use this method all the time).

But the fact that in some countries governments collect fingerprint databases of their own and not only their citizens (have you ever received an American visa?) It is necessary to mention. And if now legislative restrictions do not allow using these bases to unlock phones simply on suspicion, then in the future I will not give such a guarantee.

Comparison with Touch ID

It's impossible to directly compare the security of Apple Touch ID with the situation in the Android world: if Apple has only a few devices, then, on the contrary, there are too many smartphones on Android. They can use a wide variety of sensors based on a variety of technologies (from capacitive and optical to ultrasonic). Different bypass technologies are selected for different sensors. For example, for the Samsung Galaxy S6, the trick with unlocking the phone with a finger model printed on a 3D printer from ordinary plastic works quite well (with Apple Touch ID, such a simple trick will not work; you will need to use a material with special properties to print). Some other devices are easily deceived by high-resolution printed images.

But the comparison with the Nexus Imprint makes perfect sense. On the Nexus 5X and 6P, Google has taken an exemplary approach to security. This is non-removable encryption of the data section, and the competent integration of fingerprint sensors, and the sensors themselves were not chosen anyhow.

Third-party devices may use insufficiently secure sensors and open security holes (despite being formally compliant with the Android Compatibility Definition).

How to protect yourself from hacking your fingerprint scanner

Did you read the article and was determined to disable the ill-fated sensor in your device, using a complex alphanumeric password instead? Do not rush. In fact, things are not so bad. In the case of relatively modern Apple devices (starting with the iPhone 6, iPad mini 4, iPad Air), you are not in danger of hacking the fingerprint sensor: even if your fingerprint is scanned in high enough resolution, the attacker will have absolutely no time to use it Little. Law enforcement agencies can force you to unlock your phone with your fingerprint (and unlike unlocking with a password, they have every right to do so), but for this action they will need to obtain a special order, which will stipulate the entire procedure. It takes time to receive the order, during which the fingerprint data in your iPhone has time to "rot".

But if you have an Android smartphone ... Turn on encryption. Without it, the data from your phone will be merged without any sensors. Turn off Smart Lock - it's a gaping security hole. Make sure your device is Google certified and runs Android 6.0 or later. If this is not so, I would disconnect the sensor out of harm's way. Finally, do not be lazy to look for information about whether the fingerprint sensor for your device was hacked and if it was - it is simple or difficult to do it. Make a decision depending on how personally you are satisfied with the complexity of hacking a fingerprint sensor by a potential attacker on your device.

Conclusion

Fingerprint authentication is not a panacea. Its main purpose is not to make your device more secure, but to reduce the inconvenience associated with locking the phone securely, and thus convince the bulk of users to still lock their devices. Apple did it. In Android, the situation is more complicated: the Nexus Imprint reference system works perfectly, almost completely copying the Touch ID methods. For other manufacturers, things are not so rosy. The quality and safety of the sensors is at times questionable, and in devices running Android 5.1 and earlier, fingerprint sensors remain an open security hole. In the case of Chinese devices with an unlocked bootloader, the presence of a fingerprint sensor will in no way worsen the already lacking security (however, it can worsen: if the phone in your hands is turned on and the data section is encrypted, then deceiving such a sensor is a great way to bypass encryption).

Source
 
Original message
Как взломать сканер отпечатков пальцев?

fingerprint.jpg


Сегодня мы поднимем очень интересную тему. Мы поговорим о том, можно ли взломать сканер отпечатков пальцев на телефоне и как это сделать.

Количество vs качество
Сегодня Apple ставит датчики Touch ID практически во все устройства (за исключением линейки iPod Touch), в то время как производители смартфонов на Android получили возможность доступа к нужному API только с выходом Android 6.0, под управлением которой сейчас работает порядка 15% устройств. Попробуем разобраться, насколько безопасен дактилоскопический метод аутентификации и имеет ли практический смысл его использование.

Соблюдая исторический порядок, начнем мы, пожалуй, с Apple.


Touch ID и Secure Enclave: сладкая парочка

Однажды проблемой Apple, уже в те времена начинавшей обращать внимание на безопасность данных, было то, что пользователи в массе своей не желали каким-либо образом защищать собственные устройства. Вводить PIN-код для разблокировки телефона? Это долго и неудобно. Посмотрев на ситуацию, в Apple решили не заставлять людей использовать коды блокировки, а попросту максимально упростить процесс разблокировки. Основная идея технологии Touch ID вовсе не в том, чтобы сделать безопаснее твой конкретный аппарат. Идея в том, чтобы сделать безопасность достаточно удобной и привлекательной для основной массы пользователей. И своей цели компания добилась.

Touch ID — это уникальный программно-аппаратный комплекс, и слово «уникальный» здесь не несет рекламного оттенка: каждый датчик в процессе производства проходит настройку для работы с конкретным устройством. Помнишь скандал с «ошибкой 53»? Именно эта особенность стала камнем преткновения, который блокировал работу устройств с замененным в кустарных условиях датчиком отпечатков пальцев.

vyrCKMjfgNc.jpg


Где хранятся отпечатки пальцев

Казалось бы, необходимость хранить данные отпечатков в виде односторонней хеш-функции очевидна, но тебе это только кажется: разработчики HTC One Max решили, что хранить отпечатки можно в виде картинок в самой обычной папке в памяти устройства. Чем бы ни думали разработчики HTC, инженеры Apple такой ошибки не совершили: сканированный отпечаток пропускается через хеш-функцию и сохраняется в Secure Enclave — защищенном от доступа извне микрокомпьютере. Отдельно отмечу, что эти данные не попадают в iCloud и не передаются на сервер компании.

Что интересно, даже односторонние хеш-функции отпечатков зашифрованы, причем ключи шифрования вычисляются во время загрузки устройства на основе уникального аппаратного ключа (который также хранится внутри Secure Enclave и не может быть оттуда извлечен) и кода блокировки, который вводит пользователь. Расшифрованные дактилоскопические данные хранятся только в оперативной памяти устройства и никогда не сохраняются на диск. При этом система время от времени удаляет данные отпечатков даже из оперативной памяти устройства, вынуждая пользователя авторизоваться с помощью кода блокировки (который, напомним, даст системе возможность расшифровать данные отпечатков и возобновить работу датчика Touch ID).


Когда и почему iOS удаляет данные отпечатков из оперативной памяти

Пожалуй, самое интересное в системе безопасности iOS — это именно вопрос о том, при каких обстоятельствах iOS удалит данные отпечатков из оперативной памяти устройства и заставит пользователя заново авторизоваться с помощью кода разблокировки. Но для начала подумаем, зачем Apple вообще понадобилось периодически удалять отпечатки?

В компании отлично понимают (и понимали три года назад), что любую биометрическую систему можно обмануть. Да, в Apple разработали прекрасные дактилоскопические сканеры, обойти которые далеко не так просто, как датчик, к примеру, Samsung Galaxy S5. Но при этом все-таки можно. В конце концов, владельца можно заставить приложить палец для разблокирования телефона — вот только в рамках американской правовой системы для этого требуется ордер, на получение которого уходит время… по истечении которого телефон удалит из памяти данные отпечатков и не позволит разблокировать устройство по отпечатку пальца.

Звучит как натяжка? Попахивает теорией заговора? Нет, просто Apple очень не понравилась попытка давления со стороны правоохранительных органов, в ответ на которое она и ввела эту меру: Apple adds another rule forcing iPhone and iPad users to employ a passcode to unlock their device.

Но не будем отвлекаться, а посмотрим внимательно на условия, при которых система блокирует работу Touch ID и вынуждает авторизоваться с помощью кода блокировки. Датчик Touch ID выключается, а данные отпечатков удаляются из памяти устройства при соблюдении любого из следующих условий:

  • телефон выключен или перезагружен;
  • пользователь добавляет данные еще одного пальца;
  • телефон получает команду удаленной блокировки через Find My iPhone;
  • было пять безуспешных попыток разблокирования с помощью отпечатка подряд;
  • устройство ни разу не разблокировалось в течение двух суток;
  • антиполицай: прошло более шести суток с момента последнего ввода кода блокировки, а само устройство не было разблокировано датчиком Touch ID в течение последних восьми часов.
Смысл последнего пункта нужно пояснить. По мнению сайта PhoneArena, он «может усложнить работу правоохранительных органов». Я выразился бы более уверенно, ведь последний пункт был введен сразу после нашумевшего процесса с террористом из Сан-Бернардино, когда на Apple оказывалось беспрецедентное давление.

Как обойти сканер отпечатков пальцев

Если речь идет о взломе Touch ID, то обмануть датчик сложно, но можно. Для обмана современных датчиков тебе придется создать трехмерную модель пальца, причем из правильного материала. На старых устройствах (iPhone 5s, iPad mini 3) обойти датчик заметно проще. К примеру, команда немецких хакеров смогла провести датчик iPhone 5s через два дня после выхода устройства на рынок, попросту распечатав оригинальный отпечаток пальца с разрешением 2400 dpi.

Но перед тем, как приступать к моделированию отпечатка, тебе необходимо позаботиться о сохранности данных на устройстве, а также о том, чтобы данные отпечатка не успели «протухнуть».

Действовать нужно четко и быстро:
у тебя минимум времени.
  1. Итак, к тебе в руки попал телефон в неизвестном состоянии. Не трогай кнопку Touch ID! Если телефон заблокирован (а он, скорее всего, заблокирован), ты напрасно потратишь одну попытку из пяти. Проверь состояние устройства коротким нажатием кнопки питания.
  2. Если устройство заблокировано, изолируй его от внешних радиосетей, поместив его в клетку Фарадея (в домашних условиях ее роль выполнит обычная микроволновка. Выключенная микроволновка!). Не забудь поставить его на зарядку, даже если ее роль будет выполнять внешний аккумулятор. Все это делается для того, чтобы оградить устройство от команд по протоколу Find My iPhone, которые позволят как дистанционно заблокировать устройство, так и уничтожить его содержимое. (Думаешь, эти меры очевидны? Как бы не так! Науке известны как минимум два нашумевших случая, когда полицейские допускали удаленное уничтожение данных с уже конфискованных устройств.)
  3. А вот если устройство разблокировано, в твоих силах не позволить ему заблокировать экран. Для этого просто отключи автоматическую блокировку (в отличие от процедуры снятия кода блокировки, для отключения автоматической блокировки никакой код тебе вводить не потребуется).
  4. Если устройство было заблокировано, у тебя есть максимум 48 часов (на самом деле меньше) на попытки обмануть датчик отпечатков.
  5. Обрати внимание: все манипуляции с устройством должны проводиться исключительно в среде, защищенной от радиоволн (сетей Wi-Fi и сотовых сетей). Для срабатывания Find My iPhone достаточно пары секунд.
  6. Если датчик отпечатков удалось обмануть, отключи автоматическую блокировку экрана (см. пункт 3). Имей в виду: попытки добавить еще один отпечаток в настройках или сменить код блокировки не пройдут — для этих операций система всегда потребует ввести код.
Как это использовать?

Допустим, у тебя получилось обмануть датчик отпечатка пальцев. Что дальше? iOS — закрытая система, а вся память устройства будет зашифрована. Варианты?

  • Установка джейлбрейка: нет. Для взлома 64-битного iPhone или iPad тебе в любом случае потребуется ввести код блокировки (а в некоторых случаях еще и отключить код блокировки в настройках).
  • Физическое извлечение данных: можно попробовать. Если джейлбрейк уже установлен, ты сможешь извлечь большую часть данных, но не сможешь расшифровать keychain. А вот если джейлбрейка нет, то ничего поделать не получится — для его установки тебе потребуется код блокировки.
  • iCloud: возможно. Разблокировав устройство, ты сможешь заставить его сохранить свежую резервную копию в iCloud (Settings –> iCloud –> Backup –> Backup now). Помни, однако, что для извлечения этих данных из облака тебе понадобится пароль от Apple ID, а если в учетке активирована двухфакторная аутентификация — то и доступ ко второму фактору (в роли которого, впрочем, может выступить исследуемое устройство). Важный момент: тебе придется подключить устройство к Wi-Fi, в результате чего вместо резервной копии на устройство может прилететь команда блокировки или уничтожения данных.
  • Резервная копия iTunes: пожалуй, это единственное, что сделать можно и нужно. Разблокированное устройство легко подключается к iTunes, с помощью которого создается резервная копия данных на твоем компьютере. Дальнейшее — дело техники. Один момент: пароль на резервную копию. Если он установлен, тебе придется его взломать (например, с помощью Elcomsoft Phone Breaker).
    А вот если он не установлен — обязательно установи свой! Простейшего 123 будет вполне достаточно. Из резервной копии, зашифрованной паролем, ты сможешь извлечь все данные, а из незашифрованной — все, кроме keychain. Поскольку в keychain хранится все самое интересное, установить временный пароль перед снятием резервной копии будет весьма полезно.

Итог

В Apple смогли с первой же попытки создать завершенную и очень удачную схему защиты. Датчик отпечатков удачно вписался в общую концепцию. Программным способом обойти эту защиту невозможно, времени на любые попытки обмануть датчик у хакера совсем немного, а результат на новых устройствах не гарантирован. Однозначно — в компании добились своей цели.


Отпечатки пальцев и Android

Перейдем к исследованию дактилоскопической аутентификации в устройствах под управлением Android. Разобрав очень удачную реализацию от Apple, посмотрим внимательно на состояние дел в лагере конкурентов.

Google Android 4.x–5.1.1: все очень грустно

Первые устройства со встроенными дактилоскопическими датчиками стали появляться довольно давно, еще во времена Android 4.4. На сегодняшний день их уже очень много: это Samsung Galaxy S5, S6, S7, Motorola Moto Z, Sony Xperia Z5, LG G5, Huawei Ascend Mate 7 и последующие, Meizu Pro 5 — и это далеко не все. Вот только не в каждом устройстве датчик отпечатков используется правильным образом. Связано это в первую очередь с тем, что вплоть до версии Android 6.0 в системе не существовало универсального API для дактилоскопической аутентификации. Нет API — нет и формальных требований Compatibility Definition, и, соответственно, нет никакой сертификации со стороны Google.

При полном отсутствии внешнего контроля производители нагородили такое… в страшном сне не приснится. Например, разработчики HTC One Max экстерном сдали экзамен по курсу «Android за 21 день» и реализовали замечательную систему, которая хранит полноценные копии отпечатков пальцев в публично доступном каталоге в несжатом (не говоря уже о шифровании) формате. Пожалуй, в инструкциях по «взлому» этой системы нет никакой нужды. Уточню только, что данные хранятся в файле /data/dbgraw.bmp, причем для твоего удобства разрешение доступа выставлено 0666.


Пример не единичный. Samsung Galaxy S5 вышел с Android 4.4 на борту. В скором времени хакерам удалось получить доступ к сканеру отпечатков и успешно обойти защиту.

До выхода шестой версии Android производители успели выпустить массу устройств, к которым безграмотно прикрутили датчики отпечатков. Ломать их даже неинтересно, до того там все уныло. Понятно, что долго терпеть такую ситуацию в Google не могли. Они и не стали.

Android 6.0: Fingerprint API и Nexus Imprint

С выходом Android 6.0 в Google не только разработали собственный API для аутентификации по отпечаткам пальцев, но и обновили Compatibility Definition Document, которому обязаны следовать все производители, желающие сертифицировать свои устройства для установки сервисов Google (это очень важный момент, о нем чуть позже).

Было выпущено сразу два референсных устройства: Nexus 5X и Nexus 6P. В них — и неотключаемое шифрование раздела данных, и правильная реализация датчиков отпечатков, получившая название Nexus Imprint.

ZBgFVRU_XwQ.jpg


Итак, чего же требует Google от производителей для получения сертификата соответствия? В отличие от ситуации с обязательным шифрованием на Android 5.0, на сей раз список требований не допускает двойных толкований. Переведем выдержку из официального документа.

7.3.10. Датчик отпечатков пальцев

В устройствах, в которых возможно использование блокировки экрана, РЕКОМЕНДУЕТСЯ использование датчика отпечатков пальцев. Требования к устройствам, оборудованным таким датчиком и предоставляющим доступ к API сторонним разработчикам:

  • ОБЯЗАТЕЛЬНО декларировать поддержку android.hardware.fingerprint.
  • ОБЯЗАТЕЛЬНО полная реализация fingerprint API из документации к Android SDK [Resources, 95].
  • ОБЯЗАТЕЛЬНО иметь уровень ложноположительных срабатываний менее 0,002%.
  • НАСТОЙЧИВО РЕКОМЕНДУЕТСЯ уровень ложноотрицательных срабатываний менее 10%, задержка срабатывания менее 1 секунды (для 1 сохраненного отпечатка).
  • ОБЯЗАТЕЛЬНО ограничивать скорость попыток 30-секундной задержкой после 5 неудачных попыток.
  • ОБЯЗАТЕЛЬНО иметь аппаратное безопасное хранилище, а верификацию отпечатков проводить исключительно в доверенной зоне Trusted Execution Environment (TEE) или на выделенном процессоре с безопасным каналом связи с TEE. (На этом погорел Samsung S5, в котором с безопасным каналом связи была проблема)
  • ОБЯЗАТЕЛЬНО шифровать данные отпечатков таким образом, чтобы доступ к ним невозможно было получить за пределами Trusted Execution Environment (TEE) согласно Android Open Source Project [Resources, 96].
  • ОБЯЗАТЕЛЬНО не разрешать добавлять отпечатки без установления доверенной цепочки (пользователь должен добавить или верифицировать PIN/паттерн/пароль через TEE согласно Android Open Source).
  • НЕ ПОЗВОЛЯТЬ сторонним приложениям различать отдельные отпечатки.
  • ОБЯЗАТЕЛЬНО корректно обрабатывать флаг DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT.
  • ВСЕ ОПИСАННЫЕ ВЫШЕ ТРЕБОВАНИЯ ОБЯЗАТЕЛЬНЫ при обновлении до Android 6.0, при этом данные отпечатков должны быть или мигрированы безопасным образом, или сброшены.
  • ЖЕЛАТЕЛЬНО использовать иконку Android Fingerprint из Android Open Source Project.
Как видим, документ не подразумевает двойных толкований. Производители, желающие сертифицировать устройства на базе Android 6.0 и выше, оборудованные датчиками отпечатков, должны полностью выполнить все требования. Более того: устройства, которые обновляются на Android 6.0, также обязаны соответствовать новым требованиям (и, соответственно, проходить сертификацию).

В другой части документа приведено требование обязательно включать шифрование при использовании безопасной блокировки экрана (в том числе датчика отпечатков пальцев). Как видим, в теории дела обстоят неплохо. А что на самом деле?

aCPLmuQXM8A.jpg


Android Smart Lock

А на самом деле в Android до сих пор есть ряд зияющих дыр в безопасности, позволяющих не просто обходить, а обходить на раз плюнуть все эти отпечатки и пароли. Одна из таких дыр — система Android Smart Lock, с помощью которой можно автоматически разблокировать телефон при совпадении некоторых внешних факторов. К примеру, многие пользователи разрешают автоматическую разблокировку дома, забывая о том, что точность позиционирования далеко не идеальна и понятие «дом» для телефона будет охватывать 80-метровый радиус. Многие активируют разблокировку доверенным устройством Bluetooth или включают псевдобиометрическую разблокировку по снимку лица (обходится довольно легко демонстрацией видеоролика или трехмерной модели).

Что интересно, никакой необходимости в Smart Lock при наличии работоспособного датчика отпечатков нет: экран в любом случае включается и разблокируется нажатием одной кнопки. Почему в Compatibility Definition нет требования отключать Smart Lock при активном датчике отпечатков? Загадка. Но ты можешь использовать эту систему для разблокирования устройства. Только имей в виду, что Smart Lock не будет активна сразу после перезагрузки устройства; для активации системы устройство нужно будет разблокировать паролем или паттерном хотя бы раз.

Наши китайские друзья

А как обстоят дела в многочисленных китайских телефонах, которые тоже идут с датчиками отпечатков? Там все очень по-разному.

Выше мы говорили о требованиях Google, изложенных в Android Compatibility Document. Если производитель хочет сертифицировать свои устройства для установки на них сервисов Google, его устройство под управлением конкретной версии прошивки должно пройти сертификацию в одной из лабораторий.

В Китае Google под запретом, и многие полуподвальные производители совершенно не собираются заморачиваться с ненужными сертификациями. Да ты и сам знаешь, с какими прошивками зачастую приходят устройства из Китая. В угоду производительности шифрование, как правило, не включается даже в прошивках на основе Android 6.0, а загрузчик не блокируется принципиально (в случае с процессорами MediaTek) или может быть легко разблокирован. Соответственно, есть там датчик отпечатков или нет — не играет ни малейшей роли.

Даже если шифрование будет включено пользователем (маловероятно в случае дешевых устройств, но все же), у пользователя нет никакой гарантии, что датчик отпечатков интегрирован правильным образом. Особенно это касается устройств, которые продавались с Android 5 и более ранними версиями на борту, а обновление до 6-й версии Android получили позднее.

Из этого правила бывают исключения. Все международные модели Huawei, Lenovo в обязательном порядке сертифицируются Google (а вот о специфически китайских моделях этого сказать нельзя). Интересна ситуация со смартфонами LeEco, которые продаются в Китае и пытаются завоевать внешние рынки. В случае с LeEco для одной и той же модели часто существуют как чисто китайские, так и международные прошивки. Отличаются они далеко не только предустановленным магазином Google Play, списком доступных языков и наличием/отсутствием «китайского мусора». В случае с международными прошивками (Индия, США, Россия) компания формально сертифицирует устройство для установки Google Play Services.

В частности, в международных прошивках LeEco на основе Android 6.0 (например, для Le2 Max) активируется (и не отключается) шифрование раздела данных — в полном соответствии с требованиями Android Compatibility Document. Многими пользователями это воспринимается как неудобство, и они пытаются перейти с таких прошивок на что-то другое, основанное на китайских сборках, что в свете разблокированного загрузчика полностью обесценивает всю модель безопасности.

Как взломать сканер отпечатков пальцев
Взлом датчика отпечатков для Android подразумевает имитацию пальца, с помощью которого можно разблокировать смартфон. Насколько подробной и качественной должна быть имитация, из какого материала выполнена — зависит от технологии, на которой построен датчик конкретной модели смартфона.

Так, ультразвуковые датчики бесполезно пытаться обмануть с помощью отпечатка, распечатанного с высоким разрешением на специальной токопроводящей бумаге, — но стандартные емкостные сканеры таким образом перехитрить можно.

А вот ультразвуковой датчик обманывается с помощью пальца, отпечатанного на 3D-принтере, причем материал особого значения не имеет. Наконец, практически любой датчик примет за настоящий накладной отпечаток, выполненный из тонкого слоя токопроводящего материала и надетый поверх пальца.

rAXxLEBbAos.jpg


Наверное, о том, что для разблокирования телефона, оборудованного дактилоскопическим датчиком, можно использовать палец спящего, бессознательного человека или даже трупа (полиция пользуется этим способом постоянно), упоминать нет необходимости.

А вот о том, что в некоторых странах правительства собирают базы данных отпечатков пальцев своих и не только своих граждан (когда-нибудь получал американскую визу?), упомянуть необходимо. И если сейчас законодательные ограничения не позволяют использовать эти базы для разблокирования телефонов просто по подозрению, то в будущем я такой гарантии не дам.

Сравнение с Touch ID

Напрямую сравнить безопасность Apple Touch ID с ситуацией в мире Android не получится: если у Apple устройств единицы, то смартфонов на Android, наоборот, слишком много. В них могут использоваться самые разные датчики, основанные на разнообразных технологиях (от емкостных и оптических до ультразвуковых). Для разных датчиков подбирают разные технологии обхода. К примеру, для Samsung Galaxy S6 вполне срабатывает финт с разблокированием телефона моделью пальца, напечатанной на 3D-принтере из самого обычного пластика (с Apple Touch ID такой простой трюк не пройдет; для печати нужно будет использовать материал, обладающий особыми свойствами). Некоторые другие устройства легко обманываются распечатанными с высоким разрешением картинками.

А вот сравнение с Nexus Imprint вполне имеет смысл. В Nexus 5X и 6P Google использовал образцово-показательный подход к безопасности. Это и неотключаемое шифрование раздела данных, и грамотная интеграция датчиков отпечатков, да и сами датчики выбраны не абы как.

В устройствах сторонних производителей могут использоваться недостаточно безопасные датчики, могут зиять откровенные дыры в безопасности (несмотря на формальное соответствие требованиям Android Compatibility Definition).

Как защититься от взлома сканера отпечатков пальцев

Прочитал статью и твердо решил отключить злосчастный датчик в своем устройстве, использовав вместо него сложный буквенно-цифровой пароль? Не спеши. На самом деле все не так плохо. В случае с относительно современными устройствами Apple (начиная с iPhone 6, iPad mini 4, iPad Air) взлом дактилоскопического датчика тебе не грозит: даже если твой отпечаток сумеют отсканировать в достаточно высоком разрешении, времени на то, чтобы его использовать, у злоумышленника будет совсем немного. Правоохранительные органы могут заставить тебя разблокировать телефон отпечатком (и в отличие от разблокировки паролем они имеют на это полное право), но для этого действия им потребуется получить специальный ордер, в котором будет оговорена вся процедура. На получение ордера нужно время, за которое данные отпечатка в твоем iPhone успеют «протухнуть».

А вот если у тебя смартфон на Android… Включи шифрование. Без него данные с твоего телефона сольют безо всяких датчиков. Отключи Smart Lock — это зияющая дыра в безопасности. Убедись, что твой аппарат сертифицирован Google и работает под управлением Android 6.0 или более новой системы. Если это не так — я бы датчик отключил от греха подальше. Наконец, не поленись поискать информацию о том, был ли взломан датчик отпечатков для твоего устройства и если был — просто или сложно это сделать. Принимай решение в зависимости от того, насколько лично тебя устраивает сложность взлома дактилоскопического датчика потенциальным злоумышленником именно на твоем устройстве.

Заключение

Дактилоскопическая аутентификация — не панацея. Ее основное предназначение не в том, чтобы сделать более безопасным конкретно твое устройство, а в том, чтобы снизить неудобства, связанные с безопасной блокировкой телефона, и таким образом убедить основную массу пользователей все-таки блокировать свои устройства. У Apple — получилось. В Android ситуация сложнее: референсная система Nexus Imprint работает идеально, практически полностью копируя методы Touch ID. У других производителей дела обстоят не так радужно. Качество и безопасность датчиков временами вызывают сомнения, а в устройствах под управлением Android 5.1 и более ранних версий дактилоскопические датчики и вовсе остаются открытой дырой в безопасности. В случае с китайскими устройствами с разблокированным загрузчиком наличие дактилоскопического датчика никак не ухудшит и без того отсутствующую безопасность (впрочем, может и ухудшить: если попавший в твои руки телефон включен, а раздел данных зашифрован, то обман такого датчика — отличный способ обойти шифрование).

Источник
  • Like
Reactions: НСК-СБ

Матушкин Андрей Николаевич

Президент IAPD
Staff member
Private access level
Full members of NP "MOD"
Joined
Jan 1, 1970
Messages
21,433
Reaction score
3,531
Points
113
Age
52
Location
Россия,
Website
o-d-b.ru
Original message
Как взломать сканер отпечатков пальцев?
Спасибо!