Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
MSFinger — 微软网络服务指纹识别工具 | Kitploit
工具/GitHubGitHub/secorizon/msfinger
侦察网络映射漏洞分析信息收集渗透测试DNS 分析
GitHubsecorizon/msfinger

MSFinger

微软网络服务指纹识别工具

查看仓库
7577个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
网站

MSFinger - Microsoft 网络服务指纹识别工具

版本: 1.0
作者: Laurent Gaffie
公司: Secorizon

概述

MSFinger 是一款面向内网侦察的高性能网络指纹识别工具。它能够快速识别 Microsoft 服务、检测安全配置,并突出显示 SMB、LDAP 和 LDAPS 协议中的潜在漏洞。

主要功能:

  • 针对内网优化的快速并发扫描(默认超时 1 秒)
  • SMB/SMB2/SMB3 版本与签名检测
  • LDAP/LDAPS 签名与通道绑定检测
  • 操作系统版本识别及内部版本号映射
  • 使用 SQLite 数据库持久化保存扫描结果
  • 彩色输出,突出显示安全风险
  • 支持单个 IP、CIDR 范围、IP 范围及文件输入

安装

MSFinger 使用纯 Python 编写。除 Python 3.6+ 外,无需其他依赖。

root@kitploit:~
cd /path/to/MSFinger
chmod +x MSFinger.py

使用方法

基本语法

root@kitploit:~
python3 MSFinger.py -i <target> [options]

命令行选项

选项说明默认值
-i, --ip目标 IP、CIDR 范围或 IP 范围必需*
-f, --file包含目标的文件(每行一个)必需*
-t, --timeout连接超时(秒)1.0
-w, --workers并发工作进程数100
-d, --database用于保存结果的 SQLite 数据库文件MSFinger.db
--no-color禁用彩色输出禁用

* 必须指定 -i 或 -f 其中之一


示例

单主机扫描

root@kitploit:~
python3 MSFinger.py -i 192.168.1.10

子网扫描(CIDR)

root@kitploit:~
python3 MSFinger.py -i 192.168.1.0/24

IP 范围扫描

root@kitploit:~
python3 MSFinger.py -i 192.168.1.1-50

从文件读取多个范围

root@kitploit:~
python3 MSFinger.py -f targets.txt

示例 targets.txt:

root@kitploit:~
192.168.1.0/24
10.0.0.1-100
172.16.5.50
# Comments are supported
192.168.2.0/25

自定义超时与并发数

root@kitploit:~
# Faster scan with shorter timeout and more workers
python3 MSFinger.py -i 10.0.0.0/16 -t 0.3 -w 200

# More reliable scan with longer timeout
python3 MSFinger.py -i 192.168.1.0/24 -t 1.0 -w 50

自定义数据库

root@kitploit:~
python3 MSFinger.py -i 192.168.1.0/24 -d pentest_2026.db

禁用颜色(用于日志记录)

root@kitploit:~
python3 MSFinger.py -i 192.168.1.0/24 --no-color > scan_results.txt

输出格式

控制台输出

结果以实时方式显示,并使用彩色安全指示标记:

root@kitploit:~
[192.168.1.10] SMB: 3.1.1, Signing: required, OS: Windows Server 2022 21H2, Domain: CORP.LOCAL, Boot: 2026-01-01 10:30:15 | SMB1: disabled | Services: RDP, LDAP (signing: required), LDAPS (signing: required, channel binding: required)

颜色编码

  • 🟢 绿色:安全配置(要求签名)
  • 🟡 黄色:警告(已启用但非必需,或端口开放但存在错误)
  • 🔴 红色:易受攻击(签名已禁用或非必需)
  • 🔵 蓝色:信息提示(SMB1 已禁用、服务状态)

输出字段

SMB 信息:

  • SMB: X.X.X - SMB 方言版本(2.0.2、2.1、3.0、3.0.2、3.1.1)
  • Signing: <status> - required/enabled/disabled
  • OS: <version> - 包含内部版本号的 Windows 版本
  • Domain: <name> - NetBIOS 域/工作组名称
  • Boot: <time> - 系统启动时间(或 Disabled/Unknown)

SMB1 状态:

  • SMB1: disabled - SMB1 不受支持(安全)
  • SMB1: supported, Signing: <status> - SMB1 已启用(潜在风险)

服务:

  • RDP - 远程桌面协议(端口 3389)开放
  • MSSQL - Microsoft SQL Server(端口 1433)开放
  • LDAP (signing: <status>) - 端口 389 上的 LDAP
  • LDAPS (signing: <status>, channel binding: <status>) - 端口 636 上的 LDAPS
  • LDAPS (port open, <error>) - LDAPS 端口响应但 SSL 握手失败

