macronut / ghostcp

GhosTCP is a program for Windows that protects the TCP connections from being interfered.
GNU Lesser General Public License v3.0
837 stars 164 forks source link

[Feature] Add Protect for other tcp protocal #6

Closed Lyoko-Jeremie closed 4 years ago

Lyoko-Jeremie commented 4 years ago

in my net env, the github's ssh (port 22) connect not stable, it seems to be block.

after read the code, seems like the protect on 443 port is a generic tcp protect act. i think this also can do on the 22 port . so i add a case 22: on it like this . after my test, it feel like work well.

and i think that maybe we can add a func to set the additional protect tcp port on the config file.

the config can seems like this:

ExtraProtectTcpPort= 22
ExtraProtectTcpPort= 21

and read it when start up.

macronut commented 4 years ago

You can edit the config like this:

"header/tcpioneer.go +537"

Lyoko-Jeremie commented 4 years ago

emmmm, if i want to protect all the ssh protocal on 22 port , how to config it ?

( because i have many server (>30) need to manager. and host name and ip often change .

macronut commented 4 years ago

:22

header/tcp.go +400

//domain or ip block of you servers need be configured

Lyoko-Jeremie commented 4 years ago

thanks~~~

Lyoko-Jeremie commented 4 years ago

so sorry for that . but, i still have a question.

why this code only for 443 ? what means dose it doing ? i cannot fully understand this code.

https://github.com/Macronut/TCPioneer/blob/3e835575ed00f415b9d4808a6ce7d707a0929089/header/tcp.go#L588-L656

and then, why other pack dont need do it ? https://github.com/Macronut/TCPioneer/blob/3e835575ed00f415b9d4808a6ce7d707a0929089/header/tcp.go#L657-L659

emm 🤔

macronut commented 4 years ago

https have SNI so it needs to break from the middle of SNI, other protocols are usually enough to break from the middle of the payload.