Skip to content

Instantly share code, notes, and snippets.

@582033
Last active July 2, 2021 00:51
Show Gist options
  • Save 582033/f0160fbdeede6f144c78642d0f71f467 to your computer and use it in GitHub Desktop.
Save 582033/f0160fbdeede6f144c78642d0f71f467 to your computer and use it in GitHub Desktop.
12351工会福利抢购
#!/usr/bin/env bash
#用户session
JSESSIONID="0003it-tqm1tI0yBdJiT4cnedEh:-HLGBUP:XXXXXXXX"
#活动id
service_id="32142"
#token
token="3BF2A6E0EA39BE2FC66A3C3A82XXXXXXX"
#收货人地址
receive_id="1234567"
#收货人手机号
phone="18515150000"
#奖品领取地点,736是中关村总工会地址
firm_id="736"
#当前时间
use_date=$(date "+%Y-%m-%d")
#签到,用于抢购成功后扫码确认
signIn(){
curl -s \
-H 'Host: apphd.bjzgh12351.org' \
-H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \
-H 'Origin: file://' \
-H "Cookie: JSESSIONID=$JSESSIONID" \
-H 'Accept: application/json, text/plain, */*' \
-H 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 (5687519488)' \
-H 'Accept-Language: zh-cn' \
--data-binary "service_id=$service_id&token=$token&firm_id=$firm_id" \
--compressed 'http://apphd.bjzgh12351.org/mobile/api/check/take-service.jsp' \
| jq
}
#抢购
snapUp(){
for i in {1..200};do
curl -s \
-H 'Host: apphd.bjzgh12351.org' \
-H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \
-H 'Origin: file://' \
-H "Cookie: JSESSIONID=$JSESSIONID" \
-H 'Accept: application/json, text/plain, */*' \
-H 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 (4385191040)' \
-H 'Accept-Language: zh-cn' \
--data-binary "service_id=$service_id&token=$token&receive_id=$receive_id&use_date=$use_date&firm_id=$firm_id&reserve_count=1&phone=$phone" \
--compressed 'http://apphd.bjzgh12351.org/mobile/api/service/reserve.jsp' \
| jq 2>&1 &
done
}
if [[ $1 == "signIn" || $1 == "snapUp" ]];then
$1
else
echo -e "\n参数错误,仅支持以下参数: \n - $0 snapUp, 抢购\n - $0 signIn, 抢购成功后的扫码确认\n";
exit;
fi
@582033
Copy link
Author

582033 commented Jun 15, 2021

基础信息部分需要自己抓包获取

  • 抓包工具随意,比如charles之类
  • 随便找一个活动id点击就能抓到

jq命令非必须

  • 如果没装jq可以去掉| jq这部分
  • mac可以用brew install jq
  • win需要jq.exe扩展; 下载链接

使用

  • 使用命令 ./12351.sh snapUp 进行抢购
  • 抢购成功后,可以执行 ./12351.sh signIn 来替代抢购成功后的扫码操作

tips

  • 这玩意儿也没发现有封号的情况,如果抢购人数太多,粗暴点直接改成100进程

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment