How to Hack Android Devices Using Metasploit
I'm going to be using Sana (Kali 2.0) for this tutorial, but you're welcome to use any distro you want as long as it can run Metasploit.
This is very easy to do - simply follow the below steps and you should be good to go.
Part 1: Generating The Payload
To generate the payload, open up a terminal and type in the following commands:
Here, android/meterpreter/reverse_tcp is the name of the payload we're going to be using. LHOST is the IP address to which the client is going to connect (your IP address). To find it, open up a new terminal and type in ifconfig. Your IP address will be where I've highlighted the text:
That's going to open up the Metasploit console.
Now we want to use a payload handler for handling our reverse TCP connection. For this, type the following in the Metasploit terminal:
You should now have a prompt which says exploit(handler). Awesome, now let's set the options. To do that, enter the following commands:
Replace the required info with yours in the above commands.
Now type the following command and verify all the options:
This is what my configuration looks like:
If you're certain all the options are valid, enter the following command to start the handler (listening):
As soon as the device executes the payload (opens the app), your Meterpreter terminal should say "Meterpreter session one opened" or something of that sort.
This means you have successfully gained access to the device.
To view the list of available commands, just put a question mark (?) and hit ENTER.
To use a command, simply type the name of the command and hit ENTER. If it requires any parameters, it will mention that.
Some useful commands:
To stream video from the device's camera live, use the following command:
To download/upload files from/to the device:
Over The Internet
In the above case, everything was attempted on a local network.
In case you wish to do this over the internet, follow the same steps. Instead of using ifconfig, use the following command:
You would also need to enable port forwarding on your router for it to work over the internet.