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

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

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

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

工具目录

分类

查看所有分类
Loading categories
hassh — 对 SSH 客户端和服务器进行指纹识别。 | Kitploit
工具/GitHubGitHub/corelight/hassh
危害指标 (IOC) 管理侦察取证分析网络安全威胁情报入侵检测异常检测
GitHubcorelight/hassh

hassh

对 SSH 客户端和服务器进行指纹识别。

查看仓库
122年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

"HASSH" - 一种用于 SSH 客户端和服务器的指纹识别方法。

注意:此 Corelight 仓库是应 Salesforce 的请求而创建的,以便其能够得到积极维护,因为 Salesforce 的原始仓库已不再维护。

"HASSH" 是一种网络指纹识别标准,可用于识别特定的客户端和服务器 SSH 实现。这些指纹可以以 MD5 指纹的形式轻松存储、搜索和共享。

License: BSD 3-Clause License

HASSH 可以帮助解决什么问题:

  • 可用于高度受控、充分了解的环境中,任何超出已知良好集合的指纹都会触发警报。
  • 可以以比 IP 源更细的粒度检测、控制和调查暴力破解或撞库密码尝试——而 IP 源可能受到 NAT 或类似僵尸网络行为的影响。hassh 将成为所使用的特定客户端软件实现的一个特征,即使 IP 经过 NAT 以至于被许多其他 SSH 客户端共享也是如此。
  • 检测客户端算法集合组件内的隐蔽数据外泄。在这种情况下,特制的 SSH 客户端可以在一系列 SSH_MSG_KEXINIT 数据包中,将数据从受信任环境向外发送到受信任程度较低的环境。在与更为人熟知的通过 DNS 外泄类似的场景中,数据可以作为一系列尝试过的、但不完整且未被记录的连接到由恶意行为者控制的 SSH 服务器的连接来发送,恶意行为者随后可以记录、解码并将这些数据片段重组为其原始形式。到目前为止,此类尝试——更不用说明文数据包的内容了——即使成熟的数据包分析器或端点系统也不会记录。现在,通过使用异常检测或对具有多个不同 hassh 的 SSH 客户端发出警报,可以轻松检测这种风格的外泄。
  • 与其他上下文指标结合使用,例如通过异常的 hassh(如 Paramiko、Powershell、Ruby、Meterpreter、Empire 所使用的)来检测网络发现和横向移动尝试。
  • 共享恶意 hassh 作为失陷指标。
  • 创建额外级别的客户端应用程序控制,例如,可以阻止所有不在已批准已知 hassh 值集合内的客户端连接到 SSH 服务器。
  • 在取证环境中为不可否认性做出贡献——在比 IPSource 更高的抽象级别上——IPSource 可能受到 NAT 的影响,或者可能使用多个 IP 源。
  • 检测欺骗性应用程序。例如,一个已知属于 Cowry/Kippo SSH 蜜罐服务器安装的 hasshServer 值,而其服务器字符串声称是常见的 OpenSSH 服务器。
  • 检测具有已知属于 IoT 嵌入式系统的 hassh 的设备。示例可能包括摄像头、麦克风、键盘记录器、窃听器,这些设备很容易隐藏起来,并通过加密通道悄悄与受控服务器通信。

HASSH 是如何工作的:

"hassh" 和 "hasshServer" 是由各种 SSH 客户端和服务器应用程序支持的一组特定算法构建的 MD5 哈希。这些算法在初始 TCP 三次握手后以称为 "SSH_MSG_KEXINIT" 消息的明文数据包进行交换,并且是最终加密 SSH 通道建立中不可或缺的一部分。 这些算法的存在和排序可以具有足够的独特性,因此可以用作指纹,帮助识别底层客户端和服务器应用程序或独特实现,而无需考虑诸如 "Client" 或 "Server" 字符串之类更高级别的表面标识符。

示例 1:客户端指纹识别 - "hassh"

对于 "Cyberduck" SFTP 客户端 SSH-2.0-Cyberduck/6.7.1.28683 (Mac OS X/10.13.6) (x86_64) ,其支持的算法集合如下:

