Skip to content

Commit

Permalink
Merge pull request #10444 from projectdiscovery/pussycat0x-patch-12
Browse files Browse the repository at this point in the history
Create x11-unauth-access.yaml
  • Loading branch information
DhiyaneshGeek authored Aug 1, 2024
2 parents d56fcf1 + 8bf5b35 commit 655a31a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions javascript/misconfiguration/x11/x11-unauth-access.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
id: x11-unauth-access

info:
name: x11 - Unauthenticated Access
author: pussycat0x
severity: high
description: |
To check if you can connect to a remote X server, send an X11 initial connection request to TCP port 6000+n (where n is the display number). The response success byte (0x00 or 0x01) indicates if you are allowed; if successful, the script will display "X server access is granted," confirming that an attacker can connect to the X server
reference:
- https://nmap.org/nsedoc/scripts/x11-access.html
- https://book.hacktricks.xyz/network-services-pentesting/6000-pentesting-x11
- https://www.hackingarticles.in/penetration-testing-on-x11-server/
metadata:
shodan-query: "Open X Server:"
verified: true
max-request: 1
tags: x11,network,js,remote,unauth

javascript:
- pre-condition: |
isPortOpen(Host,Port);
code: |
let packet = bytes.NewBuffer();
const c = require("nuclei/net");
const cmd = "l\u0000\u000b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
packet.WriteString(cmd)
let conn = c.Open('tcp', `${Host}:${Port}`);
conn.SendHex(packet.Hex());
const result = conn.RecvFull();
let accessGranted;
if (result[0] === 1) {
accessGranted = true;
} else {
conn.Close();
}
accessGranted
args:
Host: "{{Host}}"
Port: 6000
matchers:
- type: dsl
dsl:
- response

0 comments on commit 655a31a

Please sign in to comment.