https://t.me/RX1948
Server : Apache/2.4.18 (Ubuntu)
System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
User : oppastar ( 1041)
PHP Version : 7.0.33-0ubuntu0.16.04.15
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Directory :  /usr/share/nmap/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/nmap/scripts/broadcast-netbios-master-browser.nse
local bit = require "bit"
local netbios = require "netbios"
local nmap = require "nmap"
local stdnse = require "stdnse"
local tab = require "tab"

description = [[
Attempts to discover master browsers and the domains they manage.
]]

---
-- @usage
-- nmap --script=broadcast-netbios-master-browser
--
-- @output
-- | broadcast-netbios-master-browser:
-- | ip            server        domain
-- |_10.0.200.156  WIN2K3-EPI-1  WORKGROUP
--

-- Version 0.1
-- Created 06/14/2011 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>

author = "Patrik Karlsson"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"broadcast", "safe"}


prerule = function() return true end

local function isGroup(flags) return ( bit.band(flags, 0x8000) == 0x8000 ) end

action = function()

  -- NBNS only works over ipv4
  if ( nmap.address_family() == "inet6") then return end

  local MASTER_BROWSER_DOMAIN = 0x1D
  local STD_WORKSTATION_SERVICE = 0x00
  local NBNAME = "\1\2__MSBROWSE__\2\1"
  local BROADCAST_ADDR = "255.255.255.255"

  local status, result = netbios.nbquery( { ip = BROADCAST_ADDR }, NBNAME, { multiple = true })
  if ( not(status) ) then return end

  local outtab = tab.new(3)
  tab.addrow(outtab, 'ip', 'server', 'domain')

  for _, v in ipairs(result) do
    local status, names, _ = netbios.do_nbstat(v.peer)
    local srv_name, domain_name
    if (status) then
      for _, item in ipairs(names) do
        if ( item.suffix == MASTER_BROWSER_DOMAIN and not(isGroup(item.flags)) ) then
          domain_name = item.name
        elseif ( item.suffix == STD_WORKSTATION_SERVICE and not(isGroup(item.flags)) ) then
          srv_name = item.name
        end
      end
      if ( srv_name and domain_name ) then
        tab.addrow(outtab, v.peer, srv_name, domain_name)
      else
        stdnse.debug3("No server name or domain name was found")
      end
    end
  end
  return "\n" .. tab.dump(outtab)
end

https://t.me/RX1948 - 2025