Skip to content

RustScan Scripting Engine

Bee edited this page Nov 5, 2020 · 6 revisions

No Scripts

No scripts will be run with this option.

Effectively this runs RustScan without custom scripts or nmap.

rustscan --scripts none

Default

You don't need to enable this.

By default, RustScan runs Nmap as its script.

rustscan --scripts default

You can do this, but it's not needed.

Custom Scripts

Custom scripts execute after the program has run. You write (or use) a script, and RustScan executes it.

RustScan supports these languages for scripts:

  • Python
  • Shell
  • Perl

To execute a custom script, we need a rustscan_scripts.toml file located at $HOME/.rustscan_scripts.toml.

This file should look like:

Test/Example ScriptConfig file

Tags to filter on scripts. Only scripts containing all these tags will run.

tags = ["core_approved", "example"]

If it's present then only those scripts will run which has a tag ports = "80". Not yet implemented.

ex.:

ports = ["80"]

ports = ["80","81","8080"]

ports = ["80"]

Only this developer(s) scripts to run. Not yet implemented.

developer = ["example"]


Let's walk through this. 

Firstly, for reference, this is a basic Python script.

```python

#!/usr/bin/python3
#tags = ["core_approved", "example",]
#developer = [ "example", "https://example.org" ]
#trigger_port = "80"
#call_format = "python3 {{script}} {{ip}} {{port}}"

# Sriptfile parser stops at the first blank line with parsing.
# This script will run itself as an argument with the system installed python interpreter, only scanning port 80.
# Unused filed: ports_separator = ","

import sys

print('Python script ran with arguments', str(sys.argv))

Tags

Scripts contain

Getting Started

Firstly, you'll need a rustscan_scripts.toml file located at $HOME/.rustscan_scripts.toml.

Scripts are expected to be stored in $HOME/.rustscan_scripts. Make the directory!

To use custom scripts, use --scripts custom.

Clone this wiki locally