PyCIRCLean/scripts/run_filecheck_single_file.py

30 lines
613 B
Python
Raw Normal View History

import sys
from bin.filecheck import File
PATH='tests/dangerous/bypass.docx'
# PATH='tests/normal/word_docx.docx'
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()