타이거팀 (번역 아티클)

윈도10에서 Metasploitable 3 세팅하기 본문

테크아티클번역

윈도10에서 Metasploitable 3 세팅하기

타이거팀 2017. 11. 14. 17:41



기사 원문: https://linuxsproutes.com/setup-metasploitable-3-windows-10/

 

How to setup Metasploitable 3 on Windows 10

- 윈도10에서 Metasploitable 3 세팅하기 





In this tutorial we will demonstrate how to install Metasploitable 3 in a Windows 10 environment using Vagrant, Packer and Virtualbox. 


이 튜토리얼은 Vagrant, Packer및 Virtualbox를 사용하여 Windows 10 환경 에서 Metasploitable 3 운영체제를 설치하는 방법에 대한 것입니다. 



So far we did a number of tutorials on hacking the Metasploitable 2 Linux machine on Hacking Tutorials. 

We’ve demonstrated how to install Metasploitable 2, how to enumerate it and perform a vulnerability assessment, and finally how to exploit it. 


As like many vulnerable machines that are for download Metasploitable 2 is a Linux machine. 


Metasploitable 2의 설치 및 취약점 평가를 수행하는 방법을 시연했습니다. 


지금까지 우리는 여러 개의 튜토리얼을 만들었는데, 그중 하나는 Metasploitable 2 리눅스 머신 해킹등등이고. 어떻게 해당 환경에 모의침투를 수행하는가에 대한 것까지입니다. 

Metasploitable2 처럼 취약하게 만든 Linux시스템들도 있구요.




Because of strict licensing policies it a challenge to provide vulnerable Windows machines without breaking any licensing rules. 


Unfortunately you cannot just download the VM but you have to configure it yourself using a few tools and a Windows 2008 evaluation copy which is downloaded from the Microsoft website.



엄격한 라이센스 정책 때문에 정품 라이센스를 위반하지 않고서 취약하게 만든 윈도 머신을 제공하는건 하는 건 사실 어려울 수 있습니다. 안타깝게도 vagrant까지 전체 구성이 끝난 VM웨어 이미지를 다운로드하도록 해줄순 없겠지만,  Microsoft 웹사이트에서  윈도 서버 2008 평가판과 몇가지 도구를 받아서 직접 구성하는 방법을알려드리는건 가능합니다.

 


The installation process is pretty straightforward and should not cause too much trouble when the right dependencies are installed. 


The biggest part of the installation process is handled automatically by the install scripts.


 The full installation procedure might take a couple hours in total, be prepared to spend time on the installation of Metasploitable 3.


설치 프로세스는 매우 간단하며 올바른 종속 파일들 (dependencies )을 설치할 때 트러블를 많이 일으키지 않아야 합니다.  설치 프로세스의 가장 큰 부분은 설치 스크립트에 의해 거의 자동으로 처리됩니다.


전체적인 설치 절차는 오랜 시간이 걸릴 수 있으며, 여러분이 Metasploitable 3를 설치하는 데 많은 시간을 할애할 준비는 되어있어야합니다. 



Before we can continue with the installation procedure we need to install a few dependencies:


설치 절차를 계속하려면 먼저 아래의 몇가지 종속 파일들을 준비해서 설치해야 합니다.




- Packer v1.0.0: https://www.packer.io/downloads.html


- Vagrant 1.9.1: https://releases.hashicorp.com/vagrant/1.9.1/


- Vagrant Reload Plugin v0.0.1: https://github.com/aidanns/vagrant-reload


- Virtualbox 5.1.14: https://www.virtualbox.org/wiki/Downloads







In order to avoid (a lot of) trouble it is recommended to download the exact version as mentioned above. 


The success rate of the installation script depends greatly on the build environment. 


For your reference, we’re building the Metasploitable 3 machine on Windows 10 Enterprise x64 Build 15063.




위에 언급한 정확한 버전을 그대로 다운로드하는 것이 트러블을 거의 일으키지않습니다. 


설치 스크립트의 성공률도 개발을 하는 여러분들의 빌드 환경에 크게 좌우됩니다. 


참고로 말하자면  Windows 10 Enterprise X64 Build 15063 환경에서 Metasploitable 3를 구축중입니다.  





Before we can build the VM we have to install Vagrant and Virtualbox using the downloaded installation files. 


We will not demonstrate the installation procedure for this software as it’s very straightforward and only involves clicking ‘next’ a couple times. 


Next we need to install the Vagrant reload plugin and we need to download Packer


 

VM 가상머신 형태로 구축하려면 다운로드된 종속 설치 파일을 사용하여 Vagrant 및 Virtualbox를 먼저 설치해야 합니다. 예전 Metasploitable 2에 없던 Vagrant같은 방식을 더 요구하는게 조금 까다로워졌네요  


