disabled yaml
This commit is contained in:
parent
dda76ee51a
commit
dde8b70240
9
scan.py
9
scan.py
@ -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':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user