← Back to Writeups
HTBVery EasyHardware

Gawk

D3v0o0Nu119/2/20262 min read
#hardware#htb#very easy

Gawk

Platform: HackTheBox | Category: Hardware | Difficulty: Very Easy | Author: D3v0o0Nu11 | Date: 2026-02-10

Description

I lost access to my computer and need a document urgently which got stuck in a printer. Can you get me the document?

Solution Approach

Core idea: Printer Exploitation. Using PRET to communicate with the printer.

Steps

  1. In this challenge seems we are tasked to recover a document that got stuck in their printer.

  2. Also we're given an instance which we can exploit using Printer Exploitation Toolkit (PRET). It's open source and posted at Github.

  3. The github documentations also provided with the system operations executeable in every printer language.

  4. Great! Let's follow the documentations.

  5. Using ps resulting to no feedback but it connected. It means the printer does not understand the language which also correlates that it's not the correct printer language.

  6. Using pjl shall resulting to the printer feedback!

  7. Noticed that it also provide the device name that we're going to exploit.

  8. BUT, somehow we got watchdog timeout everytime we want to run ls command even though the ls command is available.

  9. Possibly because there is a session which has a timeout but does not terminate the shell directly.

  10. Running the script again and execute ls again, the printer shall reflects the result to the terminal.

  11. Long story short, after traversing through the directory seems we found the stuck document at saveDevice/SavedJobs/InProgress directory.

  12. To download the document we can use get command.

  13. Upon attempt to render the PDF we got this result:

  14. Interesting, after running a basic file check we found out that it contains base64 text.

  15. Let's use cyberchef to decode it and download the content again from there.

  16. Got the flag!

Flag

REDACTED

Lessons Learned

  1. Printer Exploitation.
  2. Using PRET to communicate with the printer.
  3. Identifying printer language.