-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #472 from kevoreilly/master
Updates
- Loading branch information
Showing
13 changed files
with
277 additions
and
36 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (C) 2010-2015 Cuckoo Foundation, Optiv, Inc. ([email protected]) | ||
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org | ||
# See the file 'docs/LICENSE' for copying permission. | ||
|
||
import os | ||
import shutil | ||
from subprocess import call | ||
from lib.common.abstracts import Package | ||
|
||
class Combo(Package): | ||
"""CAPE Combo analysis package.""" | ||
|
||
def __init__(self, options={}, config=None): | ||
"""@param options: options dict.""" | ||
self.config = config | ||
self.options = options | ||
self.pids = [] | ||
self.options["combo"] = "1" | ||
|
||
def start(self, path): | ||
args = self.options.get("arguments") | ||
appdata = self.options.get("appdata") | ||
runasx86 = self.options.get("runasx86") | ||
|
||
# If the file doesn't have an extension, add .exe | ||
# See CWinApp::SetCurrentHandles(), it will throw | ||
# an exception that will crash the app if it does | ||
# not find an extension on the main exe's filename | ||
if "." not in os.path.basename(path): | ||
new_path = path + ".exe" | ||
os.rename(path, new_path) | ||
path = new_path | ||
|
||
if appdata: | ||
# run the executable from the APPDATA directory, required for some malware | ||
basepath = os.getenv('APPDATA') | ||
newpath = os.path.join(basepath, os.path.basename(path)) | ||
shutil.copy(path, newpath) | ||
path = newpath | ||
if runasx86: | ||
# ignore the return value, user must have CorFlags.exe installed in the guest VM | ||
call(["CorFlags.exe", path, "/32bit+"]) | ||
return self.execute(path, args, path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (C) 2010-2015 Cuckoo Foundation. | ||
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org | ||
# See the file 'docs/LICENSE' for copying permission. | ||
|
||
import os | ||
import shutil | ||
|
||
from lib.common.abstracts import Package | ||
|
||
class Combo_dll(Package): | ||
"""CAPE Combo DLL analysis package.""" | ||
PATHS = [ | ||
("SystemRoot", "system32", "rundll32.exe"), | ||
] | ||
|
||
def __init__(self, options={}, config=None): | ||
"""@param options: options dict.""" | ||
self.config = config | ||
self.options = options | ||
self.options["combo"] = "1" | ||
|
||
def start(self, path): | ||
rundll32 = self.get_path("rundll32.exe") | ||
function = self.options.get("function", "#1") | ||
arguments = self.options.get("arguments") | ||
dllloader = self.options.get("dllloader") | ||
|
||
# Check file extension. | ||
ext = os.path.splitext(path)[-1].lower() | ||
# If the file doesn't have the proper .dll extension force it | ||
# and rename it. This is needed for rundll32 to execute correctly. | ||
# See ticket #354 for details. | ||
if ext != ".dll": | ||
new_path = path + ".dll" | ||
os.rename(path, new_path) | ||
path = new_path | ||
|
||
args = "{0},{1}".format(path, function) | ||
if arguments: | ||
args += " {0}".format(arguments) | ||
|
||
if dllloader: | ||
newname = os.path.join(os.path.dirname(rundll32), dllloader) | ||
shutil.copy(rundll32, newname) | ||
rundll32 = newname | ||
|
||
return self.execute(rundll32, args, path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (C) 2010-2015 Cuckoo Foundation. | ||
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org | ||
# See the file 'docs/LICENSE' for copying permission. | ||
|
||
import os | ||
import shutil | ||
|
||
from lib.common.abstracts import Package | ||
|
||
class Hancitor_Dll(Package): | ||
"""CAPE Hancitor DLL analysis package.""" | ||
PATHS = [ | ||
("SystemRoot", "system32", "rundll32.exe"), | ||
] | ||
|
||
def start(self, path): | ||
rundll32 = self.get_path("rundll32.exe") | ||
function = self.options.get("function", "#1") | ||
arguments = self.options.get("arguments") | ||
dllloader = self.options.get("dllloader") | ||
self.options["hancitor"] = "1" | ||
|
||
# Check file extension. | ||
ext = os.path.splitext(path)[-1].lower() | ||
# If the file doesn't have the proper .dll extension force it | ||
# and rename it. This is needed for rundll32 to execute correctly. | ||
# See ticket #354 for details. | ||
if ext != ".dll": | ||
new_path = path + ".dll" | ||
os.rename(path, new_path) | ||
path = new_path | ||
|
||
args = "\"{0}\",{1}".format(path, function) | ||
if arguments: | ||
args += " {0}".format(arguments) | ||
|
||
if dllloader: | ||
newname = os.path.join(os.path.dirname(rundll32), dllloader) | ||
shutil.copy(rundll32, newname) | ||
rundll32 = newname | ||
|
||
return self.execute(rundll32, args, path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.