i Create debug environment for ARM architecture on Intel processor – All things in moderation

Create debug environment for ARM architecture on Intel processor

To create the ARM environment on Intel physical processor, I need use tools:
* pwndbg: s a GDB plug-in that makes debugging with GDB suck less, with a focus on features needed by low-level software developers, hardware hackers, reverse-engineers and exploit developers.
* pwntools: Pwntools is a CTF framework and exploit development library. Written in Python, it is designed for rapid prototyping and development, and intended to make exploit writing as simple as possible.
* QEMU: is a generic and open source machine emulator and virtualizer.

1. Setup environment:

Setup pwndbg

$ mkdir ~/setup
$ cd ~/setup
$ git clone https://github.com/pwndbg/pwndbg
$ cd pwndbg
$ ./setup.sh

Install pwntools

$ sudo pip install pwntools

Install qemu

$ sudo apt-get install qemu -y
$ sudo apt-get install qemu-user-static -y

Setup ARM lib:

$ sudo apt-get install gcc-arm-linux-gnueabihf -y
$ sudo apt-get install gdb-multiarch -y

Make symbolic links

$ sudo ln -s /usr/arm-linux-gnueabihf/lib/libc-2.23.so /lib/libc.so.6
$ sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3

2. Testing environmet:

Complete program on ARM architecture:

$ arm-linux-gnueabihf-gcc test.c -o test

File after compilation

In the first terminal, we run qemu-arm-static with information about a port to listen and program.

$ qemu-arm-static -g 1234 ./test

In the second terminal, we run debugger and configure this.

$ gdb-multiarch
pwndbg> set architecture arm
pwndbg> target remote localhost:1234

The results we achieve:

CONCLUSION:

I installed successfully on ubuntu 18.04. Depending on the operating system version, there will be a change in the installation instructions. If you need help, please leave a comment below. Thanks!

Leave a Reply