fingertls

module
v0.3.1-alpha.hotfix1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2025 License: LGPL-3.0

README

TLS MITM Module

Go Version License Version

一个基于Go实现的TLS指纹模拟模块库,支持MITM代理和多级代理链。

版本说明

当前版本:v0.3.1-alpha

我们遵循语义化版本规范进行版本管理。

功能特性

  • 🎭 可定制的TLS Client Hello指纹
  • ⛓️ HTTP/SOCKS5多级代理链支持
  • 🔄 HTTP1.1/HTTP2 协议自动协商
  • 📝 可扩展的日志接口

技术栈

  • Go 1.23+
  • utls - TLS指纹定制
  • zerolog - 高性能日志库

快速开始

安装
go get github.com/aberstone/fingertls
基本用法
import (
    "github.com/aberstone/fingertls/transport/tls"
    "github.com/aberstone/fingertls/transport/tls/fingerprint"
)

// 创建TLS拨号器
dialer := tls.NewTLSDialer(
    tls.WithSpecFactory(fingerprint.GetDefaultClientHelloSpec), // 设置TLS指纹
    tls.WithUpstreamProxy(upstreamProxy),                      // 可选:设置上游代理
    tls.WithProxyTimeout(30),                                  // 可选:设置超时时间
)

// 建立TLS连接
conn, err := dialer.DialTLS(context.TODO(), "tcp", "example.com:443")

更多使用示例请参考examples目录。

模块架构

核心组件
graph TD
    A[应用程序] --> B[TLS拨号器]
    B --> C[指纹定制]
    B --> D[代理连接器]
    
    D --> E[直连]
    D --> F[代理链]
    
    F --> G[HTTP代理]
    F --> H[SOCKS5代理]
关键特性
  1. TLS指纹模拟

    • 支持自定义Client Hello
    • 协议版本自动协商
  2. 代理链路由

    • 灵活的代理链配置
    • 多种代理协议支持

开发指南

环境要求
  • Go 1.23+
代码结构
.
├── transport/         # 传输层模块
│   ├── tls/          # TLS相关实现
│   │   ├── fingerprint/  # 指纹模拟
│   │   └── proxy/        # 代理支持
│   └── proxy_connector/  # 代理连接器
├── logging/          # 日志接口
└── examples/         # 使用示例

贡献指南

我们欢迎任何形式的贡献!在提交代码前,请确保阅读:

贡献流程
  1. Fork 项目
  2. 创建特性分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'feat: add amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 提交Pull Request
提交规范

我们使用Conventional Commits规范:

  • feat: 新功能
  • fix: 修复
  • docs: 文档更新
  • style: 代码风格修改
  • refactor: 重构
  • test: 测试相关
  • chore: 构建/工具链/辅助工具的变动

许可证

本项目采用 GNU Lesser General Public License v3.0 (LGPL-3.0) 许可证。这意味着:

  • ✔️ 商业用途
  • ✔️ 修改
  • ✔️ 分发
  • ✔️ 私人使用
  • ❗ 必须公开源代码
  • ❗ 需要保留许可证和版权信息
  • ❗ 需要说明修改内容

查看 LICENSE 文件了解详情。

支持与反馈


⭐️ 如果这个项目对你有帮助,欢迎点Star支持!

Directories

Path Synopsis
examples
http_req_with_tls_modify command
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
mitm_with_tls/client command
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
mitm_with_tls/server command
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
proxy_connector
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
tls
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
tls/fingerprint
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.
* Copyright (C) 2024 aberstone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL