解密 tuic-yg 脚本 原理与实践 同理 naiveproxy-yg
wget -N https://gitlab.com/rwkgyg/tuic-yg/raw/main/tuic.sh
下载一看, 第一眼感觉像是乱码.
结构上是这样.
1. 设置一堆变量.
2. eval "一堆变量连接在一起"
所以, 第
我们把
用
bash <(sed 's/eval/echo/' tuic.sh) > 1.sh
看看 1.sh 里面是啥.
先
我们把
用
bash <(sed 's/bash -c/echo/; s/bash "$@"//' 1.sh) > 2.sh
再看看 2.sh, 会发现还是一样的结构.
那就继续用同样的方法, 每次都看一眼结果. 直到看到脚本源码.
bash <(sed 's/bash -c/echo/; s/bash "$@"//' 2.sh) > 3.sh
bash <(sed 's/bash -c/echo/; s/bash "$@"//' 3.sh) > 4.sh
bash <(sed 's/bash -c/echo/; s/bash "$@"//' 4.sh) > 5.sh
bash <(sed 's/eval/echo/' ${1}) > _tmp.shwhile [[ "$(head _tmp.sh -c 7)" == "bash -c" ]]; dobash <(sed 's/bash -c/echo/; s/bash "$@"//' _tmp.sh) > _tmp1.shmv _tmp1.sh _tmp.shdonemv _tmp.sh ${1}
保存为比如 unpack.sh
用法就是这样:
wget -N https://gitlab.com/rwkgyg/tuic-yg/raw/main/tuic.sh
./unpack.sh tuic.sh
传到了
https://gitlab.com/crazypeace/tuic-yg-unpack
用法
wget -N https://gitlab.com/rwkgyg/tuic-yg/raw/main/tuic.shbash <(curl https://gitlab.com/crazypeace/tuic-yg-unpack/-/raw/main/unpack.sh) tuic.sh
========
update
同理可得 naiveproxy-yg
wget -N https://gitlab.com/rwkgyg/naiveproxy-yg/raw/main/naiveproxy.shbash <(curl -L https://gitlab.com/crazypeace/tuic-yg-unpack/-/raw/main/unpack.sh) naiveproxy.sh
评论
发表评论