panda-re / panda

Platform for Architecture-Neutral Dynamic Analysis
https://panda.re
Other
2.45k stars 475 forks source link

No httpd and other apps are installed in the ubuntu_1604_x86.qcow #1476

Closed Kingsdom005 closed 4 months ago

Kingsdom005 commented 5 months ago

How to install httpd and other apps into the ubuntu_1604_x86.qcow? I have tried the cmds "panda.run_serial_cmd("apt install apache2") " and "panda.run_serial_cmd("systemctl status httpd")" but they don't work. Is there any qcow or qcow2 mirror links for ubuntu_1604_x86 with apache2 installed? How to solve it to running the cmds? Hope for your good suggestion!!

AndrewFasano commented 5 months ago

You can interactively run the guest, install the utilities you want and then take a new snapshot.

If you run python3 -m pandare.qcows x86_64 it will give you a command line for interactively starting the x86_64 generic image. Then you can run that and can interactively install your utilities. Then switch to the qemu monitor by pressing ctrl + a and then c and you should see a (qemu) prompt. From there you can type savevm myroot or some other name to create your own snapshot. Finally, you could update your pypanda scripts to call panda.revert_sync("myroot") to load the snapshot you generated.

During your interactive use you might need to run something like dhclient so your guest gets an updated dhcp lease and can reach the internet.