Created
February 28, 2020 05:35
China Telecom SpeedUp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from Crypto.Cipher import AES | |
import requests | |
import json | |
import time | |
import urllib | |
import random | |
from base64 import b64decode,b64encode | |
# change this | |
phone = '18900000000' | |
# phone = '13%09d' % (random.randrange(1, 10e8)) | |
# : ) | |
key=b64decode('aeX4U+d/5LqENDjHe+Fcrw==') | |
cipher = AES.new(key, AES.MODE_ECB) | |
data = json.dumps({ | |
"account": phone, | |
"area_no": "420100", #if location service is disabled, this will by default be Wuhan | |
"timestamp": int(time.time() * 1000), | |
}) | |
# pkcs7 | |
length = 16 - (len(data) % 16) | |
data += chr(length) * length | |
req = b64encode(cipher.encrypt(str.encode(data))) | |
s = requests.session() | |
print("index") | |
r = s.get("http://ispeed.ebit.cn/xyfree/index.jsp?request=" + urllib.parse.quote_plus(req), allow_redirects=False) | |
# print(s.cookies.get_dict()) | |
print("fake ts.html") | |
r = s.get("http://ispeed.ebit.cn/xyfree/ts.html", allow_redirects=False) | |
print("isTs") | |
r = s.get("http://ispeed.ebit.cn/xyface/xyspeedActivity/isTs.jhtml", allow_redirects=False) | |
# print(s.cookies.get_dict()) | |
print(r.content.decode()) | |
print("isSpeedup") | |
r = s.get("http://ispeed.ebit.cn/xyface/xyspeedActivity/isSpeedup.jhtml", allow_redirects=False) | |
print(r.content.decode()) | |
print("speedup") | |
r = s.get("http://ispeed.ebit.cn/xyface/xyspeedActivity/speedup.jhtml", allow_redirects=False) | |
# print(s.cookies.get_dict()) | |
print(r.content.decode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
index
fake ts.html
isTs
{"state":9999,"message":"连接超时,请重新登录"}
isSpeedup
{"state":9999,"message":"连接超时,请重新登录"}
speedup
{"state":9999,"message":"连接超时,请重新登录"}
OTL