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

Source Code for Module modules.packages.html

 1  # Copyright (C) 2010-2015 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 shutil 
 6  import logging 
 7   
 8  from lib.common.abstracts import Package 
 9   
10  log = logging.getLogger(__name__) 
11   
12 -class HTML(Package):
13 """HTML file analysis package.""" 14 PATHS = [ 15 ("ProgramFiles", "Internet Explorer", "iexplore.exe"), 16 ] 17
18 - def start(self, path):
19 iexplore = self.get_path("browser") 20 21 # Travelling inside malware universe you should bring a towel with you. 22 # If a file detected as HTML is submitted without a proper extension, 23 # or without an extension at all (are you used to name samples with hash?), 24 # IE is going to open it as a text file, so your precious sample will not 25 # be executed. 26 # We help you sample to execute renaming it with a proper extension. 27 if not path.endswith((".htm", ".html")): 28 shutil.copy(path, path + ".html") 29 path += ".html" 30 log.info("Submitted file is missing extension, adding .html") 31 32 return self.execute(iexplore, "\"%s\"" % path)
33