mvt-project/mvt

Not dealing with the 'files' folder when check-iocs

Lynxiayel opened this issue · 1 comments

The output result from mvt-android check-adb will generate a bunch of json files, as well as a files folder. If we then use mvt-android check-iocs over the check-adb result path, it will run into this files folder, and report IsADirectoryError, as follows:

INFO [mvt.common.cmd_check_iocs] Loading results from "files" with module Files
Traceback (most recent call last):
File "/home/xxxx/software/miniconda3/bin/mvt-android", line 8, in
sys.exit(cli())
^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/mvt/android/cli.py", line 396, in check_iocs
cmd.run()
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/mvt/common/cmd_check_iocs.py", line 65, in run
m = iocs_module.from_json(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/xxxx/software/miniconda3/lib/python3.12/site-packages/mvt/common/module.py", line 71, in from_json
with open(json_path, "r", encoding="utf-8") as handle:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: '../mvt/results/files'