[
Hey I wanted to start doing ctf in this website: https://exploit.education/phoenix/
But I have encountered a problem, I can’t make the set up work. Here is a link to how to how to set up the ctf – https://blog.lamarranet.com/index.php/exploit-education-phoenix-setup/
I followed the steps until the powershell code:
But I keep getting errors from the powershell :
I put the files in D:\Guy –
My shell code –
\Program
D:\Guy\qemu\qemu-system-x86_64.exe
-kernel vmlinuz-4.9.0-8-amd64
-initrd initrd.img-4.9.0-8-amd64
-append "root=/dev/vda1"
-m 1024M `
-netdev user,id=unet,hostfwd=tcp:127.0.0.1:2222-:22
-device virtio-net,netdev=unet
-drive file=exploit-education-phoenix-amd64.qcow2,if=virtio,format=qcow2,index=0
If someone can pls help me it will be amazing.
Thank you!!!
,
The article unfortunately sets people up for one of the most common pitfalls in powershell, the backtick
`
\Program` Files\qemu\qemu-system-x86_64.exe `
-kernel vmlinuz-4.9.0-8-amd64 `
-initrd initrd.img-4.9.0-8-amd64 `
-append "root=/dev/vda1" `
-m 1024M `
-netdev user,id=unet,hostfwd=tcp:127.0.0.1:2222-:22 `
-device virtio-net,netdev=unet `
-drive file=exploit-education-phoenix-amd64.qcow2,if=virtio,format=qcow2,index=0
They are used to escape the space in Program Files
and the newline character at the end of each line. Copying and pasting from a website can cause issues easily such as adding a space after them, breaking the line continuation. I’d recommend using splatting as it’s just as or easier to read and not as error prone.
$params = @{
kernel = 'vmlinuz-4.9.0-8-amd64'
initrd = 'initrd.img-4.9.0-8-amd64'
append = "root=/dev/vda1"
m = '1024M'
netdev = 'user,id=unet,hostfwd=tcp:127.0.0.1:2222-:22'
device = 'virtio-net,netdev=unet'
drive = 'file=exploit-education-phoenix-amd64.qcow2,if=virtio,format=qcow2,index=0'
}
& '\Program Files\qemu\qemu-system-x86_64.exe' @params
Also used the call operator &
and quoted the executable path since it contains a space.
]