How autorun works
When Nmap discovers an open port on a target:- QtRecon checks the
autorunsection for matching rules - If a rule exists for that port/protocol combination, the associated tools are automatically launched
- Tools execute with the discovered IP address and port number
- Results are captured and displayed in QtRecon
Autorun section structure
Theautorun section is organized by protocol (TCP/UDP), then by port number:
Protocol sections
Rules for TCP ports
Rules for UDP ports
Port numbers
Each port number (as a string) maps to an array of tool IDs that should be executed when that port is discovered.Special key that matches all ports of the specified protocol. Tools listed here run for every discovered port.
Example autorun configurations
Web services (ports 80 and 443)
Automatically scan web servers with feroxbuster and Nikto:SMB enumeration (port 445)
Automatically run custom SMB enumeration:DNS zone transfer (port 53)
Attempt DNS zone transfer on discovered DNS servers:Database services
Run Nmap scripts against discovered databases:Redis enumeration (port 6379)
Execute custom Redis enumeration script:SNMP enumeration (UDP 161)
Autorun also works for UDP services:Running tools on all ports
Use the special"any" key to run tools on every discovered port:
Complete autorun example
Here’s a comprehensive autorun configuration from the QtRecon example:Enabling and disabling autorun
Control autorun behavior through theuser_prefs section:
Globally enable or disable autorun functionality
Whether to trigger autorun rules when importing existing Nmap XML files
You can toggle autorun on/off without editing the configuration by accessing the preferences menu in QtRecon.
Relationship to port associations
Theautorun section is separate from ports_associations:
ports_associations
ports_associations
Defines which tools are available to run manually against specific ports. These appear in context menus when right-clicking on discovered services.
autorun
autorun
Defines which tools automatically execute when ports are discovered. This is a subset of associated tools that you want to run without manual intervention.
autorun contains a subset of the tools listed in ports_associations. You might want Firefox available for manual browsing, but not automatically launched.
Best practices
Start conservative
Start conservative
Begin with a minimal autorun configuration and expand gradually. Too many autorun rules can overwhelm your system and the target network.
Avoid aggressive tools in autorun
Avoid aggressive tools in autorun
Don’t autorun tools that:
- Require user interaction
- Are very noisy or aggressive
- Generate massive amounts of traffic
- Have a high false-positive rate
Use detached mode for autorun tools
Use detached mode for autorun tools
Tools configured for autorun should typically have
"detached": false so QtRecon can track their output and completion status.Be cautious with 'any'
Be cautious with 'any'
The
"any" keyword is powerful but can be overwhelming. Consider using it only for lightweight, passive tools like Nuclei.Monitor resource usage
Monitor resource usage
When scanning large networks, autorun can spawn hundreds of processes. Monitor system resources and adjust accordingly.
Troubleshooting
Tools not running automatically
Tools not running automatically
- Verify
enable_autorunistrueinuser_prefs - Check that tool IDs in
autorunexactly match those inuser_binaries - Ensure the discovered port matches the configured port number (as a string)
Too many processes spawning
Too many processes spawning
- Reduce the number of tools in autorun rules
- Remove or limit use of the
"any"keyword - Temporarily disable autorun while scanning large networks
Autorun triggering on XML import
Autorun triggering on XML import
Set
"enable_autorun_on_xml_import": false to prevent autorun when loading saved scan results.Next steps
Tool setup
Learn how to configure the tools used in autorun rules
Variables
Use variables for dynamic tool arguments
