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 max-request: 1 shodan-query: product:"Minecraft" tags: js,network,minecraft,enum javascript: - pre-condition: | isPortOpen(Host,Port); - code: | let data = "fe01" let c = require("nuclei/net"); let conn = c.Open('tcp', `${Host}:${Port}`); conn.SendHex(data); let response = conn.RecvString(); 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); Export("Version: ", version , " Description:", description ," Online Players:", onlinePlayers, " Maximum Players:", maxPlayers) args: Host: "{{Host}}" Port: 25565 matchers: - type: dsl dsl: - "success == true" - type: word words: - "HTTP/1.1" negative: true extractors: - type: dsl dsl: - response # digest: 4a0a004730450220298b3f107f118db777907a4c1ae4ae7b4f145f9b0e616442fcc13058a48c11c5022100fb80447d42c349da17cad3edde3c0d5dcc3d0bb963c6c6e64780051ce306b780:922c64590222798bb761d5b6d8e72950