Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
tcconfig — 一个 tc 命令的封装器,便于对网络接口/Docker 容器(veth)设置网络带宽/延迟/丢包/报文损坏等流量控制。 | Kitploit
工具/GitHubGitHub/thombashi/tcconfig
通用工具网络安全混沌工程
GitHubthombashi/tcconfig

tcconfig

一个 tc 命令的封装器,便于对网络接口/Docker 容器(veth)设置网络带宽/延迟/丢包/报文损坏等流量控制。

查看仓库网站
85390552025年5月8日Kitploit 审核通过
分享

.. contents:: tcconfig :backlinks: top :depth: 2

摘要

tcconfig <https://github.com/thombashi/tcconfig>__ 是一个 tc 命令的封装工具。简化了对网络接口/Docker容器(veth)进行网络带宽/延迟/丢包/包损坏等流量控制的设置。

|PyPI pkg ver| |Supported Python ver| |CI status| |CodeQL|

.. |PyPI pkg ver| image:: https://badge.fury.io/py/tcconfig.svg :target: https://badge.fury.io/py/tcconfig :alt: PyPI package version

.. |Supported Python ver| image:: https://img.shields.io/pypi/pyversions/tcconfig.svg :target: https://pypi.org/project/tcconfig :alt: Supported Python versions

.. |CI status| image:: https://github.com/thombashi/tcconfig/actions/workflows/ci.yml/badge.svg :target: https://github.com/thombashi/tcconfig/actions/workflows/ci.yml :alt: Test CI status

.. |CodeQL| image:: https://github.com/thombashi/tcconfig/actions/workflows/build_and_release.yml/badge.svg :target: https://github.com/thombashi/tcconfig/actions/workflows/build_and_release.yml :alt: Build CI status

流量控制

设置流量整形规则 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 轻松将流量整形规则应用于特定网络:

  • 出站/入站数据包
  • 源/目标 IP 地址/网络(IPv4/IPv6)
  • 源/目标端口

可用参数 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 可对网络接口设置以下参数:

  • 网络带宽速率 [G/M/K bps]
  • 网络延迟 [微秒/毫秒/秒/分钟]
  • 丢包率 [%]
  • 数据包损坏率 [%]
  • 数据包重复率 [%]
  • 数据包重排序率 [%]
  • 数据包限制计数 [COUNT]

目标对象 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  • 网络接口:例如 eth0
  • Docker 容器(与容器对应的 veth)

.. image:: docs/gif/tcset_example.gif

用法

设置流量控制(tcset 命令)

tcset 是一个向网络接口(设备)添加流量控制规则的命令。

例如:将带宽限制设置为最大 100Kbps ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: console

# tcset eth0 --rate 100Kbps

例如:设置网络延迟 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 你可以使用时间单位(如 us/sec/min 等)来指定延迟时间。

设置 100 毫秒的网络延迟 ''''''''''''''''''''''''''''''''''''''''''''''''''' .. code-block:: console

# tcset eth0 --delay 100ms

设置 10 秒的网络延迟 ''''''''''''''''''''''''''''''''''''''''''''''''''' .. code-block:: console

# tcset eth0 --delay 10sec

