查找具有超过50个字符的字符串的PHP文件 [英] Find php files with strings that have more than 50 characters

查看:288
本文介绍了查找具有超过50个字符的字符串的PHP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图运行一个命令(查找),例如,信息内目读内读范读中的信息信息中信息亦范范信息读范范范内范范中信息上读亦范范信范亦预秘范亦预秘范读亦亦当信息的方范读范范亦范范信范范范范范范范读预读内的信息中范范当信息内预读-name'。* php'-exec fgrep -q'..'{} \;信亦信息范范亦会亦亦信息的范范信息预期基本上我试图找到PHP文件,可能已经与编码64字符串的巨大块妥协。

解决方案



  grep'[^] \ {50,\}'* .php 

另外,在Perl或PHP中 preg_match()这将匹配一个base64编码的字符串(任何可以base64解码的字符串):

 ([A-Za-z0-9 + /] {4})*([A-ZA-Z0-9 + /] {4} | [A-ZA-Z0-9 + /] {3} = | [A-ZA-Z0-9 + / ] {2} ==)


I am trying to run a command (find) for example that would allow me to find all the php files in which content there are strings with more than 50 characters.

I have a base that looks like this, but I fail what to write in the grep:

sudo find . -name '.*php' -exec fgrep -q '..' {} \; -print

I assume that a thing that is not a character is a whitespace. Basically I am trying to find PHP files that might have been compromisde with huge chunks of encoded64 strings.

解决方案

Matches lines with 50 or more consecutive non space characters:

grep '[^ ]\{50,\}' *.php

Also, in Perl or PHP preg_match() I think this will match a base64 encoded string (any string that can be base64 decoded):

([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)

这篇关于查找具有超过50个字符的字符串的PHP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