数据库结构

MSFinger 将所有扫描结果存储在 SQLite 数据库中,以便持久化保存和分析。

表:hosts

数据库行为

  • 现有数据库: 使用最新扫描数据更新记录(upsert 操作)
  • 新数据库: 自动创建,包含正确的表结构
  • 重复 IP: 同一 IP 的旧数据将被上次扫描结果覆盖

查询数据库

root@kitploit:~
# View all vulnerable hosts (no SMB signing)
sqlite3 MSFinger.db "SELECT ip, os_version, smb_signing FROM hosts WHERE smb_signing != 'required'"

# Find hosts with LDAP signing disabled
sqlite3 MSFinger.db "SELECT ip, domain, ldap_signing FROM hosts WHERE ldap_signing = 'not_required'"

# List all Windows Server 2022 hosts
sqlite3 MSFinger.db "SELECT ip, os_version, domain FROM hosts WHERE os_version LIKE '%Server 2022%'"

# Export to CSV
sqlite3 -header -csv MSFinger.db "SELECT * FROM hosts" > results.csv

# Count hosts by OS
sqlite3 MSFinger.db "SELECT os_version, COUNT(*) FROM hosts GROUP BY os_version"

检测详情

SMB/SMB2/SMB3 检测

已测试的协议:

  • SMB1(旧版协议,若启用则存在安全风险)
  • SMB2/3(包含多种方言的现代协议)

收集的信息:

  1. 方言版本: 2.0.2、2.1、3.0、3.0.2、3.1.1
  2. 签名状态:
    • required - 服务器要求消息签名(安全)
    • enabled - 服务器支持但不要求签名
    • disabled - 不支持签名(易受攻击)
  3. 操作系统版本: 从 NTLMSSP 质询中提取
  4. 内部版本号: 用于精确识别版本的 Windows 内部版本号
  5. 域: NetBIOS 域或工作组名称
  6. 启动时间: 系统启动时间戳(如果可用)

操作系统版本映射:

LDAP 检测(端口 389)

测试匿名绑定以确定签名要求:

  • 结果代码 0: 成功 - 不要求签名(易受中继攻击)
  • 结果代码 8: 需要强身份验证 - 要求签名(安全)
  • 其他代码: 各种身份验证错误

LDAPS 检测(端口 636)

测试带 LDAP 绑定的 SSL/TLS 连接:

  1. SSL 握手: 尝试使用宽松的密码套件支持建立 TLS 连接
  2. 签名检测: 测试通过 SSL 进行的 LDAP 消息签名
  3. 通道绑定: 检测是否强制使用 TLS 通道绑定

可能的结果:

  • signing: required, channel binding: required - 最高安全性(安全)
  • signing: not_required, channel binding: not_required - 无任何保护(易受攻击)
  • port open, SSL handshake failed - 端口响应,但 SSL 协商失败
  • port open, Connection error: 104 - 连接被对端重置

安全分析

严重发现(🔴 红色)

SMB 签名已禁用:

  • 易受 SMB 中继攻击
  • 攻击者可拦截并中继身份验证
  • 建议: 通过组策略启用 SMB 签名

LDAP 签名非必需:

  • 易受 LDAP 中继攻击
  • 凭据可能被中继到其他服务
  • 建议: 在注册表中设置 LdapEnforceChannelBinding=2 和 LDAPServerIntegrity=2

LDAPS 无通道绑定:

  • 即使加密,仍易受 LDAPS 中继攻击
  • 建议: 启用扩展保护(Extended Protection for Authentication)

警告(🟡 黄色)

SMB 签名已启用(非必需):

  • 比禁用要好,但并未强制执行
  • 客户端可以选择不签名
  • 建议: 将“enabled”改为“required”

支持 SMB1:

  • 具有已知漏洞的旧版协议
  • 除非旧系统需要,否则应禁用
  • 建议: 通过 PowerShell 或组策略禁用 SMBv1

良好配置(🟢 绿色)

SMB 签名必需:

  • 所有 SMB 流量均经过加密签名
  • 可防止中继攻击

LDAP/LDAPS 签名必需:

  • LDAP 消息已签名
  • 防止篡改和中继

强制通道绑定:

  • TLS 通道绑定可防止 SSL 中继
  • 最高级别的 LDAPS 安全性

性能调优

超时建议

网络类型建议超时

内存注意事项

