使用Qpython3制作老版天翼飞TP路由器拨号脚本
2024-10-15 20:20:11
#幻境拨号python版
#by 1414641776
account='xxxxxx@96301'
password='xxxxx' # 路由器脚本
def sendToRoute(account,password):
import urllib.request,base64
ip = '192.168.1.1'
login_user = 'admin'
login_pw = 'admin'
url="http://192.168.1.1/userRpm/PPPoECfgRpm.htm?wan=0&wantype=2&acc="+account+"&psw="+password+"&confirm="+password+"&specialDial=0&SecType=0&sta_ip=0.0.0.0&sta_mask=0.0.0.0&linktype=1&waittime=15&Connect=%C1%AC+%BD%D3"
auth =str(base64.b64encode((login_user+':'+login_pw).encode('utf-8')))
auth = 'Basic ' + auth[2:len(auth)-1]
heads = { 'Referer' : 'http://' + ip + '/userRpm/SysRebootRpm.htm',
'Authorization' : auth #'Basic YWRtaW46emhpZGlhbnpoZW5h'
}
request = urllib.request.Request(url, None, heads)
response = urllib.request.urlopen(request)
print(response.read()) #sl4a的Android的API调用
#剪贴板复制函数
def setClipboard(string):
import sl4a
droid = sl4a.Android()
droid.setClipboard(string) #md5加密函数
def md5(string):
import hashlib
m = hashlib.md5()
m.update(string.encode('utf-8'))
#参数必须是byte类型,否则报Unicode-objects must be encoded before hashing错误
md5=m.hexdigest()
return md5.upper() #天翼老版加密函数
def getAccount(account,password):
import time
now=time.localtime()
time_string = str(now[3])+str(now[4])+str(now[5])
encryptStr1 = md5(time_string)[0:8]
encryptStr2 = md5("jepyid"+account.upper()+encryptStr1+password.upper())[0:20]
encryptAccount = "~ghca"+encryptStr1+""+encryptStr2+account
return encryptAccount account=getAccount(account,password)
setClipboard(account)
print(account+'\r\n加密账号已复制到剪贴板')
sendToRoute(account,password)
最新文章
- 修改MS SQL忽略大小写 分类: SQL Server 数据库 2015-06-19 09:18 34人阅读 评论(0) 收藏
- ES6学习--搭建环境
- [自己动手玩黑科技] 1、小黑科技——如何将普通的家电改造成可以与手机App联动的“智能硬件”
- Android自动化预备(下)
- MVC3/4 自定义HtmlHelper截断文本内容(截取)
- 当 IDENTITY_INSERT 设置为 OFF 时,不能为表中的标识列插入显式值。
- CSS3滤镜filter浅析
- Python基础数据类型之int、bool、str
- 测者的测试技术手册:Junit执行单元测试用例成功,mvn test却失败的问题和解决方法
- python视频地址和链接
- ip 命令
- 6C - 开门人和关门人
- Android性能优化-App后台优化
- BZOJ4766: 文艺计算姬(Prufer序列)
- (一)自定义ViewGroup绘制出菜单
- AHM ---301重定向
- cpp面向对象编程
- Apache优化提高并发数量
- mysql 权限的相应修改
- oracle、MySQL、SQL Server的比较