Files
dock/搜寻 X-UI
2026-01-01 18:13:38 +08:00

43 lines
2.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
cat << 'EOF' > deep_search_xui.sh
#!/bin/bash
echo "========================================================"
echo " 正在进行 Debian 12 深度地毯式搜索 (X-UI/Xray)"
echo "========================================================"
# 1. 🕵️‍♂️ 侦探模式:查操作历史 (最可能找到线索的地方)
echo -e "\n[1/4] 正在分析命令历史 (.bash_history)..."
HISTORY_MATCH=$(grep -E "wget|curl" ~/.bash_history | grep "x-ui" | tail -n 5)
if [ -n "$HISTORY_MATCH" ]; then
echo -e "\033[0;32m发现曾经执行过的下载命令\033[0m"
echo "$HISTORY_MATCH"
echo -e "👆 (如果上面是 curl | bash 格式,说明没保存安装包,是直接运行的)"
else
echo "历史记录中未发现明显的下载命令。"
fi
# 2. 📂 全盘搜索:不放过任何角落 (排除系统虚拟目录)
echo -e "\n[2/4] 正在全盘搜索文件名包含 'x-ui' 的文件 (可能需要一点时间)..."
# 排除 /proc, /sys, /run, /dev 避免报错
find / -path /proc -prune -o -path /sys -prune -o -path /run -prune -o -path /dev -prune -o -type f -name "*x-ui*" -print 2>/dev/null | grep -vE "(/usr/local/x-ui|/var/lib/docker)" | head -n 20
# (grep -v 是为了屏蔽掉已经安装好的程序文件,只找安装包)
# 3. 📝 内容搜索:查找名字是 install.sh 但内容是 X-UI 的文件
echo -e "\n[3/4] 正在检查常见的 install.sh 脚本内容..."
# 搜索 /root 和 /home 下所有的 .sh 文件
find /root /home /tmp -maxdepth 3 -name "*.sh" -type f 2>/dev/null | while read -r script; do
if grep -q "x-ui" "$script"; then
echo -e "\033[0;33m疑似目标脚本 (内容包含 x-ui): $script\033[0m"
fi
done
# 4. 📦 大文件搜索:查找可能是压缩包的残留
echo -e "\n[4/4] 正在搜索最近修改过的压缩包 (tar.gz/zip)..."
find /root /home /tmp -type f \( -name "*.tar.gz" -o -name "*.zip" \) -mtime -365 -size +1M 2>/dev/null | head -n 10
echo -e "\n========================================================"
echo "搜索结束。"
EOF
chmod +x deep_search_xui.sh && ./deep_search_xui.sh