php禁止所有webshell的函数,php防止webshell 处理函数_PHP教程

[^`]+)`s*;', file_contents, re.ignorecase)

if match:

shell = match.group("shell")

if iname == 0:

info = 'n[%s] :n'% (filepath)

else:

info = ''

info += 't|-- [``] command is [%s] in line [%d] n'% (shell,i)

flog.write(info)

print info

iname += 1

match = re.search(r'(?p$_(?:pos|ge|reques)t)s*[[^]]+]s*(', file_contents, re.ignorecase)

if match:

shell = match.group("shell")

if iname == 0:

info = 'n[%s] :n'% (filepath)

else:

info = ''

info += 't|-- [``] command is [%s] in line [%d] n'% (shell,i)

flog.write(info)

print info

iname += 1

f.close()

flog.close()

if '__main__' == __name__:

argvnum = len(sys.argv)

liston = '0'

if argvnum == 1:

action = os.path.basename(sys.argv[0])

print "command is like:n %s d:wwwroot n %s d:wwwroot 1 -- recurse subfolders"% (action,action)

quit()

elif argvnum == 2:

path = os.path.realpath(sys.argv[1])

listdir(path,liston)

else:

liston = sys.argv[2]

path = os.path.realpath(sys.argv[1])

listdir(path,liston)

flog = open(os.getcwd()+"/check_php_shell.log","a+")

isotimeformat='%y-%m-%d %x'

now_time = time.strftime(isotimeformat,time.localtime())

flog.write("n----------------------%s checked ---------------------n"% (now_time))

flog.close()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值