python 网站路径分类

import re
import requests
from libs.Conn_scan import Mongo

import re
import requests


f_asp = open('dict/asp_path.txt','a')
f_php = open('dict/php_path.txt','a')
f_jsp = open('dict/jsp_path.txt','a')
f_s2  = open('dict/struts_path.txt','a')
f_aspx = open('dict/aspx_path.txt','a')
f_html  = open('dict/html_path.txt','a')
f_other = open('dict/other_path.txt','a')
f_xhtml = open('dict/xhtml_path.txt','a')


with open('dict/path_dict.txt') as f:
    path_list = f.readlines()
    for i in path_list:
        print i
        if not i.startswith('#'):
            if re.search('.asp', i, re.IGNORECASE):
                f_asp.write(i + '\r')
            elif re.search('.jsp', i, re.IGNORECASE):
                f_jsp.write(i + '\r')
            elif re.search('.html', i, re.IGNORECASE):
                f_html.write(i + '\r') 
            elif re.search('.php', i, re.IGNORECASE):
                f_php.write(i + '\r')  
            elif re.search('.do', i, re.IGNORECASE) or re.search('.action', i, re.IGNORECASE):
                f_s2.write(i + '\r')             
            elif re.search('.aspx', i, re.IGNORECASE):
                f_aspx.write(i + '\r')  
            elif re.search('.xhtml', i, re.IGNORECASE):
                f_xhtml.write(i + '\r')   
            else:
                f_other.write(i + '\r')
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容