mirror of https://github.com/CIRCL/AIL-framework
parent
0d06f633e2
commit
0872fb23d3
|
@ -104,8 +104,12 @@ def is_valid_default_yara_rule(yara_rule):
|
||||||
filename = os.path.join(yara_dir, yara_rule)
|
filename = os.path.join(yara_dir, yara_rule)
|
||||||
filename = os.path.realpath(filename)
|
filename = os.path.realpath(filename)
|
||||||
|
|
||||||
|
print(yara_dir)
|
||||||
|
print(filename)
|
||||||
|
|
||||||
# incorrect filename
|
# incorrect filename
|
||||||
if not os.path.commonprefix([filename, yara_dir]) == yara_dir:
|
if not os.path.commonprefix([filename, yara_dir]) == yara_dir:
|
||||||
|
print('error: file transversal')
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(filename):
|
if os.path.isfile(filename):
|
||||||
|
|
Loading…
Reference in New Issue