#幻境拨号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)

最新文章

  1. 修改MS SQL忽略大小写 分类: SQL Server 数据库 2015-06-19 09:18 34人阅读 评论(0) 收藏
  2. ES6学习--搭建环境
  3. [自己动手玩黑科技] 1、小黑科技——如何将普通的家电改造成可以与手机App联动的“智能硬件”
  4. Android自动化预备(下)
  5. MVC3/4 自定义HtmlHelper截断文本内容(截取)
  6. 当 IDENTITY_INSERT 设置为 OFF 时,不能为表中的标识列插入显式值。
  7. CSS3滤镜filter浅析
  8. Python基础数据类型之int、bool、str
  9. 测者的测试技术手册:Junit执行单元测试用例成功,mvn test却失败的问题和解决方法
  10. python视频地址和链接
  11. ip 命令
  12. 6C - 开门人和关门人
  13. Android性能优化-App后台优化
  14. BZOJ4766: 文艺计算姬(Prufer序列)
  15. (一)自定义ViewGroup绘制出菜单
  16. AHM ---301重定向
  17. cpp面向对象编程
  18. Apache优化提高并发数量
  19. mysql 权限的相应修改
  20. oracle、MySQL、SQL Server的比较

热门文章

  1. Oracle 11g R2 for Win7旗舰版(64位)的安装步骤
  2. jQuery中json对象的复制(数组及对象) .
  3. Linux后台运行
  4. 分享一个关于jackson的Json工具类
  5. C++之vector用法
  6. 表数据转换为insert语句
  7. JQuery Mobile + Cordova 实战一
  8. 十个顶级的C语言资源助你成为优秀的程序员
  9. HDU4268 Alice and Bob(贪心+multiset)
  10. C#中调用API