OXIESEC PANEL
- Current Dir:
/
/
usr
/
share
/
nmap
/
nselib
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/07/2020 12:36:00 PM
rwxr-xr-x
📄
afp.lua
71.92 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ajp.lua
16.69 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
amqp.lua
10.5 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
anyconnect.lua
4.45 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
asn1.lua
14.57 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
base32.lua
7.33 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
base64.lua
5.67 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
bin.lua
12.89 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
bit.lua
2.43 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
bitcoin.lua
16.99 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
bits.lua
1.82 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
bittorrent.lua
40.77 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
bjnp.lua
9.45 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
brute.lua
50.04 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
cassandra.lua
5.78 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
citrixxml.lua
16 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
coap.lua
76.24 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
comm.lua
10.75 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
creds.lua
18.22 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
cvs.lua
3.13 KB
04/16/2018 01:11:39 AM
rw-r--r--
📁
data
-
08/07/2020 12:36:00 PM
rwxr-xr-x
📄
datafiles.lua
11.05 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
datetime.lua
1.16 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
dhcp.lua
29.17 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
dhcp6.lua
19.87 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
dns.lua
51.44 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
dnsbl.lua
19.02 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
dnssd.lua
12.57 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
drda.lua
24.2 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
eap.lua
7.64 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
eigrp.lua
14.47 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
formulas.lua
5.35 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ftp.lua
9.03 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
geoip.lua
1.71 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
giop.lua
18.44 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
gps.lua
3.05 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
http.lua
105.81 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
httpspider.lua
36.15 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
iax2.lua
9.6 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ike.lua
15.02 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
imap.lua
9.59 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
informix.lua
39.76 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ipOps.lua
26.92 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ipmi.lua
10.02 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ipp.lua
12.54 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
irc.lua
757 bytes
04/16/2018 01:11:39 AM
rw-r--r--
📄
iscsi.lua
21.45 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
isns.lua
15.34 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
jdwp.lua
43.57 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
json.lua
11.65 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ldap.lua
31.86 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
lfs.luadoc
1.68 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
libssh2-utility.lua
4.39 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
libssh2.luadoc
4.75 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
listop.lua
4.66 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
lpeg-utility.lua
5.64 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
lpeg.luadoc
351 bytes
04/16/2018 01:11:39 AM
rw-r--r--
📄
ls.lua
10.96 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
match.lua
2.05 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
membase.lua
9.88 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
mobileme.lua
8.46 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
mongodb.lua
21.29 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
mqtt.lua
28.95 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
msrpc.lua
179.93 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
msrpcperformance.lua
29.72 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
msrpctypes.lua
167.61 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
mssql.lua
110.87 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
multicast.lua
6.1 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
mysql.lua
17.09 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
natpmp.lua
5.04 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ncp.lua
36 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ndmp.lua
11.58 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
netbios.lua
13.9 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
nmap.luadoc
40.34 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
nrpc.lua
4.42 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
nsedebug.lua
3.49 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
omp2.lua
4.77 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
openssl.luadoc
7.08 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ospf.lua
15.29 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
packet.lua
36.65 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
pcre.luadoc
6.79 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
pgsql.lua
20.61 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
pop3.lua
5.7 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
pppoe.lua
29.95 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
proxy.lua
12.04 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
rdp.lua
11.05 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
re.lua
8.22 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
redis.lua
3.59 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
rmi.lua
47.89 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
rpc.lua
106.22 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
rpcap.lua
11.19 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
rsync.lua
5.19 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
rtsp.lua
8.67 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
sasl.lua
16.38 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
shortport.lua
8.01 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
sip.lua
30.56 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
slaxml.lua
17.9 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
smb.lua
175.85 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
smb2.lua
16.32 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
smbauth.lua
37.53 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
smtp.lua
19.81 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
snmp.lua
15.99 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
socks.lua
8.26 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
srvloc.lua
12.25 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ssh1.lua
8.88 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
ssh2.lua
11.88 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
sslcert.lua
33.34 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
sslv2.lua
9.63 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
stdnse.lua
45.93 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
strbuf.lua
4.52 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
strict.lua
2.53 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
stun.lua
11.51 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
tab.lua
3.35 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
target.lua
3.93 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
tftp.lua
9.38 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
tls.lua
56.16 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
tn3270.lua
43.75 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
tns.lua
64.17 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
unicode.lua
14.32 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
unittest.lua
12.33 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
unpwdb.lua
10.08 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
upnp.lua
11.18 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
url.lua
12.09 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
versant.lua
8.6 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
vnc.lua
23.3 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
vulns.lua
76.29 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
vuzedht.lua
16.62 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
wsdd.lua
12.03 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
xdmcp.lua
11.9 KB
04/16/2018 01:11:39 AM
rw-r--r--
📄
xmpp.lua
15.88 KB
04/16/2018 01:11:39 AM
rw-r--r--
Editing: srvloc.lua
Close
--- A relatively small implementation of the Service Location Protocol. -- It was initially designed to support requests for discovering Novell NCP -- servers, but should work for any other service as well. -- -- The implementation is based on the following classes: -- * Request.Service -- - Contains necessary code to produce a service request -- -- * Request.Attributes -- - Contains necessary code to produce a attribute request -- -- * Reply.Service -- - Contains necessary code to process and parse the response to the -- service request -- -- * Reply.Attributes -- - Contains necessary code to process and parse the response to the -- attribute request -- -- The following code illustrates intended use of the library: -- -- <code> -- local helper = srvloc.Helper:new() -- local status, tree = helper:ServiceRequest("ndap.novell", "DEFAULT") -- if ( status ) then tree = tree:match("%/%/%/(.*)%.$") end -- </code> --@author Patrik Karlsson <patrik@cqure.net> --@copyright Same as Nmap--See https://nmap.org/book/man-legal.html -- Version 0.1 -- Created 24/04/2011 - v0.1 - created by Patrik Karlsson <patrik@cqure.net> local bin = require "bin" local bit = require "bit" local nmap = require "nmap" local stdnse = require "stdnse" local table = require "table" _ENV = stdnse.module("srvloc", stdnse.seeall) PacketFunction = { SERVICE_REQUEST = 1, SERVICE_REPLY = 2, ATTRIB_REQUEST = 6, } Reply = { Service = { --- Creates a new instance of the Reply.Service class -- @param data string containing the raw reply as read from the socket -- @return o instance of Reply.Service new = function(self, data) local o = { data = data } setmetatable(o, self) self.__index = self o:parse(data) return o end, --- Parses the service reply raw packet data -- @param data string containing the raw reply as read from the socket parse = function(self, data) local pos local len_hi, len_lo pos, self.version, self.func, len_hi, len_lo = bin.unpack(">CCCS", data) self.len = bit.lshift(len_hi, 16) + len_lo pos, self.flags = bin.unpack(">S", data, pos) local neo_hi, neo_lo pos, neo_hi, neo_lo = bin.unpack(">CS", data, pos) self.next_extension_offset = bit.lshift(neo_hi, 16) + neo_lo local lang_tag_len pos, self.xid, lang_tag_len = bin.unpack(">SS", data, pos) pos, self.lang_tag = bin.unpack("A" .. lang_tag_len, data, pos) local no_urls, reserved, url_len pos, self.error_code, no_urls = bin.unpack(">SS", data, pos) if ( no_urls > 0 ) then pos, reserved, self.url_lifetime, url_len = bin.unpack(">CSS", data, pos) local num_auths pos, self.url, num_auths = bin.unpack("A" .. url_len .. "C", data, pos) end end, --- Attempts to create an instance by reading data off the socket -- @param socket socket connected to the SRVLOC service -- @return new instance of the Reply.Service class fromSocket = function(socket) local status, data = socket:receive() if ( not(status) ) then return end return Reply.Service:new(data) end, --- Gets the url value from the reply -- @return uri string containing the reply url getUrl = function(self) return self.url end, }, Attribute = { --- Creates a new instance of Reply.Attribute -- @param data string containing the raw reply as read from the socket -- @return o instance of Reply.Attribute new = function(self, data) local o = { data = data } setmetatable(o, self) self.__index = self o:parse(data) return o end, --- Parses the service reply raw packet data -- @param data string containing the raw reply as read from the socket parse = function(self, data) local pos local len_hi, len_lo pos, self.version, self.func, len_hi, len_lo = bin.unpack(">CCCS", data) self.len = bit.lshift(len_hi, 16) + len_lo pos, self.flags = bin.unpack(">S", data, pos) local neo_hi, neo_lo pos, neo_hi, neo_lo = bin.unpack(">CS", data, pos) self.next_extension_offset = bit.lshift(neo_hi, 16) + neo_lo local lang_tag_len pos, self.xid, lang_tag_len = bin.unpack(">SS", data, pos) pos, self.lang_tag = bin.unpack("A" .. lang_tag_len, data, pos) local attrib_list_len pos, self.error_code, attrib_list_len = bin.unpack(">SS", data, pos) pos, self.attrib_list = bin.unpack("A"..attrib_list_len, data, pos) local num_auths pos, num_auths = bin.unpack("C", data, pos) end, --- Attempts to create an instance by reading data off the socket -- @param socket socket connected to the SRVLOC service -- @return new instance of the Reply.Attribute class fromSocket = function(socket) local status, data = socket:receive() if ( not(status) ) then return end return Reply.Attribute:new(data) end, --- Gets the attribute list -- @return attrib_list getAttribList = function(self) return self.attrib_list end, } } Request = { -- The attribute request Attribute = { --- Creates a new instance of the Attribue request -- @return o instance of Attribute new = function(self) local o = { lang_tag = "en", version = 2, service_type = "", scope = "", next_extension_offset = 0, prev_resp_list_len = 0, slp_spi_len = 0 } setmetatable(o, self) self.__index = self return o end, --- Sets the request scope -- @param scope string containing the request scope setScope = function(self, scope) self.scope = scope end, --- Sets the language tag -- @param lang string containing the language setLangTag = function(self, lang) self.lang_tag = lang end, --- Sets the request flags -- @param flags number containing the numeric flag representation setFlags = function(self, flags) self.flags = flags end, --- Sets the request XID -- @param xid number containing the request XID setXID = function(self, xid) self.xid = xid end, --- Sets the request function -- @param func number containing the request function number setFunction = function(self, func) self.func = func end, --- Sets the request taglist -- @param tl string containing the taglist setTagList = function(self, tl) self.tag_list = tl end, --- Sets the request url -- @param u string containing the url setUrl = function(self, u) self.url = u end, --- "Serializes" the request to a string -- @return data string containing a string representation of the request __tostring = function(self) assert(self.func, "Packet function was not specified") assert(self.scope, "Packet scope was not specified") local BASE_LEN = 24 local len = BASE_LEN + #self.lang_tag + self.prev_resp_list_len + self.slp_spi_len + #self.service_type + #self.url + #self.tag_list + #self.scope local len_hi = bit.band(bit.rshift(len, 16), 0x00FF) local len_lo = bit.band(len, 0xFFFF) local neo_hi = bit.band(bit.rshift(self.next_extension_offset, 16), 0x00FF) local neo_lo = bit.band(self.next_extension_offset, 0xFFFF) local data = bin.pack(">CCCSSCSSSASSASASAS", self.version, self.func, len_hi, len_lo, self.flags, neo_hi, neo_lo, self.xid, #self.lang_tag, self.lang_tag, self.prev_resp_list_len, #self.url, self.url, #self.scope, self.scope, #self.tag_list, self.tag_list, self.slp_spi_len) return data end }, -- The Service request Service = { --- Creates a new instance of the Service request -- @return o instance of Service new = function(self) local o = { lang_tag = "en", version = 2, service_type = "", scope = "", next_extension_offset = 0, prev_resp_list_len = 0, predicate_len = 0, slp_spi_len = 0 } setmetatable(o, self) self.__index = self return o end, --- Sets the service type of the request -- @param t string containing the type of the request setServiceType = function(self, t) self.service_type = t end, --- Sets the request scope -- @param scope string containing the request scope setScope = function(self, scope) self.scope = scope end, --- Sets the language tag -- @param lang string containing the language setLangTag = function(self, lang) self.lang_tag = lang end, --- Sets the request flags -- @param flags number containing the numeric flag representation setFlags = function(self, flags) self.flags = flags end, --- Sets the request XID -- @param xid number containing the request XID setXID = function(self, xid) self.xid = xid end, --- Sets the request function -- @param func number containing the request function number setFunction = function(self, func) self.func = func end, --- "Serializes" the request to a string -- @return data string containing a string representation of the request __tostring = function(self) assert(self.func, "Packet function was not specified") assert(self.scope, "Packet scope was not specified") local BASE_LEN = 24 local len = BASE_LEN + #self.lang_tag + self.prev_resp_list_len + self.predicate_len + self.slp_spi_len + #self.service_type + #self.scope local len_hi = bit.band(bit.rshift(len, 16), 0x00FF) local len_lo = bit.band(len, 0xFFFF) local neo_hi = bit.band(bit.rshift(self.next_extension_offset, 16), 0x00FF) local neo_lo = bit.band(self.next_extension_offset, 0xFFFF) local data = bin.pack(">CCCSSCSSSASSASASS", self.version, self.func, len_hi, len_lo, self.flags, neo_hi, neo_lo, self.xid, #self.lang_tag, self.lang_tag, self.prev_resp_list_len, #self.service_type, self.service_type, #self.scope, self.scope, self.predicate_len, self.slp_spi_len) return data end } } -- The Helper class serves as primary interface for scripts using the library Helper = { new = function(self, host, port) local o = { xid = 1, socket = nmap.new_socket("udp") } setmetatable(o, self) self.__index = self local family = nmap.address_family() o.host = host or (family=="inet6" and "FF02::116" or "239.255.255.253") o.port = port or { number=427, proto="udp" } return o end, --- Sends a service request and waits for the response -- @param srvtype string containing the service type to query -- @param scope string containing the scope of the request -- @return true on success, false on failure -- @return url string (on success) containing the url of the ServiceReply -- @return err string (on failure) containing the error message ServiceRequest = function(self, srvtype, scope) local srvtype = srvtype or "" local scope = scope or "" local sr = Request.Service:new() sr:setXID(self.xid) sr:setServiceType(srvtype) sr:setScope(scope) sr:setFunction(PacketFunction.SERVICE_REQUEST) sr:setFlags(0x2000) self.socket:set_timeout(5000) self.socket:sendto( self.host, self.port, tostring(sr) ) local result = {} repeat local r = Reply.Service.fromSocket(self.socket) if ( r ) then table.insert(result, r:getUrl()) end self.xid = self.xid + 1 until(not(r)) if ( #result == 0 ) then return false, "ERROR: Helper.Locate no response received" end return true, result end, --- Requests an attribute from the server -- @param url as retrieved by the Service request -- @param scope string containing the request scope -- @param taglist string containing the request tag list AttributeRequest = function(self, url, scope, taglist) local url = url or "" local scope = scope or "" local taglist = taglist or "" local ar = Request.Attribute:new() ar:setXID(self.xid) ar:setScope(scope) ar:setUrl(url) ar:setTagList(taglist) ar:setFunction(PacketFunction.ATTRIB_REQUEST) ar:setFlags(0x2000) self.socket:set_timeout(5000) self.socket:sendto( self.host, self.port, tostring(ar) ) local r = Reply.Attribute.fromSocket(self.socket) self.xid = self.xid + 1 if ( not(r) ) then return false, "ERROR: Helper.Locate no response received" end return true, r:getAttribList() end, close = function(self) return self.socket:close() end, } return _ENV;