AppNinja开发手记8: Android内核溢出教程-环境搭建

学习心得:什么是Android内核溢出

学习方向:VR、元宇宙、Android内核溢出、Android Kernel Exploit

http://blog.csdn.net/a2831942318

Written by AppNinja 开发手记

1、系统环境

操作系统:Windows11

虚拟机VirtualBox6.1:Downloads – Oracle VM VirtualBox

Ubuntu18.04.6: https://releases.ubuntu.com/18.04/ubuntu-18.04.6-desktop-amd64.iso

VirtualBox主机与虚拟机不能复制粘贴的解决办法,要开启两项:

第1项:安装增强功能

第2项:选中使用主机输(I/O)缓存

2、GDB8.2 带python功能

a@sys:~$ gdb
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) python
>import os
>import sys
>print(sys.version_info)
>end
sys.version_info(major=3, minor=6, micro=9, releaselevel='final', serial=0)
(gdb) 

如果gdb本身没有带python,需要自己安装,过程中注意事项如下:

安装Python2.7出现如下错误:

The following packages have unmet dependencies:
 python2.7 : Depends: python2.7-minimal (= 2.7.15~rc1-1) but it is not going to be installed
             Depends: libpython2.7-stdlib (= 2.7.15~rc1-1) but 2.7.17-1~18.04ubuntu1.6 is to be installed
E: Unable to correct problems, you have held broken packages.

则执行下面的安装命令:

sudo apt-get install aptitude

sudo aptitude install python2.7

其他辅助命令:查看进程的绝对路径

ll /proc/pid

sudo aptitude install gcc    输入 n y y 

sudo apt-get install g++

sudo apt-get install python2.7-dev

sudo apt-get install texinfo

wget http://ftp.gnu.org/gnu/gdb/gdb-8.2.tar.gz

tar zxf gdb-8.2.tar.gz

sudo aptitude install make

gdb-8.2$ ./configure --with-python='/usr/bin/python2.7'

3、安装Android Studio

安装sdk ndk avd

设置$PATH

a@sys:~$ cat ~/.bashrc

export PATH=~/Android/Sdk/platform-tools:~/Android/Sdk/emulator:$PATH

开启虚拟机CPU VT虚拟化,并赋予kvm权限:

sudo chown a -R /dev/kvm

4、下载安卓内核源代码

repo init --depth=1 -u https://android.googlesource.com/kernel/manifest -b q-goldfish-android-goldfish-4.14-dev

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