mirror of
https://github.com/nmap/nmap.git
synced 2026-11-15 10:47:29 +00:00
Some checks are pending
nmap multiplatform autobuilds / build (arm64, gcc, ubuntu-latest-gcc-arm64, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, freebsd-15-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-15-clang, macos-15) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, macos-26-clang, macos-26) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, netbsd-10-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, openbsd-7-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, solaris-11-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (clang, ubuntu-latest-clang, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (egcc, openbsd-7-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, freebsd-15-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, netbsd-10-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, solaris-11-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (gcc, ubuntu-latest-gcc, ubuntu-latest) (push) Waiting to run
nmap multiplatform autobuilds / build (msvc, windows-latest-msvc, windows-latest) (push) Waiting to run
60 lines
1.6 KiB
Lua
60 lines
1.6 KiB
Lua
local amqp = require "amqp"
|
|
local nmap = require "nmap"
|
|
local shortport = require "shortport"
|
|
local stdnse = require "stdnse"
|
|
|
|
description = [[
|
|
Gathers information (a list of all server properties) from an AMQP (advanced message queuing protocol) server.
|
|
|
|
See http://www.rabbitmq.com/extensions.html for details on the
|
|
<code>server-properties</code> field.
|
|
]]
|
|
|
|
---
|
|
-- @usage
|
|
-- nmap --script amqp-info -p5672 <target>
|
|
---
|
|
-- @output
|
|
-- 5672/tcp open amqp
|
|
-- | amqp-info:
|
|
-- | capabilities:
|
|
-- | publisher_confirms: YES
|
|
-- | exchange_exchange_bindings: YES
|
|
-- | basic.nack: YES
|
|
-- | consumer_cancel_notify: YES
|
|
-- | copyright: Copyright (C) 2007-2011 VMware, Inc.
|
|
-- | information: Licensed under the MPL. See http://www.rabbitmq.com/
|
|
-- | platform: Erlang/OTP
|
|
-- | product: RabbitMQ
|
|
-- | version: 2.4.0
|
|
-- | mechanisms: PLAIN AMQPLAIN
|
|
-- |_ locales: en_US
|
|
|
|
author = "Sebastian Dragomir"
|
|
|
|
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
|
|
|
categories = {"default", "discovery", "safe", "version"}
|
|
|
|
|
|
portrule = shortport.version_port_or_service(5672, {"amqp", "amqps"}, "tcp", "open")
|
|
|
|
action = function(host, port)
|
|
local cli = amqp.AMQP:new( host, port )
|
|
|
|
local status, data = cli:connect()
|
|
if not status then return "Unable to open connection: " .. data end
|
|
|
|
status, data = cli:handshake()
|
|
if not status then return data end
|
|
|
|
cli:disconnect()
|
|
|
|
port.version.name = "amqp"
|
|
port.version.product = cli:getServerProduct()
|
|
port.version.extrainfo = cli:getProtocolVersion()
|
|
port.version.version = cli:getServerVersion()
|
|
nmap.set_port_version(host, port)
|
|
|
|
return stdnse.format_output(status, cli:getServerProperties())
|
|
end
|