nuclei-templates/javascript/enumeration/minecraft-enum.yaml

51 lines
1.5 KiB
YAML
Raw Normal View History

2024-04-02 12:28:48 +00:00
id: minecraft-enum
info:
name: Minecraft - enum
author: pussycat0x
severity: info
description: |
Minecraft server for some basic information about the host.The information that is queried is the Description, Maximum Number of Players, number of Online Players, Version number, and Protocol Number
reference:
- https://github.com/sjhilt/Nmap-NSEs/blob/master/minecraft-info.nse
metadata:
verified: true
2024-04-02 12:28:48 +00:00
max-request: 1
shodan-query: product:"Minecraft"
2024-06-23 06:25:13 +00:00
tags: js,network,minecraft,enum
2024-04-02 12:28:48 +00:00
javascript:
2024-06-23 06:25:13 +00:00
- pre-condition: |
isPortOpen(Host,Port);
2024-04-02 12:28:48 +00:00
- code: |
let data = "fe01"
let c = require("nuclei/net");
let conn = c.Open('tcp', `${Host}:${Port}`);
conn.SendHex(data);
let response = conn.RecvString();
2024-06-23 06:25:13 +00:00
let cleanedResponse = response.replace(/\x00/g, '');
const version = cleanedResponse.slice(16, 30).replace(/(\d+)(\d{1})(\d+)/, "$1.$2.$3");
const description = cleanedResponse.slice(30, -4);
const onlinePlayers = cleanedResponse.slice(-1);
const maxPlayers = cleanedResponse.slice(-3);
2024-04-02 12:28:48 +00:00
Export("Version: ", version , " Description:", description ," Online Players:", onlinePlayers, " Maximum Players:", maxPlayers)
args:
Host: "{{Host}}"
Port: 25565
matchers:
- type: dsl
dsl:
- "success == true"
2024-05-24 10:11:23 +00:00
- type: word
2024-05-24 10:02:57 +00:00
words:
- "HTTP/1.1"
negative: true
2024-04-02 12:28:48 +00:00
extractors:
- type: dsl
dsl:
- response