# MSSQL Upload & Download

### Download / Upload MSSQL file

```bash
nxc mssql 10.10.10.52 -u admin -p 'm$$ql_S@_P@ssW0rd!' --put-file /tmp/users C:\\Windows\\Temp\\whoami.txt
```

Expected Results:

```bash
nxc mssql 192.168.212.134 -u administrator -p October2022 --put-file /tmp/users C:\\Windows\\Temp\\whoami.txt
MSSQL       192.168.212.134 1433   DC01             [*] Windows 10.0 Build 20348 (name:DC01) (domain:poudlard.wizard)
MSSQL       192.168.212.134 1433   DC01             [+] poudlard.wizard\administrator:October2022 (Pwn3d!)
MSSQL       192.168.212.134 1433   DC01             [*] Copy /tmp/users to C:\Windows\Temp\whoami.txt
MSSQL       192.168.212.134 1433   DC01             [*] Size is 23 bytes
MSSQL       192.168.212.134 1433   DC01             [+] File has been uploaded on the remote machine
```

```bash
nxc mssql 10.10.10.52 -u admin -p 'm$$ql_S@_P@ssW0rd!' --get-file C:\\Windows\\Temp\\whoami.txt /tmp/file
```

Expected Results:

```bash
nxc mssql 192.168.212.134 -u administrator -p October2022 --get-file C:\\Windows\\Temp\\whoami.txt /tmp/users-t
MSSQL       192.168.212.134 1433   DC01             [*] Windows 10.0 Build 20348 (name:DC01) (domain:poudlard.wizard)
MSSQL       192.168.212.134 1433   DC01             [+] poudlard.wizard\administrator:October2022 (Pwn3d!)
MSSQL       192.168.212.134 1433   DC01             [*] Copy C:\Windows\Temp\whoami.txt to /tmp/users-t
MSSQL       192.168.212.134 1433   DC01             [+] File C:\Windows\Temp\whoami.txt was transferred to /tmp/users-t
```


---

# 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://www.netexec.wiki/mssql-protocol/mssql-upload-download.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.
