1
2
3
4
5 import os.path
6
7 from lib.cuckoo.common.abstracts import Processing
8 from lib.cuckoo.common.objects import File
9
11 """General information about a file."""
12
14 """Run file information gathering.
15 @return: information dict.
16 """
17 self.key = "target"
18
19 target_info = {"category": self.task["category"]}
20
21 if self.task["category"] == "file":
22 target_info["file"] = {}
23
24
25
26 if os.path.exists(self.file_path):
27 target_info["file"] = File(self.file_path).get_all()
28
29 target_info["file"]["name"] = File(self.task["target"]).get_name()
30 elif self.task["category"] == "url":
31 target_info["url"] = self.task["target"]
32
33 return target_info
34