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

Source Code for Module modules.packages.generic

 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  from random import randint 
 6   
 7  from lib.common.abstracts import Package 
 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 ("SystemRoot", "system32", "cmd.exe"), 15 ] 16
17 - def start(self, path):
18 cmd_path = self.get_path("cmd.exe") 19 # Create random cmd.exe window title. 20 rand_title = "".join([chr(randint(0, 128)) for i in xrange(0, randint(1, 10))]) 21 # START syntax. 22 # See: https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx?mfr=true 23 # start ["title"] [/dPath] [/i] [/min] [/max] [{/separate | /shared}] 24 # [{/low | /normal | /high | /realtime | /abovenormal | belownormal}] 25 # [/wait] [/b] [FileName] [parameters] 26 cmd_args = "/c start /wait \"{0}\" \"{1}\"".format(rand_title, path) 27 return self.execute(cmd_path, cmd_args)
28