每个工作进程仅消耗少量内存(约 1-2MB)。请根据系统资源调整并发数:

root@kitploit:~
# High-performance scan (requires good CPU/RAM)
python3 MSFinger.py -i 10.0.0.0/8 -t 0.5 -w 500

# Conservative scan (low resource usage)
python3 MSFinger.py -i 192.168.0.0/16 -t 2.0 -w 50

故障排除

没有结果显示

  1. 检查网络连通性:

    root@kitploit:~
    ping <target_ip>
    telnet <target_ip> 445
    
  2. 增大超时:

    root@kitploit:~
    python3 MSFinger.py -i <target> -t 3.0
    
  3. 检查防火墙规则:

    • 确保端口 445、389、636、3389、1433 可访问
    • 确认没有基于主机的防火墙阻止扫描

LDAPS 连接错误

“SSL handshake failed”或“Connection error: 104”:

  • 服务器可能要求客户端证书身份验证
  • 服务器可能使用非标准 SSL/TLS 配置
  • 尝试使用 openssl s_client -connect <ip>:636 进行诊断

数据库被锁定

如果从多个进程进行扫描:

root@kitploit:~
# Use different database files
python3 MSFinger.py -i 192.168.1.0/24 -d scan1.db &
python3 MSFinger.py -i 192.168.2.0/24 -d scan2.db &

权限错误

确保脚本具有可执行权限:

root@kitploit:~
chmod +x MSFinger.py

集成示例

Nmap 集成

先识别存活的 SMB 主机,再进行指纹识别:

root@kitploit:~
nmap -p445 --open -oG - 192.168.1.0/24 | awk '/445\/open/{print $2}' > smb_hosts.txt
python3 MSFinger.py -f smb_hosts.txt

定时扫描

通过 cron 监控网络变化:

root@kitploit:~
# Add to crontab (every day at 2 AM)
0 2 * * * /usr/bin/python3 /path/to/MSFinger.py -i 192.168.1.0/24 -d /var/scans/daily_scan.db

PowerShell 导出

使用 PowerShell 查询并进行修复:

root@kitploit:~
# Install SQLite PowerShell module
Install-Module -Name SimplySql

# Query vulnerable hosts
Open-SQLiteConnection -DataSource "MSFinger.db"
$vulnerable = Invoke-SqlQuery -Query "SELECT ip FROM hosts WHERE smb_signing != 'required'"
Close-SqlConnection

# Remediate
foreach ($host in $vulnerable) {
    Set-SmbServerConfiguration -ComputerName $host.ip -RequireSecuritySignature $true -Force
}

致谢

作者: Laurent Gaffie ([email protected])
许可证: GNU General Public License v3.0


许可证

本程序是自由软件:您可以根据自由软件基金会发布的 GNU 通用公共许可证条款(许可证第 3 版或(由您选择的)任何更高版本)重新分发和/或修改本程序。

本程序的发布是希望它有用,但不提供任何担保;甚至不提供适销性或特定用途适用性的默示担保。有关更多详情,请参阅 GNU 通用公共许可证。

下载工具
列类型说明
idINTEGER主键(自增)
ipTEXTIP 地址(唯一)
hostnameTEXT主机名(保留供将来使用)
os_versionTEXT操作系统版本
os_buildINTEGER操作系统内部版本号
domainTEXT域/工作组名称
boot_timeTEXT系统启动时间戳
smb_dialectTEXTSMB 协议版本
smb_signingTEXTSMB 签名状态
smb1_supportedINTEGERSMB1 是否启用(0=否,1=是)
smb1_signingTEXTSMB1 签名状态
rdp_openINTEGERRDP 端口是否开放(0=否,1=是)
mssql_openINTEGERMSSQL 端口是否开放(0=否,1=是)
ldap_signingTEXTLDAP 签名状态
ldaps_signingTEXTLDAPS 签名状态
ldaps_channel_bindingTEXTLDAPS 通道绑定状态
ldaps_errorTEXTLDAPS 连接错误(如有)
scan_timeTIMESTAMP首次扫描时间戳
last_seenTIMESTAMP最近扫描时间戳
内部版本范围操作系统
10240Windows 10 1507
14393Windows 10 1607 / Server 2016
17763Windows 10 1809 / Server 2019
19041-19045Windows 10 20H2 - 22H2
20348Windows Server 2022 21H2
22000+Windows 11
25398Windows Server 2025
并发数
高速内部局域网(1Gbps+)0.5s200-300
普通内部网络1.0s(默认)100-150
慢速/无线网络2.0-3.0s50-100
VPN 连接3.0-5.0s30-50