modules.packages.js

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

# Source Code for Module modules.packages.js

     1  # Copyright (C) 2010-2013 Claudio Guarnieri.
     2  # Copyright (C) 2014-2016 Cuckoo Foundation.
     3  # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
     4  # See the file 'docs/LICENSE' for copying permission.
     5
     6  import logging
     7  import os
     8
     9  from lib.common.abstracts import Package
    10
    11  log = logging.getLogger(__name__)
    12
    13 -class Javascript(Package):
    14      """Javascript analysis package."""
    15      PATHS = [
    16          ("System32", "wscript.exe"),
    17      ]
    18
    19 -    def start(self, path):
    20          wscript = self.get_path("WScript")
    21
    22          # Enforce the .js file extension as is required by wscript.
    23          if not path.endswith(".js"):
    24              os.rename(path, path + ".js")
    25              path += ".js"
    26              log.info("Submitted file is missing extension, added .js")
    27
    28          return self.execute(wscript, args=[path], trigger="file:%s" % path)
    29