设置 0.5 分钟(30 秒)的网络延迟 ''''''''''''''''''''''''''''''''''''''''''''''''''' .. code-block:: console

# tcset eth0 --delay 0.5min

你还可以使用以下时间单位:

.. table::

+------------+----------------------------------------------------------+
|    单位    |                可用的指定方式(字符串)                    |
+============+==========================================================+
|小时        |``h``/``hour``/``hours``                                  |
+------------+----------------------------------------------------------+
|分钟        |``m``/``min``/``mins``/``minute``/``minutes``             |
+------------+----------------------------------------------------------+
|秒          |``s``/``sec``/``secs``/``second``/``seconds``             |
+------------+----------------------------------------------------------+
|毫秒        |``ms``/``msec``/``msecs``/``millisecond``/``milliseconds``|
+------------+----------------------------------------------------------+
|微秒        |``us``/``usec``/``usecs``/``microsecond``/``microseconds``|
+------------+----------------------------------------------------------+

例如:设置 0.1% 丢包率 ^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: console

# tcset eth0 --loss 0.1%

例如:同时设置以上所有参数 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: console

# tcset eth0 --rate 100Kbps --delay 100ms --loss 0.1%

例如:指定流量控制的 IP 地址 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: console

# tcset eth0 --delay 100ms --network 192.168.0.10

例如:指定流量控制的 IP 网络和端口 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: console

# tcset eth0 --delay 100ms --network 192.168.0.0/24 --port 80

对 Docker 容器设置流量控制 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 在 Docker 主机上使用 --docker 选项执行 tcconfig:

.. code-block:: console

# tcset <容器名称或 ID> --docker ...

你可以使用 --src-container/--dst-container 选项指定源/目标容器。

在 Docker 容器内部设置流量控制 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 如果你想在容器内设置 tc 规则,需要使用 --cap-add NET_ADMIN 选项运行容器:

.. code-block:: console

docker run -d --cap-add NET_ADMIN -t <Docker 镜像>

内置 tcconfig 的容器镜像可在 https://hub.docker.com/r/thombashi/tcconfig/ 获取。

删除流量控制(tcdel 命令)

tcdel 是一个从网络接口(设备)删除流量整形规则的命令。

例如:删除 eth0 的流量控制 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 你可以使用 -a/--all 选项删除 eth0 的所有整形规则:

.. code-block:: console

# tcdel eth0 --all

显示流量控制配置(tcshow 命令)

tcshow 是一个显示当前网络接口流量控制设置的命令。

示例 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: console

# tcset eth0 --delay 10ms --delay-distro 2  --loss 0.01% --rate 0.25Mbps --network 192.168.0.10 --port 8080
# tcset eth0 --delay 1ms --loss 0.02% --rate 500Kbps --direction incoming
# tcshow eth0
{
    "eth0": {
        "outgoing": {
            "dst-network=192.168.0.10/32, dst-port=8080, protocol=ip": {
                "filter_id": "800::800",
                "delay": "10.0ms",
                "delay-distro": "2.0ms",
                "loss": "0.01%",
                "rate": "250Kbps"
            }
        },
        "incoming": {
            "protocol=ip": {
                "filter_id": "800::800",
                "delay": "1.0ms",
                "loss": "0.02%",
                "rate": "500Kbps"
            }
        }
    }
}

更多信息

更多示例请访问: https://tcconfig.rtfd.io/en/latest/pages/usage/index.html

安装

安装:pip

可以通过 pip(Python 包管理器)命令从 PyPI 安装 tcconfig。

.. code:: console

sudo pip install tcconfig

安装:dpkg(Debian/Ubuntu)

.. code:: console

curl -sSL https://raw.githubusercontent.com/thombashi/tcconfig/master/scripts/installer.sh | sudo bash

依赖

  • Python 3.9+
  • Python 包依赖(自动安装) <https://github.com/thombashi/tcconfig/network/dependencies>__

Linux 包

  • 必须:tc 命令所需:
    • Ubuntu/Debian: iproute2
    • Fedora/RHEL: iproute-tc
  • 可选:使用 --iptables 选项时需要:
    • iptables

Linux 内核模块

  • sch_netem

可选的 Python 包

  • Pygments <http://pygments.org/>__

文档

https://tcconfig.rtfd.io/

故障排除

https://tcconfig.rtfd.io/en/latest/pages/troubleshooting.html

Docker 镜像

https://hub.docker.com/r/thombashi/tcconfig/

赞助商

|chasbecker| |shiguredo| |b4tman| |Arturi0| |github|

.. |chasbecker| image:: https://avatars.githubusercontent.com/u/44389260?s=48&u=6da7176e51ae2654bcfd22564772ef8a3bb22318&v=4 :target: https://github.com/chasbecker :alt: ex-sponsor: Charles Becker (chasbecker) .. |shiguredo| image:: https://avatars.githubusercontent.com/u/2549434?s=48&v=4 :target: https://github.com/shiguredo :alt: ex-sponsor: 時雨堂 (shiguredo) .. |b4tman| image:: https://avatars.githubusercontent.com/u/3658062?s=48&v=4 :target: https://github.com/b4tman :alt: onetime: Dmitry Belyaev (b4tman) .. |Arturi0| image:: https://avatars.githubusercontent.com/u/46711571?s=48&u=57687c0e02d5d6e8eeaf9177f7b7af4c9f275eb5&v=4 :target: https://github.com/Arturi0 :alt: onetime: Arturi0 .. |github| image:: https://avatars.githubusercontent.com/u/9919?s=48&v=4 :target: https://github.com/github :alt: onetime: GitHub (github)

成为赞助商 <https://github.com/sponsors/thombashi>__

下载工具

相关工具

  • CyberChef

    网络瑞士军刀 - 用于加密、编码、压缩和数据分析的网络应用

  • SecLists

    精心策划的用于安全评估的字典集合,包括用户名、密码、URL、模糊测试载荷以及用于渗透测试和情报收集的敏感数据模式。

  • scapy

    基于 Python 的交互式数据包操作库,用于在多种协议中伪造、解码、发送、捕获和分析网络数据包,支持扫描、路由追踪、攻击和网络发现。

最受欢迎

查看全部 →

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

  • 1

    Callisto

    jetp1ane/callisto

    自动化二进制漏洞分析工具,通过Ghidra反编译可执行文件,使用Semgrep扫描伪C代码,并利用GPT-3.5-Turbo验证发现以减少误报。

    2.3k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    针对 CVE-2026-43499 的一键式 Android 内核漏洞利用应用,通过内核模块加载实现权限提升,并提供偏移提取与设备端分析工具。

    850
  • 3

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    446
  • 4

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    382
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    349
  • 6

    faraday

    infobyte/faraday

    面向攻击性安全、漏洞管理和自主渗透测试的开源及AI驱动的网络安全工具。由拉丁美洲的黑客构建,供全球使用。

    344

探索所有工具

浏览我们的工具集合

查看所有工具 →