使用nop.gs网站使用api上传apk脱壳示范

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
FILE_PATH="/storage/emulated/0/0.apk" # 这是apk路径,比如/storage/emulated/0/xxx.apk
TKFILE="/storage/emulated/0/" # 这是下载路径

// 检查文件是否存在
if [ ! -f "$FILE_PATH" ]; then
echo "上传错误:apk文件$FILE_PATH不存在。"
exit 1
fi

// 检查文件是否为apk文件
if [[ "$FILE_PATH" != *.apk ]]; then
echo "上传错误:文件$FILE_PATH不是一个apk文件。"
exit 1
fi

// 网页版脱壳地址: https://nop.gs
// 如有问题加群反馈
UPLOAD_URL="https://nop.gs/api.php"
if command -v curl >/dev/null 2>&1; then
RESPONSE=$(curl -F "file=@${FILE_PATH}" -F "format=json" ${UPLOAD_URL})
HASH=$(echo ${RESPONSE} | awk -F'"' '/"hash":/{print $(NF-1)}')
echo "上传成功,哈希值为:${HASH}"
elif command -v wget >/dev/null 2>&1; then
RESPONSE=$(wget --quiet --post-file=${FILE_PATH} --post-data="format=json" ${UPLOAD_URL} -O -)
HASH=$(echo ${RESPONSE} | awk -F'"' '/"hash":/{print $(NF-1)}')
echo "上传成功,文件哈希值为:${HASH}"
else
echo "错误:系统中没有安装curl或wget。"
exit 1
fi

CHECK_URL="https://nop.gs/d/${HASH}.log"

while true; do
echo "正在查询任务状态..."
if command -v curl >/dev/null 2>&1; then
QUERY_RESULT=$(curl -s ${CHECK_URL})
elif command -v wget >/dev/null 2>&1; then
QUERY_RESULT=$(wget -q -O - ${CHECK_URL})
fi

echo "查询结果:${QUERY_RESULT}"

if [[ ${QUERY_RESULT} == *"任务成功"* ]]; then
echo "任务成功"
DOWNLOAD_URL="https://nop.gs/xz.php?url=${HASH"
echo "下载地址为:${DOWNLOAD_URL}"
if command -v curl >/dev/null 2>&1; then
curl -o "${TKFILE}${HASH}.zip" ${DOWNLOAD_URL}
echo "下载成功,文件已经下载到${TKFILE}${HASH}.zip"
elif command -v wget >/dev/null 2>&1; then
wget -O "${TKFILE}${HASH}.zip" ${DOWNLOAD_URL}
echo "下载成功,文件已经下载到${TKFILE}${HASH}.zip"
fi
break
elif [[ ${QUERY_RESULT} == *"任务失败"* ]] || [[ ${QUERY_RESULT} == *"任务异常"* ]]; then
echo "任务失败或任务异常"
break
else
sleep 25
fi
done