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

Source Code for Module modules.packages.generic

 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  from lib.common.abstracts import Package 
 7  from lib.common.rand import random_string 
 8   
9 -class Generic(Package):
10 """Generic analysis package. 11 The sample is started using START command in a cmd.exe prompt. 12 """ 13 PATHS = [ 14 ("System32", "cmd.exe"), 15 ] 16
17 - def start(self, path):
18 cmd_path = self.get_path("cmd.exe") 19 20 # Create random cmd.exe window title. 21 rand_title = random_string(4, 16) 22 23 # START syntax. 24 # See: https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true 25 # start ["title"] [/dPath] [/i] [/min] [/max] [{/separate | /shared}] 26 # [{/low | /normal | /high | /realtime | /abovenormal | belownormal}] 27 # [/wait] [/b] [FileName] [parameters] 28 args = ["/c", "start", "/wait", '"%s"' % rand_title, path] 29 return self.execute(cmd_path, args=args, trigger="file:%s" % path)
30