이 소프트웨어의 설치 절차는 매우 간단하여 여러번 '다음' 버튼을 눌러 넘어가게만 하면 됩니다. 


다음으로는 Vagrant reload 플러그 인을 설치해야 하며, Packer도 다운로드해야 합니다.




 



Install Vagrant reload plugin

Vagrant reload 플러그 인 설치



Change the directory on the command line to the directory where you have downloaded and unpacked the Vagrant Reload plugin. Then run the following command to install the plugin: 

 

 vagrant plugin install vagrant-reload

 

 

<Vagrant plugin vagrant-reload successfully installed.>

 

 

Now that we have installed the Vagrant reload plugin we can continue with downloading Packer.


커맨드라인에서 디렉터리를 변경하여 Vagrant reload 플러그 인을 다운로드하고 설치합니다.


Vagrant reload 플러그 인을 설치했으면 Packer 다운로드를 계속합니다. 

 

 




Download Packer

Packer 다운로드하기





The next step is to download Packer from the following download page:


다운로드 페이지에서 Packer를 다운로드하는 것입니다.


 

Download the latest version of Packer and unpack it the Metasploitable 3 master directory. 


Storing the Packer binary in the Metasploitable 3 directory allows us to easily execute it to setup the VM without setting up system variables or using full paths to the binary. 


After copying the Packer file to the Metasploitable 3 directory we can start setting up the virtual machine.



최신 버전의 Packer를 다운로드하여 Metasploitable 3 마스터 디렉터리에 풀어넣습니다. 


Packer binary 파일을 Metasploitable 3 디렉토리에 저장하면 시스템 변수를 설정하거나 전체 경로를 사용하지 않고도 VM 가상머신이미지를 바로 설정할 수 있습니다. 


 




Creating the Metasploitable 3 VM

Metasploitable 3 가상머신만들기 




Now that we have all pre-requisites installed we can use Packer to setup the Virtual Machine in Virtualbox. 


Move the command line to the Metasploitable 3 location and run the following command from an elevated command line:

 

모든 사전 설치파일들이 설치되었으므로 Packer를 사용하여 Virtualbox에서 가상 머신을 설정할 수 있습니다. 


명령줄을 사용하여 다음 명령줄 3개를 이동하고 고급 명령줄에서 다음 명령을 실행하십시오.

 

packer build windows_2008_r2.json


 



<Building the Metasploitable 3 VM will take a while.>





This command will take a while to complete because first it will download a Windows 2008 evaluation copy from the Microsoft website. 



When the download is finished, the script will continue to setup the virtual machine in Virtualbox and install Windows 2008 on the virtual machine. 


The entire process will take anywhere from 30-60 minutes. 


This depends on the configuration of your host machine and the speed of your internet connection. 



When the script is finished the output looks as following:


Metasploitable 3 VM 가상머신을 빌드하는데 시간은 좀 걸립니다. 


Microsoft 웹사이트에서 윈도 2008서버 평가판 다운로드도 해야되고, Virtualbox에서 가상 시스템 만들어서 윈도 2008을 설치작업도 해야하죠


전체 프로세스는 30~60분 정도 소요됩니다. 한국이라면 인터넷속도가 빠르니 다운로드는 후다닥 처리되겠지만, 호스트 시스템의 구성과 인터넷 연결 속도에 따라 달라집니다. 



스크립트가 완료후 다음과 같은 출력이 나옵니다.





<Metasploitable 3 build process finished without errors>





When the script is finished run the following command:


오류없이 Metasploitable 3 빌드가 완료되면 다음 명령을 실행합니다.




 vagrant box add windows_2008_r2_virtualbox.box ?name=metasploitable3



 

<Metasploitable 3 added to the Vagrant environment>

 


Finally we have to run the one more command to have Vagrant execute the scripts that install the vulnerable software on the Windows server 2008 virtual machine. Run the following command and expect to wait another 15-30 minutes until completion:



마지막으로 윈도 서버 2008 가상머신에 취약한 소프트웨어를 설치하는 스크립트를 실행하려면 한번 더 명령을 실행해야 합니다. 



다음 명령을 실행하고 완료될 때까지 15~30분 정도 기다리십시오.


vagrant up


   
This will conclude the installation of Metasploitable 3 and you should be able to start the VM within Virtualbox.



이를 통해 Metasploitable 3을 설치할 수 있으며 Virtualbox 내에서 가상머신을 시작할 수 있습니다.

 


 



Metasploitable 3 installation errors with Vagrant

Vagrant로 생기는 Metasploitable 3 설치에러 



The Metasploitable 3 setup process is a bit tricky and prone to errors related to specific versions of the prerequisites. 


