-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
67 additions
and
10 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
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,36 @@ | ||
# 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. | ||
|
||
from lib.common.abstracts import Package | ||
from lib.common.common import check_file_extension | ||
|
||
|
||
class Batch(Package): | ||
"""batch analysis package.""" | ||
|
||
PATHS = [ | ||
("SystemRoot", "system32", "cmd.exe"), | ||
] | ||
summary = "Executes the batch scripts with cmd.exe." | ||
description = """Uses 'cmd.exe /c start /wait "" "path"' to execute sample files. | ||
For context behind this command: | ||
/C Carries out the command specified by string and then terminates | ||
START Starts a separate window to run a specified program or command. | ||
/WAIT Start application and wait for it to terminate. | ||
"" The name of the separate window | ||
"path" The path of the uploaded batch file. | ||
""" | ||
|
||
def start(self, path): | ||
cmd_path = self.get_path("cmd.exe") | ||
# For context behind this command: | ||
# /C Carries out the command specified by string and then terminates | ||
# START Starts a separate window to run a specified program or command. | ||
# WAIT Start application and wait for it to terminate. | ||
# "" The name of the separate window | ||
# "{path}" The name of the specific batch file | ||
|
||
path = check_file_extension(path, ".bat") | ||
cmd_args = f'/c start /wait "" "{path}"' | ||
return self.execute(cmd_path, cmd_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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.