Hacking Tools

File Tunnel – Innovative TCP Connection Tunneling via Files

A powerful tool designed to tunnel TCP connections through a file. Ideal for circumventing firewalls and establishing secure network links, File Tunnel leverages shared file systems to enable seamless communication between hosts.

This article delves into practical uses, setup examples, and the underlying technology that makes it all possible.

Host A

ft.exe -L 5000:127.0.0.1:3389 --write "\\server\share\1.dat" --read "\\server\share\2.dat"

This command listens for connections on port 5000. When one is received, it is forwarded through the file tunnel and then onto 127.0.0.1:3389.

Host B

ft.exe --read "\\server\share\1.dat" --write "\\server\share\2.dat"

Now on Host A, connect the client to 127.0.0.1:5000 and it will be forwarded to the remote server.

Example 2 – Tunnel TCP Through RDP (Similar To SSH Tunnel)

You’d like to connect to a remote service (eg. 192.168.1.50:8888), but only have access to Host B using RDP.

Host A

ft.exe -L 5000:192.168.1.50:8888 --write "C:\Temp\1.dat" --read "C:\Temp\2.dat"

Run an RDP client and ensure local drives are shared as shown here.

RDP to Host B.

Host B

ft.exe --read "\\tsclient\c\Temp\1.dat" --write "\\tsclient\c\Temp\2.dat"

Now on Host A, you can connect to 127.0.0.1:5000 and it will be forwarded to 192.168.1.50:8888

Other Interesting Features

  • -L can be used multiple times, to forward numerous ports through the one tunnel.
  • To enable other computers to use the tunnel, specify a binding address of 0.0.0.0. For example: -L 0.0.0.0:5000:192.168.1.50:3389 allows any computer on the network to connect to the tunnel and onto 192.168.1.50:3389
  • Use -R for remote forwarding. For example: -R 5000:10.0.0.50:6000 instructs the remote side to listen on port 5000, and when a connection is received forward it through the tunnel and onto 10.0.0.50:6000 via the local machine. This allows you to share a server running on your local machine, with other computers.
  • The read and write files don’t have to be in the same folder or even server.

How Does It Work?

The program starts a TCP listener, and when a connection is received it writes the TCP data into a file. This same file is read by the counterpart program, which establishes a TCP connection and onforwards the TCP data.

To avoid the shared file growing indefinitely it is purged whenever it gets larger than 10 MB.

Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

1 week ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

2 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

2 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

3 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

3 weeks ago

MaLDAPtive – Pioneering LDAP SearchFilter Parsing And Security Framework

MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…

3 weeks ago