Back to skill

Security audit

Security Audit Pro

Security checks for vulnerabilities and agentic risk

Overview

This skill is a security scanner, but it overstates its coverage and can run active network scans without enough scoping or user-facing warnings.

Review this skill carefully before installing. Only use it on systems you own or are explicitly authorized to test, and treat its output as a basic scan report rather than a complete OWASP, hardening, or compliance assessment. Be aware that Nmap and Nikto scans can generate alerts, affect services, and scan unintended targets if the input is wrong.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/quick-audit.sh:10
Finding

Nmap Option Injection Through Unvalidated Target Input

Content
View full analysis

Vulnerability Details

File Location: scripts/quick-audit.sh, lines 10 and 26-31
Vulnerability Type: Argument injection into a security scanning utility
Risk Level: Medium

Vulnerable Code

bash
TARGET="${1:?Usage: quick-audit.sh <target> [output_dir]}"
OUTPUT_DIR="${2:-./audit-reports}"
DATE=$(date +%Y-%m-%d_%H%M%S)
REPORT="$OUTPUT_DIR/audit-${TARGET//\//-}-$DATE.txt"

mkdir -p "$OUTPUT_DIR"

echo "========================================" | tee "$REPORT"
echo "Security Audit: $TARGET" | tee -a "$REPORT"
echo "Date: $(date)" | tee -a "$REPORT"
echo "========================================" | tee -a "$REPORT"
echo "" | tee -a "$REPORT"

# 1. Port scan
echo "--- Port Scan (top 1000) ---" | tee -a "$REPORT"
nmap -sV --top-ports 1000 "$TARGET" 2>&1 | tee -a "$REPORT"
echo "" | tee -a "$REPORT"

# 2. SSL/TLS check (if HTTPS)
echo "--- SSL/TLS Check ---" | tee -a "$REPORT"
nmap --script ssl-cert,ssl-enum-ciphers -p 443 "$TARGET" 2>&1 | tee -a "$REPORT" || true

Technical Analysis

The script accepts its scan target directly from the first positional argument and forwards it to Nmap without validating that it is an IPv4 address, IPv6 address, CIDR range, or hostname.

Shell quoting prevents whitespace splitting, wildcard expansion, and direct shell metacharacter execution. However, quoting does not prevent the receiving program from interpreting a value beginning with - as a command-line option. Consequently, a target controlled by an untrusted caller can be parsed by Nmap as an option rather than as a host.

This is application-level argument injection rather than shell command injection. The available behavior depends on the installed Nmap version and which option forms it accepts as one argument. A crafted option can alter target selection, script selection, data sources, output behavior, or other scan settings. Even where an injected option causes the scan to fail because no po ...[truncated 1664 chars]

Remediation
View remediation

Remediation Suggestions

  1. Validate the target before constructing report names or invoking any scanner. Accept only explicitly supported formats:
    • IPv4 addresses
    • IPv6 addresses
    • CIDR ranges
    • DNS hostnames
  2. Reject empty values, values beginning with -, control characters, whitespace, URL components, and values containing scanner-option syntax.
  3. Use a structured parser rather than relying exclusively on a permissive regular expression. For example, use Python's ipaddress module for IP addresses and networks, with a separate strict hostname validator.
  4. If the installed Nmap version supports an end-of-options delimiter for the relevant invocation, place it immediately before the target. This should be defense in depth and not a replacement for validation.
  5. Run scans under a dedicated, minimally privileged account with restricted filesystem access and controlled network egress.
  6. If the script is called by a web service or job processor, enforce server-side target allowlists and authorization checks. Do not rely on client-side validation.
  7. Add regression tests confirming that inputs such as --script=..., --datadir=..., values beginning with -, values containing whitespace, and malformed CIDR ranges are rejected before Nmap is started.

A minimal defensive check should reject option-like input before use:

bash
TARGET="${1:?Usage: quick-audit.sh <target> [output_dir]}"

if [[ "$TARGET" == -* || "$TARGET" =~ [[:space:][:cntrl:]] ]]; then
    echo "Error: invalid scan target" >&2
    exit 2
fi

This check should be supplemented with strict IP, CIDR, or hostname validation.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims a comprehensive OpenClaw-specific OWASP/Nmap/Nikto audit, hardening, and compliance workflow, but the described behavior appears much narrower and more generic. This mismatch is security-relevant because users may rely on the skill for assurance they did not actually receive, leading to false confidence, missed vulnerabilities, and unsafe operational decisions.

Content

No source excerpt is available for this finding.

YARA rule 'offensive_tool_references': References to well-known offensive security tools [hacktools]

High
Category
YARA Match
Confidence
70% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · scripts/quick-audit.sh (reported line 26)May include surrounding context.

sh
S)
REPORT="$OUTPUT_DIR/audit-${TARGET//\//-}-$DATE.txt"

mkdir -p "$OUTPUT_DIR"

echo "========================================" | tee "$REPORT"
echo "Security Audit: $TARGET" | tee -a "$REPORT"
echo "Date: $(date)" | tee -a "$REPORT"
echo "========================================" | tee -a "$REPORT"
echo "" | tee -a "$REPORT"

# 1. Port scan
echo "--- Port Scan (top 1000) ---" | tee -a "$REPORT"
nmap -sV --top-ports 1000 "$TARGET" 2>&1 | tee -a "$REPORT"
echo "" | tee -a "$REPORT"

# 2. SSL/TLS check (if HTTPS)
echo "--- SSL/TLS Check ---" | tee -a "$REPORT"
nmap --script ssl-cert,ssl-enum-ciphers -p 443 "$TARGET" 2>&1 | tee -a "$REPORT" || true
echo "" | tee -a "$REPORT"

# 3. HTTP headers
echo "--- HTTP Headers ---" | tee -a "$REPORT"
curl -sI "http://$TARGET" 2>&1 | tee -a "$REPORT" || true
curl -sI "https://$TARGET" 2>&1 | tee -a "$REPORT" || true
echo "" | tee -a "$REPORT"

# 4. Nikto web scan (if nikto available)
if command -v nikto &>/dev/null; then
    echo "--- Nikto Web Scan

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises and demonstrates shell-based security scanning commands but does not declare any tool scope or permissions boundary. In a security-audit context, undeclared shell capability is dangerous because it can enable broad network probing or local command execution without explicit user/admin review, increasing the risk of misuse, surprise execution, or policy bypass.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrase is broad enough to activate the skill for vague requests involving security audits, scans, penetration testing, or hardening without sufficient scoping. In a skill capable of launching active security scans, underspecified activation can cause unintended use against the wrong host, unauthorized targets, or situations where disruptive probing was not intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description omits warnings that Nmap/Nikto and related audit actions can be disruptive, generate logs/alerts, and implicate privacy or authorization concerns. Without these warnings, users may initiate intrusive scans unknowingly, potentially causing service impact, violating policy, or scanning systems they are not authorized to assess.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.