Service:
X.Org Server (X11)Protocol:
TCPPort:
6000Used for:
The X11 (X Window System) graphical display server on Unix and LinuxPort 6000 is the default port for the X11 (X Window System) display server on Unix and Linux — the process that draws windows, and reads the keyboard and mouse, for a graphical desktop. X uses a client–server model: applications are clients that connect to the display server and ask it to render output and hand back input. Each local display maps to its own port, starting at 6000 (:0 = 6000, :1 = 6001, up through 6063), so the whole X range is 6000–6063/TCP. The reason an exposed port 6000 matters so much is what a connection to it grants: if the server accepts the connection and access control is weak or off, the client controls the entire graphical session — every keystroke, every pixel, the clipboard, and synthetic input.
Why It’s Open
X11 is the display server behind most Unix and Linux desktops, so port 6000 is bound whenever an X session is running. Historically the server also listened on TCP so applications could be displayed across the network — a single X terminal or thin client rendering programs that actually ran on a central host. You still see that pattern in research clusters, HPC and lab environments, universities, CAD/EDA workstations, and older thin-client deployments.
What changed is the default. Modern distributions start the X server with -nolisten tcp, so port 6000 is bound to a local Unix socket only and never answers on the network. When you do find 6000 open to other hosts, it usually means an old setup, a display manager configured to allow TCP, or someone ran xhost + to “make remote GUI work” — all of which turn a local desktop into a network-reachable one. For remote graphical access the safe path is tunneling X over SSH on port 22, or a purpose-built remote-desktop protocol like VNC on port 5900 or RDP on port 3389 — not raw X11 on the wire.
Common Risks
- Open, unauthenticated display — full session takeover. This is the signature X11 finding. If the server allows TCP connections and access control is disabled (
xhost +, or a missing/empty.Xauthoritywith no MIT-MAGIC-COOKIE-1), any host that reaches 6000 gets complete control of the graphical session. That is not a partial leak — it is the whole desktop. - Keystroke logging. A connected client can register for input events and record everything the user types, including passwords and sudo prompts, with tools like
xspy. - Screenshot and screen capture.
xwddumps the root window or any window to an image;xwatchwinstreams a live view of the desktop. An attacker watches the session in real time. - Keystroke and command injection.
xdotoolsynthesises keyboard and mouse events, so an attacker can open a terminal in the victim’s session and type commands — turning display access into code execution as that user. - Clipboard theft. X selections (the clipboard) are readable by any connected client, exposing whatever the user copied.
- Recon and information disclosure.
xdpyinforeveals the server vendor, version, and screen geometry; whether the server listens on0.0.0.0versus a local socket tells an attacker immediately whether the display is reachable.
Want to save time on reporting?
Let PentestPad generate, track, and export your reports - automatically.

Enumeration & Testing
Detect the service and grab the version
nmap -sV -p 6000 <target>Check whether the display accepts unauthenticated clients
nmap -p 6000 --script=x11-access <target>Query the server (vendor, version, screen geometry)
xdpyinfo -display <target>:0Scan a range for open X servers with Metasploit
msfconsole -quse auxiliary/scanner/x11/open_x11set RHOSTS <target>runCapture a screenshot of an open display
xwd -display <target>:0 -root -out screenshot.xwd# view or convert the dumpxwud -in screenshot.xwd # or: convert screenshot.xwd screenshot.pngLog keystrokes from an open display
xspy -display <target>:0Inject keystrokes into the session
xdotool key --display <target>:0 ctrl+alt+t # open a terminal, then type into itRecord every open display, whether access control is on, and any input or screen data you can pull, so the evidence lands in the pentest report instead of a scratch terminal you’ll lose.
What to Look For
| Checkpoint | What it means |
|---|---|
x11-access reports access granted |
Open, unauthenticated display — screenshot, keylog, and inject are all possible |
xhost + in a startup or session script |
Access control disabled for every host on the network |
Server listening on 0.0.0.0:6000 |
Display is network-reachable; it should be a local Unix socket only |
Missing or empty .Xauthority / no MIT-MAGIC-COOKIE-1 |
Authentication weak or absent |
No -nolisten tcp in the server args |
TCP transport is enabled — the modern default is off |
| Displays 6001–6063 also answering | Extra X displays widen the attack surface |
Known CVEs and Exploits
The most damaging X11 exposure — an open, unauthenticated display — is a configuration problem, not a software bug, and it has carried the identifier CVE-1999-0526 (“X server access control disabled, e.g. xhost +”) since the 1990s. There is no patch for it; you fix it by turning access control back on. Separately, the X.Org server has a cluster of real memory-safety CVEs — verify the build in front of you against each:
- CVE-2023-6478 — Integer overflow in the
RRChangeProviderProperty/RRChangeOutputPropertyhandlers of xorg-server (and XWayland/TigerVNC), leading to out-of-bounds read and information disclosure. NVD scores it 7.5 HIGH with a network attack vector (AV:N) — the case that matters when the X protocol is actually reachable. - CVE-2023-6377 — Out-of-bounds read/write in XKB button-action handling in X.Org Server up to 21.1.10 and XWayland up to 23.2.3. Enables local privilege escalation, or possible remote code execution where X11 forwarding is involved. CVSS 7.8 HIGH.
- CVE-2024-31083 — Use-after-free in
ProcRenderAddGlyphs()in the Xorg server; an authenticated client can craft a request that leads to arbitrary code execution. CVSS 7.8 HIGH. - CVE-2020-14345 — Out-of-bounds access in
XkbSetNamesin X.Org Server before 1.20.9, leading to privilege escalation. CVSS 7.8 HIGH.
For the open-display case itself, the ready-made tooling is Metasploit’s auxiliary/scanner/x11/open_x11 scanner and the xspy / xwd / xwatchwin / xdotool utilities above — no CVE required, because nothing is being exploited except a permissive configuration.
Mitigation
- Don’t expose X11 to the network. Keep the server started with
-nolisten tcpso port 6000 stays on a local Unix socket. This is the default on modern distros — verify it wasn’t overridden. - Use SSH X11 forwarding for remote GUI. Tunnel the X protocol through SSH on port 22 (
ssh -X), which encrypts the session and never puts 6000 on the wire. - Never run
xhost +. It disables access control for all hosts. Use host- or user-scoped grants only when unavoidable, and prefer cookie-based auth. - Use MIT-MAGIC-COOKIE-1 /
xauth. Keep a valid.Xauthorityso clients must present a cookie to connect. - Firewall the X range. Block 6000–6063/TCP at the host and perimeter so stray displays aren’t reachable.
- Patch X.Org. Keep xorg-server current to close the memory-safety CVEs above.
- Prefer Wayland where possible. Its per-client isolation removes most of the “any client can spy on any other” surface that X11’s design permits.
Real-World Example
The open-X11 problem is old and stubborn. It was catalogued as CVE-1999-0526 in the 1990s, and it still turns up on shared lab machines, HPC login nodes, and CI/build hosts where someone ran xhost + to get a remote GUI working and never undid it. The attack chain is trivial once a display is open: an x11-access scan (or Metasploit’s open_x11) confirms the server accepts anonymous clients, xwd pulls a screenshot to prove access, xspy records the keystrokes — capturing passwords as they’re typed — and xdotool opens a terminal in the victim’s own session to run commands as that user. No exploit, no CVE, no privilege escalation needed: a single misconfiguration on port 6000 hands over the entire desktop. That is exactly why disabling TCP listening and using SSH forwarding, rather than hardening an exposed X server in place, is the right fix.
FAQ
What is port 6000 used for?
Port 6000 is the default port for the X11 (X Window System) display server — the process that renders the graphical desktop and handles keyboard and mouse input on Unix and Linux. Each additional display uses the next port (6001, 6002, …) up through 6063.
Is port 6000 dangerous?
It’s dangerous when it’s reachable from the network and access control is weak or disabled. An open X display lets any host that connects capture screenshots, log keystrokes, read the clipboard, and inject commands into the session — full control of the desktop. On a local-only socket with -nolisten tcp, it’s a normal part of a running desktop and not exposed.
What service runs on port 6000?
The X11 display server, usually the X.Org Server (Xorg). Applications connect to it as clients to draw windows and receive input. For remote graphical access, X should be tunnelled over SSH (port 22) rather than exposed directly on 6000.
How do I secure or close port 6000?
Start the X server with -nolisten tcp so it doesn’t bind to the network, use SSH X11 forwarding for remote sessions, never run xhost +, keep a valid .Xauthority (MIT-MAGIC-COOKIE-1), and firewall 6000–6063. After the change, rescan with nmap -p 6000 <target> to confirm the port no longer answers.
TL;DR
- Service: X11 (X Window System) display server — X.Org
- Default port: 6000/TCP (6000 + display number; the range is 6000–6063)
- Biggest risk: an open, unauthenticated display → keystroke logging, screenshots, and command injection = full desktop compromise
- Mitigation: keep
-nolisten tcp, use SSH X11 forwarding, neverxhost +, use xauth/MIT cookies, firewall 6000–6063, patch X.Org, prefer Wayland