fscan内网资产扫描并输出报告
  

Hacking 14649

{{ttag.title}}

fscan介绍
一款内网综合扫描工具,方便一键自动化、全方位漏扫扫描。
支持主机存活探测、端口扫描、常见服务的爆破、ms17010redis批量写公钥、计划任务反弹shell、读取win网卡信息、web指纹识别、web漏洞扫描、netbios探测、域控识别等功能。
fscan开源,github上游详细的说明,详见:https://github.com/shadow1ng/fscan
使用说明(Linux)
· 指定单个IP
./fscan -h 192.168.160.1
· 指定网段
./fscan -h 192.168.75.0/24
· 将扫描结果保存到指定文件(默认保存到:result.txt
./fscan -h 192.168.75.0/24 -o 192-168-75-0-24.txt
· 扫描结果样例
   ___                              _      / _ \     ___  ___ _ __ __ _  ___| | __  / /_\/____/ __|/ __| '__/ _` |/ __| |/ // /_\\_____\__ \ (__| | | (_| | (__|   <    \____/     |___/\___|_|  \__,_|\___|_|\_\                        fscan version: 1.8.4start infoscan192.168.160.1:8089 open192.168.160.1:9000 open192.168.160.1:22 open192.168.160.1:80 open192.168.160.1:8008 open192.168.160.1:3306 open192.168.160.1:9001 open192.168.160.1:8012 open192.168.160.1:8443 open192.168.160.1:8083 open
  • alive ports len is: 10start vulscan
  • WebTitle http://192.168.160.1      code:307 len:61     title:None 跳转url: http://192.168.22.68:9001
  • WebTitle http://192.168.160.1:9000 code:307 len:61     title:None 跳转url: http://192.168.160.1:9001
  • WebTitle http://192.168.22.68:9001 code:200 len:1310   title:MinIO Console
  • WebTitle http://192.168.160.1:9001 code:200 len:1310   title:MinIO Console
  • WebTitle http://192.168.160.1:8089 code:403 len:555    title:403 Forbidden
  • WebTitle http://192.168.160.1:8012 code:302 len:0      title:None 跳转url: http://192.168.160.1:8012/index
  • WebTitle http://192.168.160.1:8012/index code:200 len:12409  title:kkFileView演示首页
  • WebTitle http://192.168.160.1:9001 code:200 len:1310   title:MinIO Console
  • WebTitle https://192.168.160.1:8083 code:502 len:559    title:502 Bad Gateway
  • WebTitle https://192.168.160.1:8443 code:404 len:232    title:404 Not Found
  • WebTitle http://192.168.160.1:8008 code:404 len:232    title:404 Not Found[+] SSH 192.168.12.20:22:root root[+] SSH 192.168.12.19:22:root root[+] SSH 192.168.12.18:22:root root[+] PocScan https://192.168.69.58:8443 poc-yaml-springboot-cve-2021-21234 spring3[+] PocScan https://192.168.69.61:8443 poc-yaml-springboot-cve-2021-21234 spring3[+] PocScan http://192.168.69.58:18000 poc-yaml-springboot-cve-2021-21234 spring3
  • 输出报告
    可以看出来,fscan扫出来的内容包含很多描述性的INFO级别日志,如何提取出主要信息并输出报告。
    可以结合Python + Pandas的形式利用正则表达式提取出主要信息再通过Pandas导出Excel
    · 首先要有Python3.5+Python环境
    · 安装pandas
    pip install pandas
    · 代码部分
    #!/usr/bin/env python# -*- coding:utf-8 -*-# @Time2024/6/27 14:35# @SoftwarePyCharm__author__ = "JentZhang"
    import re
    import pandas
    def extract_info(text):
        # 匹配SSH类型的文本    pattern = re.compile(r'\[\+\] (.+) (http://|https://)?([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(\d+))?.*')
        match = pattern.search(text)
        if match:        return {            '类型': match.group(1),            'IP': match.group(3),            '端口': match.group(5)        }
        return None
    def extract_lines(filepath, start_msg='[+]'):    """    抽取扫描结果中的指定行    :param filepath:    :param start_msg:    :return:    """    matching_lines = []    with open(filepath, 'r', encoding='utf-8') as file:        for line in file:            if line.startswith(start_msg):                matching_lines.append(line.strip())    return matching_lines
    def export_to_excel(data, filename):    """    导出数据到excel    :param data:    :param filename:    :return:    """    df = pandas.DataFrame(data)    df.to_excel(f"{filename}资产测绘.xlsx", index=False)
    def analysis_data(file_data):    """    分析扫描的文件数据    :param file_data:    :return:    """    res = []    for i in file_data:        # print(f"before: {i}")        info = extract_info(i)        if info:            info["扫描结果"] = i            res.append(info)            # print(f"after: {info}")    return res
    if __name__ == '__main__':    # files = ["10_139_0_0_23.txt", "10_139_162_0_23.txt", "10_139_176_0_21.txt"]    files = ["172_16_0_0_16.txt"]    for file in files:  # 循环便利扫描的结果文件,分析出结果并导出Excel        d = extract_lines(file)        export_to_excel(analysis_data(d), file.split(".")[0])
    · 报告样式
    file:///C:\Users\Administrator\AppData\Local\Temp\ksohtml9540\wps1.png

    打赏鼓励作者,期待更多好文!

    打赏
    暂无人打赏

    发表新帖
    热门标签
    全部标签>
    有一说一
    新版本体验
    设备维护
    安装部署配置
    山东区技术晨报
    每日一问
    虚拟机
    功能体验
    解决方案
    排障笔记本
    纪元平台
    测试报告
    授权
    技术盲盒
    2024年技术争霸赛
    问题分析处理
    标准化排查
    GIF动图学习
    原创分享
    资源访问
    齐鲁TV
    云化安全能力
    信服课堂视频
    日志审计
    每日一记
    sangfor周刊
    地址转换
    玩转零信任
    「智能机器人」
    场景专题
    2025年技术争霸赛
    专家问答
    技术圆桌
    升级
    升级&主动服务
    VMware替换
    产品连连看
    畅聊IT
    上网策略
    运维工具
    用户认证
    信服故事
    平台使用
    每周精选
    排障那些事
    西北区每日一问
    高手请过招
    高频问题集锦
    全能先锋系列
    安全攻防
    华北区交付直播
    专家说
    产品知识周周练
    技术笔记
    SDP百科
    北京区每日一练
    故障笔记
    社区新周刊
    行业实践
    流量管理
    安全效果
    产品动态
    技术顾问
    答题自测
    在线直播
    MVP
    VPN 对接
    项目案例
    存储
    产品预警公告
    技术争霸赛
    追光者计划
    2023技术争霸赛专题
    技术晨报
    关键解决方案
    声音值千金
    网络基础知识
    功能咨询
    卧龙计划
    华北区拉练
    【 社区to talk】
    工具体验官
    终端接入
    迁移
    秒懂零信任
    POC测试案例
    专家分享
    S豆商城资讯
    天逸直播
    SANGFOR资讯
    以战代练
    文档捉虫
    产品解析
    产品体验官
    热门活动

    本版达人