Skip to content

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Claude Code / Kiro / Cursor / Cline 等代码 AI 客户端

Shell

fix(bootstrap): run under a grep-free PATH

Atirnafb311078f926
diff --git a/skills/scripts/bootstrap-reverse.sh b/skills/scripts/bootstrap-reverse.sh
index c7f63ca..647cb65 100644
--- a/skills/scripts/bootstrap-reverse.sh
+++ b/skills/scripts/bootstrap-reverse.sh
@@ -142,7 +142,20 @@ sudo_cmd() {
}
is_kali() {
- [[ -f /etc/os-release ]] && grep -qi '^ID=.*kali' /etc/os-release
+ [[ -f /etc/os-release ]] || return 1
+ local line lowered
+ while IFS= read -r line || [[ -n "$line" ]]; do
+ lowered="$(printf '%s\n' "$line" | tr '[:upper:]' '[:lower:]')"
+ case "$lowered" in
+ id_like=*) continue ;;
+ id=*)
+ case "$lowered" in
+ *kali*) return 0 ;;
+ esac
+ ;;
+ esac
+ done < /etc/os-release
+ return 1
}
platform_doc() {
diff --git a/skills/scripts/test-bootstrap-supply-chain.ps1 b/skills/scripts/test-bootstrap-supply-chain.ps1
index 315e0df..a6723f8 100644
--- a/skills/scripts/test-bootstrap-supply-chain.ps1
+++ b/skills/scripts/test-bootstrap-supply-chain.ps1
@@ -15,6 +15,16 @@ function Test-AnythingAnalyzerElectronHealthy { return $true }
function Assert-True { param([bool]$Condition, [string]$Message) if (-not $Condition) { throw $Message } }
function Invoke-Git { param([string[]]$Arguments) & git @Arguments; if ($LASTEXITCODE -ne 0) { throw "git failed: $Arguments" } }
+function Write-UnixExecutable {
+ param(
+ [Parameter(Mandatory = $true)][string]$Path,
+ [Parameter(Mandatory = $true)][string]$Content
+ )
+ $normalized = ($Content -replace "`r`n", "`n") -replace "`r", "`n"
+ if (-not $normalized.EndsWith("`n")) { $normalized += "`n" }
+ [IO.File]::WriteAllText($Path, $normalized, [Text.UTF8Encoding]::new($false))
+ & chmod +x $Path
+}
try {
$source = Join-Path $scratch 'source'
@@ -63,15 +73,14 @@ echo npm^|%*>>"%BOOTSTRAP_PS_LOG%"
'@
}
else {
- Set-Content $stub @'
+ Write-UnixExecutable -Path $stub -Content @'
#!/bin/sh
printf "npm|%s\n" "$*" >> "$BOOTSTRAP_PS_LOG"
'@
- & chmod +x $stub
}
$pnpm = Join-Path $bin ($(if ($isWindowsHost) { 'pnpm.cmd' } else { 'pnpm' }))
if ($isWindowsHost) { Set-Content $pnpm "@echo off`r`necho 0" }
- else { Set-Content $pnpm "#!/bin/sh`necho 0"; & chmod +x $pnpm }
+ else { Write-UnixExecutable -Path $pnpm -Content "#!/bin/sh`necho 0" }
Ensure-Pnpm
Assert-True ((Get-Content $env:BOOTSTRAP_PS_LOG) -match 'npm\|install -g [email protected]') 'pnpm install was not pinned'
@@ -83,12 +92,11 @@ if "%1"=="--version" (echo 10.24.0) else (echo pnpm^|%*>>"%BOOTSTRAP_PS_LOG%")
'@
}
else {
- Set-Content $pnpm @'
+ Write-UnixExecutable -Path $pnpm -Content @'
#!/bin/sh
[ "$1" = --version ] && { echo 10.24.0; exit; }
printf "pnpm|%s\n" "$*" >> "$BOOTSTRAP_PS_LOG"
'@
- & chmod +x $pnpm
}
function Approve-AnythingAnalyzerBuildScripts { param([string]$RepoDir) Set-Content (Join-Path $RepoDir 'pnpm-workspace.yaml') 'generated'; Set-Content (Join-Path $RepoDir 'package.json') '{"mutated":true}' }
$dirtyRejected = $false