Skip to main content

This tool is used for forwarding local and remote (intranet) traffic

Project description

traffic-forward 是一款python开发的流量转发工具,可以使用python脚本行运行,也可以封装使用命令行,同样可以使用pyinstaller等工具进行封装成Macos,Linux, Windows 下的可执行文件运行,可用于本地流量转发,与内网流量转发

1. 安装(可选)

此工具完全使用python原生的模块进行开发不需要安全任何的第三方模块,如果需要使用命令行可能需要sudo

pip(3) install traffic_forward

2. 使用

lport与lhost是需要转发的端口

rhost与rport是转发到的目标端口

2.1 转发本地流量

traffic_forward -mode trans -lhost 127.0.0.1 -lport 22 -rhost 127.0.0.1 -rport 9999

在使用完后使用control+c退出会有错误输出这是正常的

2.2 将流量转发到公网机器

在公网上的主机监听2个端口

traffic_forward -mode listen -lport 8088 -rport 8089

内网主机连接公网主机监听的任意端口(2个中任意一个),加入debug可以查看连接出现的问题,此时是讲本地的22端口转发到公网机器的8088口

traffic_forward -mode slave -lhost 127.0.0.1 -lport 22 -rhost x.x.x.x -rport 8088 -debug 1

然后

ssh name@x.x.x.x -p 8089

2.3 转发本地的UDP流量

由于UDP原因,这里只开发到了UDP的本地转发,如果可以希望可以帮组我开发远程转发

traffic_forward -mode Utrans -lhost 127.0.0.1 -lport 8090 -rhost 127.0.0.1 -rport 9999

2.4. 日志

此工具会在当前目录下生成日志,详细日志的功能等待开发可以如果不需要请直接删去

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traffic_forward-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distributions

traffic_forward-1.0.0-py3.6.egg (10.1 kB view details)

Uploaded Source

traffic_forward-1.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file traffic_forward-1.0.0.tar.gz.

File metadata

  • Download URL: traffic_forward-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.5.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9

File hashes

Hashes for traffic_forward-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cf63be77fb3827672e538c8a798a9dfec163d8b2e2c78585aa0fdcf033e7741c
MD5 17f4a9a95f01d4c97daaeb2476d69d55
BLAKE2b-256 3ec45b39b186258f5cd9f97b0351c3eb857640e68b01accb79ca5f0010bf14d2

See more details on using hashes here.

File details

Details for the file traffic_forward-1.0.0-py3.6.egg.

File metadata

  • Download URL: traffic_forward-1.0.0-py3.6.egg
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.5.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9

File hashes

Hashes for traffic_forward-1.0.0-py3.6.egg
Algorithm Hash digest
SHA256 ae42c577e0bbcd609bae3d589041f6ad036abd3376984e322e41e39a884919f6
MD5 93af000e54260917e54045b32dbfb6f5
BLAKE2b-256 2616c1eea01c70ab47502e96c7eb7b725db42f2ead1c0c92db6da474d413a738

See more details on using hashes here.

File details

Details for the file traffic_forward-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: traffic_forward-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.5.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.9

File hashes

Hashes for traffic_forward-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03645851216d5ae4573fe1786b067b38328a7ca43f209f679e431f32091a113d
MD5 dec0124930aea0328118c6d601db4c5a
BLAKE2b-256 23c9e1693b43f6e85937f54fe7c5be39b293b76495bac533d96553af88bd5387

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page