设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 手机 数据
当前位置: 首页 > 服务器 > 系统 > 正文

2019关于phpstudy软件后门简单分析(2)

发布时间:2021-01-04 07:03 所属栏目:52 来源:网络整理
导读:? # -*- coding:utf8 -*-__author__=‘[email?protected]‘__blog__=‘http://pcat.cc‘import osimport stringimport redef strings(file) : chars = string.printable[:94] shortestReturnChar = 4 regExp = ‘[%

?

# -*- coding:utf8 -*-
__author__=‘[email?protected]‘
__blog__=‘http://pcat.cc‘

import os
import string
import re


def strings(file) :
    chars = string.printable[:94]
    shortestReturnChar = 4
    regExp = ‘[%s]{%d,}‘ % (chars,shortestReturnChar)
    pattern = re.compile(regExp)
    with open(file,‘rb‘) as f:
        return pattern.findall(f.read())


def grep(lines,pattern):
    for line in lines:
        if pattern in line:
            yield line


def pcheck(filename):
    # trojan feature
    trojan=‘@eval‘
    # just check dll file
    if filename.endswith(‘.dll‘):        
        lines=strings(filename)
        try:
            grep(lines,trojan).next()
        except:
            return
        print ‘=== {0} ===‘.format(filename)
        for line in grep(lines,trojan):
            print line
    pass


def foo():
    # . stand for current directory
    for path,dirs,files in os.walk(".",topdown=False):
        for name in files:
            pcheck(os.path.join(path,name))
        for name in dirs:
            pcheck(os.path.join(path,name))
    pass


if __name__ == ‘__main__‘:
    foo()

?

?

?

?

?

自己斟酌哦 太菜了呢学个php都给人家当鸡

2019关于phpstudy软件后门简单分析

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读