-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpoc.py
67 lines (58 loc) · 2.24 KB
/
poc.py
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
65
66
67
import json
import random
import re
import time
import jsonpath
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
with open("./token.txt",'r') as f:
youtoken = f.read().strip()
getline = "https://admin.report.mestallion.com/api/mini/sport/getline"
map = "https://admin.report.mestallion.com/api/mini/sport/today"
daka = "https://admin.report.mestallion.com/api/mini/sport/daka"
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat",
"Content-Type": "application/x-www-form-urlencoded",
"Token": youtoken,
"Referer": "https://servicewechat.com/wx5069fcccc8151ce3/28/page-frame.html",
}
getdata = {
"lat": "36.55358",
"lng": "116.75199"
}
reqgetline = requests.post(url=getline,headers=header, data=getdata,verify=False)
jsondata = json.loads(reqgetline.text)
getcode = jsonpath.jsonpath(jsondata, '$[code]')
if 200 in getcode:
print("获取线路成功")
print(f"页面响应信息:{reqgetline.text}")
elif 500 in getcode:
print("获取线路失败")
print(f"页面响应信息:{reqgetline.text}")
reqmap = requests.post(url=map, headers=header,verify=False)
name = re.findall('"name":"(.{1,12}?)",', reqmap.text)
print("你好 : " + str(name))
lngs = re.findall(',"lng":(.{1,12}?),"total_distence":', reqmap.text)
lats = re.findall(',"lat":(.{9,12}?)}', reqmap.text)
ids = re.findall(',"id":(.{1,12}?),"lat":', reqmap.text)
for i in range(4):
data = {
"ble": "false",
"gps": "false",
"lat": lats[i],
"lng": lngs[i],
"bs_id": "",
"bs_name": "",
"id": ids[i]
}
reqdaka = requests.post(url=daka, headers=header, data=data,verify=False)
jsondata = json.loads(reqdaka.text)
code = jsonpath.jsonpath(jsondata, '$[code]')
if 200 in code:
print(f"第{i + 1}次打卡成功")
print(f"页面响应信息:{reqdaka.text}")
elif 500 in code:
print(f"第{i + 1}次打卡失败")
print(f"页面响应信息:{reqdaka.text}")
time.sleep(330 + random.randint(1, 35))