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: citrixxml.lua
Close
--- -- This module was written by Patrik Karlsson and facilitates communication -- with the Citrix XML Service. It is not feature complete and is missing several -- functions and parameters. -- -- The library makes little or no effort to verify that the parameters submitted -- to each function are compliant with the DTD -- -- As all functions handling requests take their parameters in the form of tables, -- additional functionality can be added while not breaking existing scripts -- -- Details regarding the requests/responses and their parameters can be found in -- the NFuse.DTD included with Citrix MetaFrame/Xenapp -- -- This code is based on the information available in: -- NFuse.DTD - Version 5.0 (draft 1) 24 January 2008 -- local http = require "http" local stdnse = require "stdnse" local string = require "string" local table = require "table" _ENV = stdnse.module("citrixxml", stdnse.seeall) --- Decodes html-entities to chars eg.   => <space> -- -- @param xmldata string to convert -- @return string an e function decode_xml_document(xmldata) local hexval if not xmldata then return "" end local newstr = xmldata local escaped_val while string.match(newstr, "(&#%d+;)" ) do escaped_val = string.match(newstr, "(&#%d+;)") hexval = escaped_val:match("(%d+)") if ( hexval ) then newstr = newstr:gsub(escaped_val, string.char(hexval)) end end return newstr end --- Sends the request to the server using the http lib -- -- @param host string or host table of the remote server -- @param port number or port table of the remote server -- @param xmldata string, the HTTP data part of the request as XML -- -- @return string with the response body -- function send_citrix_xml_request(host, port, xmldata) local response = http.post( host, port, "/scripts/WPnBr.dll", { header={["Content-Type"]="text/xml"}}, nil, xmldata) -- this is *probably* not the right way to do stuff -- decoding should *probably* only be done on XML-values -- this is *probably* defined in the standard, for anyone interested return decode_xml_document(response.body) end --- Request information about the Citrix Server Farm -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function implements all the supported parameters described in: -- Version 5.0 (draft 1) 24 January 2008 -- -- @param host string or host table of the remote server -- @param port number or port table of the remote server -- @return string HTTP response data -- function request_server_farm_data( host, port ) local xmldata = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM \"NFuse.dtd\">\r\n\z <NFuseProtocol version=\"1.1\">\z <RequestServerFarmData></RequestServerFarmData>\z </NFuseProtocol>\r\n" return send_citrix_xml_request(host, port, xmldata) end --- Parses the response from the request_server_farm_data request -- @param response string with the XML response -- @return table containing server farm names -- function parse_server_farm_data_response( response ) local farms = {} response = response:gsub("\r?\n","") for farm in response:gmatch("<ServerFarmName.->([^<]+)</ServerFarmName>") do table.insert(farms, farm) end return farms end --- Sends a request for application data to the Citrix XML service -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function does NOT implement all the supported parameters -- -- Supported parameters are Scope, ServerType, ClientType, DesiredDetails -- -- @param host string or host table which is to be queried -- @param port number or port table of the XML service -- @param params table with parameters -- @return string HTTP response data -- function request_appdata(host, port, params) -- setup the mandatory parameters if they're missing local scope = params['Scope'] or "onelevel" local server_type = params['ServerType'] or "all" local client_type = params['ClientType'] or "ica30" local desired_details = params['DesiredDetails'] or nil local xmldata = { '<?xml version="1.0" encoding="ISO-8859-1"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd">\r\n\z <NFuseProtocol version="5.0"><RequestAppData><Scope traverse="', scope, '" /><ServerType>', server_type, "</ServerType><ClientType>", client_type, "</ClientType>" } if desired_details then if type(desired_details) == "string" then xmldata[#xmldata+1] = "<DesiredDetails>" .. desired_details .. "</DesiredDetails>" elseif type(desired_details) == "table" then for _, v in ipairs(desired_details) do xmldata[#xmldata+1] = "<DesiredDetails>" .. v .. "</DesiredDetails>" end else assert(desired_details) end end xmldata[#xmldata+1] = "</RequestAppData></NFuseProtocol>\r\n" return send_citrix_xml_request(host, port, table.concat(xmldata)) end --- Extracts the Accesslist section of the XML response -- -- @param xmldata string containing results from the request app data request -- @return table containing settings extracted from the accesslist section of the response local function extract_appdata_acls(xmldata) local acls = {} local users = {} local groups = {} for acl in xmldata:gmatch("<AccessList>(.-)</AccessList>") do if acl:match("AnonymousUser") then table.insert(users, "Anonymous") else for user in acl:gmatch("<User>(.-)</User>") do local user_name = user:match("<UserName.->(.-)</UserName>") or "" local domain_name = user:match("<Domain.->(.-)</Domain>") or "" if user_name:len() > 0 then if domain_name:len() > 0 then domain_name = domain_name .. "\\" end table.insert(users, domain_name .. user_name) end end for group in acl:gmatch("<Group>(.-)</Group>") do local group_name = group:match("<GroupName.->(.-)</GroupName>") or "" local domain_name = group:match("<Domain.->(.-)</Domain>") or "" if group_name:len() > 0 then if domain_name:len() > 0 then domain_name = domain_name .. "\\" end table.insert(groups, domain_name .. group_name) end end end if #users> 0 then acls['User'] = users end if #groups>0 then acls['Group'] = groups end end return acls end --- Extracts the settings section of the XML response -- -- @param xmldata string containing results from the request app data request -- @return table containing settings extracted from the settings section of the response local function extract_appdata_settings(xmldata) local settings = {} settings['appisdisabled'] = xmldata:match("<Settings.-appisdisabled=\"(.-)\".->") settings['appisdesktop'] = xmldata:match("<Settings.-appisdesktop=\"(.-)\".->") for s in xmldata:gmatch("<Settings.->(.-)</Settings>") do settings['Encryption'] = s:match("<Encryption.->(.-)</Encryption>") settings['EncryptionEnforced'] = s:match("<Encryption minimum=\"(.-)\">") settings['AppOnDesktop'] = s:match("<AppOnDesktop.-value=\"(.-)\"/>") settings['AppInStartmenu'] = s:match("<AppInStartmenu.-value=\"(.-)\"/>") settings['PublisherName'] = s:match("<PublisherName.->(.-)</PublisherName>") settings['SSLEnabled'] = s:match("<SSLEnabled.->(.-)</SSLEnabled>") settings['RemoteAccessEnabled'] = s:match("<RemoteAccessEnabled.->(.-)</RemoteAccessEnabled>") end return settings end --- Parses the appdata XML response -- -- @param xmldata string response from request_appdata -- @return table containing nestled tables closely resembling the DOM model of the XML response function parse_appdata_response(xmldata) local apps = {} xmldata = xmldata:gsub("\r?\n",""):gsub(">%s+<", "><") for AppData in xmldata:gmatch("<AppData>(.-)</AppData>") do local app_name = AppData:match("<FName.->(.-)</FName>") or "" local app = {} app['FName'] = app_name app['AccessList'] = extract_appdata_acls(AppData) app['Settings'] = extract_appdata_settings(AppData) table.insert(apps, app) end return apps end -- -- -- @param flags string, should be any of following: alt-addr, no-load-bias -- function request_address(host, port, flags, appname) local xmldata = { '<?xml version="1.0" encoding="ISO-8859-1"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd">\r\n\z <NFuseProtocol version="4.1"><RequestAddress>' } if flags then xmldata[#xmldata+1] = "<Flags>" .. flags .. "</Flags>" end if appname then xmldata[#xmldata+1] = "<Name><AppName>" .. appname .. "</AppName></Name>" end xmldata[#xmldata+1] = "</RequestAddress></NFuseProtocol>\r\n" return send_citrix_xml_request(host, port, table.concat(xmldata)) end --- Request information about the Citrix protocol -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function implements all the supported parameters described in: -- Version 5.0 (draft 1) 24 January 2008 -- -- @param host string or host table which is to be queried -- @param port number or port table of the XML service -- @param params table with parameters -- @return string HTTP response data -- function request_server_data(host, port, params) local params = params or {} local server_type = params.ServerType or {"all"} local client_type = params.ClientType or {"all"} local xmldata = { '<?xml version="1.0" encoding="ISO-8859-1"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd">\r\n\z <NFuseProtocol version="1.1"><RequestServerData>' } for _, srvtype in pairs(server_type) do xmldata[#xmldata+1] = "<ServerType>" .. srvtype .. "</ServerType>" end for _, clitype in pairs(client_type) do xmldata[#xmldata+1] = "<ClientType>" .. clitype .. "</ClientType>" end xmldata[#xmldata+1] = "</RequestServerData></NFuseProtocol>\r\n" return send_citrix_xml_request(host, port, table.concat(xmldata)) end --- Parses the response from the request_server_data request -- @param response string with the XML response -- @return table containing the server names -- function parse_server_data_response(response) local servers = {} response = response:gsub("\r?\n","") for s in response:gmatch("<ServerName>([^<]+)</ServerName>") do table.insert(servers, s) end return servers end --- Request information about the Citrix protocol -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function implements all the supported parameters described in: -- Version 5.0 (draft 1) 24 January 2008 -- -- @param host string or host table which is to be queried -- @param port number or port table of the XML service -- @param params table with parameters -- @return string HTTP response data -- function request_protocol_info( host, port, params ) local params = params or {} local xmldata = { '<?xml version="1.0" encoding="ISO-8859-1"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd">\r\n\z <NFuseProtocol version="1.1"><RequestProtocolInfo>' } if params['ServerAddress'] then xmldata[#xmldata+1] = ('<ServerAddress addresstype="' .. params['ServerAddress']['attr']['addresstype'] .. '">' .. params['ServerAddress'] .. "</ServerAddress>") end xmldata[#xmldata+1] = "</RequestProtocolInfo></NFuseProtocol>\r\n" return send_citrix_xml_request(host, port, table.concat(xmldata)) end --- Request capability information -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function implements all the supported parameters described in: -- Version 5.0 (draft 1) 24 January 2008 -- -- @param host string or host table which is to be queried -- @param port number or port table of the XML service -- @return string HTTP response data -- function request_capabilities( host, port ) local xmldata = '<?xml version="1.0" encoding="ISO-8859-1"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd">\r\n\z <NFuseProtocol version="1.1"><RequestCapabilities>\z </RequestCapabilities></NFuseProtocol>\r\n' return send_citrix_xml_request(host, port, xmldata) end --- Parses the response from the request_capabilities request -- @param response string with the XML response -- @return table containing the server capabilities -- function parse_capabilities_response(response) local servers = {} response = response:gsub("\r?\n","") for s in response:gmatch("<CapabilityId.->([^<]+)</CapabilityId>") do table.insert(servers, s) end return servers end --- Tries to validate user credentials against the XML service -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function implements all the supported parameters described in: -- Version 5.0 (draft 1) 24 January 2008 -- -- -- @param host string or host table which is to be queried -- @param port number or port table of the XML service -- @param params table with parameters -- @return string HTTP response data -- function request_validate_credentials(host, port, params ) local params = params or {} local credentials = params['Credentials'] or {} local xmldata = { '<?xml version="1.0" encoding="ISO-8859-1"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd">\r\n\z <NFuseProtocol version="5.0"><RequestValidateCredentials><Credentials>' } if credentials['UserName'] then xmldata[#xmldata+1] = "<UserName>" .. credentials['UserName'] .. "</UserName>" end if credentials['Password'] then xmldata[#xmldata+1] = '<Password encoding="cleartext">' .. credentials['Password'] .. "</Password>" end if credentials['Domain'] then xmldata[#xmldata+1] = '<Domain type="NT">' .. credentials['Domain'] .. "</Domain>" end xmldata[#xmldata+1] = "</Credentials></RequestValidateCredentials></NFuseProtocol>\r\n" return send_citrix_xml_request(host, port, table.concat(xmldata)) end --- Parses the response from request_validate_credentials -- @param response string with the XML response -- @return table containing the results -- function parse_validate_credentials_response(response) local tblResult = {} response = response:gsub("\r?\n","") tblResult['DaysUntilPasswordExpiry'] = response:match("<DaysUntilPasswordExpiry>(.+)</DaysUntilPasswordExpiry>") tblResult['ShowPasswordExpiryWarning'] = response:match("<ShowPasswordExpiryWarning>(.+)</ShowPasswordExpiryWarning>") tblResult['ErrorId'] = response:match("<ErrorId>(.+)</ErrorId>") return tblResult end --- Sends a request to reconnect session data -- -- Consult the NFuse.DTD for a complete list of supported parameters -- This function does NOT implement all the supported parameters ---- -- @param host string or host table which is to be queried -- @param port number or port table of the XML service -- @param params table with parameters -- function request_reconnect_session_data(host, port, params) local params = params or {} local Credentials = params.Credentials or {} params.ServerType = params.ServerType or {} params.ClientType = params.ClientType or {} local xmldata = { '<?xml version="1.0" encoding="ISO-8859-1"?>\r\n\z <!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd">\r\n\z <NFuseProtocol version="5.0"><RequestReconnectSessionData><Credentials>' } if Credentials.UserName then xmldata[#xmldata+1] = "<UserName>" .. Credentials.UserName .. "</UserName>" end if Credentials.Password then xmldata[#xmldata+1] = '<Password encoding="cleartext">' .. Credentials.Password .. "</Password>" end if Credentials.Domain then xmldata[#xmldata+1] = '<Domain type="NT">' .. Credentials.Domain .. "</Domain>" end xmldata[#xmldata+1] = "</Credentials>" if params.ClientName then xmldata[#xmldata+1] = "<ClientName>" .. params.ClientName .. "</ClientName>" end if params.DeviceId then xmldata[#xmldata+1] = "<DeviceId>" .. params.DeviceId .. "</DeviceId>" end for _, srvtype in pairs(params.ServerType) do xmldata[#xmldata+1] = "<ServerType>" .. srvtype .. "</ServerType>" end for _, clitype in pairs(params.ClientType) do xmldata[#xmldata+1] = "<ClientType>" .. clitype .. "</ClientType>" end xmldata[#xmldata+1] = "</RequestReconnectSessionData></NFuseProtocol>\r\n" return send_citrix_xml_request(host, port, table.concat(xmldata)) end return _ENV;