一种基于客户端识别的一句话WebShell拦截方法技术

技术编号:17099891 阅读:54 留言:0更新日期:2018-01-21 11:31
本发明专利技术公开了一种基于客户端识别的一句话WebShell拦截方法,包括以下步骤:步骤1:服务器接收到HTTP请求后,检测Cookie中是否有AccessToken值,如没有则转入步骤2;如有,则检测其是否与Session中的AccessToken值一致,如一致则放行,如不一致则忽略该请求;步骤2:服务器检查客户端是否传递了指定Cookie,如否则进行验证,如有则检测Cookie值是否合法;如合法则忽略本次请求,如合法则转入步骤3;步骤3:对比HTTP请求中的Referer值,如Referer值不等于当前访问的URL则忽略本次请求,如Referer值等于当前URL则转入步骤4;步骤4:服务器生成一个随机字符串作为AccessToken存入Session中,将AccessTtoken设置为网站Cookie,访问成功;本发明专利技术匹配精准度高,且不影响正常用户使用,可极大的减少漏报率和误报率。

A one sentence WebShell interception method based on client recognition

The invention discloses a client based on identification of a word WebShell interception method, which comprises the following steps: Step 1: the server receives the HTTP request, whether the detection of Cookie value in AccessToken, if not, go to step 2; if there is, is to detect whether the value is consistent with Session in AccessToken, such as the agreement the release, if not ignored the request; step 2: the server checks whether the client sends the specified Cookie, otherwise the verification, such as there is detection of Cookie value is legitimate; as the rule to ignore this request, such rules into 3 steps; step 3: comparison of HTTP request in the Referer value, such as the Referer value is not equal to the current access URL is ignored this request, such as the Referer value is equal to the current URL then go to step 4; step 4: the server generates a random string as AccessToken in Se In ssion, AccessTtoken is set as website Cookie, and the access is successful. The matching accuracy of the invention is high, and it does not affect the normal users' use, which can greatly reduce the false negative rate and false positive rate.

【技术实现步骤摘要】
一种基于客户端识别的一句话WebShell拦截方法
本专利技术涉及一种WebShell拦截方法,具体涉及一种基于客户端识别的一句话WebShell拦截方法。
技术介绍
在网站渗透过程中,攻击者通常会留下网站后门便于今后使用;其中一句话木马(即一句话WebShell)由于短小强悍而经常被使用;这些后门的功能通常是执行用户传递过来的恶意代码,因此后门本身的代码非常简短,因此俗称一句话木马;由于这些后门必须有用户传递攻击代码后才能真正执行攻击动作,所以就有了一句话后门的客户端;这些客户端通常已经自带了攻击代码,使用者只需要填入后门地址和密码就可以进行攻击操作;但是这些客户端通常是以软件的形式存在,并不具有执行javascript代码的能力;现有的WebShell访问拦截基本上是通过收集网络上公开的WebShell特征进行匹配或者检测一些敏感函数来进行拦截;这种方法基于特征匹配容易出现大量误报,并且WebShell特征随时变换,特征库不能完全包含所有的特征,容易出现遗漏。
技术实现思路
本专利技术提供一种匹配精准度高,且不影响正常用户使用,可极大的减少漏报率和误报率的基于客户端识别的一句话Web本文档来自技高网...
一种基于客户端识别的一句话WebShell拦截方法

【技术保护点】
一种基于客户端识别的一句话WebShell拦截方法,其特征在于,包括以下步骤:步骤1:服务器接收到HTTP请求后,检测Cookie中是否有AccessToken值,如没有则转入步骤2;如有,则检测其是否与Session中的AccessToken值一致,如一致则放行,如不一致则忽略该请求;步骤2:服务器检查客户端是否传递了指定Cookie,如否则进行验证,如有则检测Cookie值是否与服务器中Session里存储的加密值一致;如不一致则忽略本次请求,如一致则转入步骤3;步骤3:对比HTTP请求中的Referer值,如Referer值不等于当前访问的URL则忽略本次请求,如Referer值等于当前...

【技术特征摘要】
1.一种基于客户端识别的一句话WebShell拦截方法,其特征在于,包括以下步骤:步骤1:服务器接收到HTTP请求后,检测Cookie中是否有AccessToken值,如没有则转入步骤2;如有,则检测其是否与Session中的AccessToken值一致,如一致则放行,如不一致则忽略该请求;步骤2:服务器检查客户端是否传递了指定Cookie,如否则进行验证,如有则检测Cookie值是否与服务器中Session里存储的加密值一致;如不一致则忽略本次请求,如一致则转入步骤3;步骤3:对比HTTP请求中的Referer值,如Referer值不等于当前访问的URL则忽略本次请求,如Referer值等于当前URL则转入步骤4;步骤4:服务器生成一个随机字符串作为AccessToken存入Session中,将AccessTtoken设置为网站Cookie,访问成功。2.根据权利要求1所述的一种基于客户端识别的一句话WebShell拦截方法,其特征在于,所述步骤2中的验证过程如下:S1:在HTM...

【专利技术属性】
技术研发人员:仲俊霖
申请(专利权)人:成都知道创宇信息技术有限公司
类型:发明
国别省市:四川,51

网友询问留言 已有0条评论
  • 还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。

1