rapid7 / metasploitable3

Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities.
Other
4.78k stars 1.15k forks source link

Failed to parse file as legacy JSON template #534

Closed Rocco-hash closed 3 years ago

Rocco-hash commented 3 years ago

Issue Description

The error message I am receiving is down below. At first I was having the issue with the json file but I ran the packer fix and it fixed it. Then I ran into the issue with the iso url no longer working, so I found a downloadable windows 2k8 server iso with a verified md5 checksum as matching the md5 in json file. Changed the url to the local address of the windows is file and I get the following error. I have done everyhting I can think of and tried all of the help issues listed here. Any help is greatly appreciated thank you

Host System

Command Output

Compatible version of VirtualBox found. Compatible version of Packer found. Compatible version of Vagrant found. Compatible version of vagrant-reload plugin found. All requirements found. Proceeding... Building metasploitable3-win2k8 Vagrant box... Failed to parse file as legacy JSON template: if you are using an HCL template, check your file extensions; they should be either .pkr.hcl or .pkr.json; see the docs for more details: https://www.packer.io/docs/templates/hcl_templates. Original error: Error parsing JSON: invalid character 'W' in string escape code At line 349, column 21 (offset 13615): 348: "iso_checksum_type": "md5", 349: "iso_url": "C:\W ^

Error building the Vagrant box using Packer. Please check the output above for any error messages. At C:\Users\potat\metasploitable3-workspace\metasploitable3-master\metasploitable3-master\build.ps1:157 char:10

ab41sh3k commented 3 years ago

I'm having this issue too

jmartin-tech commented 3 years ago

Packer syntax has changed, this project is currently tested with packer versions up to 1.5, there is work on-going to update for newer key requirements in 1.6.x and 1.7.x however these updates have also been found to roll forward the required versions for some virtualization platforms such as Virtual Box and are not yet complete.

If you used an older version of packer and also account for #526 to download the ISO file that Microsoft stopped hosting in a public location you should be able to build the images.

Also some have found using packer fix on the existing JSON template files can produce a working 1.7.x template.

Another option is to use the quick-start method to download builds published in vagrant cloud.

Rocco-hash commented 3 years ago

Thank you for responding! I got it working I don’t really know how because I was trying so many different things, what confused me is when the Windows server vm was created it says can’t log in or something else f that nature so it made me feel as if I didn’t do it right but yes I believe it worked because of the fixes I used but it could be because I also used the get started right away as well. But thank you for responding and trying to help me out