rapid7/metasploit-framework — pull request #3934 by jvennix-r7 (2014-10-02 04:39:37+00:00)
Title: Adds a :vuln_test option to BES, use it in the Android Webview Exploit

This attempts to add the :vuln_test functionality from BAP to the BES mixin. I've also added a :vuln_test_error key that allows printing a custom error message when the check fails.

##### Verification
- [ ] get a shell with `exploit/android/browser/webview_addjavascriptinterface` on an affected version
- [ ] browse to the exploit on a non-vulnerable version (Stock browser on anything 4.2 and up will work)
- [ ] you should get two errors in msfconsole:

[!] 192.168.0.4 webview_addjavascriptinterface - Exploit re
quirement(s) not met: vuln_test. For more info: http://r-7.co/PV
bcgx
[!] 192.168.0.4 webview_addjavascriptinterface - No vulnera
ble Java objects were found in this web context.

- [ ] ensure you can get a shell with any other BES module (to ensure the absence of :vuln_test in BrowserRequirements does not cause the exploit to fail)