Skip to main content

Quick tool automation

Project description

Toolrunner

Automating standard procedure

Toolrunner is a small python module created to automate commands/tools, collect their respective outputs into one place, and generally expedite the "initial triage" phase of malware analysis. It's basically just a big wrapper around the subprocess module. Configurations can be loaded from or saved to python dictionaries, making it easy to switch between whatever sets of tools are most applicable to the situation.

Basic Usage

See documentation

Toolrunner's most practical use (and the inspiration behind its development) is starting/running the standard tools and processes one might typically employ during the static analysis of an exectutable. The alternative is manually clicking/running them all, redirecting outputs, copy/pasting file paths, typing commands, etc. Those clicks add up over time.

import toolrunner
target_file = toolrunner.get_argv() # Drag/drop the file, retrieve path via argv[1]
tools = toolrunner.Tools(target_file, "tool_outputs") # Define output directory (CWD, otherwise)

tools.cli("capa details", r"C:\Users\IEUser\Desktop\capa.exe", ["-vv"])
tools.cli("floss strings", r"C:\Users\IEUser\Desktop\floss.exe")
tools.gui("IDA Pro", r"C:\Program Files\IDA Freeware 8.0\ida64.exe")
tools.gui("Detect it easy", r"C:\Users\IEUser\Desktop\ToolDownloads\die_win64_portable_3.06\die.exe")

tools.run_all() # GUI tools run first, and in their own process
tools.print_config()

input("\nPress enter to continue...") # So the console doesn't just immediatly exit

DetectItEasy and IDA Pro are loaded with our file; reports on the file's capabilities and strings are stored in /tool_outputs. The print_config() method prints the dictionary of the tool information we just manually provided in a readable format. So we can copy/paste that and perform the same actions like so:

import toolrunner

static_cfg = {
        "cli" : {
                "capa summary" : ['C:\\Users\\IEUser\\Desktop\\capa.exe'],
                "capa details" : ['C:\\Users\\IEUser\\Desktop\\capa.exe', '-vv'],
                "floss strings" : ['C:\\Users\\IEUser\\Desktop\\floss.exe'],
        },
        "gui" : {
                "IDA Pro" : ['C:\\Program Files\\IDA Freeware 8.0\\ida64.exe'],
                "Detect it easy" : ['C:\\Users\\IEUser\\Desktop\\ToolDownloads\\die_win64_portable_3.06\\die.exe'],
        },
}

tools = toolrunner.Tools(toolrunner.get_argv(), "static_reports", config=static_cfg)
tools.run_all() 
input("\nPress enter to continue...") 

Dictionaries in this format can be used as the configuration for toolrunner.Tools objects, and edited to suit whatever your desires may be.

Linux equivilent here

Known Issues & TODO

  • If a tool changes the console's text color and doesn't change it back, it's just gonna stay that way
    • Use colorama

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toolrunner-1.0.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toolrunner-1.0.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file toolrunner-1.0.0.tar.gz.

File metadata

  • Download URL: toolrunner-1.0.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for toolrunner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 17b5ff68b93446bf695424846e905060886e64d0e7c5b633a4c98dfd1db8e05c
MD5 cb05ab69040fa1b846525320d5b9c252
BLAKE2b-256 11cce6a867dabb5cba81e29e5bad52c2d7ca66b7c6301e3127f1a8b00422b6f3

See more details on using hashes here.

File details

Details for the file toolrunner-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: toolrunner-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for toolrunner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13676872053ff187dbe42a651039842a8c2ce0b99f588cd0e740507e5fc6589d
MD5 d034081f0a35cf0341a6be3c1cb148e8
BLAKE2b-256 3efd204fd5c7f62bf7dea1f3988aa5e14d3a6a3c31d8f8c08d10023e37e3051a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page