dast-scanning – skill Bảo mật cho agent AI
Thực hiện kiểm thử bảo mật ứng dụng động (DAST) với OWASP ZAP, Burp Suite và Nikto.
Cài skill dast-scanning bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/dast-scanning-2349e.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /dast-scanning – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/dast-scanning-2349e.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $dast-scanning – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/dast-scanning-2349e.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /dast-scanning – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/dast-scanning-2349e.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /dast-scanning – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
> ⚠️ AUTHORIZED USE ONLY
> This skill is for educational purposes or authorized security assessments only.
> You must have explicit, written permission from the system owner before using this tool.
> Misuse of this tool is illegal and strictly prohibited.
> Mandatory confirmation gate
> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
> 1. Ask the user to state the exact target URL, IP, account, or resource.
> 2. Ask the user to confirm written authorization and the permitted scope.
> 3. Show the exact command(s) and explain their expected effect.
> 4. Wait for explicit confirmation in the current conversation.
>
> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
DAST Scanning
Test running applications for security vulnerabilities through dynamic analysis.
When to Use This Skill
Use this skill when:
- Testing deployed applications
- Performing automated security scans
- Finding runtime vulnerabilities
- Testing authentication flows
- Validating API security
Prerequisites
- Running application instance
- Network access to target
- Testing authorization
- Understanding of web security
Tool Overview
| Tool | Type | Best For |
|------|------|----------|
| OWASP ZAP | OSS | Automated scanning, CI |
| Burp Suite | Commercial | Manual testing, advanced |
| Nikto | OSS | Web server scanning |
| Nuclei | OSS | Template-based scanning |
| Arachni | OSS | Comprehensive scanning |
Agree exact URLs/hosts, authenticated test accounts, exclusions, rates, duration and stop conditions before scanning; spiders can trigger state-changing links even during baseline scans. Use staged data/backups and deny off-scope redirects/crawl targets. Keep ZAP API private with a strong API key rather than the broad address allowlist as a remote exposure pattern. The [baseline script](https://www.zaproxy.org/docs/docker/baseline-scan/) uses a preconfigured context and -U user for authentication, not the original ad-hoc login flags. Full/API scans actively attack; do not schedule them without authorization. Pin images/actions, quote mount paths and poll readiness rather than sleep. Burp REST APIs vary by edition/version: verify endpoints/auth, add timeouts/raise_for_status, parse Location and bound polling with failed/cancelled states. Its sketch also lacks time import. Reports may contain secrets/PII; restrict artifacts and permissions. No findings or HTTP 200 alone establish security; validate behavior and coverage, and do not suppress CI warnings with -I without policy review.
OWASP ZAP
Docker Setup
# Run ZAP in daemon mode
docker run -d --name zap \
-p 127.0.0.1:8080:8080 \
-v $(pwd)/reports:/zap/reports \
ghcr.io/zaproxy/zaproxy:stable \
zap.sh -daemon -host 0.0.0.0 -port 8080 \
-config api.addrs.addr.name=.* \
-config api.addrs.addr.regex=trueBaseline Scan
# Quick baseline scan
docker run --rm -v $(pwd):/zap/wrk \
ghcr.io/zaproxy/zaproxy:stable \
zap-baseline.py -t https://target.example.com \
-r baseline-report.html
# With authentication
docker run --rm -v $(pwd):/zap/wrk \
ghcr.io/zaproxy/zaproxy:stable \
zap-baseline.py -t https://target.example.com \
-r report.html \
-n /zap/wrk/auth.context \
-U testuserFull Scan
# Comprehensive scan
docker run --rm -v $(pwd):/zap/wrk \
ghcr.io/zaproxy/zaproxy:stable \
zap-full-scan.py -t https://target.example.com \
-r full-report.html \
-J full-report.jsonAPI Scan
# OpenAPI specification scan
docker run --rm -v $(pwd):/zap/wrk \
ghcr.io/zaproxy/zaproxy:stable \
zap-api-scan.py -t https://target.example.com/openapi.json \
-f openapi \
-r api-report.htmlZAP Automation Framework
# zap-automation.yaml
env:
contexts:
- name: "Default Context"
urls:
- "https://target.example.com"
includePaths:
- "https://target.example.com/.*"
excludePaths:
- "https://target.example.com/logout.*"
authentication:
method: "form"
parameters:
loginUrl: "https://target.example.com/login"
loginRequestData: "username={%username%}&password={%password%}"
verification:
method: "response"
loggedInRegex: "\\QWelcome\\E"
users:
- name: "testuser"
credentials:
username: "[email protected]"
password: "password123"
jobs:
- type: spider
parameters:
context: "Default Context"
user: "testuser"
maxDuration: 10
- type: spiderAjax
parameters:
context: "Default Context"
user: "testuser"
maxDuration: 10
- type: passiveScan-wait
parameters:
maxDuration: 5
- type: activeScan
parameters:
context: "Default Context"
user: "testuser"
policy: "Default Policy"
- type: report
parameters:
template: "traditional-html"
reportDir: "/zap/reports"
reportFile: "zap-report"# Run automation
docker run --rm -v $(pwd):/zap/wrk \
ghcr.io/zaproxy/zaproxy:stable \
zap.sh -cmd -autorun /zap/wrk/zap-automation.yamlCI/CD Integration
GitHub Actions
name: DAST Scan
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
jobs:
dast:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start Application
run: |
docker-compose up -d
sleep 30 # Wait for app to be ready
- name: OWASP ZAP Scan
uses: zaproxy/[email protected]
with:
target: 'http://localhost:8080'
rules_file_name: '.zap/rules.tsv'
cmd_options: '-a'
- name: Upload Report
uses: actions/upload-artifact@v4
if: always()
with:
name: zap-report
path: report_html.htmlGitLab CI
dast:
stage: security
image: ghcr.io/zaproxy/zaproxy:stable
variables:
TARGET_URL: $DAST_TARGET_URL
script:
- mkdir -p /zap/wrk/reports
- zap-baseline.py -t $TARGET_URL -r /zap/wrk/reports/zap-report.html -I
artifacts:
paths:
- reports/
expire_in: 1 week
rules:
- if: $CI_COMMIT_BRANCH == "main"Burp Suite Automation
REST API Usage
import requests
class BurpScanner:
def __init__(self, api_url, api_key):
self.api_url = api_url
self.headers = {'Authorization': api_key}
def create_scan(self, target_url):
"""Create and start a new scan."""
payload = {
'scan_configurations': [
{'name': 'Crawl and Audit - Balanced'}
],
'scope': {
'include': [{'rule': target_url}]
},
'urls': [target_url]
}
response = requests.post(
f'{self.api_url}/v0.1/scan',
json=payload,
headers=self.headers
)
return response.headers.get('Location')
def get_scan_status(self, scan_id):
"""Get scan status."""
response = requests.get(
f'{self.api_url}/v0.1/scan/{scan_id}',
headers=self.headers
)
return response.json()
def get_issues(self, scan_id):
"""Get scan issues."""
response = requests.get(
f'{self.api_url}/v0.1/scan/{scan_id}/issues',
headers=self.headers
)
return response.json()
# Usage
scanner = BurpScanner('http://burp:1337', 'api-key')
scan_id = scanner.create_scan('https://target.example.com')
while True:
status = scanner.get_scan_status(scan_id)
if status['scan_status'] == 'succeeded':
break
time.sleep(30)
issues = scanner.get_issues(scan_id)Nikto
Basic Scanning
# Install
apt-get install nikto
# Basic scan
nikto -h https://target.example.com
# With specific options
nikto -h https://target.example.com \
-ssl \
-Tuning 123bde \
-output nikto-report.html \
-Format html
# Scan specific ports
nikto -h target.example.com -p 80,443,8080Common DAST Findings
OWASP Top 10
owasp_findings:
A01_Broken_Access_Control:
- IDOR vulnerabilities
- Missing function-level access control
- Privilege escalation
A02_Cryptographic_Failures:
- Sensitive data in URLs
- Missing HTTPS
- Weak ciphers
A03_Injection:
- SQL injection
- Command injection
- XSS
A05_Security_Misconfiguration:
- Default credentials
- Verbose error messages
- Missing security headers
A07_Auth_Failures:
- Weak passwords accepted
- Session fixation
- Missing MFASecurity Headers Check
# Check security headers
curl -I https://target.example.com | grep -i "x-\|content-security\|strict"
# Expected headers:
#… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- tls-fingerprint-impersonation – Giả mạo dấu vân tay TLS ClientHello và JA4 để mô phỏng trình duyệt.
- database-security – Đánh giá bảo mật cơ sở dữ liệu được ủy quyền trên PostgreSQL, MySQL, MSSQL, MongoDB và…
- vhost-enumeration – Phát hiện virtual host ẩn bằng cách fuzz header Host và phân tích chứng chỉ SSL.
- solidity-security – Nắm vững các thực hành bảo mật hợp đồng thông minh tốt nhất để ngăn các lỗ hổng phổ biến…
- vmware-vcenter-attack – Ma trận tấn công từ bên ngoài nhắm vào VMware vSphere / vCenter Server — nhận diện phiên…
- web-enumeration – Quét file nhạy cảm, bypass path traversal, liệt kê vHost, trích xuất .env, khai thác…
- sherlock – Tìm tài khoản theo một username trên hơn 400 nền tảng.
- dependency-management-deps-audit – Bạn là chuyên gia bảo mật phụ thuộc, chuyên quét lỗ hổng, tuân thủ giấy phép và an toàn…