Open DemanNL opened 4 years ago
Thanks for sharing and apologies for the late response @HiddeSmit.
Routing the traffic via /etc/hosts and DNS is of course also one way and thanks for describing the steps in detail.
You could add the /etc/hosts as a seperate section after bettercap (https://github.com/OWASP/owasp-mstg/blob/master/Document/0x05b-Basic-Security_Testing.md#bettercap) and include the DNS spoofing to bettercap. Do you want to raise a PR for it?
The MSTG currently deals with non-proxy aware apps using one of the two methods:
I performed a pentest using DNS hosts file method explained below. The root free version related to DNS is DNS spoofing. Let me know what you think about this potential addition to the MSTG.
Test setup: Tested on Genymotion Android 8.0 - API 26 -- Applied Genymotion ARM Translation for 8.0 App tested: ORTEC Employee Self Service (Xamarin, no certificate pinning, root cert accepted)
Description hosts file method: Add root Burp CA (see MSTG) Genymotion: Network mode NAT
Set-up a Burp listener:
Run TCPdump to discover the outgoing DNS requests:
Edit /etc/hosts using adb shell:
To test the set-up, start for example the ORTEC ESS app and fill in the domain example.com. You should now be able to intercept all the domains you added to the hosts file.
Description DNS spoofing method: For some reason Bettercap DNS spoofing doesn't really work to well for me. But here is how it can be done.
Genymotion: Network mode Bridged (eth0 for example) Android Wi-Fi settings: set gateway to the Burp listener IP. (unsure about this, Bettercap seems to work randomly with and without a static gateway)
Set-up a Burp listener:
Run TCPdump to discover the outgoing DNS requests:
Start bettercap and execute the following one-liner:
Start the ORTEC ESS app and fill in the domain example.com. You should be able to intercept the request!