Back to skill

Security audit

Ubuntu Inspector

Security checks for vulnerabilities and agentic risk

Overview

This is a legitimate local Ubuntu inspection tool, but it asks users to run broad host checks with root access while writing sensitive reports insecurely under /tmp.

Install only if you are comfortable running a local system-inspection script and reviewing the generated report. Prefer running it without root first, avoid sharing the report publicly, and consider changing the script to use a private directory, mktemp, and 0600 permissions before running it on multi-user or production servers.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/inspect.sh:14
Finding

Predictable Temporary Report Path Permits Symlink-Based Privileged File Corruption

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/inspect.sh:64
Finding

Sensitive Host Reconnaissance Data Is Written to an Insufficiently Protected Shared-Directory Report

Content
View full analysis
/dev/null | head -10 | tee -a "$REPORT_FILE" || echo "Unable to read logs or no errors" | tee -a "$REPORT_FILE" lastb -n 10 2>/dev/null | tee -a "$REPORT_FILE" || echo "No records" | tee -a "$REPORT_FILE" ``` The report destination is defined separately at line 14: ```bash REPORT_FILE="/tmp/ubuntu_inspection_$(date +%Y%m%d_%H%M%S).txt" ``` ### Technical Analysis The script aggregates a substantial amount of security-relevant host information, including: - Interface addresses and routing information - Listening TCP ports and associated process information - Recent successful and failed login records - Currently logged-in users - Process command lines and memory usage - Recent system error logs - User and group statistics This collection is consistent with the documented inspection purpose, and the script does not transmit the information externally. However, the documentation recommends root execution for complete results, which may cause the report to contain information unavailable to ordinary local users. The collected information is written to a predictable file under the shared `/tmp` directory. The script does not set `umask 077`, explicitly create the report with mode `0600`, or place it in a private directory. Under a common `022` umask, a newly created report can be mode `0644`, making it readable by other local users. The exposure is especially significant for `ps aux`, `ss -tlnp`, `last`, `la ...[truncated 1672 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/inspect.sh (reported line 110)May include surrounding context.

sh
# 13. 安全相关
echo "【13. 安全信息】" | tee -a "$REPORT_FILE"
echo "系统用户数量: $(cat /etc/passwd | wc -l)" | tee -a "$REPORT_FILE"
echo "sudo 用户: $(grep -c 'sudo' /etc/group)" | tee -a "$REPORT_FILE"
echo "失败的登录尝试 (最近10次):" | tee -a "$REPORT_FILE"
lastb -n 10 2>/dev/null | tee -a "$REPORT_FILE" || echo "  无记录" | tee -a "$REPORT_FILE"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script writes a detailed system inspection report to /tmp, a world-accessible shared directory on many systems, and the report contains sensitive host metadata such as hostname, IP addresses, listening ports, login records, users, and service state. Even if the script is intended for legitimate administration, storing this data in /tmp without restrictive permissions or an explicit warning can expose reconnaissance data to local users or other processes.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/inspect.sh (reported line 111)May include surrounding context.

sh
# 13. 安全相关
echo "【13. 安全信息】" | tee -a "$REPORT_FILE"
echo "系统用户数量: $(cat /etc/passwd | wc -l)" | tee -a "$REPORT_FILE"
echo "sudo 用户: $(grep -c 'sudo' /etc/group)" | tee -a "$REPORT_FILE"
echo "失败的登录尝试 (最近10次):" | tee -a "$REPORT_FILE"
lastb -n 10 2>/dev/null | tee -a "$REPORT_FILE" || echo "  无记录" | tee -a "$REPORT_FILE"
echo "" | tee -a "$REPORT_FILE"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

Most user-visible messages in the script are fixed in Chinese, which forces a specific language for output. The file does not provide any opt-in, configuration, or documented justification for restricting output to that locale.

Content

No source excerpt is available for this finding.