Live data from Hacker News

Show HN: Tunnelling TCP through a file

github.com

11–20 of 42 posts

Re: Show HN: Tunnelling TCP through a file

#11
post #10

What's the benefit of this over netcat + mkfifo?

netcat+mkfifo does the actual transfer with TCP - so there's no tunneling involved. This solution tunnels tcp through file abstraction, so it works significantly differently.

As for the uses, see the three author listed. For example, by using a file share as transport you may evade firewall.

Re: Show HN: Tunnelling TCP through a file

#12
post #7

Earlier quoted context omitted.

There are many other protocols besides SMB that can be used to share a file. Webdav, ftp, nfs, two systems accessing a third file share, shared folders in a VM, ... Or a file share provided by RDP like in the example, which does not include the IPC share as far as I know.

Hah! You answered my question re how is it different. It’s strange… I re-read your comment twice a with a furrowed brow: “provided by RDP like in the example” and kept thinking to myself “what? There was a screenshot clearly showing…” yada yada SMB. So I went back to the look at the image in the readme. /smh. You know how they say eyewitness testimony is often among the least accurate, even immediately after the inci…

If you want an overview of how redirection works in MS-RDP, Microsoft has a good deep dive at https://learn.microsoft.com/en-us/openspecs/windows_protocol....

Re: Show HN: Tunnelling TCP through a file

#13
post #10

What's the benefit of this over netcat + mkfifo?

netcat+mkfifo does the actual transfer with TCP - so there's no tunneling involved. This solution tunnels tcp through file abstraction, so it works significantly differently. As for the uses, see the three author listed. For example, by using a file share as transport you may evade firewall.

[deleted]

Re: Show HN: Tunnelling TCP through a file

#14
post #7

That’s cool. A question that immediately comes to my mind is this: how is this different than using the Windows SMB native support for named pipes over the IPC$ share? From your example it would seem the users on both sides of the share would require the same AAA for your implementation as would be required to use IPC$ via SMB. If that is indeed the case, (I am not a Windows pr SMB expert, so perhaps you will tell me…

There are many other protocols besides SMB that can be used to share a file. Webdav, ftp, nfs, two systems accessing a third file share, shared folders in a VM, ... Or a file share provided by RDP like in the example, which does not include the IPC share as far as I know.

A classic is dd over nc

https://www.ndchost.com/wiki/server-administration/netcat-ov...

The main trick is to do it over UDP to get speed like Aspera:

https://www.ibm.com/products/aspera

Re: Show HN: Tunnelling TCP through a file

#15

Neat idea. For better performance, you might want to use native filesystem APIs, for example on windows use CreateFile with the FILE_WRITE_THROUGH flag to prevent caching and and extra flushing.

I think you can use named pipes if you are using SMB. Here is a example code in python (not tested). import socket import win32pipe import win32file import sys BUFFER_SIZE = 4096 def create_pipe(pipe_name): return win32pipe.CreateNamedPipe(pipe_name, win32pipe.PIPE_ACCESS_DUPLEX, win32pipe.PIPE_TYPE_BYTE | win32pipe.PIPE_READMODE_BYTE | win32pipe.PIPE_WAIT, 1, BUFFER_SIZE, BUFFER_SIZE, 0, None) def open_pipe(pipe_nam…

You wrote all that without testing anything? Oh you used ChatGPT probably

Re: Show HN: Tunnelling TCP through a file

#16
post #10

What's the benefit of this over netcat + mkfifo?

netcat+mkfifo does the actual transfer with TCP - so there's no tunneling involved. This solution tunnels tcp through file abstraction, so it works significantly differently. As for the uses, see the three author listed. For example, by using a file share as transport you may evade firewall.

  mkfifo /mnt/shared/connection
  nc localhost 12345 > /mnt/shared/connection 
Seems the same?

Re: Show HN: Tunnelling TCP through a file

#17
reminds me how the other day I circumvented disabled SSH port forwarding by using https://github.com/nwtgck/yamux-cli + ncat already on the machine to do something like: yamux -l lport | ssh server -- .sh

good thing I needed HTTP access or else i had to find that socks5 server that's actually working again.

Re: Show HN: Tunnelling TCP through a file

#18
Feature request: TCP over Facebook Messenger, TCP over Whatsapp

For use on flights where they give you "messenger only" internet access.

Feature request: TCP over JPEG cat pictures on HTTP port 80

It would likely do a better job at circumventing the China firewall than existing VPNs that can be flagged as VPN protocols.

Re: Show HN: Tunnelling TCP through a file

#19
post #18

Feature request: TCP over Facebook Messenger, TCP over Whatsapp For use on flights where they give you "messenger only" internet access. Feature request: TCP over JPEG cat pictures on HTTP port 80 It would likely do a better job at circumventing the China firewall than existing VPNs that can be flagged as VPN protocols.

> on flights

You could just sniff the traffic for an already-logged-in MAC and clone it.

Post reply on HN