Skip to content

Instantly share code, notes, and snippets.

@fffonion
Created February 26, 2020 14:08
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save fffonion/40ef2b9ba15ae9874fdaa065a0f498a4 to your computer and use it in GitHub Desktop.
Save fffonion/40ef2b9ba15ae9874fdaa065a0f498a4 to your computer and use it in GitHub Desktop.
一键起飞
from Crypto.Cipher import AES
import requests
import json
import time
import urllib
import random
# change this
phone = '13512345678'
# phone = '13%09d' % (random.randrange(1, 10e8))
# : )
key='aeX4U+d/5LqENDjHe+Fcrw=='.decode('base64')
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 = cipher.encrypt(data).encode('base64')
s = requests.Session()
print("index")
r = s.get("http://ispeed.ebit.cn/xyfree/index.jsp?request=" + urllib.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)
print("isSpeedup")
r = s.get("http://ispeed.ebit.cn/xyface/xyspeedActivity/isSpeedup.jhtml", allow_redirects=False)
print(r.content)
print("speedup")
r = s.get("http://ispeed.ebit.cn/xyface/xyspeedActivity/speedup.jhtml", allow_redirects=False)
# print(s.cookies.get_dict())
print(r.content)
@deorth-kku
Copy link

似乎电信更新了接口,没法使用了,广州电信目前输出如下
isTs
{"state":9999,"message":"连接超时,请重新登录"}
isSpeedup
{"state":9999,"message":"连接超时,请重新登录"}
speedup
{"state":9999,"message":"连接超时,请重新登录"}

@revolutionxuanbei
Copy link

是的,不能正常使用了

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