Create and generate Metasploitable 3 by yourself. Detailed tutorial on building by yourself.

Insert image description here
I created it under Windows 10. In the build environment, please note that the version of PowerShell must be higher than 2.0. Please upgrade and install the patch.



First open powershell, but the system security policy does not allow powershell to execute scripts by default, so you need to command to open the function.

set-ExecutionPolicy RemoteSigned

Insert image description here
Install Chocolatey, the package manager under powershell.

iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

Insert image description here
Use the choco manager configured earlier to install packer. Packer is used to create virtual machine images.

choco install packer

Insert image description here
Install vagrant locally.
https://www.vagrantup.com


Insert image description here
After installing vagrant, start configuring the plug-in, and then install the vagrant reload plug-in, a ruby-based tool. Create and deploy virtualized development environments. The subsequent construction uses Oracle's vbox and chef to create an automated virtual environment.

vagrant plugin install vagrant-reload

Insert image description here
Download a virtualbox and install it locally, and then be sure to add virtualbox to the system environment variables.
https://www.virtualbox.org
At this point, the early environment preparation work is completed, let’s start building.


Insert image description here
Download the metasploitable3 project on github locally. https://github.com/rapid7/metasploitable3

git clone https://github.com/rapid7/metasploitable3.git

Insert image description here
Prepare a win2008 image file downloaded from msdn and drop it into the iso folder. After putting it in, you need to change the name here.
75e529d96d6b175622512cf0a1bc55a5d1677e6a9d3b913fe95c65b6aa41770d.iso


Insert image description here
Powershell directly executes the automatic script in the root directory of the project file.

./build.ps1

It was originally a Win2k8 image I downloaded myself. I changed the name according to the content in the ps1 script and put it in the iso. However, he didn't read it, so I started downloading the image from the official website again. It doesn't matter, just wait. It will be downloaded in about eight minutes.


Insert image description here
Insert image description here
After downloading, it will automatically use virtualbox to create a virtual machine for deployment. The script itself is slowly downloaded to the virtual machine on the website. Couldn't it have packaged all the software in the project file a long time ago? After that, there was a wait of several hours, which was very slow in China. There are various errors in the build process. Interestingly, as soon as an error occurs, the script will delete all previous progress, including the virtual machine files! I turned on four computers and ran them all night long, but none of them were successful. The next day, one of them finally produced a complete box file.


Insert image description here
Fortunately, the documents have been released, and things will be easier to do later.


Insert image description here
Add the generated box file to vagrant.

vagrant box add .\windows_2008_r2_virtualbox_0.1.0.box --name=metasploitable3


Afterwards, a virtual disk is generated in the user folder .vagrant.d\boxes\metasploitable3 folder.



Check the box you just added. You can see that it exists in the list, indicating that it was added successfully.


Insert image description here
Then edit the vagrantfile configuration file. You need to change the name to the custom file name you added to vagrant before.
If the name here does not match the name in your local vagrant list, you will search and download it online.


Insert image description here
Start the final step of deploying the environment with vagrant. Vagrant will start all configuration scripts and set everything up.

vagrant up

Insert image description here
Later, because there was a problem with my win10 virtualbox network card and I couldn't connect to the network, I changed to win7 and went to vagrant up to complete the final deployment. After that, I just waited for vagrant to start the vm.
After that, you can open the VM in VirtualBox and log in. The default account and password are: vagrant.

(The method as of May 8, 2019 is still available today. If you find it troublesome, you can download
the link to the virtual machine I created above: https://pan.baidu.com/s/1Ftxii_PiPxwQ-I8lAJnS-w Extraction code: For the pzki
installation video, refer to this foreign expert: https://www.youtube.com/playlist?list=PLZOToVAK85MpnjpcVtNMwmCxMZRFaY6mT (You need to surf the Internet scientifically!)
)

おすすめ

転載: blog.csdn.net/qq_38328382/article/details/89947323