Comments (4)
@yhsnihao Just tested on a Ubuntu 20.04 VM. It's working fine and also accessible from the browser.
Contents of run.sh
#!/bin/bash
set -u
ARCHEND=mipsel
IID=2
if [ -e ./firmadyne.config ]; then
source ./firmadyne.config
elif [ -e ../firmadyne.config ]; then
source ../firmadyne.config
elif [ -e ../../firmadyne.config ]; then
source ../../firmadyne.config
else
echo "Error: Could not find 'firmadyne.config'!"
exit 1
fi
IMAGE=`get_fs ${IID}`
KERNEL=`get_kernel ${ARCHEND}`
QEMU=`get_qemu ${ARCHEND}`
QEMU_MACHINE=`get_qemu_machine ${ARCHEND}`
QEMU_ROOTFS=`get_qemu_disk ${ARCHEND}`
WORK_DIR=`get_scratch ${IID}`
TAPDEV_0=tap${IID}_0
HOSTNETDEV_0=${TAPDEV_0}
echo "Creating TAP device ${TAPDEV_0}..."
sudo tunctl -t ${TAPDEV_0} -u ${USER}
echo "Bringing up TAP device..."
sudo ip link set ${HOSTNETDEV_0} up
sudo ip addr add 192.168.31.2/24 dev ${HOSTNETDEV_0}
echo "Adding route to 192.168.31.1..."
sudo ip route add 192.168.31.1 via 192.168.31.1 dev ${HOSTNETDEV_0}
function cleanup {
pkill -P $$
echo "Deleting route..."
sudo ip route flush dev ${HOSTNETDEV_0}
echo "Bringing down TAP device..."
sudo ip link set ${TAPDEV_0} down
echo "Deleting TAP device ${TAPDEV_0}..."
sudo tunctl -d ${TAPDEV_0}
}
trap cleanup EXIT
echo "Starting firmware emulation... use Ctrl-a + x to exit"
sleep 1s
${QEMU} -m 256 -M ${QEMU_MACHINE} -kernel ${KERNEL} \
-drive if=ide,format=raw,file=${IMAGE} -append "root=${QEMU_ROOTFS} console=ttyS0 nandsim.parts=64,64,64,64,64,64,64,64,64,64 rdinit=/firmadyne/preInit.sh rw debug ignore_loglevel print-fatal-signals=1 user_debug=31 firmadyne.syscall=0" \
-nographic \
-netdev tap,id=nettap0,ifname=${TAPDEV_0},script=no -device e1000,netdev=nettap0 -netdev socket,id=net1,listen=:2001 -device e1000,netdev=net1 -netdev socket,id=net2,listen=:2002 -device e1000,netdev=net2 -netdev socket,id=net3,listen=:2003 -device e1000,netdev=net3 | tee ${WORK_DIR}/qemu.final.serial.log
from firmware-analysis-toolkit.
@jheysel-r7 Unfortunately the firmware VMG1312-T20B doesn't seem to be properly emulating. I would suggest to try qemu user mode emulation and run the /bin/zhttpd
binary.
$ sudo chroot . ./qemu-mips-static -E LD_LIBRARY_PATH=/lib/private/ ./bin/zhttpd
Initial http with port(80), SSL disable.
2023-01-04 14:29:46 zhttpd<47922>, zcfg_msg.c:798, zcfg_msg_sendAndGetReply(), ERROR: fail to bind address. errno = 2, No such file or directory
2023-01-04 14:29:46 zhttpd<47922>, zcfg_msg.c:592, zcfg_msg_serverInit(), ERROR: bind message socket error. errno = 2, No such file or directory
http daemon exit....
It exits on startup and you can research more on this.
from firmware-analysis-toolkit.
@extremecoders-re Thank you.
I build a clean Ubuntu 22.04 VM,It worked!
But there's something wrong on Ubuntu 20.04.
I think I may need more research.
from firmware-analysis-toolkit.
I'm facing the same issue trying to run the following firmware: VMG1312-T20B
[+] Setting up the network connection, please standby...
[+] Network interfaces: []
[+] All set! Press ENTER to run the firmware...
I also tried increasing the timeout in inferNetwork.sh
which didn't work for me either.
from firmware-analysis-toolkit.
Related Issues (20)
- The browser page appears blank HOT 2
- Location of dependency file has changed breaking setup script. HOT 1
- setup.sh fails on fresh kali install due to lsb-core package missing on OS HOT 4
- Can't install FAT HOT 2
- no route to host HOT 2
- setup.sh: Consider not patching firmadyne to change interpreter which is standard already HOT 2
- Upstream - Firmadyne: 'warning: fgrep is obsolescent; using grep -F' HOT 2
- WARNING: Could not open /proc/net/vlan/config. Maybe you need to load the 8021q module, or maybe you are not using PROCFS?? HOT 6
- [ 210.320000] firmadyne: ioctl: 0x4 HOT 2
- Mounting var to jffs2. [FAILED] HOT 1
- fat.py and permission error HOT 4
- Error while extracting RAX30 firmware HOT 12
- EXT2-fs error (device sda1) HOT 2
- did not get past idenitifying architecture
- error while boot with a new kernel file
- ./setup.sh failed to execute HOT 2
- /etc/rc.common: eval: 1: cannot create /proc/sys/kernel/hostname: Directory nonexistent
- [help wanted] Cant ping from the Emulated to client HOT 3
- No IP show while emulating Tp-Link Archer AX50 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firmware-analysis-toolkit.