From 06cda4a25aaf22a85e7d2ff4bb14a6ed50c2f6dd Mon Sep 17 00:00:00 2001 From: pussycat0x <65701233+pussycat0x@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:58:48 +0530 Subject: [PATCH] Create minecraft-enum.yaml --- javascript/enumeration/minecraft-enum.yaml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 javascript/enumeration/minecraft-enum.yaml diff --git a/javascript/enumeration/minecraft-enum.yaml b/javascript/enumeration/minecraft-enum.yaml new file mode 100644 index 0000000000..2b5227d194 --- /dev/null +++ b/javascript/enumeration/minecraft-enum.yaml @@ -0,0 +1,42 @@ +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: + max-request: 1 + shodan-query: product:"Minecraft" + verified: true + tags: js,network,minecraft,enum + +javascript: + - code: | + let data = "fe01" + let c = require("nuclei/net"); + let conn = c.Open('tcp', `${Host}:${Port}`); + conn.SendHex(data); + let response = conn.RecvString(); + const version = response.slice(16, 30).replace(/(\d+)(\d{1})(\d+)/, "$1.$2.$3"); + const description = response.slice(30, -4); + const onlinePlayers = response.slice(-1); + const maxPlayers = response.slice(-3); + Export("Version: ", version , " Description:", description ," Online Players:", onlinePlayers, " Maximum Players:", maxPlayers) + + args: + Host: "{{Host}}" + Port: 25565 + + matchers: + - type: dsl + dsl: + - "success == true" + + extractors: + - type: dsl + dsl: + - response