disabled yaml

This commit is contained in:
Palma Solutions LTD 2019-01-03 13:16:41 +01:00
parent dda76ee51a
commit dde8b70240

View File

@ -12,7 +12,6 @@
import os
import re
import fnmatch
import textwrap
whitelist = [
'/lp-msh-scanner/',
@ -301,7 +300,7 @@ def is_hacked(filename):
if filename[0] != '/':
filename = os.getcwd() + '/' + filename
return {'filename': filename,
return {'filename': filename[0:200],
'score': total_score,
'mtime': os.stat(filename).st_mtime,
'ctime': os.stat(filename).st_ctime,
@ -611,7 +610,8 @@ def is_hacked(filename):
cleanup_available = True
if cleanup_available and line_num == 1:
cleanup_available = False
return {'filename': join(textwrap.wrap(filename, 200),
return {'filename': filename[0:200],
'score': total_score,
'mtime': os.stat(filename).st_mtime,
'ctime': os.stat(filename).st_ctime,
@ -671,6 +671,7 @@ if __name__ == '__main__':
for root, dirnames, filenames in os.walk(basedir):
for filename in filenames:
if fnmatch.fnmatch(filename, '*.php') or \
fnmatch.fnmatch(filename, '*.txt') or \
fnmatch.fnmatch(filename, '*.js'):
hacked = is_hacked(os.path.join(root, filename))
if hacked is not False and hacked['score'] >= MIN_SCORE:
@ -679,11 +680,13 @@ if __name__ == '__main__':
filename = basedir
root = os.getcwd()
if fnmatch.fnmatch(filename, '*.php') or \
fnmatch.fnmatch(filename, '*.txt') or \
fnmatch.fnmatch(filename, '*.js'):
hacked = is_hacked(os.path.join(root, filename))
if hacked is not False and hacked['score'] >= MIN_SCORE:
results.append(hacked)
results.sort(key=lambda x: x['score'], reverse=True)
if SERIALIZER == 'yaml':