乌云漏洞库/知识库离线维护

爬取乌云的最后日期大概是16年2月,十个压缩包,图文并茂,唯一的缺点就是少个目录,于是写了个按照漏洞标题生成目录的脚本

 

import os
f0= open('index.html', 'w')
cnt=1
list=os.listdir('bugs');
for i in range(0,len(list)):
    path=os.path.join('bugs',list[i])
    if os.path.isfile(path):
        f=open(path,'r');
        t=0;
        for li in f.readlines():
            t=t+1;
            if t==6:
                f0.write('<li><a href="'+path+'">'+'\t'+li[7:-22]+'</a></li>'+'\n')
                break
        cnt=cnt+1
        f.close()
f0.close()
print cnt
#40294 means success
#this script cost about 1min or so

 

posted @ 2020-05-15 10:56  小强找BUG  阅读(648)  评论(1编辑  收藏  举报