FinalShell激活原理详解


⚠️提醒

本文仅供学习和研究用途,请支持正版软件,尊重开发者的劳动成果

image.png

概述

FinalShell是一款支持多平台的远程终端管理工具,但其官网经常失联,导致激活服务器无法连接。在某些网络受限的环境下使用,在线激活经常失败或超时,此时就需要使用"离线授权码"进行手动激活。

激活码生成原理

实际上,不同版本的FinalShell在生成授权码时使用了不同的加密规则,但它们的本质是:哈希 + 盐值。

目前激活码生成工具支持以下版本的FinalShell:

  • < 3.9.6(旧版)
  • ≥ 3.9.6 < 4.5(旧版)
  • ≥ 4.5(新版)
  • ≥ 4.6(最新版)

离线授权码本质是对「机器码 + 盐」进行散列处理后,从结果中截取某一段作为激活码:

版本范围使用算法盐值构造

版本范围使用算法盐值构造
< 3.9.6MD561305 + 机器码 + 8552(高级版)
2356 + 机器码 + 13593(专业版)
≥ 3.9.6 < 4.5Keccak384机器码 + hSf(78cvVlS5E(高级版)
机器码 + FF3Go(*Xvbb5s2(专业版)
4.5 版本Keccak384机器码 + wcegS3gzA$(高级版)
机器码 + b(xxkHn%z);x(专业版)
4.6 版本Keccak384机器码 + csSf5*xlkgYSX,y(高级版)
机器码 + Scfg*ZkvJZc,s,Y(专业版)

生成流程:对「机器码 + 盐」进行散列处理后,从哈希结果中截取指定片段作为激活码。

获取机器码步骤

要使用激活码生成工具,首先需要获取FinalShell的机器码,具体步骤如下:

  1. 打开FinalShell软件
  2. 点击右上角的同步状态选项
  3. 点击登录账号
  4. 输入任意账号和密码
  5. 点击离线激活选项
  6. 复制显示的机器码(格式类似: ai@ABCDEF123456 )

浏览器版激活码计算工具

使用HTML + JavaScript(CryptoJS)计算的在线工具代码:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>FinalShell 离线激活码生成器</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
  <style>
    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }
    
    .container {
      width: 100%;
      max-width: 800px;
      background: rgba(255, 255, 255, 0.95);
      border-radius: 16px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
      overflow: hidden;
    }
    
    .header {
      background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
      color: white;
      padding: 24px 32px;
    }
    
    .header h1 {
      font-size: 24px;
      margin-bottom: 8px;
    }
    
    .header p {
      opacity: 0.9;
      font-size: 14px;
      line-height: 1.5;
    }
    
    .content {
      padding: 32px;
    }
    
    .input-section {
      margin-bottom: 32px;
    }
    
    .input-group {
      display: flex;
      gap: 12px;
      margin-bottom: 16px;
    }
    
    input {
      flex: 1;
      padding: 14px 16px;
      border: 2px solid #e1e5e9;
      border-radius: 10px;
      font-size: 16px;
      transition: all 0.3s ease;
    }
    
    input:focus {
      outline: none;
      border-color: #4b6cb7;
      box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.1);
    }
    
    button {
      background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
      color: white;
      border: none;
      padding: 14px 28px;
      border-radius: 10px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
    }
    
    button:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(75, 108, 183, 0.4);
    }
    
    button:active {
      transform: translateY(0);
    }
    
    .result-section {
      background: #f8fafc;
      border-radius: 10px;
      padding: 24px;
      border: 1px solid #e1e5e9;
    }
    
    .result-section h3 {
      color: #1e293b;
      margin-bottom: 16px;
      font-size: 18px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .result-section h3::before {
      content: "📋";
      font-size: 20px;
    }
    
    .code-container {
      font-family: 'Consolas', 'Monaco', monospace;
      font-size: 14px;
      line-height: 1.8;
      white-space: pre-wrap;
      background: #1e293b;
      color: #e2e8f0;
      padding: 20px;
      border-radius: 8px;
      overflow-x: auto;
      margin-top: 8px;
    }
    
    .version-tag {
      display: inline-block;
      background: #4b6cb7;
      color: white;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 600;
      margin: 8px 0;
    }
    
    .tip-box {
      background: #fff7ed;
      border: 1px solid #fed7aa;
      border-radius: 8px;
      padding: 16px;
      margin-top: 24px;
    }
    
    .tip-box h4 {
      color: #c2410c;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .tip-box h4::before {
      content: "💡";
    }
    
    .tip-box ul {
      padding-left: 20px;
      color: #5a5a5a;
    }
    
    .tip-box li {
      margin: 6px 0;
      line-height: 1.5;
    }
    
    @media (max-width: 640px) {
      .content {
        padding: 20px;
      }
      
      .input-group {
        flex-direction: column;
      }
      
      button {
        width: 100%;
      }
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="header">
      <h1>FinalShell 离线激活码生成器</h1>
      <p>支持多版本FinalShell离线激活 | 无需连接激活服务器</p>
    </div>
    
    <div class="content">
      <div class="input-section">
        <div class="input-group">
          <input type="text" id="machineCode" placeholder="请输入机器码 (格式: ai@ABCDEF123456)" />
          <button onclick="generateActivationCodes()">生成激活码</button>
        </div>
        <p style="color: #666; font-size: 14px; margin-top: 8px;">
          🔍 提示:在FinalShell中点击"离线激活"即可查看机器码
        </p>
      </div>
      
      <div class="result-section">
        <h3>生成的激活码:</h3>
        <div class="code-container" id="output">
          等待生成...
        </div>
      </div>
      
      <div class="tip-box">
        <h4>使用说明与注意事项</h4>
        <ul>
          <li>请根据您的FinalShell版本选择对应的激活码</li>
          <li>激活后建议立即屏蔽激活服务器以防止二次激活</li>
          <li>4.6版本激活后点击"确定"无反应时,请先修改hosts文件</li>
          <li>确保准确复制机器码,包含"ai@"前缀</li>
        </ul>
      </div>
    </div>
  </div>

  <script>
    // 哈希计算函数
    function md5(str) {
      return CryptoJS.MD5(str).toString();
    }

    function keccak384(str) {
      return CryptoJS.SHA3(str, { outputLength: 384 }).toString();
    }

    // 生成激活码的主函数
    function generateActivationCodes() {
      const machineCode = document.getElementById('machineCode').value.trim();
      const output = document.getElementById('output');
      
      if (!machineCode) {
        output.innerHTML = '<span style="color: #ef4444;">❌ 请输入机器码!</span>';
        return;
      }
      
      if (!machineCode.includes('@')) {
        output.innerHTML = '<span style="color: #ef4444;">❌ 机器码格式不正确,应包含"ai@"前缀</span>';
        return;
      }

      let result = '';
      
      // 版本 < 3.9.6
      result += '<div class="version-tag">FinalShell < 3.9.6</div>\n';
      result += '高级版: ' + md5('61305' + machineCode + '8552').slice(8, 24) + '\n';
      result += '专业版: ' + md5('2356' + machineCode + '13593').slice(8, 24) + '\n\n';
      
      // 版本 ≥ 3.9.6
      result += '<div class="version-tag">FinalShell ≥ 3.9.6</div>\n';
      result += '高级版: ' + keccak384(machineCode + 'hSf(78cvVlS5E').slice(12, 28) + '\n';
      result += '专业版: ' + keccak384(machineCode + 'FF3Go(*Xvbb5s2').slice(12, 28) + '\n\n';
      
      // 版本 4.5
      result += '<div class="version-tag">FinalShell 4.5</div>\n';
      result += '高级版: ' + keccak384(machineCode + 'wcegS3gzA$').slice(12, 28) + '\n';
      result += '专业版: ' + keccak384(machineCode + 'b(xxkHn%z);x').slice(12, 28) + '\n\n';
      
      // 版本 4.6
      result += '<div class="version-tag">FinalShell 4.6</div>\n';
      result += '高级版: ' + keccak384(machineCode + 'csSf5*xlkgYSX,y').slice(12, 28) + '\n';
      result += '专业版: ' + keccak384(machineCode + 'Scfg*ZkvJZc,s,Y').slice(12, 28);
      
      output.textContent = result;
    }
    
    // 支持按Enter键生成
    document.getElementById('machineCode').addEventListener('keypress', function(e) {
      if (e.key === 'Enter') {
        generateActivationCodes();
      }
    });
  </script>
</body>
</html>

Python 实现

使用pycryptodome进行哈希计算的Python代码:

# 安装包 
pip3 install pycryptodome
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
FinalShell 离线激活码生成工具
Python版本要求:3.6+
依赖:pip install pycryptodome
"""

from Crypto.Hash import MD5, keccak
import sys

def calc_md5(data: str) -> str:
    """计算MD5哈希值"""
    return MD5.new(data.encode('utf-8')).hexdigest()

def calc_keccak384(data: str) -> str:
    """计算Keccak384哈希值"""
    return keccak.new(data=data.encode('utf-8'), digest_bits=384).hexdigest()

def generate_activation_codes(machine_id: str):
    """生成所有版本的激活码"""
    
    # 验证机器码格式
    if '@' not in machine_id:
        print("⚠️  警告:机器码格式异常,通常应包含'ai@'前缀")
        proceed = input("是否继续?(y/n): ")
        if proceed.lower() != 'y':
            return
    
    print("\n" + "="*60)
    print("FinalShell 离线激活码生成结果")
    print("="*60)
    
    # < 3.9.6 版本
    print("\n🔹 FinalShell < 3.9.6")
    print("   ┌ 高级版:", calc_md5(f'61305{machine_id}8552')[8:24])
    print("   └ 专业版:", calc_md5(f'2356{machine_id}13593')[8:24])
    
    # ≥ 3.9.6 版本
    print("\n🔹 FinalShell ≥ 3.9.6")
    print("   ┌ 高级版:", calc_keccak384(f'{machine_id}hSf(78cvVlS5E')[12:28])
    print("   └ 专业版:", calc_keccak384(f'{machine_id}FF3Go(*Xvbb5s2')[12:28])
    
    # 4.5 版本
    print("\n🔹 FinalShell 4.5")
    print("   ┌ 高级版:", calc_keccak384(f'{machine_id}wcegS3gzA$')[12:28])
    print("   └ 专业版:", calc_keccak384(f'{machine_id}b(xxkHn%z);x')[12:28])
    
    # 4.6 版本
    print("\n🔹 FinalShell 4.6")
    print("   ┌ 高级版:", calc_keccak384(f'{machine_id}csSf5*xlkgYSX,y')[12:28])
    print("   └ 专业版:", calc_keccak384(f'{machine_id}Scfg*ZkvJZc,s,Y')[12:28])
    
    print("\n" + "="*60)

def main():
    """主函数"""
    print("🚀 FinalShell 离线激活码生成工具")
    print("-"*40)
    
    # 获取机器码
    if len(sys.argv) > 1:
        machine_id = sys.argv[1]
        print(f"使用命令行参数中的机器码: {machine_id}")
    else:
        machine_id = input("请输入机器码 (格式: awyme@ABCDEF123456): ").strip()
    
    if not machine_id:
        print("❌ 错误:机器码不能为空")
        sys.exit(1)
    
    # 生成激活码
    generate_activation_codes(machine_id)
    
    # 显示使用提示
    print("\n📌 使用提示:")
    print("1. 根据您的FinalShell版本选择对应的激活码")
    print("2. 激活成功后建议立即修改hosts文件防止二次激活")
    print("3. 如遇激活问题,请尝试切换其他版本激活码")

if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        print("\n\n👋 已取消操作")
        sys.exit(0)
    except ImportError:
        print("❌ 缺少依赖模块,请执行: pip install pycryptodome")
        sys.exit(1)

防止二次激活的方法

激活后,可以通过以下方法防止软件二次激活:

  1. 修改本机hosts文件,将以下地址指向127.0.0.1:
127.0.0.1 www.youtusoft.com
127.0.0.1 youtusoft.com
127.0.0.1 hostbuf.com
127.0.0.1 www.hostbuf.com
127.0.0.1 dkys.org
127.0.0.1 tcpspeed.com
127.0.0.1 www.wn1998.com
127.0.0.1 wn1998.com
127.0.0.1 pwlt.wn1998.com
127.0.0.1 backup.www.hostbuf.com

hosts文件位置

  • Windows: C:\Windows\System32\drivers\etc\hosts
  • Linux/macOS: /etc/hosts
  1. 屏蔽以下IP(可使用防火墙如火绒等):
101.32.72.254
45.56.98.223
193.9.44.7
103.99.178.153
47.76.185.223

Windows防火墙操作步骤

  1. 打开"Windows Defender 防火墙"
  2. 选择"高级设置"
  3. 创建出站规则,阻止上述IP地址

推荐使用火绒安全软件,添加自定义规则屏蔽相关域名和IP。

常见问题解决

  • 4.6.5版本点击确定没有反应,可先尝试修改hosts文件,如果不行请使用其他版本
  • 确保正确输入机器码,格式通常为: awyme@ABCDEF123456
  • 如果激活后软件仍显示需要激活,请检查是否正确屏蔽了相关域名和IP