95个可见字符生成的6位密码词典有多大?

2022-02-12 23:33:44 浏览数 (1)

95个可见字符生成的6位密码有多少个?

95^6=735091890625

这将近7351亿个6位密码放在一个TXT文件里有多大?

#ls -lh /data3/ccc.txt

-rw-r--r-- 1 root root 4.7T Apr 14 07:41 /data3/ccc.txt

#ls -lk /data3/ccc.txt

-rw-r--r-- 1 root root 5145643234565 Apr 14 07:41 /data3/ccc.txt

5145643234565/(1024^3)=4792.2537GB

压缩这个4.7T的TXT密码词典用了将近2000分钟,压缩后的RAR文件不到14GB 压缩率挺高的,1-14486568771/5145643234565=99.718469235%

如果是8位的密码,那就有95^8=6634204312890625个 如果是12位的密码,那就有95^12=540360087662636962890625个 如果是16位的密码,那就有95^16=44012666865176569775543212890625个

就服务器入侵来说,无非5个途径: ①操作系统密码弱:设置大写、小写、数字、特殊字符组成的没有明显规律或词法特点的16位复杂密码可以切断这一途径 ②操作系统有漏洞:及时打补丁,禁用共享服务、禁用高危端口比如135-139和445等端口 ③业务系统密码弱:业务系统的密码复杂度要求跟操作系统的是一样的,不要出现123qwe、1qaz2wsx、admin、admin123、passw@rd、oracle、scott、system、root、mysql、ilove***、123456、123321、666666、88888888、12345677890等这样形同虚设的密码 ④业务系统有漏洞:关注业务软件官网动态及时升级业务系统,服务器安全组或防火墙只放行业务端口,非业务端口一律禁止 ⑤上传或下载文件到服务器时引入了病毒木马导致被入侵:尽量先下载到本地电脑,对下载下来的文件扫描杀毒,没有发现异常再上传到服务器 做到以上几点,基本可以告别被入侵的惨痛经历

95个可见字符生成的6位密码原创C语言代码如下: #include  <stdio.h> #include  <string.h> int main(int argc,char argv[]) { char str[6]={''}; int i,i0,i1,i2,i3,i4,i5; char c[95]={"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","`","-","=","[","]","",";","'",",",".","/","!","@","#","$","%","^","&","*","(",")","~","_"," ","{","|","}",":","""," <",">","?"," "}; for(i=0;i <95;i ) printf("%sn",c[i]); for(i0=0;i0 <95;i0 ) for(i1=0;i1 <95;i1 ) for(i2=0;i2 <95;i2 ) for(i3=0;i3 <95;i3 ) for(i4=0;i4 <95;i4 ) for(i5=0;i5 <95;i5 ) {//每拼接一个6位密码打印一次并换行,然后把存放器清零继续下一次拼接 strcat(str,c[i0]); strcat(str,c[i1]); strcat(str,c[i2]); strcat(str,c[i3]); strcat(str,c[i4]); strcat(str,c[i5]); printf("%sn",str); memset(str,'',sizeof(char)*6); } }

0 人点赞