Skip to content

Instantly share code, notes, and snippets.

@winooxx
Created February 28, 2020 05:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save winooxx/6aad0e8cf236405ea9465ddbdd66370a to your computer and use it in GitHub Desktop.
Save winooxx/6aad0e8cf236405ea9465ddbdd66370a to your computer and use it in GitHub Desktop.
China Telecom SpeedUp
#!/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())
@daiaji
Copy link

daiaji commented Apr 9, 2020

index
fake ts.html
isTs
{"state":9999,"message":"连接超时,请重新登录"}
isSpeedup
{"state":9999,"message":"连接超时,请重新登录"}
speedup
{"state":9999,"message":"连接超时,请重新登录"}

OTL

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