2017-08-07 20:13:02 +02:00
|
|
|
import sys
|
|
|
|
|
2017-08-11 00:12:30 +02:00
|
|
|
from filecheck.filecheck import File
|
2017-08-07 20:13:02 +02:00
|
|
|
|
|
|
|
|
2017-08-11 00:12:30 +02:00
|
|
|
PATH = 'tests/dangerous/bypass.docx'
|
|
|
|
# PATH = 'tests/normal/word_docx.docx'
|
2017-08-07 20:13:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
try:
|
|
|
|
file = File(sys.argv[1], '')
|
|
|
|
except IndexError:
|
|
|
|
file = File(PATH, '')
|
|
|
|
file.check()
|
|
|
|
print(
|
|
|
|
"Name: " + file.filename,
|
|
|
|
"Desc: " + file.description_string,
|
|
|
|
"Mime: " + file.mimetype,
|
|
|
|
"Desc list: " + repr(file._description_string),
|
|
|
|
"Size: " + str(file.size),
|
|
|
|
"Src path: " + file.src_path,
|
|
|
|
"Is dangerous: " + str(file.is_dangerous),
|
|
|
|
sep='\n'
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|