Back to skill

Security audit

Linux 服务排障(分层自底向上)

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Linux troubleshooting skill, but it includes root commands that persistently change firewall and Bluetooth startup settings without clearly requiring user confirmation.

Install only if you are comfortable with an agent advising or running administrative Linux troubleshooting commands. Before applying fixes, confirm the exact port, subnet, service name, and whether changes should persist after reboot; ask for rollback commands such as removing the firewalld rule or disabling Bluetooth autostart.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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)

T06 · System Persistence

Note
Location
SKILL.md:60
Finding

Bluetooth Service Persistently Enabled Without Explicit User Consent

Content
View full analysis
[default] bluetoothctl show # Powered: yes (and HCI/LMP version, supported profiles) ``` ### Technical Analysis The documented recovery procedure runs both `systemctl start bluetooth` and `systemctl enable bluetooth` with root privileges. Starting the service is sufficient to restore Bluetooth during the current boot. Enabling it separately changes the host's boot-time service configuration so that Bluetooth starts automatically in future sessions. This persistent change may be legitimate on a system intended to use Bluetooth regularly, but it is not strictly required to diagnose or immediately repair an inactive service. The instructions do not distinguish temporary recovery from persistent configuration and do not require confirmation before making the lasting change. Consequently, an agent following the Skill literally could exceed the user's intended scope. This is a system-persistence concern rather than evidence of a backdoor: the command enables the standard operating-system Bluetooth service and does not install attacker-controlled code. ### Attack Path 1. A user invokes the Skill to diagnose a temporary Bluetooth failure. 2. The agent follows the documented fix and executes the commands with `sudo`. 3. `systemctl start bluetooth` restores the service for the current boot. 4. `systemctl enable bluetooth` additionally modifies system service configuration. 5. On subsequent boots, the Bluetooth service starts automatically even if the user intended only a temporary repair. No external attacker-controlled payload or privilege-escalation mechanism is present. Exploitation depends on an agent applying the persistent comm ...[truncated 715 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 19)May include surrounding context.

md
1. **Hardware present?** `lsusb | grep -i <type>`, `lspci`
2. **Kernel driver loaded + initialized?** `lsmod | grep <mod>`, `dmesg | grep -i <subsys>`
3. **Radio/firewall unblocked?** `rfkill list` (bt/wifi), `firewall-cmd --list-all`, `nft list ruleset`
4. **Service running + enabled?** `systemctl status <svc>`, `systemctl is-active <svc>`, `is-enabled <svc>`
5. **Effective config value?** use the tool's OWN probe (`sshd -T`, `bluetoothctl show`), not manual `grep` of a config file.

## SSH reachability on a custom port — the firewalld trap

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 · SKILL.md (reported line 30)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 31)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 32)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 33)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 34)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 37)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 44)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 61)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 62)May include surrounding context.

Fix + verify:

bash
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port port="50022" protocol="tcp" accept'
sudo firewall-cmd --reload
sudo firewall-cmd --list-rich-rules | grep 50022   # confirm persisted
sudo nft list ruleset | grep 50022                 # confirm in the live ruleset

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 · SKILL.md (reported line 49)May include surrounding context.

md
(`prohibit-password` may be reported as `without-password` — same meaning.)
- **`systemctl reload sshd`** applies per-connection settings (PermitRootLogin, PasswordAuthentication, etc.) WITHOUT dropping existing sessions (SIGHUP). Use `restart` only for `Port`/`ListenAddress`-class changes.
- **Remove dead firewalld services**: after moving off a port, `--remove-service=ssh` to avoid a "fake allow" for a port nothing listens on.
- Back up before editing: `sudo cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%Y%m%d)`.

## Bluetooth not working

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 62)May include surrounding context.

Fix:

bash
sudo systemctl start bluetooth
sudo systemctl enable bluetooth
bluetoothctl list   # Controller <MAC> <host> [default]
bluetoothctl show   # Powered: yes  (and HCI/LMP version, supported profiles)