Security Scanning Tools
Security scanning tools enable agents to assess network security, analyze SSL/TLS configurations, check DNS records, and detect potential vulnerabilities.Port Scanner
port_scan
Scan TCP ports and detect exposed services.Hostname or IP address to scan
Ports to scan: “top20”, “top100”, or comma-separated list
Connection timeout in seconds (1-10)
Attempt to grab service banners
Risk Categories
Ports are categorized by risk level:- High Risk
- Medium Risk
- Low Risk
Database Ports (should not be exposed):
- 3306 - MySQL
- 5432 - PostgreSQL
- 1433 - MSSQL
- 6379 - Redis
- 27017/27018 - MongoDB
- 9200/9300 - Elasticsearch
- 3389 - RDP
- 5900 - VNC
- 10000 - Webmin
Common Port Mappings
SSL/TLS Scanner
ssl_tls_scan
Analyze SSL/TLS configuration and certificate.Hostname to scan
Port to scan (default: 443)
Example
Checks Performed
- Certificate validity and expiration
- Certificate chain verification
- Hostname verification
- TLS protocol version support
- Cipher suite strength
- Common vulnerabilities:
- Expired certificates
- Self-signed certificates
- Weak ciphers (RC4, 3DES)
- SSLv3/TLS 1.0 support
- Missing intermediate certificates
DNS Security Scanner
dns_security_scan
Check DNS security records (SPF, DMARC, DKIM, DNSSEC).Domain to scan
Example
DNS Records Checked
SPF (Sender Policy Framework)
SPF (Sender Policy Framework)
Prevents email spoofing by specifying authorized mail servers.Example SPF record:Checks:
- Record exists
- Syntax is valid
- No more than 10 DNS lookups
- Ends with
-allor~all
DMARC (Domain-based Message Authentication)
DMARC (Domain-based Message Authentication)
Provides policy for handling SPF/DKIM failures.Example DMARC record:Checks:
- Record exists
- Policy is set (none, quarantine, reject)
- Aggregate reporting configured
DKIM (DomainKeys Identified Mail)
DKIM (DomainKeys Identified Mail)
Cryptographically signs emails to verify authenticity.Checks:
- Common selectors exist (default, google, mail)
- Public key is published
DNSSEC
DNSSEC
Cryptographically signs DNS records to prevent tampering.Checks:
- DNSSEC is enabled
- DS records exist in parent zone
- Chain of trust is valid
HTTP Headers Scanner
http_headers_scan
Check security-related HTTP response headers.URL to scan
Follow HTTP redirects
Example
Security Headers
| Header | Purpose | Recommendation |
|---|---|---|
Strict-Transport-Security | Force HTTPS | max-age=31536000; includeSubDomains |
Content-Security-Policy | Prevent XSS | default-src 'self' |
X-Frame-Options | Prevent clickjacking | DENY or SAMEORIGIN |
X-Content-Type-Options | Prevent MIME sniffing | nosniff |
Referrer-Policy | Control referrer info | strict-origin-when-cross-origin |
Permissions-Policy | Control browser features | geolocation=(), camera=() |
Subdomain Enumeration
subdomain_enumerate
Enumerate subdomains via DNS.Domain to enumerate
Enumeration method: “dns”, “brute”, or “all”
Path to wordlist for brute force
Example
Technology Stack Detection
tech_stack_detect
Detect technologies used by a website.URL to analyze
Example
Detection Methods
- HTTP response headers
- HTML meta tags
- JavaScript libraries
- CSS frameworks
- Cookie names
- URL patterns
- Favicon hashes
Risk Scoring
risk_score
Compute overall security risk grade.Hostname or domain to assess
Include port scan in assessment
Include SSL/TLS check
Include DNS security check
Include HTTP headers check
Example
Risk Grades
| Grade | Score Range | Description |
|---|---|---|
| A+ | 95-100 | Excellent security posture |
| A | 85-94 | Strong security |
| B | 70-84 | Good security with minor issues |
| C | 50-69 | Moderate security concerns |
| D | 30-49 | Significant security issues |
| F | 0-29 | Critical security problems |
Best Practices
Legal Compliance
Legal Compliance
- Only scan systems you own or have permission to test
- Check local laws regarding security testing
- Respect robots.txt and security.txt
- Use appropriate scan timing to avoid disruption
Rate Limiting
Rate Limiting
Avoid overwhelming target systems:
Interpreting Results
Interpreting Results
Not all findings are vulnerabilities:
- Open port 80/443 is normal for web servers
- Self-signed certs are acceptable for internal use
- Missing SPF is only an issue for mail domains
- Critical: Exposed databases, weak SSL
- High: Missing security headers, legacy protocols
- Medium: Missing DNS records, outdated software
- Low: Informational findings
Remediation Priority
Remediation Priority
Fix vulnerabilities in this order:
- Exposed sensitive services - Close database ports
- SSL/TLS issues - Update certs, disable weak ciphers
- Email security - Configure SPF, DMARC, DKIM
- HTTP headers - Add security headers
- Legacy protocols - Disable FTP, Telnet
Example: Complete Security Audit
Security Audit Script
Next Steps
MCP Server Setup
Deploy security scanning tools
Creating Tools
Build custom security tools