Skip to content

Instantly share code, notes, and snippets.

@misterch0c
Created April 22, 2016 09:25
Show Gist options
  • Save misterch0c/a292664343d43d3b1cf74ed989cd1c48 to your computer and use it in GitHub Desktop.
Save misterch0c/a292664343d43d3b1cf74ed989cd1c48 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Use the extractor to recover only the filesystem, no kernel (-nk), no parallel operation (-np), populating the image table in the SQL server at 127.0.0.1 (-sql) with the Netgear brand (-b), and storing the tarball in images.
sources/extractor/extractor.py -b Netgear -sql 127.0.0.1 -np -nk "WNAP320 Firmware Version 2.0.3.zip" images
#Identify the architecture of firmware 1 and store the result in the image table of the database.
scripts/getArch.sh images/1.tar.gz
#Load the contents of the filesystem for firmware 1 into the database, populating the object and object_to_image tables.
scripts/tar2db.py -i 1 -f images/1.tar.gz
#Create the QEMU disk image for firmware 1
scripts/makeImage.sh 1
#Infer the network configuration for firmware 1. Kernel messages are logged to ./scratch/1/qemu.initial.serial.log.
scripts/inferNetwork.sh 1
#Emulate firmware 1 with the inferred network configuration. This will modify the configuration of the host system by creating a TAP device and adding a route.
scratch/1/run.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment