Post

WINDOWS CMD 命令行下载文件的几种方法

certutil

1
$ certutil.exe -urlcache -split -f http://7-zip.org/a/7z1604-x64.exe 7zip.exe

bitsdmin

1
$ bitsadmin /transfer taskname http://7-zip.org/a/7z1604-x64.exe c:\temp\7zip.exe

Copy file

1
2
3
4
$ bitsadmin /create taskname
$ bitsadmin /addfile taskname c:\temp\7zip.exe c:\7zip.exe
$ bitsadmin /resume taskname
$ bitsadmin /complete taskname

vbs

Windows 10 未测试成功。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 用echo写入
On Error Resume Next
Dim iRemote,iLocal
iLocal = LCase(WScript.Arguments(1))
iRemote = LCase(WScript.Arguments(0))
Set xPost = createObject("Microsoft.XMLHTTP")
xPost.Open "GET",iRemote,0
xPost.Send()
Set sGet = createObject("ADODB.Stream")
sGet.Mode = 3
sGet.Type = 1
sGet.Open()
sGet.Write(xPost.responseBody)
sGet.SaveToFile iLocal,2

$ cscript ff.vbs http://7-zip.org/a/7z1604-x64.exe 7zip.exe

powershell

1
$ powershell (new-object System.Net.WebClient).DownloadFile( 'http://7-zip.org/a/7z1604-x64.exe','c:\temp\7zip.exe')

ftp

1
2
$ echo open 8.8.8.8 > a.txt & echo get fuck.exe>>a.txt & echo bye>>a.txt
$ ftp -A -s:a.txt

Bitsadmin.exe

Windows for Pentester: BITSAdmin

cmd 环境下载文件的几种方法

This post is licensed under CC BY 4.0 by the author.