使用Qpython3制作老版天翼飞TP路由器拨号脚本
#幻境拨号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)
使用Qpython3制作老版天翼飞TP路由器拨号脚本的更多相关文章
- (36)老版和新版API调用
---------更新时间18:06 2016-09-18 星期日------- *前言 我用的是odoo8,但里面有相当多的api是以前版本,这时若我们自己开发的 插件采用新版本api,里面 ...
- 制作便携版 FireFox 火狐浏览器
Firefox是一款可高度自定义的开源浏览器: 你可以访问 火狐DIY 定制自己的Firefox安装包, 此外,你还可以自己动手定制一款可以放在U盘随身携带的便携版Firefox火狐浏览器. 制作便携 ...
- CSS3弹性盒模型新版和老版写法差异
1.在使用弹性盒模型的时候父元素必须要加display:box 或 display:inline-box: 新版弹性盒模型:flex:display : flex 老版弹性盒模型:box : disp ...
- MidoNet 安装(Kilo RDO)(最老版)
一.初始化(Kilo RDO)版(最老版) 环境介绍 系统 CentOS 7.3 主机ip 10.211.55.5 主机名 midonet 1.配置yum源 ###OpenStack源 yum ins ...
- 纯CSS制作加<div>制作动画版哆啦A梦
纯CSS代码加上<div>制作动画版哆啦A梦(机器猫) 哆啦A梦(机器猫)我们大家一定都很熟悉,今天给大家演示怎么用纯CSS代码,来做一个动画版的哆啦A梦. 效果图: ###下面代码同学可 ...
- 老毛桃制作装机版u盘
启动盘准备工作: ① 老毛桃官网首页下载老毛桃v9.3装机版u盘启动盘制作工具安装到电脑上: ② 准备一个容量大在4G以上并能够正常使用的u盘. 第一步 到老毛桃官网中下载老毛桃v9.3安装包到系统桌 ...
- [系统]制作老毛桃U盘WinPE
准备工作,1G以上的U盘一个, Winpe 工具一个,个人推荐老毛桃winpe Ghost镜像文件(这个不用说了吧,能想到U盘装系统肯定都知道的) 可以开始了:插入U盘(最好把U盘里的东西清空,自己保 ...
- 最详细的制作正式版10.11 OS X El Capitan 安装U盘的方法
原帖地址:http://bbs.feng.com/read-htm-tid-10036487.html 一.准备工作: 1.准备一个 8GB 或以上容量的 U 盘,确保里面的数据已经妥善备份好(该过程 ...
- 制作正式版10.11 OS X El Capitan 安装U盘(优盘)
一.准备工作:1.准备一个 8GB 或以上容量的 U 盘,确保里面的数据已经妥善备份好(该过程会抹掉 U 盘全部数据)2.从官网Appstore下载下来的 “安装 OS X El Capitan”,当 ...
随机推荐
- div/span等获取焦点问题(tabindex属性的简单理解)
1.先看问题 当我们要对一个div/span元素获取焦点的时候,直接对$("#div1").focus()是不能实现效果的,比如下图: 当点击输入框进行输入后,在点击区域弹出选择地 ...
- 在ios7系统下,scrollView下移20像素
从设备图库返回到scrollView时,scrollView会下移20像素,解决办法:self.edgesForExtendedLayout = UIRectEdgeNone; 如果加入此代码导致其他 ...
- Google Chrome 55 Released – Install on RHEL/CentOS 7/6 and Fedora 25-20
Google Chrome is a freeware web browser developed by Google Inc. Google Chrome team proudly announce ...
- 【BUG】---ng-show/ng-hide修改成功但没有效果
问题:点击搜索,隐藏tab,出现搜索结果列表,调试也成功修改了分别元素的ng-hide就是没有效果 我的错误: <div ng-hide="{{isShow}}" class ...
- Android高手进阶:Adapter深入理解与优化
一般是针对包含多个元素的View,如ListView,GridView,ExpandableListview,的时候我们是给其设置一个Adapter.Adapter是与View之间提供数据的桥梁,也是 ...
- 配置SQL Server 2008 R2 Reporting Services
记录如何在本地配置SQL Server 2008 R2 Reporting Services,笔者环境为Windows 7 64位 + SQL Server 2008 R2 一.准备工作 其实准备工作 ...
- Javascript之日历
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <ti ...
- asp双表查询
sql="select sum(***) as ** from ** as a,** as b where a.id=b.id" Rs(A.id) Rs(B.id) [提示.双表中 ...
- 导航栏 UITabBarController等颜色的区别
//tint color是设置你选中的那个tabBar的颜色,默认是蓝色,点击是设置的红色 vc.tabBar.tintColor = [UIColor redColor]; // ...
- HDU1042 N! 大数的阶乘
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1042 由于数字特别大, 所以用数组来模拟. 经测试, 数组大小开50000 可过. 附AC代码, 欢迎 ...