Skip to content

Instantly share code, notes, and snippets.

@refabr1k
Last active July 5, 2023 14:21
Show Gist options
  • Save refabr1k/5d0b95aa7334b6b408134d89e9f2f879 to your computer and use it in GitHub Desktop.
Save refabr1k/5d0b95aa7334b6b408134d89e9f2f879 to your computer and use it in GitHub Desktop.
ippsec guide to genymotion (windows edition)

video: https://www.youtube.com/watch?v=xp8ufidc514

Genymotion cannot start android emulator - shows the error "The VirtualBox DHCP server has not assigned an IP address to the virtual device"

Workaround:

  • on your virtualbox, select and start the created android emulator vm

  • observe the console output should be "IP Management : 192.168.56.x". If there is no IP or wrong IP address range, you need to start your DHCP server or ensure the VM settings > Network is using the right Host-Only network adapter

  • Virtualbox network properties > Host-only Networks > Create > take note of the network adapter name e.g "VirtualBox Host-Only Ethernet Adapter #2"

(Manual) Adapter
ipv4: 192.168.56.1
mask: 255.255.255.0

DHCP Server
check > Enable Server
addr: 192.168.56.100
mask: 255.255.255.0
low: 192.168.56.101
high: 192.168.56.254
  • your android emulator vm settings > Network > Adapter 1 > set your Host-only Adapter to the your network adapter with DHCP server e.g. "VirtualBox Host-Only Ethernet Adapter #2"

  • Now start the VM manually (not from genymotion)

  • observe the console output is now "IP Management : 192.168.56.x". And your should see "Running second stage..."

  • Now, click "Start" icon in genymotion, your android emulator should now run.


preparing burp CA Cert

start burp

navigate to http://localhost:8080/cert and save cert as cert.der

# below was done using 'openssl' on windows WSL ubuntu

# convert cert from der to pem
openssl x509 -inform der -in cert.der -out burp.pem

# check the md5 hash id of pem cert (gonna use the string to rename the file)
openssl x509 -inform PEM -subject_hash_old -in burp.pem
#9a5ba575
#----BEGIN CERTIFICATE-----
#IIDqDCCApCgAwIB
#

# rename the file with trailing '.0' 
mv burp.pem 9a5ba575.0

# check cert has 'PortSwigger'
openssl x509 -inform PEM -subject -in 9a5ba575.0

installing burp cert to genymotion android

start genymotion

# on windows terminal
adb devices -l

adb shell

# on android shell
su

# modify android to allow read,write so you can write the burp certificate into device
mount -o remount,rw /

exit

exit

# push cert to android device
adb push 9a5ba575.0 /system/etc/security/cacerts

# check cert is installed on android emulator
Settings > Security > Encryption > Trusted Credentials > observe that PortSwigger cert is in

# to set proxy (intercept traffic with burp)
adb shell settings put global http_proxy 192.168.50.111:8080
# to unset proxy 
adb shell settings put global http_proxy :0

installing apps

emulator right side menu > Open GAPPS icon to install google apps

https://frida.re/docs/android/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment