Introduction
Networking challenges are some of the most common in picoCTF. They appear across nearly every category: general skills challenges where you must connect to a service and read output, web exploitation where you craft HTTP requests with specific headers or cookies, and forensics where you analyze captured network traffic in a pcap file. Even binary exploitation challenges are usually remote -- you exploit a service running on a server, not a local binary.
The good news is that five tools cover the vast majority of what you will need: netcat for raw TCP connections, curl for HTTP requests, Wireshark (and its CLI sibling tshark) for pcap analysis, nmap for port discovery, and your browser's built-in DevTools for inspecting and manipulating web requests without installing anything at all.
This guide shows the exact commands you will use in a CTF context, with examples drawn from real picoCTF challenges. Each tool section links directly to the challenge where it was the key to finding the flag.
netcat (nc)
netcat (the nc command) is the simplest way to open a raw TCP connection to a challenge server. When picoCTF says "connect with nc challenge.picoctf.org 12345" this is the tool they mean. It sends everything you type to the server and prints everything the server sends back -- nothing more, nothing less.
Install
sudo apt install netcat-openbsd # Debian / Ubuntu / Kali# macOS: nc is pre-installed
Connecting to a challenge service
# Basic connectionnc challenge.picoctf.org 12345# With a timeout (exit if idle for 5 seconds)nc -w 5 challenge.picoctf.org 12345# Pipe a pre-written answer directly into ncecho '42' | nc challenge.picoctf.org 12345# Pipe a multi-line payload filenc challenge.picoctf.org 12345 < payload.txt
Listening mode (for reverse shells)
Some challenges involve getting a server to connect back to you. netcat can listen on a local port and accept that incoming connection.
# Listen on port 4444 and print anything that connectsnc -lvnp 4444# -l listen mode# -v verbose (print connection info)# -n numeric only (no DNS lookup)# -p port number
curl
curl is an HTTP Swiss Army knife. It sends arbitrary HTTP requests from the command line, including custom headers, cookies, POST bodies, and form data. In web exploitation challenges, curl lets you craft exactly the request the challenge expects -- something a regular browser may not allow you to do easily.
Install
sudo apt install curl # usually pre-installed on Kali and Ubuntu
Basic GET and POST requests
# Simple GET requestcurl http://challenge.picoctf.org:8080/# Follow redirects (important for login flows)curl -L http://challenge.picoctf.org:8080/# POST with form datacurl -X POST http://challenge.picoctf.org:8080/login \-d 'username=admin&password=secret'# POST with JSON bodycurl -X POST http://challenge.picoctf.org:8080/api \-H 'Content-Type: application/json' \-d '{"username": "admin", "password": "secret"}'
Setting cookies and headers
# Send a specific cookie valuecurl http://challenge.picoctf.org:8080/flag \-b 'admin=true'# Multiple cookiescurl http://challenge.picoctf.org:8080/flag \-b 'session=abc123; role=admin'# Custom header (e.g. a secret header the server checks)curl http://challenge.picoctf.org:8080/flag \-H 'X-Secret-Header: picoCTF'# Combine: POST with cookie and custom headercurl -X POST http://challenge.picoctf.org:8080/submit \-H 'Content-Type: application/x-www-form-urlencoded' \-b 'admin=1' \-d 'answer=flag'
Inspecting response headers
# Show response headers onlycurl -I http://challenge.picoctf.org:8080/# Show both headers and bodycurl -i http://challenge.picoctf.org:8080/# Save cookies from the server for reusecurl -c cookies.txt http://challenge.picoctf.org:8080/login \-d 'user=admin&pass=admin'# Send those saved cookies in the next requestcurl -b cookies.txt http://challenge.picoctf.org:8080/flag
Challenges that use curl
Wireshark / tshark
Wireshark is the standard GUI tool for analyzing packet captures (pcap files). Forensics challenges often provide a .pcap or .pcapng file containing recorded network traffic and ask you to find the flag hidden somewhere inside it -- in an HTTP response body, a DNS query, an FTP download, or a TCP stream.
tshark is Wireshark's command-line counterpart. It reads the same pcap files but outputs text, making it scriptable and usable on servers without a graphical desktop.
Install
# Wireshark (GUI)sudo apt install wireshark# tshark (CLI, part of the wireshark package)sudo apt install tshark
tshark: CLI analysis
# List all packets (summary view)tshark -r capture.pcap# Filter for HTTP traffic onlytshark -r capture.pcap -Y 'http'# Show only source IP, destination IP, and HTTP URItshark -r capture.pcap -Y 'http.request' \-T fields -e ip.src -e ip.dst -e http.request.uri# Extract all HTTP response bodiestshark -r capture.pcap -Y 'http.response' \-T fields -e http.file_data# Search for the flag string across all packetstshark -r capture.pcap -Y 'frame contains "picoCTF"'
Wireshark GUI: following a TCP stream
The most useful Wireshark feature for CTF work is Follow TCP Stream. It reassembles all the packets in a single TCP connection and shows the full conversation as readable text -- perfect for HTTP, FTP, or custom protocols.
- Open the pcap via File > Open.
- In the filter bar, type
tcporhttpto narrow the packet list. - Right-click any packet in an interesting stream and choose Follow > TCP Stream.
- The popup shows the full conversation. Red text is client-to-server; blue is server-to-client. Use Save as to export just the server-side data if it is a binary file.
- Use
Ctrl+Finside the stream view to search forpicoCTF.
Useful Wireshark display filters
http # all HTTP traffichttp.request.method == "POST" # POST requests onlydns # all DNS queries and responsesftp || ftp-data # FTP control and data channelstcp.stream eq 0 # first TCP stream onlyframe contains "pico" # any packet containing the string 'pico'
Challenges that use Wireshark
nmap
nmap is a network port scanner. In most picoCTF challenges the host and port are given to you directly, so nmap is not always necessary. But it becomes essential when a challenge says only "connect to this IP address" and you need to discover which ports are open and what services are running on them.
Install
sudo apt install nmap # pre-installed on Kali Linux
Basic scanning
# Scan the 1000 most common ports (fast, good starting point)nmap challenge.picoctf.org# Service and version detection (-sV) on all 65535 portsnmap -sV -p- challenge.picoctf.org# Scan a specific port onlynmap -p 8080 challenge.picoctf.org# OS detection + service detection (requires root)sudo nmap -O -sV challenge.picoctf.org# Aggressive scan: OS, version, scripts, traceroutesudo nmap -A challenge.picoctf.org
Reading nmap output
nmap prints a table of open ports with the service name and version it detected. Focus on the STATE column: open means the port is reachable. The SERVICE column tells you what protocol to use -- if it says http, open it in a browser or curl; if it says ssh, connect with ssh; an unknown service can be probed with nc.
# Example nmap output:PORT STATE SERVICE VERSION22/tcp open ssh OpenSSH 8.980/tcp open http Apache httpd 2.4.528080/tcp open http Werkzeug httpd 2.3 (Python 3.10)# Result: three services to explore# -> port 80 and 8080 in browser/curl# -> port 22 with: ssh user@challenge.picoctf.org
-T4 for faster timing or --min-rate 1000 to send at least 1000 packets per second. Be aware that aggressive scans may trigger rate limiting on picoCTF servers.Browser DevTools
Every modern browser ships with a powerful suite of developer tools -- and for many web exploitation challenges, these are all you need. No installation required. Press F12 (or Cmd+Option+I on macOS) in Chrome, Firefox, or Edge to open them.
Network tab: inspecting requests
The Network tab records every HTTP request the page makes. This is where you find hidden API calls, see exactly what cookies and headers the browser sends, and inspect full request/response bodies.
- Open DevTools and go to the Network tab.
- Reload the page (the tab must be open before the page loads to capture all requests).
- Click any request to see its Headers, Payload, and Response panels.
- Right-click a request and choose Copy > Copy as cURL to get a ready-to-run curl command with all headers and cookies filled in.
Application tab: editing cookies
The Application tab (Chrome) or Storage tab (Firefox) shows cookies, localStorage, and sessionStorage. You can double-click any cookie value and edit it directly -- no curl needed.
- Go to Application > Cookies > [your domain].
- Find the relevant cookie (e.g.
admin,role,session). - Double-click the Value cell and type the new value.
- Reload the page -- the server now sees your modified cookie.
Console tab: running JavaScript
The Console tab lets you execute arbitrary JavaScript in the context of the current page. This is useful for reading cookie values, interacting with page elements, or decoding data embedded in the page source.
// Read all cookiesdocument.cookie// Decode a base64 string found in the page sourceatob('cGljb0NURntmbGFnfQ==')// Submit a form field you can't normally editdocument.querySelector('input[name=admin]').value = 'true';document.querySelector('form').submit();
Challenges that use DevTools
Quick reference
Not sure which tool to reach for? Use this card grid as a decision guide based on the challenge type.
Use case: TCP service challenges
Technique: Raw TCP connection, piping payloads
Use case: Web / HTTP challenges
Technique: Custom headers, cookies, POST bodies
Use case: pcap / pcapng files
Technique: GUI packet analysis, stream following
Use case: pcap / pcapng files
Technique: CLI packet filtering and field extraction
Use case: Unknown challenge hosts
Technique: Port and service discovery
Use case: Web / HTTP challenges
Technique: Cookie editing, request inspection, JS console
Recommended first-pass workflow for a networking challenge
- If given a host and port with no protocol hint, try
nc host portfirst. The banner will tell you what protocol to use. - If it is HTTP (port 80, 8080, or a URL is given), open it in a browser first and inspect with DevTools. Look at cookies, page source, and network requests.
- If you need to set specific headers or automate requests, switch to curl. Use
Copy as cURLfrom DevTools to get a baseline command. - If you receive a pcap file, open it in Wireshark, filter for
httpfirst, and use Follow TCP Stream on any interesting session. Usetshark -r file.pcap -Y 'frame contains "pico"'to quickly grep for the flag. - If you only have an IP address and need to discover services, run
nmap -sV ipto identify open ports.