将这些算法以 ";" 作为分隔符连接在一起,即可得到 hasshAlgorithms,这对详细分析很有用。
[email protected],diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group15-sha512,diffie-hellman-group16-sha512,diffie-hellman-group17-sha512,diffie-hellman-group18-sha512,[email protected],diffie-hellman-group15-sha256,[email protected],[email protected],diffie-hellman-group16-sha256,[email protected],[email protected],[email protected];aes128-cbc,aes128-ctr,aes192-cbc,aes192-ctr,aes256-cbc,aes256-ctr,blowfish-cbc,blowfish-ctr,cast128-cbc,cast128-ctr,idea-cbc,idea-ctr,serpent128-cbc,serpent128-ctr,serpent192-cbc,serpent192-ctr,serpent256-cbc,serpent256-ctr,3des-cbc,3des-ctr,twofish128-cbc,twofish128-ctr,twofish192-cbc,twofish192-ctr,twofish256-cbc,twofish256-ctr,twofish-cbc,arcfour,arcfour128,arcfour256;hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-sha2-256,hmac-sha2-512;[email protected],zlib,none

最后,hassh 就是 hasshAlgorithms 的 MD5,用于存储、搜索和共享。以下是一些示例:

root@kitploit:~
de30354b88bae4c2810426614e1b6976  Powershell Renci.SshNet.SshClient.0.0.1 (used by Empire exploit modules)
fafc45381bfde997b6305c4e1600f1bf  Ruby/Net::SSH_5.0.2 x86_64-linux (used by Metasploit exploit modules)
b5752e36ba6c5979a575e43178908adf  Python Paramiko_2.4.1 (used by Metasploit exploit modules) 
16f898dd8ed8279e1055350b4e20666c  Dropbear_2012.55 (used in IOT embedded systems)  
8a8ae540028bf433cd68356c1b9e8d5b  CyberDuck Version 6.7.1 (28683)  
06046964c022c6407d15a27b12a6a4fb  OpenSSH_7.7p1 Ubuntu-4

示例 2:服务器指纹识别 - "hasshServer"

对于标准 SSH-2.0-OpenSSH_5.3 SSH 服务器,其支持的算法集合如下:

功能SSH_MSG_KEXINIT 数据包中出现的算法

将这些算法以 ";" 作为分隔符连接在一起,即可得到 hasshServerAlgorithms,这对详细分析很有用。
diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1;aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected];hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96;none,[email protected]

最后,hasshServer 就是 hasshServerAlgorithms 的 MD5,以下是一些示例:

root@kitploit:~
c1c596caaeb93c566b8ecf3cae9b5a9e  SSH-2.0-dropbear_2016.74	  
d93f46d063c4382b6232a4d77db532b2  SSH-2.0-dropbear_2016.72	  
2dd9a9b3dbebfaeec8b8aabd689e75d2  SSH-2.0-AWSCodeCommit  
696e7f84ac571fdf8fa5073e64ee2dc8  SSH-2.0-FTP

选项

默认情况下,会记录原始算法字符串和密钥算法,并可通过在脚本中设置这些布尔变量来控制。

root@kitploit:~
option log_raw_hasshAlgorithms = T;
option log_key_algorithm = T;

参考:

  • Salesforce 工程博客
  • BSides 2019 - HASSH - 一种用于 SSH 客户端和服务器的指纹识别方法
  • RFC4253 安全外壳(SSH)传输层协议

致谢:

hassh 和 hasshServer 由 Salesforce 的 Detection Cloud Team 的 Ben Reardon 构思和开发,并受到 Adel Karimi(@0x4d31)和 JA3 团队的启发与贡献。

下载工具
功能SSH_MSG_KEXINIT 数据包中出现的算法
密钥交换方法[email protected],diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group15-sha512,diffie-hellman-group16-sha512,diffie-hellman-group17-sha512,diffie-hellman-group18-sha512,[email protected],diffie-hellman-group15-sha256,[email protected],[email protected],diffie-hellman-group16-sha256,[email protected],[email protected],[email protected]
加密aes128-cbc,aes128-ctr,aes192-cbc,aes192-ctr,aes256-cbc,aes256-ctr,blowfish-cbc,blowfish-ctr,cast128-cbc,cast128-ctr,idea-cbc,idea-ctr,serpent128-cbc,serpent128-ctr,serpent192-cbc,serpent192-ctr,serpent256-cbc,serpent256-ctr,3des-cbc,3des-ctr,twofish128-cbc,twofish128-ctr,twofish192-cbc,twofish192-ctr,twofish256-cbc,twofish256-ctr,twofish-cbc,arcfour,arcfour128,arcfour256
消息认证hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-sha2-256,hmac-sha2-512
压缩[email protected],zlib,none
密钥交换方法diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
加密aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
消息认证hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
压缩none,[email protected]