├── .github
├── ISSUE_TEMPLATE
│ ├── 01_false-positive.md
│ ├── 02_false-negative.md
│ ├── 03_bug-report.md
│ ├── 04_feature.md
│ └── config.yml
└── workflows
│ └── stale.yml
├── .gitignore
├── .gitmodules
├── .travis.yml
├── CHANGES
├── CONTRIBUTING.md
├── CONTRIBUTORS.md
├── INSTALL
├── KNOWN_BUGS
├── LICENSE
├── README.md
├── SECURITY.md
├── crs-setup.conf.example
├── docs
└── README
├── rules
├── REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example
├── REQUEST-901-INITIALIZATION.conf
├── REQUEST-903.9001-DRUPAL-EXCLUSION-RULES.conf
├── REQUEST-903.9002-WORDPRESS-EXCLUSION-RULES.conf
├── REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf
├── REQUEST-903.9004-DOKUWIKI-EXCLUSION-RULES.conf
├── REQUEST-903.9005-CPANEL-EXCLUSION-RULES.conf
├── REQUEST-903.9006-XENFORO-EXCLUSION-RULES.conf
├── REQUEST-905-COMMON-EXCEPTIONS.conf
├── REQUEST-910-IP-REPUTATION.conf
├── REQUEST-911-METHOD-ENFORCEMENT.conf
├── REQUEST-912-DOS-PROTECTION.conf
├── REQUEST-913-SCANNER-DETECTION.conf
├── REQUEST-920-PROTOCOL-ENFORCEMENT.conf
├── REQUEST-921-PROTOCOL-ATTACK.conf
├── REQUEST-930-APPLICATION-ATTACK-LFI.conf
├── REQUEST-931-APPLICATION-ATTACK-RFI.conf
├── REQUEST-932-APPLICATION-ATTACK-RCE.conf
├── REQUEST-933-APPLICATION-ATTACK-PHP.conf
├── REQUEST-934-APPLICATION-ATTACK-NODEJS.conf
├── REQUEST-941-APPLICATION-ATTACK-XSS.conf
├── REQUEST-942-APPLICATION-ATTACK-SQLI.conf
├── REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf
├── REQUEST-944-APPLICATION-ATTACK-JAVA.conf
├── REQUEST-949-BLOCKING-EVALUATION.conf
├── RESPONSE-950-DATA-LEAKAGES.conf
├── RESPONSE-951-DATA-LEAKAGES-SQL.conf
├── RESPONSE-952-DATA-LEAKAGES-JAVA.conf
├── RESPONSE-953-DATA-LEAKAGES-PHP.conf
├── RESPONSE-954-DATA-LEAKAGES-IIS.conf
├── RESPONSE-959-BLOCKING-EVALUATION.conf
├── RESPONSE-980-CORRELATION.conf
├── RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example
├── crawlers-user-agents.data
├── iis-errors.data
├── java-classes.data
├── java-code-leakages.data
├── java-errors.data
├── lfi-os-files.data
├── php-config-directives.data
├── php-errors.data
├── php-function-names-933150.data
├── php-function-names-933151.data
├── php-variables.data
├── restricted-files.data
├── restricted-upload.data
├── scanners-headers.data
├── scanners-urls.data
├── scanners-user-agents.data
├── scripting-user-agents.data
├── sql-errors.data
├── unix-shell.data
└── windows-powershell-commands.data
├── tests
├── integration
│ ├── format_tests.py
│ └── requirements.txt
└── regression
│ ├── CRS_Tests.py
│ ├── CRS_Tests_Journal.py
│ ├── README.md
│ ├── __init__.py
│ ├── config.ini
│ ├── conftest.py
│ ├── requirements.txt
│ ├── tests
│ ├── REQUEST-911-METHOD-ENFORCEMENT
│ │ └── 911100.yaml
│ ├── REQUEST-913-SCANNER-DETECTION
│ │ ├── 913100.yaml
│ │ ├── 913110.yaml
│ │ └── 913120.yaml
│ ├── REQUEST-920-PROTOCOL-ENFORCEMENT
│ │ ├── 920100.yaml
│ │ ├── 920120.yaml
│ │ ├── 920160.yaml
│ │ ├── 920170.yaml
│ │ ├── 920180.yaml
│ │ ├── 920190.yaml
│ │ ├── 920200.yaml
│ │ ├── 920201.yaml
│ │ ├── 920202.yaml
│ │ ├── 920210.yaml
│ │ ├── 920220.yaml
│ │ ├── 920230.yaml
│ │ ├── 920240.yaml
│ │ ├── 920250.yaml
│ │ ├── 920260.yaml
│ │ ├── 920270.yaml
│ │ ├── 920271.yaml
│ │ ├── 920272.yaml
│ │ ├── 920273.yaml
│ │ ├── 920274.yaml
│ │ ├── 920280.yaml
│ │ ├── 920290.yaml
│ │ ├── 920300.yaml
│ │ ├── 920310.yaml
│ │ ├── 920311.yaml
│ │ ├── 920320.yaml
│ │ ├── 920330.yaml
│ │ ├── 920340.yaml
│ │ ├── 920350.yaml
│ │ ├── 920360.yaml
│ │ ├── 920370.yaml
│ │ ├── 920380.yaml
│ │ ├── 920390.yaml
│ │ ├── 920400.yaml
│ │ ├── 920420.yaml
│ │ ├── 920430.yaml
│ │ ├── 920440.yaml
│ │ ├── 920450.yaml
│ │ ├── 920460.yaml
│ │ ├── 920470.yaml
│ │ ├── 920480.yaml
│ │ ├── 920490.yaml
│ │ └── 920500.yaml
│ ├── REQUEST-921-PROTOCOL-ATTACK
│ │ ├── 921110.yaml
│ │ ├── 921120.yaml
│ │ ├── 921130.yaml
│ │ ├── 921140.yaml
│ │ ├── 921150.yaml
│ │ ├── 921160.yaml
│ │ ├── 921190.yaml
│ │ └── 921200.yaml
│ ├── REQUEST-930-APPLICATION-ATTACK-LFI
│ │ ├── 930100.yaml
│ │ ├── 930110.yaml
│ │ └── 930120.yaml
│ ├── REQUEST-931-APPLICATION-ATTACK-RFI
│ │ ├── 931100.yaml
│ │ ├── 931110.yaml
│ │ ├── 931120.yaml
│ │ └── 931130.yaml
│ ├── REQUEST-932-APPLICATION-ATTACK-RCE
│ │ ├── 932100.yaml
│ │ └── 932140.yaml
│ ├── REQUEST-933-APPLICATION-ATTACK-PHP
│ │ ├── 933100.yaml
│ │ ├── 933110.yaml
│ │ ├── 933120.yaml
│ │ ├── 933130.yaml
│ │ ├── 933131.yaml
│ │ ├── 933140.yaml
│ │ ├── 933150.yaml
│ │ ├── 933151.yaml
│ │ ├── 933160.yaml
│ │ ├── 933161.yaml
│ │ ├── 933170.yaml
│ │ ├── 933180.yaml
│ │ └── 933210.yaml
│ ├── REQUEST-934-APPLICATION-ATTACK-NODEJS
│ │ └── 934100.yaml
│ ├── REQUEST-941-APPLICATION-ATTACK-XSS
│ │ ├── 941100.yaml
│ │ ├── 941101.yaml
│ │ ├── 941110.yaml
│ │ ├── 941120.yaml
│ │ ├── 941130.yaml
│ │ ├── 941140.yaml
│ │ ├── 941150.yaml
│ │ ├── 941160.yaml
│ │ ├── 941170.yaml
│ │ ├── 941180.yaml
│ │ ├── 941190.yaml
│ │ ├── 941200.yaml
│ │ ├── 941210.yaml
│ │ ├── 941220.yaml
│ │ ├── 941230.yaml
│ │ ├── 941240.yaml
│ │ ├── 941250.yaml
│ │ ├── 941260.yaml
│ │ ├── 941270.yaml
│ │ ├── 941280.yaml
│ │ ├── 941290.yaml
│ │ ├── 941300.yaml
│ │ ├── 941310.yaml
│ │ ├── 941320.yaml
│ │ ├── 941330.yaml
│ │ ├── 941340.yaml
│ │ ├── 941350.yaml
│ │ ├── 941360.yaml
│ │ ├── 941370.yaml
│ │ └── 941380.yaml
│ ├── REQUEST-942-APPLICATION-ATTACK-SQLI
│ │ ├── 942100.yaml
│ │ ├── 942101.yaml
│ │ ├── 942110.yaml
│ │ ├── 942120.yaml
│ │ ├── 942130.yaml
│ │ ├── 942140.yaml
│ │ ├── 942150.yaml
│ │ ├── 942160.yaml
│ │ ├── 942180.yaml
│ │ ├── 942190.yaml
│ │ ├── 942200.yaml
│ │ ├── 942210.yaml
│ │ ├── 942220.yaml
│ │ ├── 942230.yaml
│ │ ├── 942240.yaml
│ │ ├── 942250.yaml
│ │ ├── 942260.yaml
│ │ ├── 942270.yaml
│ │ ├── 942280.yaml
│ │ ├── 942290.yaml
│ │ ├── 942300.yaml
│ │ ├── 942310.yaml
│ │ ├── 942320.yaml
│ │ ├── 942330.yaml
│ │ ├── 942340.yaml
│ │ ├── 942350.yaml
│ │ ├── 942360.yaml
│ │ ├── 942361.yaml
│ │ ├── 942370.yaml
│ │ ├── 942380.yaml
│ │ ├── 942390.yaml
│ │ ├── 942400.yaml
│ │ ├── 942410.yaml
│ │ ├── 942420.yaml
│ │ ├── 942421.yaml
│ │ ├── 942430.yaml
│ │ ├── 942431.yaml
│ │ ├── 942432.yaml
│ │ ├── 942440.yaml
│ │ ├── 942450.yaml
│ │ ├── 942470.yaml
│ │ ├── 942480.yaml
│ │ ├── 942490.yaml
│ │ ├── 942500.yaml
│ │ ├── 942510.yaml
│ │ └── 942511.yaml
│ ├── REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION
│ │ ├── 943100.yaml
│ │ ├── 943110.yaml
│ │ └── 943120.yaml
│ ├── REQUEST-944-APPLICATION-ATTACK-JAVA
│ │ ├── 944000.yaml
│ │ ├── 944100.yaml
│ │ ├── 944110.yaml
│ │ ├── 944120.yaml
│ │ ├── 944130.yaml
│ │ ├── 944200.yaml
│ │ ├── 944210.yaml
│ │ ├── 944240.yaml
│ │ ├── 944250.yaml
│ │ └── 944300.yaml
│ ├── base_positive_rules.py
│ ├── positivetest-light.yaml.skeleton
│ └── positivetest.yaml.skeleton
│ └── utils
│ ├── data
│ └── popularUAs.data
│ ├── testSampling.py
│ └── testUserAgents.py
└── util
├── README
├── av-scanning
├── runAV
│ ├── common.c
│ ├── common.h
│ ├── comp
│ ├── runAV-clamd.c
│ └── runAV.c
└── runav.pl
├── browser-tools
└── js-overrides.js
├── crs2-renumbering
├── IdNumbering.csv
├── README
└── update.py
├── docker
├── Dockerfile
├── Dockerfile-2.9-apache
├── Dockerfile-3.0-apache
├── Dockerfile-3.0-nginx
├── README.md
├── REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
├── RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
├── docker-compose.yaml
├── docker-entrypoint.sh
├── httpd-logging-after-modsec.conf
├── httpd-logging-before-modsec.conf
└── proxy.conf
├── geo-location
└── README
├── honeypot-sensor
├── README.md
├── mlogc-honeypot-sensor.conf
└── modsecurity_crs_10_honeypot.conf
├── id-range
├── join-multiline-rules
└── join.py
├── regexp-assemble
├── regexp-932100.txt
├── regexp-932105.txt
├── regexp-932106.txt
├── regexp-932110.txt
├── regexp-932115.txt
├── regexp-932130.data
├── regexp-932140.data
├── regexp-932150.txt
├── regexp-933131.data
├── regexp-933160.data
├── regexp-933161.data
├── regexp-934100.txt
├── regexp-941130.data
├── regexp-941160.data
├── regexp-942120.data
├── regexp-942130.data
├── regexp-942140.data
├── regexp-942150.data
├── regexp-942170.data
├── regexp-942180.data
├── regexp-942190.data
├── regexp-942200.data
├── regexp-942210.data
├── regexp-942240.data
├── regexp-942260.data
├── regexp-942280.data
├── regexp-942300.data
├── regexp-942310.data
├── regexp-942320.data
├── regexp-942330.data
├── regexp-942340.data
├── regexp-942350.data
├── regexp-942360.data
├── regexp-942370.data
├── regexp-942380.data
├── regexp-942390.data
├── regexp-942400.data
├── regexp-942410.data
├── regexp-942470.data
├── regexp-942480.data
├── regexp-assemble-v2.pl
├── regexp-assemble.pl
└── regexp-cmdline.py
├── regression-tests
└── tests
│ └── REQUEST-920-PROTOCOL-ENFORCEMENT
│ └── 920181.yaml
├── send-payload-pls.sh
├── verify.rb
└── virtual-patching
├── arachni2modsec.pl
└── zap2modsec.pl
/.github/ISSUE_TEMPLATE/01_false-positive.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 'False positive'
3 | about: Report a false positive (incorrect blocking)
4 | title: ''
5 | labels: 'False Positive'
6 | assignees: ''
7 | ---
8 |
9 | PLEASE DON'T CREATE NEW ISSUES USING THIS REPO.
10 |
11 | WE ARE PERFORMING A MIGRATION RIGHT NOW.
12 |
13 | ### Description
14 |
15 |
16 |
17 |
18 |
19 | ### Audit Logs / Triggered Rule Numbers
20 |
21 |
22 |
23 |
24 | ### Your Environment
25 |
26 |
27 |
28 |
29 | * CRS version (e.g., v3.2.0):
30 | * Paranoia level setting:
31 | * ModSecurity version (e.g., 2.9.3):
32 | * Web Server and version (e.g., apache 2.4.41):
33 | * Operating System and version:
34 |
35 | ### Confirmation
36 |
37 | [ ] I have removed any personal data (email addresses, IP addresses,
38 | passwords, domain names) from any logs posted.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/02_false-negative.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 'False negative'
3 | about: Report a false negative (incorrect bypass)
4 | title: ''
5 | labels: 'False Negative - Evasion'
6 | assignees: ''
7 | ---
8 |
9 | PLEASE DON'T CREATE NEW ISSUES USING THIS REPO.
10 |
11 | WE ARE PERFORMING A MIGRATION RIGHT NOW.
12 |
13 | ### Description
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ### Your Environment
24 |
25 |
26 |
27 |
28 | * CRS version (e.g., v3.2.0):
29 | * Paranoia level setting:
30 | * ModSecurity version (e.g., 2.9.3):
31 | * Web Server and version (e.g., apache 2.4.41):
32 | * Operating System and version:
33 |
34 | ### Confirmation
35 |
36 | [ ] I have removed any personal data (email addresses, IP addresses,
37 | passwords, domain names) from any logs posted.
38 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/03_bug-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: '🐞 Bug report'
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: 'Bug'
6 | assignees: ''
7 | ---
8 |
9 | PLEASE DON'T CREATE NEW ISSUES USING THIS REPO.
10 |
11 | WE ARE PERFORMING A MIGRATION RIGHT NOW.
12 |
13 | ### Describe the bug
14 |
15 |
16 |
17 | ### Steps to reproduce
18 |
19 |
20 |
21 | ### Expected behaviour
22 |
23 |
24 |
25 | ### Actual behaviour
26 |
27 |
28 |
29 |
30 | ### Additional context
31 |
32 |
33 |
34 | ### Your Environment
35 |
36 |
37 |
38 |
39 | * CRS version (e.g., v3.2.0):
40 | * Paranoia level setting:
41 | * ModSecurity version (e.g., 2.9.3):
42 | * Web Server and version (e.g., apache 2.4.41):
43 | * Operating System and version:
44 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/04_feature.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: '🚀 Feature request'
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: 'Feature Request'
6 | assignees: ''
7 | ---
8 |
9 | PLEASE DON'T CREATE NEW ISSUES USING THIS REPO.
10 |
11 | WE ARE PERFORMING A MIGRATION RIGHT NOW.
12 |
13 | ### Motivation
14 |
15 |
16 |
17 |
18 | ### Proposed solution
19 |
20 |
21 |
22 |
23 | ### Alternatives
24 |
25 |
26 |
27 |
28 |
29 | ### Additional context
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Help and support
4 | url: https://security.stackexchange.com/questions/tagged/owasp-crs
5 | about: For help and support please go here.
6 | - name: OWASP Core Rule Set mailing list
7 | url: https://groups.google.com/a/owasp.org/forum/#!forum/modsecurity-core-rule-set-project
8 | about: Ask general usage questions and participate in discussions on the CRS.
9 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | name: Mark stale issues
2 |
3 | on:
4 | schedule:
5 | - cron: "0 0 * * *"
6 |
7 | jobs:
8 | stale:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/stale@v1
14 | with:
15 | repo-token: ${{ secrets.GITHUB_TOKEN }}
16 | stale-issue-message: 'This issue has been open 120 days with no activity. Remove the stale label or comment, or this will be closed in 14 days'
17 | stale-issue-label: 'Stale issue'
18 | days-before-stale: 120
19 | days-before-close: 14
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | *.swo
3 |
4 | # User configuration
5 | crs-setup.conf
6 | rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
7 | rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
8 |
9 | # The MaxMind GeoIP database can be downloaded or upgraded by running:
10 | # util/upgrade.py geoip
11 | util/geo-location/GeoIP.dat
12 |
13 | # Unit test caches
14 | .cache
15 |
16 | # Byte-compiled / optimized / DLL files
17 | __pycache__/
18 | *.py[cod]
19 | *$py.class
20 |
21 | .idea/
22 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "docs/OWASP-CRS-Documentation"]
2 | path = docs/OWASP-CRS-Documentation
3 | url = https://github.com/SpiderLabs/OWASP-CRS-Documentation
4 | branch = master
5 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | os: linux
2 | language: python
3 | python:
4 | - 2.7
5 |
6 | # no more required in travis
7 | #sudo: required
8 |
9 | services:
10 | - docker
11 |
12 | jobs:
13 | include:
14 | script:
15 | - |
16 | if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
17 | docker run -ti --name crs-test --entrypoint /docker-entrypoint.sh -e REPO=$TRAVIS_PULL_REQUEST_SLUG -e BRANCH=$TRAVIS_PULL_REQUEST_BRANCH themiddle/crs-test
18 | else
19 | docker run -ti --name crs-test --entrypoint /docker-entrypoint.sh -e REPO=$TRAVIS_REPO_SLUG -e BRANCH=$TRAVIS_BRANCH themiddle/crs-test
20 | fi
21 |
22 | # safelist
23 | branches:
24 | only:
25 | - v3.1/dev
26 | - v3.2/dev
27 | - v3.3/dev
28 | - fix-travis
29 |
30 | #notifications:
31 | # irc: "chat.freenode.net#modsecurity"
32 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 |
5 | OWASP CRS has two types of releases, Major releases (3.0.0, 3.1.0, 3.2.0 etc.) and point releases (3.0.1, 3.0.2 etc.).
6 | For more information see our [wiki](https://github.com/SpiderLabs/owasp-modsecurity-crs/wiki/Release-Policy).
7 | The OWASP CRS officially supports the two point releases with security patching preceding the current major release .
8 | We are happy to receive and merge PR's that address security issues in older versions of the project, but the team itself may choose not to fix these.
9 | Along those lines, OWASP CRS team may not issue security notifications for unsupported software.
10 |
11 | | Version | Supported |
12 | | --------- | ------------------ |
13 | | 3.3.x-dev | :white_check_mark: |
14 | | 3.2.x | :white_check_mark: |
15 | | 3.1.x | :white_check_mark: |
16 | | 3.0.x | :x: |
17 |
18 | ## Reporting a Vulnerability
19 |
20 | We strive to make the OWASP ModSecurity CRS accessible to a wide audience of beginner and experienced users.
21 | We welcome bug reports, false positive alert reports, evasions, usability issues, and suggestions for new detections.
22 | Submit these types of non-vulnerability related issues via Github.
23 | Please include your installed version and the relevant portions of your audit log.
24 | False negative or common bypasses should [create an issue](https://github.com/SpiderLabs/owasp-modsecurity-crs/issues/new) so they can be addressed.
25 |
26 | Do this before submitting a vulnerability using our email:
27 | 1) Verify that you have the latest version of OWASP CRS.
28 | 2) Validate which Paranoia Level this bypass applies to. If it works in PL4, please send us an email.
29 | 3) If you detected anything that causes unexpected behavior of the engine via manipulation of existing CRS provided rules, please send it by email.
30 |
31 | Our email is [security@coreruleset.org](mailto:security@coreruleset.org). You can send us encrypted email using [this key](https://coreruleset.org/security.asc), (fingerprint: `3600 6F0E 0BA1 6783 2158 8211 38EE ACA1 AB8A 6E72`).
32 |
33 | We are happy to work with the community to provide CVE identifiers for any discovered security issues if requested.
34 |
35 | If in doubt, feel free to reach out to us!
36 |
--------------------------------------------------------------------------------
/docs/README:
--------------------------------------------------------------------------------
1 | Welcome to the OWASP Core Rule Set (CRS) documentation.
2 | The OWASP CRS documentation is generated as a Sphinx project and is stored in a separate Github repository. While the documentation is available as part of the CRS project it is provided in the form of a git-submodule. Using a git-submodule allow us to update the documentation without making changes to the main rule repository.
3 |
4 | You can download the documentation using git:
5 | $ git submodule init
6 | $ git submodule update
7 |
8 | Alternatively, the latest version of the documentation is available at https://www.modsecurity.org/CRS/Documentation/
9 |
--------------------------------------------------------------------------------
/rules/REQUEST-903.9005-CPANEL-EXCLUSION-RULES.conf:
--------------------------------------------------------------------------------
1 | # ------------------------------------------------------------------------
2 | # OWASP ModSecurity Core Rule Set ver.3.2.0
3 | # Copyright (c) 2006-2019 Trustwave and contributors. All rights reserved.
4 | #
5 | # The OWASP ModSecurity Core Rule Set is distributed under
6 | # Apache Software License (ASL) version 2
7 | # Please see the enclosed LICENSE file for full details.
8 | # ------------------------------------------------------------------------
9 |
10 | # These exclusions remedy false positives in a default cPanel environment.
11 | # The exclusions are only active if crs_exclusions_cpanel=1 is set.
12 | # See rule 900130 in crs-setup.conf.example for instructions.
13 |
14 |
15 | SecRule &TX:crs_exclusions_cpanel|TX:crs_exclusions_cpanel "@eq 0" \
16 | "id:9005000,\
17 | phase:1,\
18 | pass,\
19 | t:none,\
20 | nolog,\
21 | ver:'OWASP_CRS/3.2.0',\
22 | skipAfter:END-CPANEL"
23 |
24 | SecRule &TX:crs_exclusions_cpanel|TX:crs_exclusions_cpanel "@eq 0" \
25 | "id:9005001,\
26 | phase:2,\
27 | pass,\
28 | t:none,\
29 | nolog,\
30 | ver:'OWASP_CRS/3.2.0',\
31 | skipAfter:END-CPANEL"
32 |
33 |
34 | #
35 | # [ cPanel whm-server-status ]
36 | #
37 | # Cpanel's WHM auto generates requests to /whm-server-status from
38 | # 127.0.0.1 (triggers rule 920280, non-blocking, log only) Once every 5 minutes.
39 | # These false positives have a low impact (logged, non-blocking) to a large number of users (all cPanel admins).
40 | #
41 |
42 | #
43 | # Rule to allow cPanel whm-server-status requests from localhost without log entry.
44 | #
45 | SecRule REQUEST_LINE "@rx ^GET /whm-server-status(?:/|/\?auto)? HTTP/[12]\.[01]$" \
46 | "id:9005100,\
47 | phase:1,\
48 | pass,\
49 | t:none,\
50 | nolog,\
51 | tag:'application-multi',\
52 | tag:'language-multi',\
53 | tag:'platform-apache',\
54 | tag:'attack-generic',\
55 | ver:'OWASP_CRS/3.2.0',\
56 | chain"
57 | SecRule REMOTE_ADDR "@ipMatch 127.0.0.1,::1" \
58 | "t:none,\
59 | ctl:ruleRemoveById=920280,\
60 | ctl:ruleRemoveById=920350"
61 |
62 |
63 | SecMarker "END-CPANEL"
64 |
--------------------------------------------------------------------------------
/rules/REQUEST-905-COMMON-EXCEPTIONS.conf:
--------------------------------------------------------------------------------
1 | # ------------------------------------------------------------------------
2 | # OWASP ModSecurity Core Rule Set ver.3.2.0
3 | # Copyright (c) 2006-2019 Trustwave and contributors. All rights reserved.
4 | #
5 | # The OWASP ModSecurity Core Rule Set is distributed under
6 | # Apache Software License (ASL) version 2
7 | # Please see the enclosed LICENSE file for full details.
8 | # ------------------------------------------------------------------------
9 |
10 |
11 | # This file is used as an exception mechanism to remove common false positives
12 | # that may be encountered.
13 | #
14 | # Exception for Apache SSL pinger
15 | #
16 | SecRule REQUEST_LINE "@streq GET /" \
17 | "id:905100,\
18 | phase:1,\
19 | pass,\
20 | t:none,\
21 | nolog,\
22 | tag:'application-multi',\
23 | tag:'language-multi',\
24 | tag:'platform-apache',\
25 | tag:'attack-generic',\
26 | ver:'OWASP_CRS/3.2.0',\
27 | chain"
28 | SecRule REMOTE_ADDR "@ipMatch 127.0.0.1,::1" \
29 | "t:none,\
30 | ctl:ruleEngine=Off,\
31 | ctl:auditEngine=Off"
32 |
33 | #
34 | # Exception for Apache internal dummy connection
35 | #
36 | SecRule REMOTE_ADDR "@ipMatch 127.0.0.1,::1" \
37 | "id:905110,\
38 | phase:1,\
39 | pass,\
40 | t:none,\
41 | nolog,\
42 | tag:'application-multi',\
43 | tag:'language-multi',\
44 | tag:'platform-apache',\
45 | tag:'attack-generic',\
46 | ver:'OWASP_CRS/3.2.0',\
47 | chain"
48 | SecRule REQUEST_HEADERS:User-Agent "@endsWith (internal dummy connection)" \
49 | "t:none,\
50 | chain"
51 | SecRule REQUEST_LINE "@rx ^(?:GET /|OPTIONS \*) HTTP/[12]\.[01]$" \
52 | "t:none,\
53 | ctl:ruleEngine=Off,\
54 | ctl:auditEngine=Off"
55 |
--------------------------------------------------------------------------------
/rules/crawlers-user-agents.data:
--------------------------------------------------------------------------------
1 | # Search engine crawlers and other bots
2 | # crawler
3 | # https://80legs.com/
4 | 80legs
5 | # site ripper
6 | # http://www.softbytelabs.com/en/BlackWidow/
7 | black widow
8 | blackwidow
9 | # crawler
10 | # 2006
11 | prowebwalker
12 | # generic crawler
13 | pymills-spider/
14 | # SEO
15 | # https://ahrefs.com/robot
16 | AhrefsBot
17 | # people database
18 | # https://pipl.com/bot/
19 | PiplBot
20 | # advertising targeting
21 | # https://www.grapeshot.com/crawler/
22 | GrapeshotCrawler/2.0
23 | grapeFX
24 | # SEO
25 | # http://www.searchmetrics.com/searchmetricsbot/
26 | SearchmetricsBot
27 | # SEO
28 | # https://www.semrush.com/bot/
29 | SemrushBot
30 | # SEO
31 | # https://moz.com/help/guides/moz-procedures/what-is-rogerbot
32 | rogerbot
33 | # SEO
34 | # http://www.majestic12.co.uk/projects/dsearch/mj12bot.php
35 | MJ12bot
36 | # news service
37 | Owlin bot
38 | # misbehaving spider
39 | Lingewoud-550-Spyder
40 | # https://www.wappalyzer.com/
41 | Wappalyzer
42 |
--------------------------------------------------------------------------------
/rules/iis-errors.data:
--------------------------------------------------------------------------------
1 |
HTTP 403.6 - Forbidden: IP address rejected
2 | 500 Internal Server Error
3 | Microsoft VBScript runtime (0x8
4 | error '800
5 | Application uses a value of the wrong type for the current operation
6 | Microsoft VBScript compilation (0x8
7 | Microsoft VBScript compilation error
8 | Microsoft .NET Framework Version:
9 | A trappable error occurred in an external object. The script cannot continue running
10 | Microsoft VBScript runtime Error
11 | >Syntax error in string in query expression
12 | ADODB.Command
13 | Object required: '
14 |
--------------------------------------------------------------------------------
/rules/java-classes.data:
--------------------------------------------------------------------------------
1 | com.opensymphony.xwork2
2 | com.sun.org.apache
3 | java.io.BufferedInputStream
4 | java.io.BufferedReader
5 | java.io.ByteArrayInputStream
6 | java.io.ByteArrayOutputStream
7 | java.io.CharArrayReader
8 | java.io.DataInputStream
9 | java.io.File
10 | java.io.FileOutputStream
11 | java.io.FilePermission
12 | java.io.FileWriter
13 | java.io.FilterInputStream
14 | java.io.FilterOutputStream
15 | java.io.FilterReader
16 | java.io.InputStream
17 | java.io.InputStreamReader
18 | java.io.LineNumberReader
19 | java.io.ObjectOutputStream
20 | java.io.OutputStream
21 | java.io.PipedOutputStream
22 | java.io.PipedReader
23 | java.io.PrintStream
24 | java.io.PushbackInputStream
25 | java.io.Reader
26 | java.io.StringReader
27 | java.lang.Class
28 | java.lang.Integer
29 | java.lang.Number
30 | java.lang.Object
31 | java.lang.Process
32 | java.lang.ProcessBuilder
33 | java.lang.reflect
34 | java.lang.Runtime
35 | java.lang.String
36 | java.lang.StringBuilder
37 | java.lang.System
38 | javax.script.ScriptEngineManager
39 | org.apache.commons
40 | org.apache.struts
41 | org.apache.struts2
42 | org.omg.CORBA
43 | java.beans.XMLDecode
44 |
--------------------------------------------------------------------------------
/rules/java-code-leakages.data:
--------------------------------------------------------------------------------
1 | hello.html
3 | /actSensepostnottherenonotive
4 | /acunetix-wvs-test-for-some-inexistent-file
5 | /antidisestablishmentarianism
6 | /appscan_fingerprint/mac_address
7 | /arachni-
8 | /cybercop
9 | /nessus_is_probing_you_
10 | /nessustest
11 | /netsparker-
12 | /rfiinc.txt
13 | /thereisnowaythat-you-canbethere
14 | /w3af/remotefileinclude.html
15 | appscan_fingerprint
16 | w00tw00t.at.ISC.SANS.DFind
17 | w00tw00t.at.blackhats.romanian.anti-sec
18 |
--------------------------------------------------------------------------------
/rules/scripting-user-agents.data:
--------------------------------------------------------------------------------
1 | # Generic HTTP clients (popular libraries)
2 |
3 | # http library
4 | # http://search.cpan.org/~opera/HTTP-DAV/DAV.pm
5 | dav.pm/v
6 | # http library
7 | # http://search.cpan.org/dist/libwww-perl/lib/LWP.pm
8 | libwww-perl
9 | # generic
10 | mozilla/4.0 (compatible)
11 | mozilla/4.0 (compatible; msie 6.0; win32)
12 | mozilla/5.0 sf/
13 | mozilla/5.0 sf//
14 | # http library
15 | # https://pypi.python.org/pypi/httplib2
16 | python-httplib2
17 | # http library
18 | # http://docs.python-requests.org/en/master/
19 | python-requests
20 | # http library
21 | # https://docs.python.org/2/library/urllib.html
22 | Python-urllib
23 | # http library
24 | # https://github.com/typhoeus/typhoeus
25 | typhoeus
26 | # http library
27 | # https://msdn.microsoft.com/en-us/library/windows/desktop/aa382925%28v=vs.85%29.aspx
28 | winhttp.winhttprequest
29 |
--------------------------------------------------------------------------------
/rules/sql-errors.data:
--------------------------------------------------------------------------------
1 | MySqlClient.
2 | Server message
3 | SQL error
4 | Oracle error
5 | JET Database Engine
6 | Procedure or function
7 | SQLite.Exception
8 | [IBM][CLI Driver][DB2/6000]
9 | the used select statements have different number of columns
10 | org.postgresql.util.PSQLException
11 | Access Database Engine
12 | Incorrect syntax near
13 | Syntax error in string in query expression
14 | SQLiteException
15 | ' doesn't exist
16 | CLI Driver
17 | on MySQL result index
18 | sybase
19 | com.informix.jdbc
20 | [MySQL][ODBC
21 | Error
22 | has occurred in the vicinity of:
23 | Sintaxis incorrecta cerca de
24 | MySQL server version for the right syntax to use
25 | com.mysql.jdbc.exceptions
26 | You have an error in your SQL syntax near
27 | You have an error in your SQL syntax;
28 | An illegal character has been found in the statement
29 | pg_query() [:
30 | supplied argument is not a valid MySQL
31 | mssql_query()
32 | mysql_fetch_array()
33 | Exception
34 | java.sql.SQLException
35 | Column count doesn't match value count at row
36 | Sybase message
37 | SQL Server
38 | PostgreSQL query failed:
39 | Dynamic SQL Error
40 | System.Data.SQLite.SQLiteException
41 | SQLite/JDBCDriver
42 | Unclosed quotation mark before the character string
43 | System.Data.SqlClient.
44 | Unclosed quotation mark after the character string
45 | System.Data.OleDb.OleDbException
46 | [DM_QUERY_E_SYNTAX]
47 | [SqlException
48 | Unexpected end of command in statement
49 | valid PostgreSQL result
50 | pg_exec() [:
51 | SQL Server
52 | [SQLITE_ERROR]
53 | Microsoft OLE DB Provider for ODBC Drivers
54 | PostgreSQL
55 | org.hsqldb.jdbc
56 | ADODB.Field (0x800A0BCD)
57 | SQL syntax
58 | Exception
59 | System.Data.SqlClient.SqlException
60 | Data type mismatch in criteria expression.
61 | Driver
62 | DB2 SQL error
63 | Sybase message:
64 | ORA-
65 | [Microsoft][ODBC SQL Server Driver]
66 | '80040e14'
67 | Microsoft OLE DB Provider for SQL Server
68 | in query expression
69 | Npgsql.
70 | valid MySQL result
71 | supplied argument is not a valid PostgreSQL result
72 | db2_
73 | Ingres SQLSTATE
74 | Column count doesn't match
75 | Warning
76 | [Microsoft][ODBC Microsoft Access Driver]
77 | [Macromedia][SQLServer JDBC Driver]
78 | Warning: ibase_
79 | Roadhouse.Cms.
80 | DB2 SQL error:
81 |
--------------------------------------------------------------------------------
/rules/unix-shell.data:
--------------------------------------------------------------------------------
1 | ${CDPATH}
2 | ${DIRSTACK}
3 | ${HOME}
4 | ${HOSTNAME}
5 | ${IFS}
6 | ${OLDPWD}
7 | ${OSTYPE}
8 | ${PATH}
9 | ${PWD}
10 | $CDPATH
11 | $DIRSTACK
12 | $HOME
13 | $HOSTNAME
14 | $IFS
15 | $OLDPWD
16 | $OSTYPE
17 | $PATH
18 | $PWD
19 | bin/bash
20 | bin/cat
21 | bin/csh
22 | bin/dash
23 | bin/du
24 | bin/echo
25 | bin/grep
26 | bin/less
27 | bin/ls
28 | bin/mknod
29 | bin/more
30 | bin/nc
31 | bin/ps
32 | bin/rbash
33 | bin/sh
34 | bin/sleep
35 | bin/su
36 | bin/tcsh
37 | bin/uname
38 | dev/fd/
39 | dev/null
40 | dev/stderr
41 | dev/stdin
42 | dev/stdout
43 | dev/tcp/
44 | dev/udp/
45 | dev/zero
46 | etc/group
47 | etc/master.passwd
48 | etc/passwd
49 | etc/pwd.db
50 | etc/shadow
51 | etc/shells
52 | etc/spwd.db
53 | proc/self/
54 | usr/bin/awk
55 | usr/bin/base64
56 | usr/bin/cat
57 | usr/bin/cc
58 | usr/bin/clang
59 | usr/bin/clang++
60 | usr/bin/curl
61 | usr/bin/diff
62 | usr/bin/env
63 | usr/bin/fetch
64 | usr/bin/file
65 | usr/bin/find
66 | usr/bin/ftp
67 | usr/bin/gawk
68 | usr/bin/gcc
69 | usr/bin/head
70 | usr/bin/hexdump
71 | usr/bin/id
72 | usr/bin/less
73 | usr/bin/ln
74 | usr/bin/mkfifo
75 | usr/bin/more
76 | usr/bin/nc
77 | usr/bin/ncat
78 | usr/bin/nice
79 | usr/bin/nmap
80 | usr/bin/perl
81 | usr/bin/php
82 | usr/bin/php5
83 | usr/bin/php7
84 | usr/bin/php-cgi
85 | usr/bin/printf
86 | usr/bin/psed
87 | usr/bin/python
88 | usr/bin/python2
89 | usr/bin/python3
90 | usr/bin/ruby
91 | usr/bin/sed
92 | usr/bin/socat
93 | usr/bin/tail
94 | usr/bin/tee
95 | usr/bin/telnet
96 | usr/bin/top
97 | usr/bin/uname
98 | usr/bin/wget
99 | usr/bin/who
100 | usr/bin/whoami
101 | usr/bin/xargs
102 | usr/bin/xxd
103 | usr/bin/yes
104 | usr/local/bin/bash
105 | usr/local/bin/curl
106 | usr/local/bin/ncat
107 | usr/local/bin/nmap
108 | usr/local/bin/perl
109 | usr/local/bin/php
110 | usr/local/bin/python
111 | usr/local/bin/python2
112 | usr/local/bin/python3
113 | usr/local/bin/rbash
114 | usr/local/bin/ruby
115 | usr/local/bin/wget
116 |
--------------------------------------------------------------------------------
/tests/integration/format_tests.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 | import pytest
3 | import os
4 | import sys
5 |
6 | def get_file_list(start):
7 | """
8 | Gets the file list of all files that end in .conf
9 | """
10 | valid_files = []
11 | for root, dirs, files in os.walk(start):
12 | for name in files:
13 | if name[-5:] == ".conf":
14 | valid_files.append(os.path.join(root,name))
15 | return valid_files
16 |
17 |
18 | def test_trailing_whitespace():
19 | """
20 | Test to ensure that there is no line with trailing whitespace
21 | """
22 | test_failed = False
23 | files = get_file_list(".")
24 | for fname in files:
25 | with open(fname,'r') as fp:
26 | for i,line in enumerate(fp):
27 | if len(line) > 1 and line[-2] == ' ':
28 | print("Line", i+1, "in", fname, "has trailing whitespace.")
29 | test_failed = True
30 | assert test_failed == False
31 |
--------------------------------------------------------------------------------
/tests/integration/requirements.txt:
--------------------------------------------------------------------------------
1 | pytest>=2.9.1
2 |
--------------------------------------------------------------------------------
/tests/regression/CRS_Tests.py:
--------------------------------------------------------------------------------
1 | from ftw import ruleset, logchecker, testrunner
2 | import datetime
3 | import pytest
4 | import sys
5 | import re
6 | import os
7 |
8 |
9 | def test_crs(ruleset, test, logchecker_obj):
10 | runner = testrunner.TestRunner()
11 | for stage in test.stages:
12 | runner.run_stage(stage, logchecker_obj)
13 |
14 |
15 | class FooLogChecker(logchecker.LogChecker):
16 | def __init__(self, config):
17 | super(FooLogChecker, self).__init__()
18 | self.log_location = config['log_location_linux']
19 | self.log_date_regex = config['log_date_regex']
20 | self.log_date_format = config['log_date_format']
21 |
22 | def reverse_readline(self, filename):
23 | with open(filename) as f:
24 | f.seek(0, os.SEEK_END)
25 | position = f.tell()
26 | line = ''
27 | while position >= 0:
28 | f.seek(position)
29 | next_char = f.read(1)
30 | if next_char == "\n":
31 | yield line[::-1]
32 | line = ''
33 | else:
34 | line += next_char
35 | position -= 1
36 | yield line[::-1]
37 |
38 | def get_logs(self):
39 | pattern = re.compile(r'%s' % self.log_date_regex)
40 | our_logs = []
41 | for lline in self.reverse_readline(self.log_location):
42 | # Extract dates from each line
43 | match = re.match(pattern, lline)
44 | if match:
45 | log_date = match.group(1)
46 | log_date = datetime.datetime.strptime(
47 | log_date, self.log_date_format)
48 | # NGINX doesn't give us microsecond level by detail, round down.
49 | if "%f" not in self.log_date_format:
50 | ftw_start = self.start.replace(microsecond=0)
51 | else:
52 | ftw_start = self.start
53 | ftw_end = self.end
54 | if log_date <= ftw_end and log_date >= ftw_start:
55 | our_logs.append(lline)
56 | # If our log is from before FTW started stop
57 | if log_date < ftw_start:
58 | break
59 | return our_logs
60 |
61 |
62 | @pytest.fixture(scope='session')
63 | def logchecker_obj(config):
64 | return FooLogChecker(config)
65 |
--------------------------------------------------------------------------------
/tests/regression/CRS_Tests_Journal.py:
--------------------------------------------------------------------------------
1 | from ftw import ruleset, logchecker, testrunner
2 | import datetime
3 | import pytest
4 | import sys
5 | import re
6 | import os
7 |
8 |
9 | def test_crs(ruleset, test, logchecker_obj, with_journal, tablename):
10 | runner = testrunner.TestRunner()
11 | for stage in test.stages:
12 | runner.run_stage_with_journal(test.ruleset_meta['name'], test, with_journal, tablename, logchecker_obj)
13 |
14 |
15 | class FooLogChecker(logchecker.LogChecker):
16 | def __init__(self, config):
17 | super(FooLogChecker, self).__init__()
18 | self.log_location = config['log_location_linux']
19 | self.log_date_regex = config['log_date_regex']
20 | self.log_date_format = config['log_date_format']
21 |
22 | def reverse_readline(self, filename):
23 | with open(filename) as f:
24 | f.seek(0, os.SEEK_END)
25 | position = f.tell()
26 | line = ''
27 | while position >= 0:
28 | f.seek(position)
29 | next_char = f.read(1)
30 | if next_char == "\n":
31 | yield line[::-1]
32 | line = ''
33 | else:
34 | line += next_char
35 | position -= 1
36 | yield line[::-1]
37 |
38 | def get_logs(self):
39 | pattern = re.compile(r'%s' % self.log_date_regex)
40 | our_logs = []
41 | for lline in self.reverse_readline(self.log_location):
42 | # Extract dates from each line
43 | match = re.match(pattern, lline)
44 | if match:
45 | log_date = match.group(1)
46 | log_date = datetime.datetime.strptime(
47 | log_date, self.log_date_format)
48 | # NGINX doesn't give us microsecond level by detail, round down.
49 | if "%f" not in self.log_date_format:
50 | ftw_start = self.start.replace(microsecond=0)
51 | else:
52 | ftw_start = self.start
53 | ftw_end = self.end
54 | if log_date <= ftw_end and log_date >= ftw_start:
55 | our_logs.append(lline)
56 | # If our log is from before FTW started stop
57 | if log_date < ftw_start:
58 | break
59 | return our_logs
60 |
61 |
62 | @pytest.fixture(scope='session')
63 | def logchecker_obj(config):
64 | return FooLogChecker(config)
65 |
--------------------------------------------------------------------------------
/tests/regression/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpiderLabs/owasp-modsecurity-crs/56ff01a8408bd387fe14f7856391c48e245b7937/tests/regression/__init__.py
--------------------------------------------------------------------------------
/tests/regression/config.ini:
--------------------------------------------------------------------------------
1 | [2.9-apache]
2 | log_date_format = %a %b %d %H:%M:%S.%f %Y
3 | log_date_regex = \[([A-Z][a-z]{2} [A-z][a-z]{2} \d{1,2} \d{1,2}\:\d{1,2}\:\d{1,2}\.\d+? \d{4})\]
4 | log_location_linux = /var/log/apache2/error.log
5 |
6 | [3.0-apache]
7 | log_date_format = %a %b %d %H:%M:%S.%f %Y
8 | log_date_regex = \[([A-Z][a-z]{2} [A-z][a-z]{2} \d{1,2} \d{1,2}\:\d{1,2}\:\d{1,2}\.\d+? \d{4})\]
9 | log_location_linux = /var/log/apache2/error.log
10 |
11 | [3.0-nginx]
12 | log_date_format = %Y/%m/%d %H:%M:%S
13 | log_date_regex = (\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2})
14 | log_location_linux = /var/log/nginx/error.log
15 |
--------------------------------------------------------------------------------
/tests/regression/conftest.py:
--------------------------------------------------------------------------------
1 | try:
2 | import ConfigParser as configparser
3 | except ImportError:
4 | import configparser
5 | import os
6 | import pytest
7 |
8 |
9 | def pytest_addoption(parser):
10 | parser.addoption('--config', action='store', default='2.9-apache')
11 |
12 |
13 | @pytest.fixture(scope='session')
14 | def config(request):
15 | cp = configparser.RawConfigParser()
16 | cp.read(os.path.join(os.path.dirname(__file__), 'config.ini'))
17 | return dict(cp.items(request.config.getoption('--config')))
18 |
--------------------------------------------------------------------------------
/tests/regression/requirements.txt:
--------------------------------------------------------------------------------
1 | ftw==1.1.7
2 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-913-SCANNER-DETECTION/913110.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: csanders-git
4 | description: None
5 | enabled: true
6 | name: 913110.yaml
7 | tests:
8 | -
9 | test_title: 913110-1
10 | desc: Request Indicates a Security Scanner Scanned the Site (913110) from old modsec
11 | regressions
12 | stages:
13 | -
14 | stage:
15 | input:
16 | dest_addr: 127.0.0.1
17 | headers:
18 | Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
19 | Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
20 | Accept-Encoding: gzip,deflate
21 | Accept-Language: en-us,en;q=0.5
22 | Acunetix-Product: WVS/5.0 (Acunetix Web Vulnerability Scanner - EVALUATION)
23 | Host: localhost
24 | Keep-Alive: '300'
25 | Proxy-Connection: keep-alive
26 | User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET
27 | CLR 2.0.50727)
28 | method: GET
29 | port: 80
30 | uri: /
31 | version: HTTP/1.0
32 | output:
33 | log_contains: id "913110"
34 | -
35 | test_title: 913110-2
36 | desc: "Scanner identification based on custom header"
37 | stages:
38 | -
39 | stage:
40 | input:
41 | dest_addr: "127.0.0.1"
42 | method: "GET"
43 | port: 80
44 | headers:
45 | Host: "localhost"
46 | X-Scanner: "whatever"
47 | uri: "/"
48 | output:
49 | log_contains: id "913110"
50 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-913-SCANNER-DETECTION/913120.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: csanders-git
4 | description: None
5 | enabled: true
6 | name: 913120.yaml
7 | tests:
8 | -
9 | test_title: 913120-1
10 | desc: Request Indicates a Security Scanner Scanned the Site (913120) from old modsec
11 | regressions
12 | stages:
13 | -
14 | stage:
15 | input:
16 | dest_addr: 127.0.0.1
17 | headers:
18 | Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
19 | Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
20 | Accept-Encoding: gzip,deflate
21 | Accept-Language: en-us,en;q=0.5
22 | Host: localhost
23 | Keep-Alive: '300'
24 | Proxy-Connection: keep-alive
25 | User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET
26 | CLR 2.0.50727)
27 | method: GET
28 | port: 80
29 | uri: /nessustest
30 | version: HTTP/1.0
31 | output:
32 | log_contains: id "913120"
33 | -
34 | test_title: 913120-2
35 | desc: IBM fingerprint from (http://www-01.ibm.com/support/docview.wss?uid=swg21293132)
36 | stages:
37 | -
38 | stage:
39 | input:
40 | dest_addr: 127.0.0.1
41 | headers:
42 | User-Agent: "ModSecurity CRS 3 Tests"
43 | Host: localhost
44 | uri: /AppScan_fingerprint/MAC_ADDRESS_01234567890.html?9ABCDG1
45 | version: HTTP/1.0
46 | output:
47 | log_contains: id "913120"
48 | -
49 | test_title: 913120-3
50 | desc: "Scanner identification based on uri"
51 | stages:
52 | -
53 | stage:
54 | input:
55 | dest_addr: "127.0.0.1"
56 | method: "GET"
57 | port: 80
58 | headers:
59 | Host: "localhost"
60 | version: HTTP/1.0
61 | uri: "/nessus_is_probing_you_"
62 | output:
63 | log_contains: id "913120"
64 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920190.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: "csanders-git"
4 | enabled: true
5 | name: "920190.yaml"
6 | description: "Description"
7 | tests:
8 | -
9 | test_title: 920190-1
10 | stages:
11 | -
12 | stage:
13 | input:
14 | dest_addr: "127.0.0.1"
15 | method: "GET"
16 | port: 80
17 | headers:
18 | User-Agent: "ModSecurity CRS 3 Tests"
19 | Host: "localhost"
20 | Range: "0-1"
21 | protocol: "http"
22 | uri: "/"
23 | output:
24 | no_log_contains: id "920190"
25 | -
26 | test_title: 920190-2
27 | desc: 'Range: Invalid Last Byte Value (920190) from old modsec regressions'
28 | stages:
29 | -
30 | stage:
31 | input:
32 | dest_addr: 127.0.0.1
33 | headers:
34 | Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
35 | Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
36 | Accept-Language: en-us,en;q=0.5
37 | Connection: close
38 | Host: localhost
39 | Keep-Alive: '300'
40 | Proxy-Connection: keep-alive
41 | Range: bytes=0-,5-0,5-1,5-2,5-3,5-4,5-5,5-6,5-7,5-8,5-9,5-10,5-11,5-12,5-13,5-14,5-15
42 | User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv
43 | method: GET
44 | port: 80
45 | uri: /
46 | version: HTTP/1.1
47 | output:
48 | log_contains: id "920190"
49 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920201.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: "csanders-git"
4 | enabled: true
5 | name: "920201.yaml"
6 | description: "Tests for 920201"
7 | tests:
8 | -
9 | test_title: 920201-1
10 | desc: This should FAIL with rule 920201 (PL2)
11 | stages:
12 | -
13 | stage:
14 | input:
15 | dest_addr: 127.0.0.1
16 | headers:
17 | Host: localhost
18 | Range: "bytes=10-11, 20-21, 30-31, 40-41, 50-51, 60-61, 70-71, 80-81, 90-91, 100-101, 110-11, 120-21, 130-31, 140-41, 150-51, 160-61, 170-71, 180-81, 190-91, 200-101, 210-11, 220-21, 230-31, 240-41, 250-51, 260-61, 270-71, 280-81, 290-91, 300-101, 310-311, 320-321, 330-331, 340-341, 350-351, 360-361, 370-371, 380-381, 390-391, 400-401, 410-411, 420-421, 430-431, 440-441, 450-451, 460-461, 470-471, 480-481, 490-491, 500-501, 510-511, 520-521, 530-531, 540-541, 550-551, 560-561, 570-571, 580-581, 590-591, 600-601, 610-611, 620-621, 630-631"
19 | User-Agent: "ModSecurity CRS 3 Tests"
20 | method: GET
21 | port: 80
22 | uri: /index.pdf
23 | output:
24 | log_contains: id "920201"
25 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920202.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: "csanders-git"
4 | enabled: true
5 | name: "920202.yaml"
6 | description: "Tests for 920202"
7 | tests:
8 | -
9 | test_title: 920202-1
10 | desc: This should FAIL with rule 920202 (PL4)
11 | stages:
12 | -
13 | stage:
14 | input:
15 | dest_addr: 127.0.0.1
16 | headers:
17 | Host: localhost
18 | Range: "bytes=10-11, 20-21, 30-31, 40-41, 50-51, 60-61"
19 | User-Agent: "ModSecurity CRS 3 Tests"
20 | method: GET
21 | port: 80
22 | uri: /index.pdf
23 | output:
24 | log_contains: id "920202"
25 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920230.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: "csanders-git"
4 | enabled: true
5 | name: "920230.yaml"
6 | description: "Description"
7 | tests:
8 | -
9 | # From old modsec regression tests
10 | test_title: 920230-1
11 | stages:
12 | -
13 | stage:
14 | input:
15 | dest_addr: "127.0.0.1"
16 | port: 80
17 | uri: "/?parm=%25%37%33%25%36%46%25%36%44%25%36%35%25%37%34%25%36%35%25%37%38%25%37%34%25%35%46%25%33%31%25%33%32%25%33%33%25%33%34"
18 | headers:
19 | User-Agent: "ModSecurity CRS 3 Tests"
20 | Host: "localhost"
21 | Accept: "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
22 | Accept-Language: "en-us,en;q=0.5"
23 | Accept-Charset: "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
24 | Keep-Alive: "300"
25 | Proxy-Connection: "keep-alive"
26 | output:
27 | log_contains: "id \"920230\""
28 | -
29 | # From old modsec regression tests
30 | test_title: 920230-2
31 | stages:
32 | -
33 | stage:
34 | input:
35 | dest_addr: "127.0.0.1"
36 | port: 80
37 | uri: "/?parm=%7%6F%6D%65%74%65%78%74%5F%31%32%33%"
38 | headers:
39 | User-Agent: "ModSecurity CRS 3 Tests"
40 | Host: "localhost"
41 | Accept: "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
42 | Accept-Language: "en-us,en;q=0.5"
43 | Accept-Charset: "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
44 | Keep-Alive: "300"
45 | Proxy-Connection: "keep-alive"
46 | output:
47 | no_log_contains: "id \"920230\""
48 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920260.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: "csanders-git"
4 | enabled: true
5 | name: "920260.yaml"
6 | description: "Description"
7 | tests:
8 | -
9 | test_title: 920260-1
10 | stages:
11 | -
12 | stage:
13 | input:
14 | dest_addr: "127.0.0.1"
15 | port: 80
16 | uri: "/?test=%uff0F"
17 | headers:
18 | User-Agent: "ModSecurity CRS 3 Tests"
19 | Host: "localhost"
20 | output:
21 | log_contains: "id \"920260\""
22 | -
23 | test_title: 920260-2
24 | stages:
25 | -
26 | stage:
27 | input:
28 | dest_addr: "127.0.0.1"
29 | port: 80
30 | uri: "/?test=%u0F"
31 | headers:
32 | User-Agent: "ModSecurity CRS 3 Tests"
33 | Host: "localhost"
34 | output:
35 | no_log_contains: "id \"920260\""
36 | -
37 | # Test taken from existing modsec regression
38 | test_title: 920260-3
39 | stages:
40 | -
41 | stage:
42 | input:
43 | dest_addr: "127.0.0.1"
44 | port: 80
45 | uri: "/?param=foo%uFF01"
46 | version: "HTTP/1.0"
47 | headers:
48 | User-Agent: "ModSecurity CRS 3 Tests"
49 | Host: "localhost"
50 | Accept: "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
51 | Accept-Language: "en-us,en;q=0.5"
52 | Accept-Charset: "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
53 | Keep-Alive: "300"
54 | Proxy-Connection: "keep-alive"
55 | output:
56 | log_contains: "id \"920260\""
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920272.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: "csanders-git"
4 | enabled: true
5 | name: "920272.yaml"
6 | description: "Description"
7 | tests:
8 | -
9 | test_title: 920272-1
10 | stages:
11 | -
12 | stage:
13 | input:
14 | dest_addr: "127.0.0.1"
15 | port: 80
16 | uri: "/?test=test1%25"
17 | headers:
18 | User-Agent: "ModSecurity CRS 3 Tests"
19 | Host: "localhost"
20 | output:
21 | log_contains: "id \"920272\""
22 | -
23 | test_title: 920272-2
24 | stages:
25 | -
26 | stage:
27 | input:
28 | dest_addr: "127.0.0.1"
29 | port: 80
30 | uri: "/?test=test1%80"
31 | headers:
32 | User-Agent: "ModSecurity CRS 3 Tests"
33 | Host: "localhost"
34 | output:
35 | log_contains: "id \"920272\""
36 | -
37 | test_title: 920272-3
38 | stages:
39 | -
40 | stage:
41 | input:
42 | dest_addr: "127.0.0.1"
43 | port: 80
44 | uri: "/index.html?test=t%FFest1"
45 | headers:
46 | User-Agent: "ModSecurity CRS 3 Tests"
47 | Host: "localhost"
48 | output:
49 | log_contains: "id \"920272\""
50 | -
51 | test_title: 920272-4
52 | stages:
53 | -
54 | stage:
55 | input:
56 | dest_addr: "127.0.0.1"
57 | port: 80
58 | uri: "/?test=test1%35"
59 | headers:
60 | User-Agent: "ModSecurity CRS 3 Tests"
61 | Host: "localhost"
62 | output:
63 | no_log_contains: "id \"920272\""
64 | -
65 | # This will not trigger with Apache because Apache will block with AH00127
66 | #(22)Invalid argument: [client 127.0.0.1:47427] AH00127: Cannot map GET /i%FFndex.html?test=test1 HTTP/1.1 to file. It will return a 404 instead so we accept either.
67 | test_title: 920272-5
68 | stages:
69 | -
70 | stage:
71 | input:
72 | dest_addr: "127.0.0.1"
73 | port: 80
74 | uri: "/i%FFndex.html?test=test1"
75 | headers:
76 | User-Agent: "ModSecurity CRS 3 Tests"
77 | Host: "localhost"
78 | output:
79 | status: [403, 404]
80 |
--------------------------------------------------------------------------------
/tests/regression/tests/REQUEST-920-PROTOCOL-ENFORCEMENT/920273.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | meta:
3 | author: "csanders-git"
4 | enabled: true
5 | name: "920273.yaml"
6 | description: "Description"
7 | tests:
8 | -
9 | test_title: 920273-1
10 | stages:
11 | -
12 | stage:
13 | input:
14 | dest_addr: "127.0.0.1"
15 | port: 80
16 | uri: "/?test=test1%20"
17 | headers:
18 | User-Agent: "ModSecurity CRS 3 Tests"
19 | Host: "localhost"
20 | output:
21 | log_contains: "id \"920273\""
22 | -
23 | # the '&' is one of the only symbol allowed
24 | test_title: 920273-2
25 | stages:
26 | -
27 | stage:
28 | input:
29 | dest_addr: "127.0.0.1"
30 | port: 80
31 | uri: "/?test=test1&test=t"
32 | headers:
33 | User-Agent: "ModSecurity CRS 3 Tests"
34 | Host: "localhost"
35 | output:
36 | no_log_contains: "id \"920273\""
37 | -
38 | test_title: 920273-3
39 | stages:
40 | -
41 | stage:
42 | input:
43 | dest_addr: "127.0.0.1"
44 | port: 80
45 | uri: "/index.html?test=test1"
46 | headers:
47 | User-Agent: "ModSecurity CRS 3 Tests"
48 | Host: "localhost"
49 | data: "Shazam