| Server IP : 101.53.144.229 / Your IP : 216.73.216.181 Web Server : Apache System : Linux host.gdigitalindia.in 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : digitalshiksha ( 1179) PHP Version : 5.6.40 Disable Function : eval,show_source,system,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,show_source,curl_multi_exechellcmd, ini_restore,apache_get_modules,get_cfg_var,passthru, exec ,proc_get_status,fpassthru,c999_buff_prepare,c999_sess_put,c99_buff_prepare,c99_sess_put,proc_close,ini_alter,dl,symlink,link,proc_close,ini_alter,dl,symlink,link,mail MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/nmap/scripts/ |
Upload File : |
local nmap = require "nmap"
local shortport = require "shortport"
local snmp = require "snmp"
local stdnse = require "stdnse"
local table = require "table"
description = [[
Attempts to enumerate Windows services through SNMP.
]]
---
-- @output
-- | snmp-win32-services:
-- | Apache Tomcat
-- | Application Experience Lookup Service
-- | Application Layer Gateway Service
-- | Automatic Updates
-- | COM+ Event System
-- | COM+ System Application
-- | Computer Browser
-- | Cryptographic Services
-- | DB2 - DB2COPY1 - DB2
-- | DB2 Management Service (DB2COPY1)
-- | DB2 Remote Command Server (DB2COPY1)
-- | DB2DAS - DB2DAS00
-- |_ DCOM Server Process Launcher
author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"default", "discovery", "safe"}
dependencies = {"snmp-brute"}
-- Version 0.3
-- Created 01/15/2010 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
-- Revised 01/19/2010 - v0.2 - fixed loop that would occure if a mib did not exist
-- Revised 04/11/2010 - v0.3 - moved snmp_walk to snmp library <patrik@cqure.net>
portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"})
--- Processes the table and creates the script output
--
-- @param tbl table containing <code>oid</code> and <code>value</code>
-- @return table suitable for <code>stdnse.format_output</code>
function process_answer( tbl )
local new_tab = {}
for _, v in ipairs( tbl ) do
table.insert( new_tab, v.value )
end
table.sort( new_tab )
return new_tab
end
action = function(host, port)
local socket = nmap.new_socket()
local catch = function() socket:close() end
local try = nmap.new_try(catch)
local snmpoid = "1.3.6.1.4.1.77.1.2.3.1.1"
local services = {}
local status
socket:set_timeout(5000)
try(socket:connect(host, port))
status, services = snmp.snmpWalk( socket, snmpoid )
socket:close()
if ( not(status) ) or ( services == nil ) or ( #services == 0 ) then
return
end
services = process_answer(services)
nmap.set_port_state(host, port, "open")
return stdnse.format_output( true, services )
end