Skip to content

Simple TCP Server to handle multiple reverse connection/sessions

License

Notifications You must be signed in to change notification settings

tajiknomi/TCPServerCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

netcat is mostly used for reverse connection but it's limited to handling only one connection at a time. This utility offers a more convenient way to manage multiple sessions within a single terminal, allowing you to listen for and handle incoming connections simultaneously.

How to build

cd TCPServerCLI && mkdir build && cd build
cmake ..
cmake --build . --config Release

You can specify the cmake-generator to create configuration files for your build system. some examples are given below

cmake -G "Visual Studio 16 2019" -A x64 ..
cmake -A x64 ..
cmake -A Win32 ..

Usage

TCPServerCLI.exe [PortNumber]

The tool accepts two commands

# Specify the [id] of the connected client/session
1) select client [id]

# Disconnect from client/session
2) exit

Screenshots

Waiting for clients to connect, two clients are shown below as connected

Alt text

Client 0 is selected for communication

Alt text

Upgrading a simple reverse shell to a fully interactive tty on client 1

Alt text

Note

It is better to use MINGW/GIT/WSL terminal because it can handle interactive shell for all OS's, while the native Windows command prompt i.e. cmd and PowerShell environments do not natively support PTYs in the same way as Linux. They use different mechanisms for terminal emulation and may not fully support all PTY features expected by applications like pty.spawn()

License

MIT