MIPS Qemu环境搭建

First Post:

Last Update:

Word Count:
245

Read Time:
1 min

MIPS 环境搭建

安装 与 配置 Qemu:

1
2
3
4
5
apt-get install qemu 
apt-get install qemu-user-static
apt-get install qemu-system
apt-get install uml-utilities
apt-get install bridge-utils
配置网络
方法一

创建网桥,名字是 virbr0

1
2
sudo brctl added virbr0
sudo ifconfig virbr0 192.168.122.1/24 up

创建 tap 接口,名字为 tap0,并添加到网桥

1
2
3
sudo tunctl -t tap0
sudo ifconfig tap0 192.168.122.11/24 up
sudo brctl addif virbr0 tap0

然后运行

1
sudo qemu-system-mips -M malta -kernel mips_vmlinux-3.2.0-4-4kc-malta -hda debian_wheezy_mips_standard.qcow2 -append "root=/dev/sda1 console=tty0" -netdev tap,id=tapnet,ifname=tap0,script=no -device rtl8139,netdev=tapnet -nographic

然后在 虚拟机里面设置 ip

1
sudo ifconfig eth0 192.168.122.12/24 up

来源

1
https://blog.csdn.net/RichardYSteven/article/details/54807927

Issue

1
2
3
4
5
6
7
8
9
10
11
12
13
Checksec file: uhttpd
[!] Could not populate MIPS GOT: seek out of range
[!] Did not find any GOT entries
[*] '/run/media/i0gan/disk1/share/route_pwn/run/uhttpd'
Arch: mips-32-little
RELRO: Partial RELRO
Stack: No canary found
NX: NX enabled
PIE: No PIE (0x400000)
RWX: Has RWX segments

$ qemu-mips uhttpd
qemu-mips: uhttpd: Invalid ELF image for this architecture

Anwser:

It seems your binaries are little-endian, so you neeed qemu-mipsel.

ref: https://xz.aliyun.com/t/1508

打赏点小钱
支付宝 | Alipay
微信 | WeChat