> For the complete documentation index, see [llms.txt](https://sarpers-organization.gitbook.io/ctftricks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sarpers-organization.gitbook.io/ctftricks/_chapter-intro-4/linux/scp/trick-0416.md).

# SCP Inbound File Transfer

***

Download a file from the target machine to your attacker machine using SCP over an existing SSH connection. Specify the remote user and hostname, followed by the absolute or relative path to the file on the target. The second argument is the destination path on your local machine (often just the filename to place it in the current directory).

To download a file from a remote host to your local machine, the general syntax is:

```bash
scp [user@]remote_host:/remote/file/path /local/file/path
```

For example, to download `hashdump.txt` from user `alice`'s home directory (assuming the current directory on the target is `alice`'s home) to your current directory:

```bash
scp alice@target.ine.local:hashdump.txt hashdump.txt
```

Using absolute paths, you might download a file like this:

```bash
scp alice@target.ine.local:/path/to/remote/file.txt /path/to/local/destination/file.txt
```

To download a file from a remote server directly to your current local directory, you can use a dot (`.`) as the local destination path:

```bash
scp user@remote.host:/path/to/file.txt .
```
