Pdfy Htb Writeup Upd 【2025】

Pdfy Htb Writeup Upd 【2025】

<img src="http://your-ip:8000/test">

Check your netcat listener. If you receive a request, SSRF is confirmed.

In many HTB PDF challenges, the application processes the metadata of images embedded in the submitted page.

Using the SSRF, read the main PHP file that handles PDF generation. pdfy htb writeup upd

Common location:

<img src="file:///var/www/html/index.php">

From the source, you may find API endpoints, database credentials, or internal service ports. In PDFY, there is often a local service on port 8080 or 5000 that isn't exposed externally. &lt;img src="http://your-ip:8000/test"&gt;


The core vulnerability lies in how the application handles the conversion.

  • Credential Leak: Inside the generated PDF (viewing the internal admin page), you often find hardcoded credentials, an API key, or a private SSH key.
  • Shell: Use the found credentials to SSH into the machine and grab the user.txt flag.
  • find / -perm -4000 2>/dev/null
    

    Look for pdftex or tex. If pdftex is SUID root or you can run it as sudo, exploit it. Check your netcat listener

    Check sudo rights:

    sudo -l
    

    You might see:

    (ALL) NOPASSWD: /usr/bin/pdftex
    
  • Visit web root: look for a PDF processing app (upload/convert), parameterized endpoints, and common LFI/XXE patterns.

  • PDFY is a web application that allows users to upload PDF files, extract metadata, and convert them to images. The application uses an unsafe system call to pdftotext and pdfimages, allowing command injection via crafted PDF metadata or filenames. Privilege escalation involves a misconfigured sudo permission for a custom PDF processing script.


    The critical vulnerability in this scenario lies in how the PDF generator renders the input.

  • Source Code Disclosure: Using the file:// protocol, attackers can read the source code of the web application (e.g., file:///var/www/html/app.py). This reveals the libraries used and potential logic flaws.
  • Advanced search
    Planning See your selected contents and create your own Plan or Brochure
    Forgotten your password?
    Login using social networks
    *Please wait *The password recovery instructions will be sent to your e-mail. *E-mail not sent. Try again.
    Login using social networks