tehmoon / cryptocli

The ultimate tool for data transfer, manipulation and proxy.
MIT License
16 stars 2 forks source link

New tls module #56

Closed tehmoon closed 4 years ago

tehmoon commented 4 years ago

This module will be used to perform some TLS inspection. The goal is to grab the client hello and dial the requested server on the same listening port. Once it's dial, there are two options:

features:

I tried to do a PoC but it's really hard:

 - start a tcp server
 - wait for a tcp connection
 - duplicate a reader from the tcp connection to a buffer
 - wrap tcp connection into a tls connection
 - register callback for client hello
 - start handshake
 - when callback triggers
   - send servername from clienthello to dedicated buffer goroutine
   - read the entire buffer from the goroutine
   - dial tcp connection from servername
   - send the buffered first bytes which should be the client hello to the new tcp socket
   - pipe the conn (not the tls conn) to the new tcp socket read/write

Edit:

Merge the new module with tcp-server since the module currently just sends the bytes through the channel.

tehmoon commented 4 years ago

80 Got merged! I did not merge it with tcp-server because I don't see the need right now.