We need to use VirtualBox docker-machine image instead of desktop Docker client to forward USB device and attach to mobile process inside container (rephrase).
-
Install VirtualBox >= 6.20
-
Collect and install VirtualBox Extension Pack for your VirtualBox version, we need it for USB 2.0 support: https://download.virtualbox.org/virtualbox/6.0.20 (just change 6.0.20 in url to your version to catch a correct one).
-
Install docker-machine
Command:
brew install docker-machine
- Generate docker VM
Command:
docker-machine create -d virtualbox default
- Now you need to stop docker machine to enable correct USB settings
Command:
docker-machine stop
- Enable USB 2.0
Command:
vboxmanage modifyvm default --usbehci on
- Start docker-machine
Command: docker-machine start
- Find ProductID and VendorID for your device
Command:
vboxmanage list usbhost
- Add your device using ProductID and VendorID from previous step
Command:
vboxmanage usbfilter add 0 --target default --name 'Nexus' --vendorid YOUR_vendorid --productid YOUR_productid
- You can also do it through VirtualBox GUI on USB settings tab.
- Enable docker environment:
Command:
eval "$(docker-machine env default)"
- Your VirtualBox image name might be different from "default" if you changed it on step 4.
- Pull the image
Command:
docker pull hd421/memoeb:tmp
If you are already configured docker-machine (as described in previous section). Each time you restart docker-machine there is one command to be used:
docker-machine start
eval "$(docker-machine env default)"
Command:
docker run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb --device=/dev/bus/usb:/dev/bus/usb:rwm CONTAINER_ID_HERE
Command:
docker run --rm -it --privileged -v /dev/bus/usb:/dev/bus/usb --device=/dev/ttyUSB0 CONTAINER_ID_HERE
Commands:
lsusb
(check that you see your attached device)
usbmuxd -f --verbose &
(press "Trust" on your phone)
frida-ps -Uai
(make sure you see your apps list)
source /usr/local/rvm/scripts/rvm
(enable RVM)
Inside /home/memoeb_v2:
ruby app.rb 'AppName' -d
(start dynamic analysis)
Commands:
lsusb
(check that you see your attached device)
adb devices
(Make sure ADB is enabled in device settings and press "Allow USB debugging")
frida-ps -Uai
(make sure frida-server is running on your device)
source /usr/local/rvm/scripts/rvm
(enable RVM)
Inside /home/memoeb_v2:
ruby app.rb 'bundle.id.here' -d
(start dynamic analysis)
- Linux initial set-up walkthrough
- Tool usage examples
- Conference links
- List of installed components inside container