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
Metadata
Release files for toolrunner 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| toolrunner-1.0.0.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| toolrunner-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.7 kB
Release files / toolrunner-1.0.0.tar.gz
| Download URL | toolrunner-1.0.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17b5ff68b93446bf695424846e905060886e64d0e7c5b633a4c98dfd1db8e05c
|
|
BLAKE2b-256 checksum How to use checksums |
11cce6a867dabb5cba81e29e5bad52c2d7ca66b7c6301e3127f1a8b00422b6f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / toolrunner-1.0.0-py3-none-any.whl
| Download URL | toolrunner-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13676872053ff187dbe42a651039842a8c2ce0b99f588cd0e740507e5fc6589d
|
|
BLAKE2b-256 checksum How to use checksums |
3efd204fd5c7f62bf7dea1f3988aa5e14d3a6a3c31d8f8c08d10023e37e3051a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for toolrunner 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.