explo is a simple tool to describe web security issues in a human and machine readable format.
By defining a request/condition workflow, explo is able to exploit security issues without the
need of writing a script. This allows to share complex vulnerabilities in a simple readable and executable format.
Example for extracting a csrf token and using this in a form:
name: get_csrfdescription: extract csrf tokenmodule: httpparameter:
url: http://example.com/contactmethod: GETheader:
user-agent: Mozilla/5.0extract:
csrf: [CSS, "#csrf"]
---
name: exploitdescription: exploits sql injection vulnerability with valid csrf tokenmodule: httpparameter:
url: http://example.com/contactmethod: POSTbody:
csrf: "{{get_csrf.extracted.csrf}}"username: "' SQL INJECTION"find: You have an error in your SQL syntaxIn this example definition file the security issue is tested by executing two steps which are run from top to bottom. The last step returns a success or failure, depending on the string 'You have an error in your SQL syntax' to be found.
pip install explo
git clone https://github.com/dtag-dev-sec/explo
cd explo
python setup.py install
explo [--verbose|-v] testcase.yaml
explo [--verbose|-v] examples/*.yaml
There are a few example testcases in the examples/ folder.
$ explo examples/SQLI_simple_testphp.vulnweb.com.yaml
You can also include explo as a python lib:
fromexplo.coreimportfrom_contentasexplo_from_contentfromexplo.coreimportExploException, ProxyExceptiondefsave_log(msg):
print(msg)
try:
result=explo_from_content(explo_yaml_file, save_log)
exceptExploExceptionaserr:
print(err)A http/https proxy and a timeout for requests can be set via environment variables. The default timeout is set to 15 seconds.
$ export http_proxy=http://proxy:8089
$ export https_proxy=https://proxy:8090
$ export timeout=10
$ explo ...
Modules can be added to improve functionality and classes of security issues.
The http modules allows to make a http request, extract content and search/verify content.
The following data is made available for following steps:
- the http response body:
stepname.response.content - the http response cookies:
stepname.response.cookies - extracted content:
response.extracted.variable_name
If a find_regex parameter is set, a regular expression match is executed on the response body. If this fails, this module returns a failure and thus stopping the executing of the current workflow (and all steps).
When extracting by regular expressions, use the match group extract to mark the value to extract (view below for an example).
For referencing cookies, reference the name of the previous step where cookies should be taken from (cookies: the_other_step.response.cookies).
Parameter examples:
parameter:
url: http://example.commethod: GETallow_redirects: Trueheaders:
User-Agent: exploContent-Type: abccookies: stepname.response.cookiesbody:
key: valuefind: search for stringfind_regex: search for (reg|ular)expressionfind_in_headers: searchstring in headersexpect_response_code: 200extract:
variable1: [CSS, '#csrf']variable2: [REGEX, '<input(.*?)value="(?P<extract>.*?)"']The http_header module allows to check if a response misses a specified set of headers (and values). All other parameters are identical to the http module.
The following data is made available for other modules:
- the http response body:
stepname.response.content - the http response cookies:
stepname.response.cookies
Parameter examples:
parameter:
url: http://example.commethod: GETallow_redirects: Trueheaders:
User-Agent: exploContent-Type: abcbody:
key: valueheaders_required:
X-XSS-Protection: 1Server: . # all values are validThe sqli_blind module is able to identify time based blind sql injections.
The following data is made available for other modules:
- the http response body:
stepname.response.content - the http response cookies:
stepname.response.cookies
Parameter examples:
parameter:
url: http://example.com/vulnerable.php?id=1' waitfor delay '00:00:5'--method: GETdelay_seconds: 5If the threshold of 5 seconds (delay_seconds) is exceeded, the check returns true (and thus resulting in a success).
The metadata block is a special block which can be added as the first block in a .yaml file to add metadata to a vulnerability for further processing. This becomes usefull when explo is used as a lib and metadata for each vulnerability description can be read with meta_from_content(content). This module does not need a name or description.
Examples:
module: metadataparameter:
cvss: 8.9author: Robin Verton
---
name: logindescription: login with test credentialsmodule: httpparameter:
url: http://testphp.vulnweb.com/userinfo.phpmethod: POSTbody:
uname: testpass: test