- Metasploitable 2: Lab Setup
- Setting our environment
- Hypervisor
- Kali Linux
- Update
- Metasploitable
- Virtualbox (optional)
- Network
- Worspace settings
- Kali Linux & Metasploit: Getting Started with Pen Testing
- In this blog we will take a look at two of the most popular tools in penetration testing — Kali Linux & The Metasploit Framework.
- Learning Goals
- Introduction to Kali Linux
- Metasploit Framework
- Exploit
- Payload
- Environment Setup
- Virtualbox
- Kali Linux
- Metasploitable 2
- Metasploitable Installation
- Metasploitable2 и VirtualBox для Кали Линукс
- Metasploitable2 и VirtualBox для Кали Линукс: ставим Metasploitable2
- Metasploitable2 и VirtualBox для Кали Линукс: настройка Metasploitable2
- Metasploitable2 и VirtualBox для Кали Линукс: ставим виртуальную машину
- Metasploitable 2 Installing on Kali Linux
Metasploitable 2: Lab Setup
Metasploitable 2 is a vulnerable server created for pentesting training. In this suite of articles I’ll guide you through the vulnerabilities and exploit them with the metasploit framework and other tools.
Setting our environment
Our environment will be composed of several virtual machines. Our first task is making sure out host machine is capable of running multiple guest OSes.
Hypervisor
There are several hypervisers available (VMWare, Virtualbox, Hyper-V, etc). I’m currently running Virtualbox but feel free to chose your own.
Kali Linux
It’s possible to download and install Kali Linux from the project’s site. I advise to download a preconfigured ISO from Offensive Security (https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/).
Update
Kali has lots of tools for pentesting. It’s paramount to keep them updated. Open the terminal and type:
$ apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove -y
Metasploitable
The metasploitable ISO is availble in Rapid 7’s site or on Sourceforge (http://sourceforge.net/projects/metasploitable/files/Metasploitable2/). The ISO is VMWare format.
Virtualbox (optional)
Unzip the file. Create a new VM. Choose Linux->Ubuntu (64bit), give it at least at least 1024MB RAM and do not create a HDD. Wait and add the disk *.vmdk:
Change the network configuration:
Network
Start the machine and determine its IP address:
Lets now start our pentest.
Worspace settings
Now open the terminal and prepare the DB:
Lets check for DB status, create our workspace and set our global RHOSTS:
> workspace -a metaploitable2
> setg RHOSTS 192.168.231.109
Finnaly, we’ll check for open ports in metasploitable. We know it’s a vulnerable machine so let’s expand our port scan:
Источник
Kali Linux & Metasploit: Getting Started with Pen Testing
In this blog we will take a look at two of the most popular tools in penetration testing — Kali Linux & The Metasploit Framework.
Learning Goals
- Understand why and how Kali Linux is used
- Learn the common commands and features of the Metasploit Framework
- Build a testing environment with Kali Linux and Metasploitable 2
- Complete an example attack with Metasploit
Reminder: Attacking systems you do not have permission to attack is illegal. Only perform attacks on machines and networks you own or have permission for.
Introduction to Kali Linux
The field of cybersecurity has an abundance of tools for all sorts of tasks. One way to cut right to the most common tools is using Kali Linux. Kali Linux is a Linux based operating system with preinstalled security tools for penetration testing. Kali Linux is created an maintained by Offensive Security who focus on advancing security through tools and education. For our purposes we will use a virtual machine so that we can have multiple machines running at the same time.
Metasploit Framework
The Metasploit Framework is an open source penetration testing and development platform that provides exploits for a variety of applications, operating systems and platforms. Metasploit is one of the most commonly used penetration testing tools and comes built-in to Kali Linux.
The main components of the Metasploit Framework are called modules. Modules are standalone pieces of code or software that provide functionality to Metasploit. There are six total modules: exploits, payloads, auxiliary, nops, posts, and encoders. We will just focus on exploits and payloads.
Exploit
An exploit takes advantage of a system’s vulnerability and installs a payload.
Payload
The payload gives access to the system by a variety of methods (reverse shell, meterpreter etc.)
We will us both of these to gain access to the victim machine in the exercise detailed later.
Environment Setup
Virtualbox
Virtualbox is an operating system emulation software that gives us the ability to run additional systems from our local machine.
Kali Linux
Kali Linux will be our local machine where we can run our attacks from. Since we will need both Kali and the Metasploitable vulnerable machine running we will use Virtualbox to emulate both environments. To login to Kali: username is root & password is toor.
Metasploitable 2
Metasploitable 2 is designed to be vulnerable in order to work as a sandbox to learn security. This will provide us with a system to attack legally. Most of the vulnerabilities on Metasploitable are known so there are tons of resources available to help learn various attack types.
Metasploit is a framework within Kali to run attacks on other systems. Metasploitable is a vulnerable system that can be used as a target for attacks and security testing.
Metasploitable Installation
The pictures below show the settings to setup a new virtual machine for Metasploitable.
Metasploitable shouldn’t need more than 256MB of ram but you can add more if your system can handle it.
Instead of creating a new hard disk the Metasploitable machine we downloaded will act as our existing virtual hard disk.
We do not want the Metasploitable machine on our actual network, so configure the settings for that machine as below. Make sure the Kali machine is also on the Host-Only Adapter. (Settings or tabs not shown in the pictures below were left as default)
Источник
Metasploitable2 и VirtualBox для Кали Линукс
Metasploitable2 и VirtualBox для Кали Линукс: подготовка к тестированию.
Всем привет, и сегодня мы устанавливаем и настраиваем на нашей Кали Линукс метасплойт с виртуальной машиной VirtualBox. Кто забрёл сюда случайно, напомню, что Metasploitable на сегодняшний день, пожалуй, самый популярный инструмент тестирования на проникновение. Собственно, это его прямое назначение — разработка и применение эксплойтов против удалённых компьютеров. Будем использовать его бесплатную версию (community version); в платной, конечно, возможности поинтереснее. От себя добавлю, что именно эта связка является тренировочной базой, позволяя администратору безболезненно и не нарушая закона проводить тестирование машин на уязвимость и является предтечей всем приёмов по выявлению дыр в безопасности систем. Хотите научиться стрелять — вам понадобится винтовка, хотите взломать сайт — ну… вы меня поняли.
У Метасплойта есть версия с графическим интерфейсом, более дружелюбным. Так, имеющаяся в сборке Кали Armitage является неплохим графическим инструментом управления атакой на удалённый хост, придавая цели чёткие очертания и даёт советы по использованию наиболее подходящих способов применения эксплойта.
Здесь и далее мы будем использовать установленную в Кали Линукс рабочую среду Metasploit Framework и последовательно установим Metasploitable2 и VirtualBox.
Metasploitable2 и VirtualBox для Кали Линукс: ставим Metasploitable2
- У меня установлена последняя на этот момент версия Кали 2016.2. Если у вас нет, настоятельно советую обновиться. А мне же нужно просто нажать по значку Metasploit Framework для запуска службы. Если вы делаете это впервые, подождите немного, пока сформируется база данных.
- Если же вы настраиваете машину в предыдущих версиях Кали, для запуска Metasploit Framework вам просто нужно набрать в терминале последовательно три следующих команды:
Теперь командой тут же
проверим связь с базой данных:
Всё просто, как видите. Остались финишные штрихи. Этими командами вы заставите Кали запускать нужные вам сервисы автоматически вместе с загрузкой системы:
Metasploitable2 и VirtualBox для Кали Линукс: настройка Metasploitable2
Надеюсь, на жёстком диске место найдётся. Как я говорил в статье установки, Вам понадобится не менее 10-15 Гбайт свободного пространства винчестера, чтобы запускать Кали и виртуальную машину на одном хосте. Плюс к тому побольше оперативной памяти с неплохим процессором. Так или иначе, оба условия часто являются камнем преткновения для тестеров, кто предпочитает работать с Кали Линукс на виртуальной машине. Так что ваш покорный слуга советует вам установить Кали Линукс в чистом виде.
Приступаем к установке. Вот ссылка для скачивания Metasploitable2:
Придётся чуть подождать, к вам «приедет» файл весом почти 1 Гбайт. После закачки распакуйте в любую папку (я оставил в папке по умолчанию — Загрузки — после распаковки файлы весят ещё больше). На этом пока всё — там их распакованными и оставьте.
Metasploitable2 и VirtualBox для Кали Линукс: ставим виртуальную машину
ВНИМАНИЕ! От версии к версии принципы установки и условия подгрузки из репозиториев сторонних программ могут меняться. На момент написания статьи описанные методы рабочие. Если с течением времени что-то изменилось — в том моей вины нет. Вопросы — в комменты.
Вариантов установки несколько, но текущая сборка Кали позволяла скачать VirtualBox прямо из существующего списка репозиториев. А значит в терминале так и попробуем набрать:
Однако, если у вас возникли проблемы со скачиванием уже на этом этапе, переходите на страницу Index of /virtualbox, где можете найти последнюю версию:
Переходим по ссылке и на следующей странице находим уже версию под стать разрядности вашей Кали. У меня 64-х битная Кали, а значит…
копируем адрес ссылки с содержанием Debian и окончанием .deb и, открыв терминал, вводим команду в виде:
у меня получилось так (для Intel процессора):
Ждём окончания скачивания, «палим» место сохранения файла и заканчиваем установку:
Можно запускать. После установки запускаем виртуальную машину:
Но мне повезло, и в панели задач слева появился значок быстрого запуска:
Нас встретит дружелюбное (на русском) окно с привычным пользователям Windows интерфейсом, где мы должны создать новую виртуальную машину с условием Использовать существующий виртуальный жёсткий диск. Настройки вы вольны выбрать на усмотрение, но не жадничайте. Щёлкнув по значку жёлтой с зелёной стрелочкой справа от целевой строки, укажите место расположения недавно скачанной и разархивированной папки (у меня, напомню, в Загрузках) с Metasploitable2. Нам нужен файл Metasploitable.vmdk.
Готово. Запускайте машину. Вводите последовательно логин и пароль, что предложены тут же, последней строкой (они одинаковы: это msfadmin, однако пароль, как обычно, отображаться не будет.
Источник
Metasploitable 2 Installing on Kali Linux
Metasploitable is a virtual machine image that is intentionally vulnerable and created for cybersecurity students to learn ethical hacking on own environment.
Metasploitable2 is a second version of Metasploitable and it is very good and safe to use and learn penetration testing. Attacking others system with out proper permission will be illegal, and they won’t give permission to hack their system to new learners.
Metasploitable2 is a OS disk image file that can be run from VMware/VirtualBox. So first we need to have a virtualization software like VMware or VirtualBox. Lets install KVM (Kernel Virtual Machine) in our Kali Linux system by using following command:
Now this will take some time so, we are going for a coffee 🍵. This also requires a reboot to finish the installation. If this installation process got any error for dependencies then we need to install dependencies manually or our comment box is opened for solutions.
After installing this we can run KVM by using following command:
After running this command our virtual machine manager box will opened as the following screenshot:
KVM main menu |
Now we can add ISO images here. But we need to download the Metasploitable2 ISO image. We can download it from sourceforge.
It is a quite big image file with 865MB in size. Downloading this depends on internet speed. After download we can extract the zip file as we did it in the following screenshot:
Our required file is highlited |
After downloading this we can can add this on our KVM. On the KVM main menu we need to click on the ➕ icon to create a new virtual machine, and choose «import existing disk image» as we did in the following screenshot:
Now we click on forward option, and we got a window like following:
Now we move forward and KVM will ask us for RAM and CPU. The Default will be 1024 MB(1GB) RAM and 1 CPU. We will go with the default. Metasploitable2 can be run easily on 512 MB RAM.
YOO, our Metasploitable2 system will start on KVM and run all the services inside it. As we can see in the following screenshot:
After finishing the set up in some seconds it will ask for login. The default username and password will be msfadmin . After a sucessful login we can see the command line interface of metasploitable as following screenshot:
Now we check the IP address of the Metasploitable2 machine by using following command:
The output on the metasploitable machine is following:
Now in the above screenshot we can see that our Metasploitable2 machine’s Ip address is 192.168.122.118. This may be diffrent for everyone becase our local network assign this IP address.
We can open this IP address on our browser.
Now we can practice our penetration testing skills on this machine. We can find vulnerabilities on this machine and exploit it.
For an example we just did a nmap scan to find open ports, and we found a lots of vulnerable ports.
We just need to find the way to exploit these vulnerabilities. We can use msfconsole or Google to find and exploit them.
This was about how we can install Metasploitable2 in our Kali Linux system and how we can practice it. This will improve our skills on cybersecurity.
Liked our tutorial then don’t forgot to follow us on Twitter. For any problem and inquiry please leave a comment on the comment section. We always reply.
Источник