linux系统弱密码检测

您所在的位置:网站首页 弱口令原理 linux系统弱密码检测

linux系统弱密码检测

2023-03-13 20:36| 来源: 网络整理| 查看: 265

需要自备弱密码明文字典

from _utils.patrol2 import data_format,report_format,run_cmd import platform import crypt with open(passwd[0],'r') as f: cOntent=f.readlines() def use_md5(password,salt): global content for i in content: cmd="openssl passwd -1 -salt '{}' '{}'".format(salt,i) code,res=run_cmd(cmd) if res.split('$')[-1].strip()==password: return True return False def use_SHA512(id,password,salt): global content for i in content: cry_password=crypt.crypt(i,'${}${}'.format(id,salt)) if cry_password==password: return True return False cOntent=[i.strip('\r\n').strip('\n') for i in content] weak_passwd=[] remove_users =remove_users.split(',') low_length_users=[] cmd="awk -F: 'length($2)

  



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3