# coding:utf-8

import os
import sys
import re rulelist = [
'(\$_(GET|POST|REQUEST)\[.{0,15}\]\(\$_(GET|POST|REQUEST)\[.{0,15}\]\))',
'(base64_decode\([\'"][\w\+/=]{200,}[\'"]\))',
'eval\(base64_decode\(',
'(eval\(\$_(POST|GET|REQUEST)\[.{0,15}\]\))',
'(assert\(\$_(POST|GET|REQUEST)\[.{0,15}\]\))',
'(\$[\w_]{0,15}\(\$_(POST|GET|REQUEST)\[.{0,15}\]\))',
'(wscript\.shell)',
'(gethostbyname\()',
'(cmd\.exe)',
'(shell\.application)',
'(documents\s+and\s+settings)',
'(system32)',
'(serv-u)',
'(提权)',
'(phpspy)',
'(后门)',
'(webshell)',
'(Program\s+Files)'
] def Scan(path):
for root,dirs,files in os.walk(path):
for filespath in files:
isover = False
if '.' in filespath:
ext = filespath[(filespath.rindex('.')+1):]
if ext=='php':
file= open(os.path.join(root,filespath))
filestr = file.read()
file.close()
for rule in rulelist:
result = re.compile(rule).findall(filestr)
if result:
print '文件:'+os.path.join(root,filespath)
print '恶意代码:'+str(result[0])
print '\n\n'
break if os.path.lexists(sys.argv[1]):
print('\n\n开始扫描:'+sys.argv[1])
print(' 可疑文件 ')
print('########################################')
Scan(sys.argv[1])
print('提示:扫描完成-- O(∩_∩)O哈哈~')
else:
print '提示:指定的扫描目录不存在--- 我靠( \'o′)!!凸'

  

最新文章

  1. thinkphp相关总结
  2. vs2012安装Microsoft.AspNet.WebApi.WebHost
  3. 如何显示二进制流的图片(利用img控件)
  4. iOS push与present Controller的区别
  5. Codeforces Round #366 Div.2[11110]
  6. commonjs amd cmd的区别
  7. JSP基本原理
  8. debugging tools
  9. 正则 提取html标签value
  10. (九)Hibernate 检索策略
  11. traits编程技法
  12. Android四大图片缓存(Imageloader,Picasso,Glide,Fresco)原理、特性对比
  13. iframe自适应高度计算,iframe自适应
  14. ASP.NET MVC5 实现分页查询
  15. 工厂方法模式(Java与Kotlin版)
  16. TF-IDF学习(python实现)
  17. NgDL:【第二周】NN基础
  18. 3、lvs调度方法详解
  19. MySQL 日期类型及默认设置 (除timestamp类型外,系统不支持其它时间类型字段设置默认值)
  20. westrac server security configure user info

热门文章

  1. windows10下如何完全卸载串口驱动?
  2. Orcal nvl函数
  3. Workflow-产品:泛微工作流引擎
  4. win + T 快捷键
  5. c# 匿名类型获取值
  6. mssql表分区
  7. JavaScript高程第三版笔记-面向对象编程
  8. Opencv中的WMesh
  9. socket之UDP协议,并发编程介绍,操作系统发展史
  10. 分片式图片服务器fastDFS安装过程