Most errors I faced while writing this tutorial were avoided by using the versions of Vagrant, Packer & Virtualbox mentioned earlier in this tutorial. 


Especially the latest version of Virtualbox resulted in many errors after issuing the vagrant up command.



During the installation of the vulnerable software you might get an error related to the virtual machine state: 


"The guest machine entered an invalid state while waiting for it to boot.”. 




Metasploitabl 3 셋업 프로세스는 까다로운데다 특정 버전의 필수 구성 요소와 관련된 오류가 발생하기 쉽다. 


튜토리얼에서 언급한 Vagrant, Packualbox의 버전을 사용하면 대부분의 오류를 방지할수있지만, 


특히, Virtualbox의 최신 버전은 vagrant up 명령을 실행한 후 많은 에러가 발생하는걸 피할 수 없다. 



취약한 소프트웨어를 설치하는 동안 가상머신의 상태와 관련된 오류가 발생할 수 있다.



"게스트 머신은 부팅하다 잘못된 상태로 전환되는에러가 나기 십상이다" 






When this happens reboot the virtual machine and run the vagrant up command again.


Another error that may occur during the installation of vulnerable software is the following:


"chocolatey is not recognized as an internal or external command”. 



The error didn’t only apply to Chocolatey but also some other scripts. 


To get rid of this error I’ve added the following directory to the Path variable:





이렇게 하면 가상 시스템을 재부팅하고 vagrant up 명령을 또 실행해야된다.




발생하기 쉬운  또 다른 오류중 하나는 "Chocolatey는 내부 또는 외부 명령으로 인식되지 않습니다" 가 있는데,  


이 오류를 제거하기 위해 다음 디렉터리를 path 시스템 변수에 추가했다.



  C:\Users\admin\Desktop\metasploitable-3-master\metasploitable-3-master\scripts\installs\





This will make all the scripts in this directory accessible without using a full path. 



Eventually I had to run the ‘Vagrant up’ command several times before it finished without errors.



이렇게 하면 패스가 설정되어있으니 이 디렉토리 안의 모든 스크립트에 액세스 할 수 있습니다. 



에러없이 끝내려면 Vagrant up  명령어를 여러 차례 실행해야 했다.





If you’re running your Kali Linux virtual machine in Virtualbox on the same host you have to make sure that you set the correct network settings. 


Otherwise you won’t be able to connect to the Metasploitable 3 machine from your Kali Linux attack box. 


You’re not required to alter the network settings for the Metasploitable 3 machine, only for the Kali Linux VM:



버추얼박스에서 각 가상머신끼리 네트워크를 올바르게 설정해줘야합니다. 



그렇지 않으면 칼리리눅스 공격용 가상머신에서 Metasploitable 3 시스템쪽에 접속이 잘 안되겠죠 

 

 

<Metasploitable 3 added to the Vagrant environment>




Booting Metasploitable 3




Now that we’ve completed the installation procedure for Metasploitable 2 we are ready to boot in in Virtualbox. The default username for the virtual machine is “vagrant” with password “vagrant”. Even though the installation process produced quiet some errors there were none that we couldn’t fix quickly (Google is your friend!). I must say that the developers of Metasploitable 3 did a great job on the installation procedure and providing a vulnerable Windows machine to the public.

 

Metasploitable 2 에 대한 설치 프로시저는 완료했으므로 Virtualbox에서 부팅 준비는 다 되었습나다. 가상 시스템의 디폴트 사용자 이름과 암호는 패스워드는 vagrant/vagrant 입니다. 비록 설치 과정에서 다소 약간의 오류가 발생하긴 했지만, 우리가 빨리 고칠 수있었던 던 역시 구글 신 덕분이죠.  

Metasploitable 3 개발자들이 설치 과정에서 훌륭한 업무를 수행했고, 대중들에게 취약한 윈도 머신을 제공하기 위해 최선을 다했다고 봅니다.. 사실 가상 모의침투 연구실 환경 구축을 위한 vagrant나 saltstack등의 기술은 일반 대중들은 설정이 어려울 수있습니다.  

 

In the next tutorials we will be enumerating and exploiting Metasploitable 3 and create a full walkthrough.

Do you prefer immediate access to a full virtual penetration testing environment with 30 vulnerable machines, courseware and a Certificate for less than $99,- USD?

Check out: The Virtual Hacking Labs.


다음 튜토리얼에서는 라이트업을 만들 정도로 Metasploitable 3 를 샅샅이 후벼파야겠죠

30여 개의 취약 시스템과 가상 모의침투 테스트 환경에 즉각적으로 액세스 하는 것을 원한다면 자세한 내용은 가상 해킹 랩을 참조하십시오.