GithubHelp home page GithubHelp logo

4dnat's Introduction

4DNAT

English | 简体中文

Introduction

The 4DNAT was named from 4 and DNAT. This tool works in the fourth layer of transport layer of the OSI model, while 4 and for sound, means a tool that is dedicated to the target address conversion. 4dnat develops using Go language, has natural cross-platform, and uses the GO standard library development, without any third-party dependence, only one binary executable after compiling. It has four working modes:

Forward

Accept two parameters, listen port, and destination addresses, actively connect the target address after receiving the request in the listening port, example:

./4dnat -forward 2222 192.168.1.100:22

Listen

Accept two parameters, listen port 1 and monitor port 2, and exchange data received by two ports, example:

./4dnat -listen 10000 10001

Agent

Accept two parameters, target addresses 1, and destination address 2, actively connect these two target addresses after startup, and exchange data received by the two ports, example:

./4dnat -agent 127.0.0.1:10000 127.0.0.1:22

http/https proxy

Accept two parameters or four parameters, proxy types, listener ports, certificate paths, and private key paths, examples:

http proxy

./4dnat -proxy http 1080

https proxy

./4dnat -proxy https 1080 server.crt server.key

4dnat's People

Contributors

dushixiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

4dnat's Issues

关于agent模式的一些问题

在测试中发现使用 - -agent 时候 http的代理是正常的,socks5的代理做转发就存在问题。。是我个人原因么

我简单描述下

a 计算机 (我的操作计算机,可以上外网) 20.20.20.20
b 计算机 (内网计算机,不能外网,只能a ssh过去)30.30.30.30


a 主机
1、 a ssh tunnel b,起一个socks5代理 local 1122端口(因为我只能ssh 到b,b的其他端口全部无法访问,所以需要一个ssh隧道先)
2、起http代理 10800 (测试起socsk5代理存在问题)
3、然后 proxychains 4dnat agent 20.20.20.20:10800 30.30.30.30 10000

b 主机
1、4dnat 10000 10001
2、设置proxy


不知道是 4dnat的 agent问题,还是因为我先走了一层ssh socks5代理的问题

switch case好像有点问题啊老哥

switch args[1] {
	case "-listen":
	case "-l":
		listener(args[2], args[3])
		break
	}

这种写法好像不能达到或的效果啊,要改成这种,我这里试过了,不然你试试?

switch args[1] {
	case "-listen","-l":
		listener(args[2], args[3])
		break
	}

连接超时问题

连接超时怎么办,是一直net.dial建立连接吗?
端口转发时,其中一个端口的连接中断了,断开了。另一个怎么办,一直等吗,
如何主动检测连接中断,并关闭此线程呢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.