Skip to content
Afa' Afa'

Create a fake TCP server

Open a throwaway TCP server with netcat and connect a client to it.

1 min read Updated

netcat can stand in for a TCP server when you only need something to connect to. This snippet opens a listener on port 5000 and connects a client to it. The commands are below.

See https://www.cyberciti.biz/faq/linux-unix-open-ports/

fake-tcp-server.sh

bash
# create server
nc -l 5000

# connect to server
nc localhost 5000
Something wrong or want to discuss this article? Get in touch

Search articles and projects

Type to filter articles and projects. Use the arrow keys to move through results and Enter to open one. Press Escape to close.