Git Product home page Git Product logo

Comments (4)

extremecoders-re avatar extremecoders-re commented on August 16, 2024 1

@yhsnihao Just tested on a Ubuntu 20.04 VM. It's working fine and also accessible from the browser.

image

image
Tunneled with localhost.run.

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.

extremecoders-re avatar extremecoders-re commented on August 16, 2024 1

@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.

yhsnihao avatar yhsnihao commented on August 16, 2024 1

@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.

jheysel-r7 avatar jheysel-r7 commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.