Package modules :: Package packages :: Module html
[hide private]
[frames] | no frames]

Source Code for Module modules.packages.html

 1  # Copyright (C) 2010-2014 Cuckoo Foundation. 
 2  # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org 
 3  # See the file 'docs/LICENSE' for copying permission. 
 4   
 5  import os 
 6   
 7  from lib.common.abstracts import Package 
 8  from lib.api.process import Process 
 9  from lib.common.exceptions import CuckooPackageError 
10   
11 -class HTML(Package):
12 """HTML file analysis package.""" 13
14 - def start(self, path):
15 free = self.options.get("free", False) 16 dll = self.options.get("dll", None) 17 suspended = True 18 if free: 19 suspended = False 20 21 iexplore = os.path.join(os.getenv("ProgramFiles"), "Internet Explorer", "iexplore.exe") 22 23 p = Process() 24 if not p.execute(path=iexplore, args="\"%s\"" % path, suspended=suspended): 25 raise CuckooPackageError("Unable to execute initial Internet " 26 "Explorer process, analysis aborted") 27 28 if not free and suspended: 29 p.inject(dll) 30 p.resume() 31 return p.pid 32 else: 33 return None
34
35 - def check(self):
36 return True
37
38 - def finish(self):
39 if self.options.get("procmemdump", False): 40 for pid in self.pids: 41 p = Process(pid=pid) 42 p.dump_memory() 43 44 return True
45