T09 · Insecure Skill Coding Practices
- Location
scripts/security-audit.sh:61- Finding
Command Injection Through Dynamically Constructed SSH Configuration Summary
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Linux audit skill mostly does what it says, but its script can turn crafted SSH configuration values into shell commands, which is risky if run as root.
Install only if you are comfortable reviewing and fixing the shell script first. The audit checks are coherent and local, but do not run this as sudo/root on systems where SSH configuration content might be attacker-controlled; replace the dynamic bash -c SSH summary with fixed printf-style handling before privileged use.
scripts/security-audit.sh:61Command Injection Through Dynamically Constructed SSH Configuration Summary
Referenced artifact was not completely inspected
`scripts/security-audit.sh` — the single entry point for all checks.
Referenced artifact was not completely inspected
`scripts/security-audit.sh` — the single entry point for all checks.
Referenced artifact was not completely inspected
`scripts/security-audit.sh` — the single entry point for all checks.
Referenced artifact was not completely inspected
`scripts/security-audit.sh` — the single entry point for all checks.
Referenced artifact was not completely inspected
`scripts/security-audit.sh` — the single entry point for all checks.
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
ed directories"
else
warn "World-writable files found — review the list above"
fi
gather_section "World-Writable Files" bash -c "for d in /etc /tmp /var /home /opt; do [ -d \"\$d\" ] && find \"\$d\" -maxdepth 3 -type f -perm -0002 2>/dev/null; done | head -50"
}
check_suid() {
section "SUID Binaries"
echo "Finding SUID bit set on binaries..."
local suid_list=$(find / -perm -4000 -type f 2>/dev/null | sort)
if [[ -z "$suid_list" ]]; then
info "No SUID binaries found"
return
fi
echo "$suid_list"
echo ""
local known_risky=("pkexec" "passwd" "sudo" "su" "mount" "umount" "chsh" "chfn" "newgrp" "gpasswd")
local risky_found=()
for bin in $suid_list; do
local name=$(basename "$bin")
for risky in "${known_risky[@]}"; do
if [[ "$name" == "$risky" ]]; then
risky_found+=("$bin")
break
fi
done
done
if [[ ${#risky_found[@]} -gt
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
---
name: linux-security-scanner
description: Linux security auditing tool that checks SSH configuration, open/listening ports, firewall rules (ufw/iptables/nftables), failed login attempts, sudoers permissions, world-writable files, and SUID binaries. Use when a user needs a security posture assessment, hardening audit, or compliance check on a Linux host — run individual checks or a full comprehensive audit with a formatted report.
---
# Linux Security Scanner
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
---
name: linux-security-scanner
description: Linux security auditing tool that checks SSH configuration, open/listening ports, firewall rules (ufw/iptables/nftables), failed login attempts, sudoers permissions, world-writable files, and SUID binaries. Use when a user needs a security posture assessment, hardening audit, or compliance check on a Linux host — run individual checks or a full comprehensive audit with a formatted report.
---
# Linux Security Scanner
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
---
name: linux-security-scanner
description: Linux security auditing tool that checks SSH configuration, open/listening ports, firewall rules (ufw/iptables/nftables), failed login attempts, sudoers permissions, world-writable files, and SUID binaries. Use when a user needs a security posture assessment, hardening audit, or compliance check on a Linux host — run individual checks or a full comprehensive audit with a formatted report.
---
# Linux Security Scanner
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
---
name: linux-security-scanner
description: Linux security auditing tool that checks SSH configuration, open/listening ports, firewall rules (ufw/iptables/nftables), failed login attempts, sudoers permissions, world-writable files, and SUID binaries. Use when a user needs a security posture assessment, hardening audit, or compliance check on a Linux host — run individual checks or a full comprehensive audit with a formatted report.
---
# Linux Security Scanner
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
---
name: linux-security-scanner
description: Linux security auditing tool that checks SSH configuration, open/listening ports, firewall rules (ufw/iptables/nftables), failed login attempts, sudoers permissions, world-writable files, and SUID binaries. Use when a user needs a security posture assessment, hardening audit, or compliance check on a Linux host — run individual checks or a full comprehensive audit with a formatted report.
---
# Linux Security Scanner
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
---
name: linux-security-scanner
description: Linux security auditing tool that checks SSH configuration, open/listening ports, firewall rules (ufw/iptables/nftables), failed login attempts, sudoers permissions, world-writable files, and SUID binaries. Use when a user needs a security posture assessment, hardening audit, or compliance check on a Linux host — run individual checks or a full comprehensive audit with a formatted report.
---
# Linux Security Scanner
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| `--ports` | Listening TCP ports (ss or netstat) |
| `--firewall` | ufw status, iptables filter rules, nftables ruleset |
| `--failed-logins` | lastb output and journalctl SSH auth failures (last 24h) |
| `--sudoers` | Sudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants |
| `--world-writable` | World-writable files in /etc, /tmp, /var, /home, /opt (depth 3) |
| `--suid` | All SUID binaries, risk assessment, unusual path detection |
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| `--ports` | Listening TCP ports (ss or netstat) |
| `--firewall` | ufw status, iptables filter rules, nftables ruleset |
| `--failed-logins` | lastb output and journalctl SSH auth failures (last 24h) |
| `--sudoers` | Sudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants |
| `--world-writable` | World-writable files in /etc, /tmp, /var, /home, /opt (depth 3) |
| `--suid` | All SUID binaries, risk assessment, unusual path detection |
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| `--ports` | Listening TCP ports (ss or netstat) |
| `--firewall` | ufw status, iptables filter rules, nftables ruleset |
| `--failed-logins` | lastb output and journalctl SSH auth failures (last 24h) |
| `--sudoers` | Sudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants |
| `--world-writable` | World-writable files in /etc, /tmp, /var, /home, /opt (depth 3) |
| `--suid` | All SUID binaries, risk assessment, unusual path detection |
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| `--ports` | Listening TCP ports (ss or netstat) |
| `--firewall` | ufw status, iptables filter rules, nftables ruleset |
| `--failed-logins` | lastb output and journalctl SSH auth failures (last 24h) |
| `--sudoers` | Sudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants |
| `--world-writable` | World-writable files in /etc, /tmp, /var, /home, /opt (depth 3) |
| `--suid` | All SUID binaries, risk assessment, unusual path detection |
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
| `--firewall` | ufw status, iptables filter rules, nftables ruleset |
| `--failed-logins` | lastb output and journalctl SSH auth failures (last 24h) |
| `--sudoers` | Sudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants |
| `--world-writable` | World-writable files in /etc, /tmp, /var, /home, /opt (depth 3) |
| `--suid` | All SUID binaries, risk assessment, unusual path detection |
Example:
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
| `--firewall` | ufw status, iptables filter rules, nftables ruleset |
| `--failed-logins` | lastb output and journalctl SSH auth failures (last 24h) |
| `--sudoers` | Sudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants |
| `--world-writable` | World-writable files in /etc, /tmp, /var, /home, /opt (depth 3) |
| `--suid` | All SUID binaries, risk assessment, unusual path detection |
Example:
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
| `--firewall` | ufw status, iptables filter rules, nftables ruleset |
| `--failed-logins` | lastb output and journalctl SSH auth failures (last 24h) |
| `--sudoers` | Sudoers file permissions (must be 440), files present, NOPASSWD entries, full sudo access grants |
| `--world-writable` | World-writable files in /etc, /tmp, /var, /home, /opt (depth 3) |
| `--suid` | All SUID binaries, risk assessment, unusual path detection |
Example:
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
gather_section "Sudoers Audit" bash -c "echo 'Files:'; find /etc/sudoers /etc/sudoers.d -type f 2>/dev/null; echo '---'; echo 'NOPASSWD:'; grep -r 'NOPASSWD' /etc/sudoers /etc/sudoers.d 2>/dev/null || echo 'none'; echo 'Full sudo:'; grep -r 'ALL=(ALL:ALL) ALL' /etc/sudoers /etc/sudoers.d 2>/dev/null || echo 'none'"
}
check_world_writable() {
section "World-Writable Files"
local dirs=("/etc" "/tmp" "/var" "/home" "/opt")
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
gather_section "Sudoers Audit" bash -c "echo 'Files:'; find /etc/sudoers /etc/sudoers.d -type f 2>/dev/null; echo '---'; echo 'NOPASSWD:'; grep -r 'NOPASSWD' /etc/sudoers /etc/sudoers.d 2>/dev/null || echo 'none'; echo 'Full sudo:'; grep -r 'ALL=(ALL:ALL) ALL' /etc/sudoers /etc/sudoers.d 2>/dev/null || echo 'none'"
}
check_world_writable() {
section "World-Writable Files"
local dirs=("/etc" "/tmp" "/var" "/home" "/opt")
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
gather_section "Sudoers Audit" bash -c "echo 'Files:'; find /etc/sudoers /etc/sudoers.d -type f 2>/dev/null; echo '---'; echo 'NOPASSWD:'; grep -r 'NOPASSWD' /etc/sudoers /etc/sudoers.d 2>/dev/null || echo 'none'; echo 'Full sudo:'; grep -r 'ALL=(ALL:ALL) ALL' /etc/sudoers /etc/sudoers.d 2>/dev/null || echo 'none'"
}
check_world_writable() {
section "World-Writable Files"
local dirs=("/etc" "/tmp" "/var" "/home" "/opt")
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
}
check_world_writable() {
section "World-Writable Files"
local dirs=("/etc" "/tmp" "/var" "/home" "/opt")
local found=0
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
}
check_world_writable() {
section "World-Writable Files"
local dirs=("/etc" "/tmp" "/var" "/home" "/opt")
local found=0
The manifest says the skill can run a full audit with a formatted report, and the script builds a REPORT variable throughout execution. However, at the end it only states that raw audit data is stored in the shell variable and does not print, save, or otherwise return the formatted report, so the documented/reporting intent diverges from actual behavior.