Skip to content

Commit 374ebd0

Browse files
SnbigghostAhsraeisiSigning BotMasoudAbdaal
authored
Implement 13 new Nuclei Templates for ASVS 4.0.3 Compliance Checks (#23)
* Add Project Co-lead Signed-off-by: Hamed Salimian <[email protected]> * Create 2.1.11.yaml Signed-off-by: Hamed Salimian <[email protected]> * Update template-sign.yml Signed-off-by: Hamed Salimian <[email protected]> * Update 2.1.11.yaml Signed-off-by: Hamed Salimian <[email protected]> * Update template-sign.yml Signed-off-by: Hamed Salimian <[email protected]> * Update 13.1.3.yaml Signed-off-by: Hamed Salimian <[email protected]> * chore: sign templates 🤖 * Update Submodule * Create 3.4.2.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update 3.4.2.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Create update-readme.py Signed-off-by: AmirHossein Raeisi <[email protected]> * Create update-readme.yml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update update-readme.yml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update update-readme.yml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * Create 3.4.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * chore: sign templates 🤖 * Update update-readme.yml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 12.6.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update README.md Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 12.3.3.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * chore: sign templates 🤖 * Fix typo. Signed-off-by: Hamed Salimian <[email protected]> * Update template-validate.yml Signed-off-by: Hamed Salimian <[email protected]> * Update syntax-checking.yml Signed-off-by: Hamed Salimian <[email protected]> * Update update-readme.py Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 3.4.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * chore: sign templates 🤖 * Update update-readme.py Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 12.6.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * chore: sign templates 🤖 * Create 3.1.1.yaml Signed-off-by: Hamed Salimian <[email protected]> * Update README table * chore: sign templates 🤖 * Added ASVS V13.2.3.yaml * Update README table * chore: sign templates 🤖 * Added V5.1.2 Template And It's Assets * Update README table * chore: sign templates 🤖 * Fixed Hostname variable * chore: sign templates 🤖 * Added V5.2.1 * Update README table * chore: sign templates 🤖 * Added V5.1.1 * Update README table * chore: sign templates 🤖 * Update update-readme.yml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update update-readme.py Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 12.6.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update README table * Update update-readme.py Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 12.6.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update README table * Updated 5.1.1 (Added matchers, extractors) * chore: sign templates 🤖 * Update update-readme.py Signed-off-by: Hamed Salimian <[email protected]> * Modified 13.2.3 * Update README table * chore: sign templates 🤖 * Update 5.1.2.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update 5.2.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update 5.2.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update update-readme.yml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 5.1.2.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update 5.1.2.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update 5.1.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Update 5.1.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Create 5.2.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Delete templates/dast/assets/5.2.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Create 5.2.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Rename templates/dast/5.1.2.yaml to templates/5.1.2.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * chore: sign templates 🤖 * Delete templates/5.2.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * Delete templates/dast/assets/5.2.1Payloads.txt Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README.md Signed-off-by: AmirHossein Raeisi <[email protected]> * Rename templates/dast/assets/keysList.txt to templates/assets/keysList.txt Signed-off-by: AmirHossein Raeisi <[email protected]> * Update 5.1.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * chore: sign templates 🤖 * Rename templates/dast/assets/valuesList.txt to templates/assets/valuesList.txt Signed-off-by: AmirHossein Raeisi <[email protected]> * Rename templates/dast/assets/5.1.1Parameters.txt to templates/assets/5.1.1Parameters.txt Signed-off-by: AmirHossein Raeisi <[email protected]> * Update template-validate.yml Signed-off-by: AmirHossein Raeisi <[email protected]> * Rename templates/12.6.1.yaml to templates/dast/12.6.1.yaml Signed-off-by: AmirHossein Raeisi <[email protected]> * Update README table * chore: sign templates 🤖 --------- Signed-off-by: Hamed Salimian <[email protected]> Signed-off-by: AmirHossein Raeisi <[email protected]> Co-authored-by: ghost <[email protected]> Co-authored-by: AmirHossein Raeisi <[email protected]> Co-authored-by: Ahsraeisi <[email protected]> Co-authored-by: Signing Bot <[email protected]> Co-authored-by: Masoud Abdaal <[email protected]>
1 parent 336dfdf commit 374ebd0

22 files changed

+681
-8
lines changed

.github/scripts/update-readme.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import os
2+
import re
3+
import math
4+
5+
# Function to find .yaml files recursively in all directories under templates
6+
def find_yaml_files(root_dir):
7+
yaml_files = []
8+
for dirpath, _, filenames in os.walk(root_dir):
9+
for filename in filenames:
10+
if filename.endswith('.yaml') and re.match(r'(\d+\.)+\d+\.yaml', filename):
11+
yaml_files.append(os.path.join(dirpath, filename))
12+
return yaml_files
13+
14+
# Function to list all templates with a default ❌ mark
15+
def initialize_template_status(yaml_files):
16+
template_status = {}
17+
for file in yaml_files:
18+
base_name = os.path.splitext(os.path.basename(file))[0]
19+
template_status[base_name] = "❌" # Default to ❌
20+
return template_status
21+
22+
# Function to check if a related vulnerable page exists and update the status
23+
def update_vulnerable_status(template_status, vuln_dir):
24+
for vuln_file in os.listdir(vuln_dir):
25+
if vuln_file.startswith("ASVS_"):
26+
base_name = vuln_file.replace("ASVS_", "").replace("_", ".")
27+
if base_name in template_status:
28+
template_status[base_name] = f'<a href="https://snbig.github.io/Vulnerable-Pages/{vuln_file}">✔️</a>' # Update to ✔️ if found
29+
30+
# Function to update README.md with a table (4 columns: Template Name, Vulnerable Page, Template Name, Vulnerable Page)
31+
def update_readme(template_status, root_dir):
32+
readme_file = 'README.md'
33+
github_base_url = "https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/"
34+
35+
try:
36+
with open(readme_file, 'r', encoding='utf-8') as file:
37+
readme_content = file.read()
38+
39+
# Sort templates based on the first two sections of the version number
40+
sorted_templates = sorted(template_status.items(), key=lambda x: tuple(map(int, x[0].split(".")[:2])))
41+
42+
# Create table rows with 4 columns
43+
table_rows = ""
44+
for i in range(0, len(sorted_templates), 2):
45+
# Take two templates at a time
46+
row_templates = sorted_templates[i:i + 2]
47+
row_html = ""
48+
for file_name, status in row_templates:
49+
file_path = next(file for file in yaml_files if file_name in file) # Find full file path
50+
file_url = github_base_url + file_path.replace(os.sep, '/') # Convert path to GitHub URL
51+
file_link = f'<a href="{file_url}">{file_name}</a>'
52+
row_html += f"<td>{file_link}</td><td align='center'>{status}</td>"
53+
table_rows += f"<tr>{row_html}</tr>\n"
54+
55+
table_html = f'''<h2 align="center">Available Templates</h2>
56+
<table border="1" cellpadding="5" cellspacing="0" align="center">
57+
<tr><th>Template Name</th><th>Vulnerable Page</th><th>Template Name</th><th>Vulnerable Page</th></tr>
58+
{table_rows}
59+
</table>
60+
</center>
61+
'''
62+
63+
if "<h2 align=\"center\">Available Templates</h2>" in readme_content:
64+
h2_index = readme_content.index("<h2 align=\"center\">Available Templates</h2>")
65+
readme_content = readme_content[:h2_index]
66+
67+
readme_content += f'{table_html}'
68+
with open(readme_file, 'w', encoding='utf-8') as file:
69+
file.write(readme_content)
70+
71+
print("README.md updated successfully.")
72+
73+
except FileNotFoundError:
74+
print(f"{readme_file} not found.")
75+
except Exception as e:
76+
print(f"An error occurred: {e}")
77+
78+
if __name__ == '__main__':
79+
root_dir = 'templates'
80+
vuln_dir = 'Vulnerable-Pages'
81+
yaml_files = find_yaml_files(root_dir)
82+
83+
if yaml_files:
84+
template_status = initialize_template_status(yaml_files)
85+
update_vulnerable_status(template_status, vuln_dir)
86+
update_readme(template_status, root_dir)
87+
else:
88+
print("No matching YAML files found.")

.github/workflows/syntax-checking.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: ❄️ YAML Lint
22

33
on:
44
push:
5+
paths:
6+
- '**.yaml'
57
pull_request:
68
paths:
79
- '**.yaml'

.github/workflows/template-sign.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ jobs:
1414
if: github.repository == 'OWASP/www-project-asvs-security-evaluation-templates-with-nuclei'
1515
steps:
1616
- uses: actions/checkout@v4
17-
1817
- uses: projectdiscovery/actions/setup/nuclei@v1
18+
with:
19+
token: '${{ secrets.GITHUB_TOKEN }}'
1920
- run: nuclei -lfa -duc -sign -ud $GITHUB_WORKSPACE -t .
2021
env:
2122
NUCLEI_USER_CERTIFICATE: ${{ secrets.NUCLEI_USER_CERTIFICATE }}

.github/workflows/template-validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: 🛠 Template Validate
22

33
on:
44
push:
5+
paths:
6+
- '**.yaml'
57
pull_request:
68
paths:
79
- '**.yaml'
@@ -26,5 +28,6 @@ jobs:
2628
- name: Template Validation
2729
run: |
2830
cp -r ${{ github.workspace }}/templates /home/runner/nuclei-templates
31+
cd /home/runner/nuclei-templates
2932
nuclei -duc -validate -allow-local-file-access
3033
nuclei -duc -validate -allow-local-file-access -w /home/runner/nuclei-templates/workflows
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Update README with Templates
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
paths:
8+
- '**.yaml'
9+
pull_request:
10+
branches:
11+
- dev
12+
13+
jobs:
14+
update-readme:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout the repository
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: true # Ensure submodules are initialized and updated
21+
22+
- name: Initialize and update submodules (if needed)
23+
run: git submodule update --init --recursive
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: '3.x'
29+
30+
- name: Run Python script to update README
31+
run: python .github/scripts/update-readme.py
32+
33+
# Set up GPG for commit signing
34+
- name: Set up GPG
35+
run: |
36+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
37+
git config --global user.name "Signing Bot"
38+
git config --global user.email "[email protected]"
39+
git config --global commit.gpgSign true
40+
git config --global user.signingkey ${{ secrets.GPG_KEY_ID }}
41+
42+
# Commit changes with GPG signing
43+
- name: Commit changes if any
44+
run: |
45+
git add README.md
46+
if ! git diff --cached --quiet; then
47+
git commit -S -m "Update README table"
48+
else
49+
echo "No changes to commit"
50+
fi
51+
52+
# Push changes
53+
- name: Push changes
54+
run: |
55+
git pull origin dev --rebase
56+
git push origin dev

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,32 @@ For detailed information and guidelines about contributing in developing templat
3030

3131
#### Core Team
3232
The project current core team are:
33-
- [Hamed Salimain](https://github.com/Snbig) (Project Leader)
33+
- [Hamed Salimian](https://github.com/Snbig) (Project Leader)
34+
- [AmirHossein Raeisi](https://github.com/Ahsraeisi) (Project Co-Leader)
35+
- [Masoud Abdaal](https://github.com/MasoudAbdaal) (Contributor)
36+
- [AmirMohammad Ahmadi](https://github.com/) (Contributor)
37+
<h2 align="center">Available Templates</h2>
38+
<table border="1" cellpadding="5" cellspacing="0" align="center">
39+
<tr><th>Template Name</th><th>Vulnerable Page</th><th>Template Name</th><th>Vulnerable Page</th></tr>
40+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/headless/2.1.11.yaml">2.1.11</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_2_1_11">✔️</a></td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/3.1.1.yaml">3.1.1</a></td><td align='center'>❌</td></tr>
41+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/3.4.1.yaml">3.4.1</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/3.4.2.yaml">3.4.2</a></td><td align='center'>❌</td></tr>
42+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/5.1.5.yaml">5.1.5</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_5_1_5">✔️</a></td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/5.1.2.yaml">5.1.2</a></td><td align='center'>❌</td></tr>
43+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/5.1.1.yaml">5.1.1</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/5.2.1.yaml">5.2.1</a></td><td align='center'>❌</td></tr>
44+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/5.2.5.1.yaml">5.2.5.1</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/5.2.6.yaml">5.2.6</a></td><td align='center'>❌</td></tr>
45+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/headless/5.3.3.1.yaml">5.3.3.1</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/5.3.3.2.yaml">5.3.3.2</a></td><td align='center'>❌</td></tr>
46+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/5.3.9.yaml">5.3.9</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_5_3_9">✔️</a></td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/5.5.2.yaml">5.5.2</a></td><td align='center'>❌</td></tr>
47+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/8.2.1.yaml">8.2.1</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/9.1.3.yaml">9.1.3</a></td><td align='center'>❌</td></tr>
48+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/9.1.2.yaml">9.1.2</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/12.1.1.yaml">12.1.1</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_12_1_1">✔️</a></td></tr>
49+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/code/12.1.1.2.yaml">12.1.1.2</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/12.3.3.yaml">12.3.3</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_12_3_3">✔️</a></td></tr>
50+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/dast/12.6.1.yaml">12.6.1</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_12_6_1">✔️</a></td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/headless/13.1.3.yaml">13.1.3</a></td><td align='center'>❌</td></tr>
51+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/13.2.1.yaml">13.2.1</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/13.2.3.yaml">13.2.3</a></td><td align='center'>❌</td></tr>
52+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/13.2.2.yaml">13.2.2</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_13_2_2">✔️</a></td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/13.3.1.yaml">13.3.1</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_13_3_1">✔️</a></td></tr>
53+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/headless/14.2.3.yaml">14.2.3</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/workflows/14.3.2.yaml">14.3.2</a></td><td align='center'>❌</td></tr>
54+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.4.4.yaml">14.4.4</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.4.3.yaml">14.4.3</a></td><td align='center'>❌</td></tr>
55+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.4.5.yaml">14.4.5</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.4.7.yaml">14.4.7</a></td><td align='center'>❌</td></tr>
56+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.4.1.yaml">14.4.1</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.4.6.yaml">14.4.6</a></td><td align='center'>❌</td></tr>
57+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.4.2.yaml">14.4.2</a></td><td align='center'>❌</td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.5.1.yaml">14.5.1</a></td><td align='center'>❌</td></tr>
58+
<tr><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.5.3.yaml">14.5.3</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_14_5_3">✔️</a></td><td><a href="https://github.com/OWASP/www-project-asvs-security-evaluation-templates-with-nuclei/blob/dev/templates/14.5.2.yaml">14.5.2</a></td><td align='center'><a href="https://snbig.github.io/Vulnerable-Pages/ASVS_14_5_2">✔️</a></td></tr>
59+
60+
</table>
61+
</center>

templates/13.2.3.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
id: ASVS-4-0-3-V13-2-3
2+
3+
info:
4+
name: ASVS 13.2.3 Check
5+
author: Masoud Abdaal
6+
severity: medium
7+
classification:
8+
cwe-id: CWE-352
9+
reference:
10+
- https://github.com/OWASP/ASVS/blob/master/4.0/en/0x21-V13-API.md#v132-restful-web-service
11+
tags: asvs,13.2.3
12+
description: |
13+
Verify that RESTful web services that utilize cookies are protected from Cross-Site Request Forgery via the use of at least one or more of the following: double submit cookie pattern, CSRF nonces, or Origin request header checks
14+
15+
http:
16+
- raw:
17+
- |
18+
GET {{BaseURL}} HTTP/1.1
19+
Host: {{Hostname}}
20+
Origin: {{origin_schema}}{{origin_host}}{{origin_port}}
21+
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
22+
Accept: */*
23+
24+
cookie-reuse: true
25+
payloads:
26+
origin_host:
27+
- 127.0.0.1
28+
- localhost
29+
- '{{resolve("{{FQDN}}")}}'
30+
origin_schema:
31+
- http://
32+
- https://
33+
origin_port:
34+
-
35+
- :80
36+
- :443
37+
attack: clusterbomb
38+
39+
stop-at-first-match: true
40+
matchers:
41+
- type: dsl
42+
name: 'Access Restriction Bypass Via Origin Spoof'
43+
dsl:
44+
- status_code < 210 && status_code >= 200
45+
- to_number(forbidden_status_code) != status_code
46+
# digest: 490a00463044022050741006143f221ad95a93394da23c3bd73610d9f22873f039394a22c85958b602205cf0afc9b7f7a0628148c24168902290446034a0a136daab47024b7cd8750ef8:236a7c23afe836fbe231d6e037cff444

templates/3.1.1.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
id: ASVS-4-0-3-V3-1-1
2+
3+
info:
4+
name: ASVS 3.1.1 Check
5+
author: Hamed Salimian
6+
severity: medium
7+
classification:
8+
cwe-id: CWE-598
9+
reference:
10+
- https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/06-Session_Management_Testing/04-Testing_for_Exposed_Session_Variables.html
11+
- https://github.com/danielmiessler/SecLists/blob/master/Miscellaneous/Web/session-id.txt
12+
tags: asvs,3.1.1
13+
description: |
14+
Verify the application never reveals session tokens in URL parameters.
15+
16+
17+
http:
18+
- method: GET
19+
path:
20+
- "{{BaseURL}}"
21+
redirects: true
22+
23+
extractors:
24+
- type: regex
25+
part: body
26+
regex:
27+
- (i?)((https?|wss?))?(://)?[^\s?]+(?:\?|&)(?:session|sessionID|ASP.NET_SessionId|ASPSESSIONID|SITESERVER|cfid|cftoken|jsessionid|sessid|sid|viewstate|zenid|PHPSESSID|ConsumerKey|ConsumerSecret|DB_USERNAME|HEROKU_API_KEY|HOMEBREW_GITHUB_API_TOKEN|JEKYLL_GITHUB_TOKEN|PT_TOKEN|SESSION_TOKEN|SF_USERNAME|SLACK_BOT_TOKEN|access-token|access_token|access_token_secret|accesstoken|admin|api-key|api_key|api_secret_key|api_token|auth_token|authkey|authorization|authorization_key|authorization_token|authtoken|aws_access_key_id|aws_secret_access_key|bearer|bot_access_token|bucket|client-secret|client_id|client_key|client_secret|clientsecret|consumer_key|consumer_secret|dbpasswd|email|encryption-key|encryption_key|encryptionkey|id_dsa|irc_pass|key|oauth_token|pass|password|private_key|private-key|privatekey|secret|secret-key|secret_key|secret_token|secretkey|secretkey|session_key|session_secret|slack_api_token|slack_secret_token|slack_token|ssh-key|ssh_key|sshkey|token|username|xoxa-2|xoxr)=[^&\s]+
28+
29+
matchers:
30+
- type: regex
31+
part: body
32+
regex:
33+
- (i?)((https?|wss?))?(://)?[^\s?]+(?:\?|&)(?:session|sessionID|ASP.NET_SessionId|ASPSESSIONID|SITESERVER|cfid|cftoken|jsessionid|sessid|sid|viewstate|zenid|PHPSESSID|ConsumerKey|ConsumerSecret|DB_USERNAME|HEROKU_API_KEY|HOMEBREW_GITHUB_API_TOKEN|JEKYLL_GITHUB_TOKEN|PT_TOKEN|SESSION_TOKEN|SF_USERNAME|SLACK_BOT_TOKEN|access-token|access_token|access_token_secret|accesstoken|admin|api-key|api_key|api_secret_key|api_token|auth_token|authkey|authorization|authorization_key|authorization_token|authtoken|aws_access_key_id|aws_secret_access_key|bearer|bot_access_token|bucket|client-secret|client_id|client_key|client_secret|clientsecret|consumer_key|consumer_secret|dbpasswd|email|encryption-key|encryption_key|encryptionkey|id_dsa|irc_pass|key|oauth_token|pass|password|private_key|private-key|privatekey|secret|secret-key|secret_key|secret_token|secretkey|secretkey|session_key|session_secret|slack_api_token|slack_secret_token|slack_token|ssh-key|ssh_key|sshkey|token|username|xoxa-2|xoxr)=[^&\s]+
34+
# digest: 4a0a0047304502200b04f148664841a92e2869491bb697da5a91b249b52641cce2fd21b2af3ed58e022100c90f5e35cb5924de9cc68967dfb48baae881590e336956b906b90e7730ca7bdc:236a7c23afe836fbe231d6e037cff444

0 commit comments

Comments
 (0)