what's a net cat?

Published: April 2, 2026

Description

Using netcat (nc) is going to be pretty important. Can you connect to the server at 2019shell1.picoctf.com port 4158 to get the flag?

Remote

Ensure netcat (nc) is installed on your system.

Connect to the challenge server -- the flag is printed immediately on connection.

nc 2019shell1.picoctf.com 4158

Solution

  1. Step 1Connect and read the flag
    Connecting with nc opens a raw TCP socket to the server. This particular server prints the flag the moment you connect and then closes the connection -- no input required.
    nc 2019shell1.picoctf.com 4158
    Learn more

    netcat (nc) is a networking utility that reads from and writes to network connections using TCP or UDP. It opens a raw socket connection to the target host and port, then bridges stdin/stdout to the socket -- anything typed goes to the server, and anything the server sends is printed to the terminal. It is called the "Swiss army knife" of networking tools.

    In CTF competitions, nc is used constantly: connecting to remote challenge servers that run custom binaries, interacting with TCP-based puzzles, and piping exploit scripts to remote services. The basic syntax is always nc hostname port. For TLS/SSL connections, use openssl s_client -connect hostname:port instead.

    netcat is available on virtually every Unix-like system. On Windows, ncat (from Nmap) or nc64.exe serve the same purpose. Common netcat variants include the traditional BSD netcat, OpenBSD netcat (which supports more features), and GNU netcat. The -v flag adds verbose connection output; -n skips DNS resolution; -z scans for open ports without sending data (useful for port scanning).

    • nc host port -- connect to host:port (client mode)
    • nc -l port -- listen for incoming connections (server mode)
    • nc -u host port -- use UDP instead of TCP
    • echo 'data' | nc host port -- send data and exit

Flag

picoCTF{...}

netcat opens raw TCP connections -- connecting to a challenge server that simply waits to print the flag is the simplest possible remote challenge.

More General Skills