-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgiop-info.nse
61 lines (44 loc) · 1.37 KB
/
giop-info.nse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
local giop = require "giop"
local shortport = require "shortport"
local stdnse = require "stdnse"
local table = require "table"
description = [[
Queries a CORBA naming server for a list of objects.
]]
author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"default", "discovery", "safe"}
---
-- @output
-- PORT STATE SERVICE REASON
-- 1050/tcp open java-or-OTGfileshare syn-ack
-- | giop-info:
-- | Object: Hello
-- | Context: Test
-- |_ Object: GoodBye
-- Version 0.1
-- Created 07/08/2010 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
portrule = shortport.port_or_service( {2809,1050,1049} , "giop", "tcp", "open")
action = function(host, port)
local helper = giop.Helper:new( host, port )
local ctx, objs, status, err
local result = {}
status, err = helper:Connect()
if ( not(status) ) then return err end
status, ctx = helper:GetNamingContext()
if ( not(status) ) then return " \n ERROR: " .. ctx end
status, objs = helper:ListObjects(ctx)
if ( not(status) ) then return " \n ERROR: " .. objs end
for _, obj in ipairs( objs ) do
local tmp = ""
if ( obj.enum == 0 ) then
tmp = "Object: "
elseif( obj.enum == 1 ) then
tmp = "Context: "
else
tmp = "Unknown: "
end
table.insert(result, tmp .. obj.id )
end
return stdnse.format_output(true, result)
end