fiddyschmitt / file-tunnel Goto Github PK
View Code? Open in Web Editor NEWTunnel TCP connections through a file
License: MIT License
Tunnel TCP connections through a file
License: MIT License
Errors are appearing during working of the tunnel, and the connection is down (version 2.0.0 and v1.0.6 too)
Closed relay. Unknown stream -> 1.dat
Closed relay. 2.dat -> Unknown stream
This is real magic. By adding com-port support, you will save the world from the pain of incredibly slow forwarded com ports. Thanks for your work.))
Thanks!
First, great initiative! This is exactly what I was looking for ;)
So, the scenario is that I have a close to air gapped machine which needs to download updates, but I have an RDP connection to it.
I run ft on this machine with:
ft.exe --read \\tsclient\c\temp\2.dat --tcp-listen 10.0.0.131:8080 --write \\tsclient\c\temp\1.dat
On my side I have access to a proxy which I want to relay to, and I start ft with:
ft.exe --read c:\Temp\1.dat --tcp-connect myproxy.local:8080 --write c:\Temp\2.dat
Initially everything goes well, but then eventually I get this on the air gapped machine:
2024-02-22 09:43:18: File Tunnel 1.0.1
2024-02-22 09:43:18: Will listen to: 10.0.0.131:8080
2024-02-22 09:43:18: and forward to: \\tsclient\c\temp\1.dat
2024-02-22 09:43:18: and read responses from: \\tsclient\c\temp\2.dat
2024-02-22 09:43:18: Listening on 10.0.0.131:8080
2024-02-22 09:43:18: Read file existed, so seeked to 0 in \\tsclient\c\temp\2.dat
2024-02-22 09:43:18: 2024-02-22 09:43:18: Accepted connection from 10.0.0.132:56157
2024-02-22 09:43:19: Write file existed, so seeked to 0 in \\tsclient\c\temp\1.dat
2024-02-22 09:43:19: 10.0.0.132:56157 -> 10.0.0.131:8080 -> 1.dat 302 bytes.
2024-02-22 09:43:20: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56157 324 bytes.
2024-02-22 09:43:20: Closed relay. 10.0.0.132:56157 -> 10.0.0.131:8080 -> 2.dat
2024-02-22 09:43:20: Closed relay. 2.dat -> 10.0.0.132:56157 -> 10.0.0.131:8080
2024-02-22 09:43:21: Was asked to tear down connection 0
2024-02-22 09:43:21: Closed relay. 10.0.0.132:56157 -> 10.0.0.131:8080 -> 2.dat
2024-02-22 09:43:21: Closed relay. 2.dat -> 10.0.0.132:56157 -> 10.0.0.131:8080
2024-02-22 09:43:32: 2024-02-22 09:43:32: Accepted connection from 10.0.0.132:56158
2024-02-22 09:43:32: 10.0.0.132:56158 -> 10.0.0.131:8080 -> 1.dat 302 bytes.
2024-02-22 09:43:32: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56158 326 bytes.
2024-02-22 09:43:32: Closed relay. 10.0.0.132:56158 -> 10.0.0.131:8080 -> 2.dat
2024-02-22 09:43:32: Closed relay. 2.dat -> 10.0.0.132:56158 -> 10.0.0.131:8080
2024-02-22 09:43:32: Was asked to tear down connection 1
2024-02-22 09:43:32: Closed relay. 10.0.0.132:56158 -> 10.0.0.131:8080 -> 2.dat
2024-02-22 09:43:32: Closed relay. 2.dat -> 10.0.0.132:56158 -> 10.0.0.131:8080
2024-02-22 09:43:43: 2024-02-22 09:43:43: Accepted connection from 10.0.0.132:56161
2024-02-22 09:43:43: 10.0.0.132:56161 -> 10.0.0.131:8080 -> 1.dat 377 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 33 750 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 6 750 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 27 000 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 9 450 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 6 750 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 27 000 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 21 600 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 8 100 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 25 650 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 20 250 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 8 100 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 4 050 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 21 600 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 2 700 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 31 050 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 2 700 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 9 450 bytes.
2024-02-22 09:43:43: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 1 350 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 10 800 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 24 300 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 31 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 31 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 8 100 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 4 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 2 700 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 9 450 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 2 700 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 9 450 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 43 200 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 31 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 6 750 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 8 100 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 4 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 4 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 8 100 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 6 750 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 43 200 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 14 850 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 2 700 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 131 000 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 14 800 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 12 150 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 4 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 8 100 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 2 700 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 9 450 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 4 050 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 8 100 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 5 400 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 6 750 bytes.
2024-02-22 09:43:44: 2.dat -> 10.0.0.131:8080 -> 10.0.0.132:56161 131 000 bytes.
2024-02-22 09:43:44: Was asked to purge connection 2 \\tsclient\c\temp\2.dat
2024-02-22 09:43:44: Truncating file, attempt 1: \\tsclient\c\temp\2.dat
2024-02-22 09:43:44: System.IO.IOException: Not enough memory resources are available to process this command. : \\tsclient\c\temp\2.dat
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String, FileMode, FileAccess, FileShare, FileOptions)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable1 )
at System.IO.Strategies.OSFileStreamStrategy..ctor(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable 1)
at System.IO.Strategies.SyncWindowsFileStreamStrategy..ctor(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable 1)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable 1)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream, String, FileMode, FileAccess, FileShare, Int32, FileOptions, Int64, Nullable 1)
at System.IO.FileStream..ctor(String, FileStreamOptions)
at ft.Utilities.IOUtils.TruncateFile(String)
at ft.Streams.SharedFileManager.ReceivePump()
This seems to happen in ft.Utilities.IOUtils.TruncateFile while opening the FileStream.
I did try to implement a fix I found out there that is supposed to free up resources, but didn't find a way to link to WindowsBase.dll, so that never worked.
Dispatcher dispatcher = Dispatcher.CurrentDispatcher;
dispatcher.BeginInvokeShutdown(DispatcherPriority.Normal);
Dispatcher.Run();
No saying that this is the fix, just sharing what I've looked at.
Hello Fidel,
I have run into an Issue with Version 1.05
I have the file tunnel using my ramdisk, which is limited to a maximum of 1 or 2 GB currently in my configuration with a NTFS filesystem.
During longer session of transferring files and generally just working with this setup i ran into the following situation:
The filetunnel application was reporting no available disk space left at some point.
The partition in windows under local computer was showing to be completely 100% full.
The files themselves were displayed to be small on the view presented by explorer, but when clicking on the properties of the directory, it displayed a disk usage of the full gigabyte.
I will send some pictures later on. It was kind of late when i ran into this and just restarted everything to continue.
Best regards
Lennart
Currently, the Windows client does not allow connections to a non standard SMB port.
eg.
\\127.0.0.1:5000
But it may be possible in the future according to this article: https://techcommunity.microsoft.com/t5/storage-at-microsoft/smb-alternative-ports-now-supported-in-windows-insider/ba-p/3974509
Add an example when this is possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.