├── FscanOutput_v2.2.py ├── FscanOutput_v2.3.1_Pro.py ├── FscanOutput_v3.0_Pro.py ├── README.md └── requirements.txt /FscanOutput_v2.2.py: -------------------------------------------------------------------------------- 1 | # -*- coding : utf-8 -*- 2 | # -*- author : zoro123 -*- 3 | # -*- version : v2.2 -*- 4 | # -*- date : 2023.11 -*- 5 | 6 | import re 7 | import time 8 | import openpyxl 9 | import sys 10 | import os 11 | import chardet 12 | import openpyxl as p 13 | 14 | from openpyxl.cell.cell import ILLEGAL_CHARACTERS_RE 15 | from openpyxl.styles import Font 16 | from chardet.universaldetector import UniversalDetector 17 | 18 | 19 | 20 | def get_encoding(file): 21 | # 二进制方式读取,获取字节数据,检测类型 22 | with open(file, 'rb') as f: 23 | data = f.read() 24 | return chardet.detect(data)['encoding'] 25 | 26 | def get_encode_info(file): 27 | with open(file, 'rb') as f: 28 | data = f.read() 29 | result = chardet.detect(data) 30 | return result['encoding'] 31 | 32 | def read_file(file): 33 | with open(file, 'rb') as f: 34 | return f.read() 35 | 36 | def write_file(content, file): 37 | with open(file, 'wb') as f: 38 | f.write(content) 39 | 40 | 41 | def convert_encode2utf8(file, original_encode, des_encode): 42 | file_content = read_file(file) 43 | file_decode = file_content.decode(original_encode, 'ignore') 44 | file_encode = file_decode.encode(des_encode) 45 | write_file(file_encode, file) 46 | 47 | 48 | def OpenFile(): 49 | 50 | file_name = getInput() 51 | datalist = [] 52 | datastr = '' 53 | 54 | encode_info = get_encode_info(file_name) 55 | 56 | if encode_info == 'utf-8': 57 | 58 | with open(file_name, encoding='utf-8') as f: 59 | for i in f.readlines(): 60 | datalist.append(i.strip()) 61 | with open(file_name, encoding='utf-8') as f: 62 | datastr = f.read() 63 | 64 | elif encode_info != 'utf-8': 65 | 66 | convert_encode2utf8(file_name, encode_info, 'utf-8') 67 | 68 | with open(file_name, encoding='utf-8') as f: 69 | for i in f.readlines(): 70 | datalist.append(i.strip()) 71 | with open(file_name, encoding='utf-8') as f: 72 | datastr = f.read() 73 | 74 | return datalist, datastr 75 | 76 | #输出存活端口 77 | def OpenPort(datalist): 78 | 79 | sheetList = [['ip', 'port']] 80 | 81 | for i in datalist: 82 | p = re.findall(r'^\d[^\s]+', i) 83 | 84 | if len(p) != 0: 85 | p1 = list(p) 86 | 87 | for u in p1: 88 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 89 | # exit() 90 | # port = u.replace(ip[0], '').strip(':') 91 | port = re.findall("(?<=:)\d+" , u) 92 | # exit() 93 | try: 94 | # exit() 95 | ip.append(port[0]) 96 | sheetList.append(ip) 97 | except IndexError: 98 | pass 99 | 100 | OutPut('OpenPort', sheetList) 101 | 102 | #输出IP段内存货数量 103 | def AliveIp(datalist): 104 | 105 | sheetList = [['IP段', '段存活数量']] 106 | 107 | for t in datalist: 108 | Ip_d = re.findall(r"\[\*]\sLiveTop\s\d+\.\d+\.\d+\.\d+/\d+.*", t) 109 | 110 | if len(Ip_d) != 0: 111 | p1 = list(Ip_d) 112 | 113 | for u in p1: 114 | ip_duan = re.findall(r"\d+\.\d+\.\d+\.\d+/\d+", u) 115 | No = re.findall(r"\d+$", u) 116 | ip_duan.append(No[0]) 117 | sheetList.append(ip_duan) 118 | 119 | OutPut('AliveIp', sheetList) 120 | 121 | 122 | #输出识别到的系统 123 | def Oslist(datalist): 124 | 125 | replaceList = ["[*]", '\t', "\x01", '\x02'] 126 | 127 | sheetList = [['ip', 'os']] 128 | 129 | for t in datalist: 130 | p = re.findall(r"\[\*]\s\d+\.\d+\.\d+\.\d+.*", t) 131 | 132 | if len(p) != 0: 133 | p1 = list(p) 134 | 135 | for u in p1: 136 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 137 | #删除无用字符 138 | for q in replaceList: 139 | u = u.replace(q, "") 140 | 141 | ip.append(u.replace(ip[0], '').strip()) 142 | sheetList.append(ip) 143 | 144 | OutPut('OsList', sheetList) 145 | 146 | #输出exp漏洞列表 147 | def Bug_ExpList(datalist): 148 | 149 | sheetList = [['ip', 'bug_exp']] 150 | 151 | for i in datalist: 152 | p = re.findall(r"\[\+]\s\d+\.\d+\.\d+\.\d+.*", i) 153 | 154 | # print(p) 155 | 156 | if len(p) != 0: 157 | p1 = list(p) 158 | for u in p1: 159 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 160 | bug = u.replace(ip[0], '').replace("[+]", "").replace('\t', '').strip() 161 | ip.append(bug) 162 | sheetList.append(ip) 163 | 164 | OutPut('Bug_ExpList', sheetList) 165 | 166 | #输出poc漏洞列表 167 | def Bug_PocList(datalist): 168 | 169 | sheetList = [['url', 'bug_poc']] 170 | 171 | for i in datalist: 172 | p = re.findall(r"\[\+]\shttp[^\s].*", i) 173 | # print(p) 174 | 175 | if len(p) != 0: 176 | p1 = list(p) 177 | for u in p1: 178 | # url = re.findall(r"http[^\s].*\s", u) 179 | url = re.findall(r"(?Phttps?://\S+)", u) 180 | bug = u.replace(url[0], '').replace("[+]", "").replace('\t', '').strip() 181 | url.append(bug) 182 | sheetList.append(url) 183 | 184 | OutPut('Bug_PocList', sheetList) 185 | 186 | #输出title 187 | def GetTitle(datalist): 188 | 189 | sheetList = [['url', 'code', 'len', 'title']] 190 | 191 | for i in datalist: 192 | p = re.findall(r'\[\*]\sWebTitle.*', i) 193 | 194 | if len(p) != 0: 195 | p1 = list(p) 196 | for u in p1: 197 | all_url = re.findall(r"http[^\s]+", u) 198 | url = [all_url[0]] 199 | code = re.findall(r'(?<=code:)[^\s]+', u) 200 | len1 = re.findall(r'(?<=len:)[^\s]+', u) 201 | title = re.findall(r'(?<=title:).*', u) 202 | 203 | # url.append(str(code).strip("['").strip("']'")) 204 | url.append(code[0]) 205 | url.append(str(len1).strip("['").strip("']'")) 206 | url.append(str(title).strip("['").strip("']'")) 207 | # print(url) 208 | # exit() 209 | sheetList.append(url) 210 | 211 | OutPut('Title', sheetList) 212 | 213 | #输出弱口令 214 | def GetPassword(datalist): 215 | 216 | sheetList = [['ip', 'port', 'server', 'user&passwd']] 217 | 218 | for i in datalist: 219 | p = re.findall(r'((ftp|mysql|mssql|SMB|RDP|Postgres|SSH|oracle|SMB2-shares)(:|\s).*)', i, re.I) 220 | rd = re.findall(r'((redis|Mongodb)(:|\s).*)', i, re.I) 221 | mc = re.findall(r"((Memcached)(:|\s).*)", i, re.I) 222 | 223 | if len(p) != 0 and p[0][-1] == ":": 224 | p1 = list(p) 225 | 226 | all = p1[0][0].split(":") 227 | try: 228 | passwd = all[3] 229 | except: 230 | passwd = [] 231 | pass 232 | server = all[0] 233 | port = all[2] 234 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", str(all)) 235 | ip.append(port) 236 | ip.append(server) 237 | ip.append(passwd) 238 | sheetList.append(ip) 239 | 240 | 241 | if len(rd) != 0 and len(rd[0][0].split(" ")) == 2: 242 | rd1 = list(rd) 243 | 244 | rd_all = rd1[0][0].split(" ") 245 | passwd = rd_all[-1] 246 | server = rd1[0][1] 247 | port = (rd_all[0].split(":"))[2] 248 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", rd1[0][0]) 249 | ip.append(port) 250 | ip.append(server) 251 | ip.append(passwd) 252 | sheetList.append(ip) 253 | 254 | if len(mc) != 0: 255 | mc1 = list(mc) 256 | 257 | mc_all = mc1[0][0].split(" ") 258 | passwd = mc_all[2] 259 | server = mc_all[0] 260 | port = (mc_all[1].split(":"))[-1] 261 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", mc1[0][0]) 262 | ip.append(port) 263 | ip.append(server) 264 | ip.append(passwd) 265 | sheetList.append(ip) 266 | 267 | OutPut('WeakPasswd', sheetList) 268 | 269 | 270 | #输出指纹信息 271 | def FingerOut(datalist): 272 | 273 | # w1 = wb.create_sheet('') 274 | sheetList = [['url', 'finger']] 275 | 276 | for i in datalist: 277 | p = re.findall(r'.*InfoScan.*', i) 278 | # print(p) 279 | 280 | if len(p) != 0: 281 | p1 = list(p) 282 | for u in p1: 283 | url = re.findall(r'http[^\s]+', u) 284 | finger = u.split(url[0])[-1].strip() 285 | url.append(finger) 286 | # ws4.append(url) 287 | sheetList.append(url) 288 | 289 | OutPut('Finger', sheetList) 290 | 291 | #表格输出整理 292 | def OutPut(sheetname,sheetList): 293 | 294 | sheetName = wb.create_sheet(sheetname) 295 | 296 | #将列表写入sheet 297 | for i in sheetList: 298 | # 解决\x03此类特殊字符报错 299 | try: 300 | sheetName.append(i) 301 | except openpyxl.utils.exceptions.IllegalCharacterError: 302 | i[-1] = ILLEGAL_CHARACTERS_RE.sub(r'', i[-1]) 303 | sheetName.append(i) 304 | except Exception as e: 305 | print(f"err: {e}") 306 | 307 | 308 | #首行格式 309 | for row in sheetName[f"A1:{chr(65 + len(list1[0]) - 1)}1"]: 310 | for cell in row: 311 | cell.font = Font(size=12, bold=True) 312 | 313 | 314 | def getInput(): 315 | 316 | if len(sys.argv) != 2: 317 | print("\n[*] fscan结果整理脚本,输出为.xlsx文件\n\nUsage: \n\n python3 FscanOutput_v1.02.py result.txt\n") 318 | exit() 319 | 320 | if not os.path.exists(sys.argv[1]): 321 | print(f"[{sys.argv[1]}] 文件不存在") 322 | exit() 323 | 324 | return sys.argv[1] 325 | 326 | if __name__ == "__main__": 327 | 328 | print(r''' 329 | 330 | ============================================================ 331 | ______ ____ _ _ 332 | | ____| / __ \ | | | | 333 | | |__ ___ ___ __ _ _ __ | | | |_ _| |_ _ __ _ _| |_ 334 | | __/ __|/ __/ _` | '_ \| | | | | | | __| '_ \| | | | __| 335 | | | \__ \ (_| (_| | | | | |__| | |_| | |_| |_) | |_| | |_ 336 | |_| |___/\___\__,_|_| |_|\____/ \__,_|\__| .__/ \__,_|\__| 337 | | | 338 | |_| Plus 339 | ============================================================ 340 | ---By zoro123 v2.2 341 | ''') 342 | list1, str1 = OpenFile() 343 | 344 | wb = openpyxl.Workbook() 345 | OpenPort(list1) 346 | AliveIp(list1) 347 | Bug_ExpList(list1) 348 | Bug_PocList(list1) 349 | Oslist(list1) 350 | GetTitle(list1) 351 | GetPassword(list1) 352 | FingerOut(list1) 353 | ws5 = wb["Sheet"] 354 | wb.remove(ws5) 355 | input_filename = sys.argv[1].split(".txt")[0] 356 | Output_xlsx = (f"%s_{time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime())}.xlsx" % input_filename) 357 | # wb.save(f"%s_{time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime())}.xlsx" %input_filename) 358 | wb.save(Output_xlsx) 359 | print("[+]文件读取成功,处理结果如下······\n") 360 | New_fscanxlsx = p.load_workbook(Output_xlsx) 361 | 362 | print("+---------------------------------+\n") 363 | wt = New_fscanxlsx['OpenPort'] 364 | print("[+++]探测存活端口共计:%s 个" % (wt.max_row-1)) 365 | wt = New_fscanxlsx['AliveIp'] 366 | print("[+++]探测存活IP段共计:%s 个" % (wt.max_row - 1)) 367 | wt1 = New_fscanxlsx['Bug_ExpList'] 368 | print("[+++]Exp可利用漏洞共计:%s 个" % (wt1.max_row-1)) 369 | wt2 = New_fscanxlsx['Bug_PocList'] 370 | print("[+++]Poc可利用漏洞共计:%s 个" % (wt2.max_row-1)) 371 | wt3 = New_fscanxlsx['OsList'] 372 | print("[+++]成功识别操作系统共计:%s 个" % (wt3.max_row-1)) 373 | wt4 = New_fscanxlsx['Title'] 374 | print("[+++]成功探测Web服务共计:%s 条" % (wt4.max_row-1)) 375 | wt5 = New_fscanxlsx['WeakPasswd'] 376 | print("[+++]成功破解账号密码共计:%s 个" % (wt5.max_row-1)) 377 | wt6 = New_fscanxlsx['Finger'] 378 | print("[+++]成功识别指纹共计:%s 个" % (wt6.max_row-1)) 379 | print("+---------------------------------+\n") 380 | 381 | print('[+]结果已经整理输出至 -- %s -- 文件所在目录!\n' % sys.argv[1]) 382 | print('--> 文件名为:%s' % Output_xlsx) 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | -------------------------------------------------------------------------------- /FscanOutput_v2.3.1_Pro.py: -------------------------------------------------------------------------------- 1 | # -*- coding : utf-8 -*- 2 | # -*- author : zoro123 -*- 3 | # -*- version : v2.3.1 -*- 4 | # -*- date : 2024.06 -*- 5 | 6 | import re 7 | import time 8 | import openpyxl 9 | import sys 10 | import os 11 | import chardet 12 | import openpyxl as p 13 | 14 | from openpyxl.cell.cell import ILLEGAL_CHARACTERS_RE 15 | from openpyxl.styles import Font 16 | from chardet.universaldetector import UniversalDetector 17 | 18 | 19 | 20 | def get_encoding(file): 21 | # 二进制方式读取,获取字节数据,检测类型 22 | with open(file, 'rb') as f: 23 | data = f.read() 24 | return chardet.detect(data)['encoding'] 25 | 26 | def get_encode_info(file): 27 | with open(file, 'rb') as f: 28 | data = f.read() 29 | result = chardet.detect(data) 30 | return result['encoding'] 31 | 32 | def read_file(file): 33 | with open(file, 'rb') as f: 34 | return f.read() 35 | 36 | def write_file(content, file): 37 | with open(file, 'wb') as f: 38 | f.write(content) 39 | 40 | 41 | def convert_encode2utf8(file, original_encode, des_encode): 42 | file_content = read_file(file) 43 | file_decode = file_content.decode(original_encode, 'ignore') 44 | file_encode = file_decode.encode(des_encode) 45 | write_file(file_encode, file) 46 | 47 | 48 | def OpenFile(): 49 | 50 | file_name = getInput() 51 | datalist = [] 52 | datastr = '' 53 | 54 | encode_info = get_encode_info(file_name) 55 | 56 | if encode_info == 'utf-8': 57 | 58 | with open(file_name, encoding='utf-8') as f: 59 | for i in f.readlines(): 60 | datalist.append(i.strip()) 61 | with open(file_name, encoding='utf-8') as f: 62 | datastr = f.read() 63 | 64 | elif encode_info != 'utf-8': 65 | 66 | convert_encode2utf8(file_name, encode_info, 'utf-8') 67 | 68 | with open(file_name, encoding='utf-8') as f: 69 | for i in f.readlines(): 70 | datalist.append(i.strip()) 71 | with open(file_name, encoding='utf-8') as f: 72 | datastr = f.read() 73 | 74 | return datalist, datastr 75 | 76 | #输出存活端口 77 | def OpenPort(datalist): 78 | 79 | sheetList = [['ip', 'port']] 80 | 81 | for i in datalist: 82 | p = re.findall(r'^\d[^\s]+', i) 83 | 84 | if len(p) != 0: 85 | p1 = list(p) 86 | 87 | for u in p1: 88 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 89 | # exit() 90 | # port = u.replace(ip[0], '').strip(':') 91 | port = re.findall("(?<=:)\d+" , u) 92 | # exit() 93 | try: 94 | # exit() 95 | ip.append(port[0]) 96 | sheetList.append(ip) 97 | except IndexError: 98 | pass 99 | 100 | OutPut('OpenPort', sheetList) 101 | 102 | #输出IP段内存货数量 103 | def AliveIp(datalist): 104 | 105 | sheetList = [['IP range', 'Active IP ranges']] 106 | 107 | 108 | for t in datalist: 109 | Ip_d = re.findall(r"\[\*]\sLiveTop\s\d+\.\d+\.\d+\.\d+/\d+.*", t) 110 | 111 | if len(Ip_d) != 0: 112 | p1 = list(Ip_d) 113 | 114 | for u in p1: 115 | ip_duan = re.findall(r"\d+\.\d+\.\d+\.\d+/\d+", u) 116 | No = re.findall(r"\d+$", u) 117 | ip_duan.append(No[0]) 118 | sheetList.append(ip_duan) 119 | 120 | OutPut('AliveIp', sheetList) 121 | 122 | 123 | #输出识别到的系统 124 | def Oslist(datalist): 125 | 126 | replaceList = ["[*]", '\t', "\x01", '\x02'] 127 | 128 | sheetList = [['ip', 'os']] 129 | 130 | for t in datalist: 131 | p = re.findall(r"\[\*]\s\d+\.\d+\.\d+\.\d+.*", t) 132 | 133 | if len(p) != 0: 134 | p1 = list(p) 135 | 136 | for u in p1: 137 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 138 | #删除无用字符 139 | for q in replaceList: 140 | u = u.replace(q, "") 141 | 142 | ip.append(u.replace(ip[0], '').strip()) 143 | sheetList.append(ip) 144 | 145 | OutPut('OsList', sheetList) 146 | 147 | #输出exp漏洞列表 148 | def Bug_ExpList(datalist): 149 | 150 | sheetList = [['ip', 'bug_exp']] 151 | 152 | for i in datalist: 153 | p = re.findall(r"\[\+]\s\d+\.\d+\.\d+\.\d+.*", i) 154 | new_p = re.findall(r"\[\+]\s\w+-.*", i) 155 | 156 | if len(p) != 0: 157 | p1 = list(p) 158 | for u in p1: 159 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 160 | bug = u.replace(ip[0], '').replace("[+]", "").replace('\t', '').strip() 161 | ip.append(bug) 162 | sheetList.append(ip) 163 | 164 | if len(new_p) != 0: 165 | p2 = list(new_p) 166 | for u1 in p2: 167 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u1) 168 | bug = u1.replace(ip[0], '').replace("[+]", "").strip() 169 | ip.append(bug) 170 | sheetList.append(ip) 171 | 172 | OutPut('Bug_ExpList', sheetList) 173 | 174 | #输出poc漏洞列表 175 | def Bug_PocList(datalist): 176 | 177 | 178 | sheetList = [['url', 'bug_poc']] 179 | 180 | for i in datalist: 181 | p = re.findall(r"\[\+].*poc-yaml[^\s].*", i) 182 | 183 | if len(p) != 0: 184 | p1 = list(p) 185 | for u in p1: 186 | url = re.findall(r"(?Phttps?://\S+)", u) 187 | bug = re.findall(r"poc-yaml.*", u) 188 | url.append(bug[0]) 189 | sheetList.append(url) 190 | 191 | OutPut('Bug_PocList', sheetList) 192 | 193 | #输出title 194 | def GetTitle(datalist): 195 | 196 | sheetList = [['url', 'code', 'len', 'title']] 197 | 198 | for i in datalist: 199 | p = re.findall(r'\[\*]\sWebTitle.*', i) 200 | 201 | if len(p) != 0: 202 | p1 = list(p) 203 | for u in p1: 204 | all_url = re.findall(r"http[^\s]+", u) 205 | url = [all_url[0]] 206 | code = re.findall(r'(?<=code:)[^\s]+', u) 207 | len1 = re.findall(r'(?<=len:)[^\s]+', u) 208 | title = re.findall(r'(?<=title:).*', u) 209 | 210 | # url.append(str(code).strip("['").strip("']'")) 211 | url.append(code[0]) 212 | url.append(str(len1).strip("['").strip("']'")) 213 | url.append(str(title).strip("['").strip("']'")) 214 | # print(url) 215 | # exit() 216 | sheetList.append(url) 217 | 218 | OutPut('Title', sheetList) 219 | 220 | #输出弱口令 221 | def GetPassword(datalist): 222 | 223 | sheetList = [['ip', 'port', 'server', 'user&passwd']] 224 | 225 | for i in datalist: 226 | p = re.findall(r'((ftp|mysql|mssql|SMB|RDP|Postgres|SSH|oracle|SMB2-shares)(:|\s).*)', i, re.I) 227 | n_p = re.findall(r'((ftp|mysql|mssql|SMB|RDP|Postgres|SSH|oracle|SMB2-shares)(:|\s).*)', i, re.I) 228 | rd = re.findall(r'((redis|Mongodb)(:|\s).*)', i, re.I) 229 | n_rd = re.findall(r'((redis|Mongodb)(:|\s).*)', i, re.I) 230 | mc = re.findall(r"((Memcached)(:|\s).*)", i, re.I) 231 | 232 | if len(p) != 0 and p[0][-1] == ":": 233 | p1 = list(p) 234 | 235 | all = p1[0][0].split(":") 236 | try: 237 | passwd = all[3] 238 | except: 239 | passwd = [] 240 | pass 241 | server = all[0] 242 | port = all[2] 243 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", str(all)) 244 | ip.append(port) 245 | ip.append(server) 246 | ip.append(passwd) 247 | sheetList.append(ip) 248 | 249 | if len(n_p) != 0 and ':' in n_p[0][0]: 250 | p2 = list(n_p) 251 | 252 | all2 = p2[0][0].split(":") 253 | try: 254 | passwd = all2[2] 255 | except: 256 | passwd = [] 257 | pass 258 | server = p2[0][1] 259 | port = all2[1] 260 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", str(all2)) 261 | ip.append(port) 262 | ip.append(server) 263 | ip.append(passwd) 264 | sheetList.append(ip) 265 | 266 | 267 | 268 | if len(rd) != 0 and len(rd[0][0].split(" ")) == 2: 269 | rd1 = list(rd) 270 | 271 | rd_all = rd1[0][0].split(" ") 272 | passwd = rd_all[-1] 273 | server = rd1[0][1] 274 | port = (rd_all[0].split(":"))[2] 275 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", rd1[0][0]) 276 | ip.append(port) 277 | ip.append(server) 278 | ip.append(passwd) 279 | sheetList.append(ip) 280 | 281 | if len(n_rd) != 0 and (n_rd[0][0].split(" "))[0].lower() in ["redis", "mongodb"]: 282 | rd2 = list(n_rd) 283 | 284 | rd_all2 = rd2[0][0].split(" ") 285 | passwd = rd_all2[2] 286 | server = rd_all2[0] 287 | port = (rd_all2[1].split(":"))[1] 288 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", rd2[0][0]) 289 | ip.append(port) 290 | ip.append(server) 291 | ip.append(passwd) 292 | sheetList.append(ip) 293 | 294 | 295 | if len(mc) != 0: 296 | mc1 = list(mc) 297 | 298 | mc_all = mc1[0][0].split(" ") 299 | passwd = mc_all[2] 300 | server = mc_all[0] 301 | port = (mc_all[1].split(":"))[-1] 302 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", mc1[0][0]) 303 | ip.append(port) 304 | ip.append(server) 305 | ip.append(passwd) 306 | sheetList.append(ip) 307 | 308 | OutPut('WeakPasswd', sheetList) 309 | 310 | 311 | #输出指纹信息 312 | def FingerOut(datastr): 313 | 314 | sheetList = [['url', 'finger']] 315 | 316 | for i in datastr: 317 | p = re.findall(r'.*InfoScan.*', i) 318 | 319 | 320 | if len(p) != 0: 321 | p1 = list(p) 322 | for u in p1: 323 | url = re.findall(r'http[^\s]+', u) 324 | finger = u.split(url[0])[-1].strip() 325 | url.append(finger) 326 | sheetList.append(url) 327 | 328 | OutPut('Finger', sheetList) 329 | 330 | #输出netinfo信息 331 | def NetInfo(datalist): 332 | 333 | sheetList = [['Ip', 'Netinfo', 'NetBios']] 334 | pattern = r'(.*NetInfo.*\n.*(\n.*\[->].*)+(\n.*NetBios.*)?)' 335 | 336 | info_n = re.findall(pattern, datalist) 337 | 338 | for i in info_n: 339 | ip = re.findall(r'\[\*](\d+\.\d+\.\d+\.\d+)', i[0]) 340 | netinfo_get = re.findall(r'((\n?.*\[->].*)+)', i[0]) 341 | netinfo = netinfo_get[0][0] 342 | if i[-1] == '': 343 | netbios = '' 344 | else: 345 | netbios_get = re.findall(r'.*NetBios.*', i[0]) 346 | netbios = netbios_get[0] 347 | ip.append(netinfo) 348 | ip.append(netbios) 349 | sheetList.append(ip) 350 | 351 | OutPut('NetInfo', sheetList) 352 | 353 | #表格输出整理 354 | def OutPut(sheetname,sheetList): 355 | 356 | sheetName = wb.create_sheet(sheetname) 357 | 358 | 359 | 360 | input_filename = sys.argv[1].split(".txt")[0] 361 | 362 | print(f"[*]{input_filename}.txt读取成功,{input_filename}_{sheetname}.txt文件生成中······\n") 363 | 364 | delimiter = "================{}================\n" 365 | with open(f"{input_filename}_{sheetname}.txt", 'w', encoding='utf-8') as txt_file: 366 | txt_file.write(delimiter.format(sheetname)) 367 | for row in sheetList: 368 | txt_file.write("\t".join(map(str, row)) + "\n") 369 | 370 | #将列表写入sheet 371 | for i in sheetList: 372 | # 解决\x03此类特殊字符报错 373 | try: 374 | sheetName.append(i) 375 | except openpyxl.utils.exceptions.IllegalCharacterError: 376 | i[-1] = ILLEGAL_CHARACTERS_RE.sub(r'', i[-1]) 377 | sheetName.append(i) 378 | except Exception as e: 379 | print(f"err: {e}") 380 | 381 | 382 | #首行格式 383 | for row in sheetName[f"A1:{chr(65 + len(list1[0]) - 1)}1"]: 384 | for cell in row: 385 | cell.font = Font(size=12, bold=True) 386 | 387 | 388 | def getInput(): 389 | 390 | if len(sys.argv) != 2: 391 | print("\n[*] fscan结果整理脚本,输出为.xlsx文件\n\nUsage: \n\n python3 FscanOutput.py result.txt\n") 392 | exit() 393 | 394 | if not os.path.exists(sys.argv[1]): 395 | print(f"[{sys.argv[1]}] 文件不存在") 396 | exit() 397 | 398 | return sys.argv[1] 399 | 400 | if __name__ == "__main__": 401 | 402 | print(r''' 403 | 404 | ============================================================ 405 | ______ ____ _ _ 406 | | ____| / __ \ | | | | 407 | | |__ ___ ___ __ _ _ __ | | | |_ _| |_ _ __ _ _| |_ 408 | | __/ __|/ __/ _` | '_ \| | | | | | | __| '_ \| | | | __| 409 | | | \__ \ (_| (_| | | | | |__| | |_| | |_| |_) | |_| | |_ 410 | |_| |___/\___\__,_|_| |_|\____/ \__,_|\__| .__/ \__,_|\__| 411 | | | 412 | |_| Pro 413 | ============================================================ 414 | ---By zoro123 v2.3.1 415 | ''') 416 | list1, str1 = OpenFile() 417 | 418 | wb = openpyxl.Workbook() 419 | OpenPort(list1) 420 | AliveIp(list1) 421 | Bug_ExpList(list1) 422 | Bug_PocList(list1) 423 | Oslist(list1) 424 | GetTitle(list1) 425 | GetPassword(list1) 426 | FingerOut(list1) 427 | NetInfo(str1) 428 | ws5 = wb["Sheet"] 429 | wb.remove(ws5) 430 | input_filename = sys.argv[1].split(".txt")[0] 431 | Output_xlsx = (f"%s_{time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime())}.xlsx" % input_filename) 432 | wb.save(Output_xlsx) 433 | print("[+]文件处理结果如下······\n") 434 | New_fscanxlsx = p.load_workbook(Output_xlsx) 435 | 436 | print("+---------------------------------+\n") 437 | wt = New_fscanxlsx['OpenPort'] 438 | print("[+++]探测存活端口共计:%s 个" % (wt.max_row-1)) 439 | wt = New_fscanxlsx['AliveIp'] 440 | print("[+++]探测存活IP段共计:%s 个" % (wt.max_row - 1)) 441 | wt1 = New_fscanxlsx['Bug_ExpList'] 442 | print("[+++]Exp可利用漏洞共计:%s 个" % (wt1.max_row-1)) 443 | wt2 = New_fscanxlsx['Bug_PocList'] 444 | print("[+++]Poc可利用漏洞共计:%s 个" % (wt2.max_row-1)) 445 | wt3 = New_fscanxlsx['OsList'] 446 | print("[+++]成功识别操作系统共计:%s 个" % (wt3.max_row-1)) 447 | wt4 = New_fscanxlsx['Title'] 448 | print("[+++]成功探测Web服务共计:%s 条" % (wt4.max_row-1)) 449 | wt5 = New_fscanxlsx['WeakPasswd'] 450 | print("[+++]成功破解账号密码共计:%s 个" % (wt5.max_row-1)) 451 | wt6 = New_fscanxlsx['Finger'] 452 | print("[+++]成功识别指纹共计:%s 个" % (wt6.max_row-1)) 453 | wt7 = New_fscanxlsx['NetInfo'] 454 | print("[+++]成功识别NetInfo共计:%s 个\n" % (wt7.max_row - 1)) 455 | print("+---------------------------------+\n") 456 | 457 | print('[+]结果已经整理输出至 -- %s -- 文件所在目录!\n' % sys.argv[1]) 458 | print('--> 表格文件名为:%s\n' % Output_xlsx) 459 | print(f'--> 各个模块处理文件名为:{input_filename}_sheetName.txt') 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | -------------------------------------------------------------------------------- /FscanOutput_v3.0_Pro.py: -------------------------------------------------------------------------------- 1 | # -*- coding : utf-8 -*- 2 | # -*- author : zoro123 -*- 3 | # -*- version : v3.0 -*- 4 | # -*- date : 2024.07 -*- 5 | 6 | import re 7 | import time 8 | import openpyxl 9 | import sys 10 | import os 11 | import chardet 12 | import openpyxl as p 13 | 14 | 15 | from openpyxl.cell.cell import ILLEGAL_CHARACTERS_RE 16 | from openpyxl.styles import Font 17 | from chardet.universaldetector import UniversalDetector 18 | 19 | 20 | 21 | def get_encoding(file): 22 | # 二进制方式读取,获取字节数据,检测类型 23 | with open(file, 'rb') as f: 24 | data = f.read() 25 | return chardet.detect(data)['encoding'] 26 | 27 | def get_encode_info(file): 28 | with open(file, 'rb') as f: 29 | data = f.read() 30 | result = chardet.detect(data) 31 | return result['encoding'] 32 | 33 | def read_file(file): 34 | with open(file, 'rb') as f: 35 | return f.read() 36 | 37 | def write_file(content, file): 38 | with open(file, 'wb') as f: 39 | f.write(content) 40 | 41 | 42 | def convert_encode2utf8(file, original_encode, des_encode): 43 | file_content = read_file(file) 44 | file_decode = file_content.decode(original_encode, 'ignore') 45 | file_encode = file_decode.encode(des_encode) 46 | write_file(file_encode, file) 47 | 48 | 49 | def OpenFile(): 50 | 51 | file_name = getInput() 52 | datalist = [] 53 | datastr = '' 54 | 55 | encode_info = get_encode_info(file_name) 56 | 57 | if encode_info == 'utf-8': 58 | 59 | with open(file_name, encoding='utf-8') as f: 60 | for i in f.readlines(): 61 | datalist.append(i.strip()) 62 | with open(file_name, encoding='utf-8') as f: 63 | datastr = f.read() 64 | 65 | elif encode_info != 'utf-8': 66 | 67 | convert_encode2utf8(file_name, encode_info, 'utf-8') 68 | 69 | with open(file_name, encoding='utf-8') as f: 70 | for i in f.readlines(): 71 | datalist.append(i.strip()) 72 | with open(file_name, encoding='utf-8') as f: 73 | datastr = f.read() 74 | 75 | return datalist, datastr 76 | 77 | #输出存活端口 78 | def OpenPort(datalist): 79 | 80 | sheetList = [['ip', 'port']] 81 | 82 | for i in datalist: 83 | p = re.findall(r'^\d[^\s]+', i) 84 | 85 | if len(p) != 0: 86 | p1 = list(p) 87 | 88 | for u in p1: 89 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 90 | # exit() 91 | # port = u.replace(ip[0], '').strip(':') 92 | port = re.findall("(?<=:)\d+" , u) 93 | # exit() 94 | try: 95 | # exit() 96 | ip.append(port[0]) 97 | sheetList.append(ip) 98 | except IndexError: 99 | pass 100 | 101 | OutPut('OpenPort', sheetList) 102 | 103 | #输出IP段内存货数量 104 | def AliveIp(datalist): 105 | 106 | sheetList = [['IP range', 'Active IP ranges']] 107 | 108 | 109 | for t in datalist: 110 | Ip_d = re.findall(r"\[\*]\sLiveTop\s\d+\.\d+\.\d+\.\d+/\d+.*", t) 111 | 112 | if len(Ip_d) != 0: 113 | p1 = list(Ip_d) 114 | 115 | for u in p1: 116 | ip_duan = re.findall(r"\d+\.\d+\.\d+\.\d+/\d+", u) 117 | No = re.findall(r"\d+$", u) 118 | ip_duan.append(No[0]) 119 | sheetList.append(ip_duan) 120 | 121 | OutPut('AliveIp', sheetList) 122 | 123 | 124 | #输出识别到的系统 125 | def Oslist(datalist): 126 | 127 | replaceList = ["[*]", '\t', "\x01", '\x02'] 128 | 129 | sheetList = [['ip', 'os']] 130 | 131 | for t in datalist: 132 | p = re.findall(r"\[\*]\s\d+\.\d+\.\d+\.\d+.*", t) 133 | 134 | if len(p) != 0: 135 | p1 = list(p) 136 | 137 | for u in p1: 138 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 139 | #删除无用字符 140 | for q in replaceList: 141 | u = u.replace(q, "") 142 | 143 | ip.append(u.replace(ip[0], '').strip()) 144 | sheetList.append(ip) 145 | 146 | OutPut('OsList', sheetList) 147 | 148 | #输出exp漏洞列表 149 | def Bug_ExpList(datalist): 150 | 151 | sheetList = [['ip', 'bug_exp']] 152 | 153 | for i in datalist: 154 | p = re.findall(r"\[\+]\s\d+\.\d+\.\d+\.\d+.*", i) 155 | new_p = re.findall(r"\[\+]\s\w+-.*", i) 156 | 157 | if len(p) != 0: 158 | p1 = list(p) 159 | for u in p1: 160 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u) 161 | bug = u.replace(ip[0], '').replace("[+]", "").replace('\t', '').strip() 162 | ip.append(bug) 163 | sheetList.append(ip) 164 | 165 | if len(new_p) != 0: 166 | p2 = list(new_p) 167 | for u1 in p2: 168 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", u1) 169 | bug = u1.replace(ip[0], '').replace("[+]", "").strip() 170 | ip.append(bug) 171 | sheetList.append(ip) 172 | 173 | OutPut('Bug_ExpList', sheetList) 174 | 175 | #输出poc漏洞列表 176 | def Bug_PocList(datalist): 177 | 178 | 179 | sheetList = [['url', 'bug_poc']] 180 | 181 | for i in datalist: 182 | p = re.findall(r"\[\+].*poc-yaml[^\s].*", i) 183 | 184 | if len(p) != 0: 185 | p1 = list(p) 186 | for u in p1: 187 | url = re.findall(r"(?Phttps?://\S+)", u) 188 | bug = re.findall(r"poc-yaml.*", u) 189 | url.append(bug[0]) 190 | sheetList.append(url) 191 | 192 | OutPut('Bug_PocList', sheetList) 193 | 194 | #输出title 195 | def GetTitle(datalist): 196 | 197 | sheetList = [['url', 'code', 'len', 'title']] 198 | 199 | for i in datalist: 200 | p = re.findall(r'\[\*]\sWebTitle.*', i) 201 | 202 | if len(p) != 0: 203 | p1 = list(p) 204 | for u in p1: 205 | all_url = re.findall(r"http[^\s]+", u) 206 | url = [all_url[0]] 207 | code = re.findall(r'(?<=code:)[^\s]+', u) 208 | len1 = re.findall(r'(?<=len:)[^\s]+', u) 209 | title = re.findall(r'(?<=title:).*', u) 210 | 211 | # url.append(str(code).strip("['").strip("']'")) 212 | url.append(code[0]) 213 | url.append(str(len1).strip("['").strip("']'")) 214 | url.append(str(title).strip("['").strip("']'")) 215 | # print(url) 216 | # exit() 217 | sheetList.append(url) 218 | 219 | OutPut('Title', sheetList) 220 | 221 | #输出弱口令 222 | def GetPassword(datalist): 223 | 224 | sheetList = [['ip', 'port', 'server', 'user&passwd']] 225 | 226 | for i in datalist: 227 | p = re.findall(r'((ftp|mysql|mssql|SMB|RDP|Postgres|SSH|oracle|SMB2-shares)(:|\s).*)', i, re.I) 228 | n_p = re.findall(r'((ftp|mysql|mssql|SMB|RDP|Postgres|SSH|oracle|SMB2-shares)(:|\s).*)', i, re.I) 229 | rd = re.findall(r'((redis|Mongodb)(:|\s).*)', i, re.I) 230 | n_rd = re.findall(r'((redis|Mongodb)(:|\s).*)', i, re.I) 231 | mc = re.findall(r"((Memcached)(:|\s).*)", i, re.I) 232 | 233 | if len(p) != 0 and p[0][-1] == ":": 234 | p1 = list(p) 235 | 236 | all = p1[0][0].split(":") 237 | try: 238 | passwd = all[3] 239 | except: 240 | passwd = [] 241 | pass 242 | server = all[0] 243 | port = all[2] 244 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", str(all)) 245 | ip.append(port) 246 | ip.append(server) 247 | ip.append(passwd) 248 | sheetList.append(ip) 249 | 250 | if len(n_p) != 0 and ':' in n_p[0][0]: 251 | p2 = list(n_p) 252 | 253 | all2 = p2[0][0].split(":") 254 | try: 255 | passwd = all2[2] 256 | except: 257 | passwd = [] 258 | pass 259 | server = p2[0][1] 260 | port = all2[1] 261 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", str(all2)) 262 | ip.append(port) 263 | ip.append(server) 264 | ip.append(passwd) 265 | sheetList.append(ip) 266 | 267 | 268 | 269 | if len(rd) != 0 and len(rd[0][0].split(" ")) == 2: 270 | rd1 = list(rd) 271 | 272 | rd_all = rd1[0][0].split(" ") 273 | passwd = rd_all[-1] 274 | server = rd1[0][1] 275 | port = (rd_all[0].split(":"))[2] 276 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", rd1[0][0]) 277 | ip.append(port) 278 | ip.append(server) 279 | ip.append(passwd) 280 | sheetList.append(ip) 281 | 282 | if len(n_rd) != 0 and (n_rd[0][0].split(" "))[0].lower() in ["redis", "mongodb"]: 283 | rd2 = list(n_rd) 284 | 285 | rd_all2 = rd2[0][0].split(" ") 286 | passwd = rd_all2[2] 287 | server = rd_all2[0] 288 | port = (rd_all2[1].split(":"))[1] 289 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", rd2[0][0]) 290 | ip.append(port) 291 | ip.append(server) 292 | ip.append(passwd) 293 | sheetList.append(ip) 294 | 295 | 296 | if len(mc) != 0: 297 | mc1 = list(mc) 298 | 299 | mc_all = mc1[0][0].split(" ") 300 | passwd = mc_all[2] 301 | server = mc_all[0] 302 | port = (mc_all[1].split(":"))[-1] 303 | ip = re.findall(r"\d+\.\d+\.\d+\.\d+", mc1[0][0]) 304 | ip.append(port) 305 | ip.append(server) 306 | ip.append(passwd) 307 | sheetList.append(ip) 308 | 309 | OutPut('WeakPasswd', sheetList) 310 | 311 | 312 | #输出指纹信息 313 | def FingerOut(datastr): 314 | 315 | sheetList = [['url', 'finger']] 316 | 317 | for i in datastr: 318 | p = re.findall(r'.*InfoScan.*', i) 319 | 320 | 321 | if len(p) != 0: 322 | p1 = list(p) 323 | for u in p1: 324 | url = re.findall(r'http[^\s]+', u) 325 | finger = u.split(url[0])[-1].strip() 326 | url.append(finger) 327 | sheetList.append(url) 328 | 329 | OutPut('Finger', sheetList) 330 | 331 | #输出netinfo信息 332 | def NetInfo(datalist): 333 | 334 | sheetList = [['Ip', 'Netinfo']] 335 | pattern = r'(.*NetInfo.*\n.*(\n.*\[->].*)+)' 336 | 337 | info_n = re.findall(pattern, datalist) 338 | 339 | for i in info_n: 340 | ip = re.findall(r'\[\*](\d+\.\d+\.\d+\.\d+)', i[0]) 341 | netinfo_get = re.findall(r'((\n?.*\[->].*)+)', i[0]) 342 | netinfo = netinfo_get[0][0] 343 | ip.append(netinfo) 344 | sheetList.append(ip) 345 | 346 | OutPut('NetInfo', sheetList) 347 | 348 | 349 | #输出NetBios信息 350 | def NetBios(datalist): 351 | 352 | sheetList = [['Ip', 'NetBios']] 353 | pattern = r'(.*NetBios.*)' 354 | 355 | info_n = re.findall(pattern, datalist) 356 | 357 | for i in info_n: 358 | ip = re.findall(r'(\d+\.\d+\.\d+\.\d+)', i) 359 | netbios_get = re.findall(r'.*NetBios.*', i) 360 | netbios = netbios_get[0] 361 | ip.append(netbios) 362 | sheetList.append(ip) 363 | 364 | OutPut('NetBios', sheetList) 365 | 366 | #表格输出整理 367 | def OutPut(sheetname,sheetList): 368 | 369 | sheetName = wb.create_sheet(sheetname) 370 | 371 | input_filename = sys.argv[1].split(".txt")[0] 372 | 373 | output_folder = input_filename 374 | if not os.path.exists(output_folder): 375 | os.makedirs(output_folder) 376 | 377 | 378 | print(f"[*]{input_filename}.txt读取成功,{input_filename}_{sheetname}.txt文件生成中······\n") 379 | 380 | delimiter = "================{}================\n" 381 | output_path = os.path.join(output_folder, f"{input_filename}_{sheetname}.txt") 382 | 383 | with open(output_path, 'w', encoding='utf-8') as txt_file: 384 | txt_file.write(delimiter.format(sheetname)) 385 | for row in sheetList: 386 | txt_file.write("\t".join(map(str, row)) + "\n") 387 | 388 | #将列表写入sheet 389 | for i in sheetList: 390 | # 解决\x03此类特殊字符报错 391 | try: 392 | sheetName.append(i) 393 | except openpyxl.utils.exceptions.IllegalCharacterError: 394 | i[-1] = ILLEGAL_CHARACTERS_RE.sub(r'', i[-1]) 395 | sheetName.append(i) 396 | except Exception as e: 397 | print(f"err: {e}") 398 | 399 | 400 | #首行格式 401 | for row in sheetName[f"A1:{chr(65 + len(list1[0]) - 1)}1"]: 402 | for cell in row: 403 | cell.font = Font(size=12, bold=True) 404 | 405 | 406 | def getInput(): 407 | 408 | if len(sys.argv) != 2: 409 | print("\n[*] fscan结果整理脚本,输出为.xlsx文件\n\nUsage: \n\n python3 FscanOutput.py result.txt\n") 410 | exit() 411 | 412 | if not os.path.exists(sys.argv[1]): 413 | print(f"[{sys.argv[1]}] 文件不存在") 414 | exit() 415 | 416 | return sys.argv[1] 417 | 418 | if __name__ == "__main__": 419 | 420 | print(r''' 421 | 422 | ============================================================ 423 | ______ ____ _ _ 424 | | ____| / __ \ | | | | 425 | | |__ ___ ___ __ _ _ __ | | | |_ _| |_ _ __ _ _| |_ 426 | | __/ __|/ __/ _` | '_ \| | | | | | | __| '_ \| | | | __| 427 | | | \__ \ (_| (_| | | | | |__| | |_| | |_| |_) | |_| | |_ 428 | |_| |___/\___\__,_|_| |_|\____/ \__,_|\__| .__/ \__,_|\__| 429 | | | 430 | |_| Pro 431 | ============================================================ 432 | ---By zoro123 v3.0 433 | ''') 434 | list1, str1 = OpenFile() 435 | 436 | wb = openpyxl.Workbook() 437 | OpenPort(list1) 438 | AliveIp(list1) 439 | Bug_ExpList(list1) 440 | Bug_PocList(list1) 441 | Oslist(list1) 442 | GetTitle(list1) 443 | GetPassword(list1) 444 | FingerOut(list1) 445 | NetInfo(str1) 446 | NetBios(str1) 447 | ws5 = wb["Sheet"] 448 | wb.remove(ws5) 449 | input_filename = sys.argv[1].split(".txt")[0] 450 | Output_xlsx = (f"%s_{time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime())}.xlsx" % input_filename) 451 | wb.save(Output_xlsx) 452 | print("[+]文件处理结果如下······\n") 453 | New_fscanxlsx = p.load_workbook(Output_xlsx) 454 | 455 | print("+---------------------------------+\n") 456 | wt = New_fscanxlsx['OpenPort'] 457 | print("[+++]探测存活端口共计:%s 个" % (wt.max_row-1)) 458 | wt = New_fscanxlsx['AliveIp'] 459 | print("[+++]探测存活IP段共计:%s 个" % (wt.max_row - 1)) 460 | wt1 = New_fscanxlsx['Bug_ExpList'] 461 | print("[+++]Exp可利用漏洞共计:%s 个" % (wt1.max_row-1)) 462 | wt2 = New_fscanxlsx['Bug_PocList'] 463 | print("[+++]Poc可利用漏洞共计:%s 个" % (wt2.max_row-1)) 464 | wt3 = New_fscanxlsx['OsList'] 465 | print("[+++]成功识别操作系统共计:%s 个" % (wt3.max_row-1)) 466 | wt4 = New_fscanxlsx['Title'] 467 | print("[+++]成功探测Web服务共计:%s 条" % (wt4.max_row-1)) 468 | wt5 = New_fscanxlsx['WeakPasswd'] 469 | print("[+++]成功破解账号密码共计:%s 个" % (wt5.max_row-1)) 470 | wt6 = New_fscanxlsx['Finger'] 471 | print("[+++]成功识别指纹共计:%s 个" % (wt6.max_row-1)) 472 | wt7 = New_fscanxlsx['NetInfo'] 473 | print("[+++]成功识别NetInfo共计:%s 个" % (wt7.max_row - 1)) 474 | wt7 = New_fscanxlsx['NetBios'] 475 | print("[+++]成功识别NetBios共计:%s 个\n" % (wt7.max_row - 1)) 476 | print("+---------------------------------+\n") 477 | 478 | print(f'[+]结果已经整理输出至 -- {input_filename} -- 文件夹下!\n') 479 | print(f'--> 各个模块处理文件名为:{input_filename}_sheetName.txt') 480 | print('--> 表格文件名为:%s\n' % Output_xlsx) 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fscanOutput 2 | 3 | ### 一个用于处理fsacn输出结果的小脚本(尤其面对大量资产的fscan扫描结果做输出优化,**让你打点快人一步!!!**) 4 | 5 | `python3 fscanOutput.py result.txt` 6 | 7 | ## 关于更新V3.0版本 8 | 9 | 1、优化netbios和netinfo的提取规则,将其分别提取至不同的sheetList中,避免漏匹配的问题。 10 | 11 | 2、将所有的txt结果整理至目标处理文件命名文件下,避免杂乱。 12 | 13 | ![image](https://github.com/user-attachments/assets/70d46a70-f4ec-4276-8abc-41410bd49542) 14 | 15 | 16 | ## 关于更新V2.3.1版本 17 | 18 | 1、优化密码提取规则,兼容新版本fscan!!! 19 | 20 | ## 关于更新V2.3版本 21 | 22 | 1、对各个模块进行优化,兼容了新版本的fscan; 23 | 24 | 2、新增NetInfo信息提取模块,包含NetBIOS信息; 25 | 26 | 3、新增各个模块txt格式输出,方便无Office环境、Linux命令行类型环境查看; 27 | 28 | 4、修复了一些BUG! 29 | 30 | ![image](https://github.com/ZororoZ/fscanOutput/assets/46238787/d5a3b48e-4816-49ef-bc64-1605859c6d34) 31 | 32 | 33 | ## 关于更新V2.2版本 34 | 35 | 1、优化弱口令模块,新增对应开放端口号,剔除多余显示的redis可写目录。 36 | 37 | 2、修复了一些BUG! 38 | 39 | ## 关于更新V2.1版本 40 | 41 | 1、新增txt文件编码修复功能; 42 | 43 | 2、新增存活IP段的功能; 44 | 45 | 3、修复一些已知的bug,优化弱口令的输出; 46 | 47 | 4、优化漏洞模块的输出。 48 | 49 | 50 | ## 关于更新V2.0版本 51 | 52 | 1、对工具进行了一些优化,修复了一些Bug。 53 | 54 | 2、对处理结果做了简单的输出。**更快!更高!更强!!!** 55 | 56 | ![image](https://user-images.githubusercontent.com/46238787/197140508-617a9758-837e-4350-bf99-7027f6e717db.png) 57 | 58 | ## 关于更新V1.03版本 59 | 60 | 1、由于fscan导出的个别结果中存在如下特殊字符,导致运行报错。 61 | ![图片](https://user-images.githubusercontent.com/46238787/181872469-af304c06-321d-4096-b211-0f995d8c0ed4.png) 62 | 63 | 2、整改了输出文件命名方式,与导入文件名称相同,方便查找。 64 | ![图片](https://user-images.githubusercontent.com/46238787/181872698-4d47653d-cd6f-4d52-a615-f9fed4b45987.png) 65 | 66 | 67 | ## 关于更新 V1.02 版本 68 | 69 | 1、将漏洞列表分为exp和poc; 70 | 71 | 2、将之前无法匹配的一些结果优化匹配; 72 | 73 | ![图片](https://user-images.githubusercontent.com/46238787/174651191-2f3d0fbf-2358-40b9-9bbc-047beb27e0a9.png) 74 | 75 | ![图片](https://user-images.githubusercontent.com/46238787/174651252-22edc59f-3b87-48cc-9fde-6dcabf343568.png) 76 | 77 | 78 | ## 使用方法 79 | 80 | 1、python3 fscanOutput.py result.txt 81 | 82 | ![图片](https://user-images.githubusercontent.com/46238787/174651780-484454d7-25e6-4fc2-a3db-ac0fbd07a6af.png) 83 | 84 | 85 | 2、输出结果为xlsx格式的文件,比较清楚的整理了fscan的各类型输出结果: 86 | 87 | ![图片](https://user-images.githubusercontent.com/46238787/160351612-00308a30-2241-4924-988c-8b9f063f9d76.png) 88 | 89 | **注:为了最佳使用效果,请使用新版本fsan工具生成的结果进行处理** 90 | 91 | sma11New师傅 YYDS 92 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | openpyxl==2.4.11 2 | chardet 3 | --------------------------------------------------------------------------------