自动签到
多此一举
因为学校的实习系统天天需要签到,实在是浪费精力,所以有了下面的过程.
过程
1. 抓包
用burp来代理流量,分别抓了以下请求和请求成功的响应json,问号为隐私
- 登录
url: https://fw.tcc1955.edu.cn/newdgsx/mobile/login?loginName=????&password=????&schoolId=?????,参数分别为学号、密码、学校idPOST1
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
65
66{
"success": true,
"code": 0,
"data": {
"sessionId": "?????????????",
"user": {
"createTime": 1648263450000,
"teacherIn": null,
"type": "STUDENT",
"isTeacherEx": false,
"creator": 1,
"passwordChangeTime": ??????,
"id": ????,
"isStudent": true,
"isTeacherIn": false,
"latestUpdateCreator": 3107,
"student": {
"id": ????,
"creator": 1,
"latestUpdateCreator": 1,
"createTime": 1648263423000,
"latestUpdateTime": 1701705607000,
"number": "???????", #学号
"name": "???",
"clazzId": ???,
"userId": ???,
"gender": "1",
"birthdate": null,
"homePhone": "",
"homeName": "???",
"mobilePhone": "????",
"mobileShortNumber": null,
"email": null,
"qq": null,
"weixin": null,
"weixinOpenId": null,
"isDeleted": false,
"roleId": 5,
"provinceId": null,
"cityId": null,
"provinceName": null,
"cityName": null
},
"name": "???",
"role": {
"id": 5,
"creator": null,
"latestUpdateCreator": null,
"createTime": null,
"latestUpdateTime": null,
"type": "STUDENT",
"name": "学生",
"memo": "学生",
"sortNum": 5,
"userHidden": false
},
"isAdmin": false,
"latestUpdateTime": 1699343989000,
"teacherEx": null,
"roleId": ?,
"loginName": "??"
}
},
"msg": null,
"errors": {}
} - 获取签到历史
url: https://fw.tcc1955.edu.cn/newdgsx/mobile/process/stu-location/getMylistByDate?token=??????&startDate=2023-11-01&endDate=2023-12-01参数token就是前面响应的sessionId,后面的参数为开始时间和截止时间GET1
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{
"success": true,
"code": 0,
"data": {
"list": [
{
"id": ???,
"creator": 3107,
"latestUpdateCreator": 3107,
"createTime": 1701491137000,
"latestUpdateTime": 1701491137000,
"studentId": 2480,
"locationX": "???", #x坐标
"locationY": "???", #y坐标
"scale": 16,
"label": "?????", #地名
"sendTime": 1701446400000,
"mapType": "baidu",
"content": null,
"isAbnormal": false,
"abnormalType": null,
"imei": "weizhi",
"isEvection": false,
"status": true,
"auditOpinion": null,
"applyOpinion": null,
"internshipId": 68,
"isIgnore": null,
"studentName": "???",
"checkType": "CHECKIN",
"checkStatus": "3", #签到状态1为正常上班,3为休息,2为出差
"customForms": null
}
]
},
"msg": null,
"errors": {}
} - 签到
url: https://fw.tcc1955.edu.cn/newdgsx/mobile/process/stu-location/save?token=???&isAbnormal=0&checkType=CHECKIN&studentId=?&locationX=????&locationY=?????&scale=16&label=???&mapType=baidu&imei=weizhi&checkStatus=1&internshipId=68&attachIds=参数主要就是token、坐标、地名、签到状态,其他参数填的跟历史记录一样,不知具体干什么的。POST1
2
3
4
5
6
7{
"success": true,
"code": 0,
"data": null,
"msg": null,
"errors": {}
}
2.编写python脚本
其实主要是分析url请求,后面编写脚本很容易,用request库写个简单的就够用了,先用登录请求获取token,再用token获取签到历史里的坐标和地名,最后签到就好了
1 | #!/usr/bin/python3 |
3. 部署到服务器
我用的crontab定时任务,系统是arch,当然也可以在脚本里写上定时触发,不过没必要,毕竟最好保持KISS😙,如果要自动化签到记得把脚本中的交互给注释了。
1 | crontab -e |
添加下面的一行
1 | 0 9 * * * /path/to/autocheck.py #每天9点签一次到 |
吐槽
其实学校的实习系统用的慧职教🤐不是我说的(spring框架和远古的不知道啥玩意弄的实习系统)。真的不知道这些形式化的东西有啥用。顺带提一嘴,知道为啥学校教学水平不咋地了,你看看这系统做的🤡🤡🤡,万事还得靠自己,学习的动力又有了哈哈哈。
- 标题: 自动签到
- 作者: Hulk
- 创建于 : 2023-12-05 19:53:49
- 更新于 : 2023-12-05 21:02:43
- 链接: https://blog.vmiss.shop/2023/12/05/自动签到/
- 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论