!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/inventory.picotech.app/public_html/node_modules/hpack.js/test/   drwxr-xr-x
Free 28.25 GB of 117.98 GB (23.94%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     decompressor-test.js (5.13 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
var assert = require('assert');
var hpack = require('../');
var fixtures = require('./fixtures');

describe('hpack/decompressor', function() {
  var decomp;

  beforeEach(function() {
    decomp = hpack.decompressor.create({
      table: {
        maxSize: 1024
      }
    });
  });

  describe('indexed field', function() {
    it('should fail on 0-index', function(cb) {
      decomp.write(new Buffer([ 0b10000000 ]));
      decomp.execute(function(err) {
        assert(/zero index/i.test(err.message), err.message);
        cb();
      });
    });

    it('should fetch entry from static table', function() {
      decomp.write(new Buffer([ 0b10000000 | 2 ]));
      decomp.execute();
      var field = decomp.read();
      assert.equal(field.name, ':method');
      assert.equal(field.value, 'GET');
    });

    it('should fetch entry from the end of the static table', function() {
      decomp.write(new Buffer([ 0b10000000 | 61 ]));
      decomp.execute();
      var field = decomp.read();
      assert.equal(field.name, 'www-authenticate');
      assert.equal(field.value, '');
    });

    it('should fail on OOB-index', function(cb) {
      decomp.write(new Buffer([ 0b11000000 ]));
      decomp.execute(function(err) {
        assert(/field oob/i.test(err.message), err.message);
        cb();
      });
    });
  });

  describe('literal field', function() {
    it('should lookup name in the table (incremental)', function() {
      var value = new Buffer('localhost');
      var header = new Buffer([
        0b01000000 | 38,  // 38th element from static table
        value.length
      ]);
      decomp.write(Buffer.concat([ header, value ]));
      decomp.execute();

      var field = decomp.read();
      assert.equal(field.name, 'host');
      assert.equal(field.value, 'localhost');

      decomp.write(new Buffer([ 0b10000000 | 62 ]));
      decomp.execute();
      var field = decomp.read();
      assert.equal(field.name, 'host');
      assert.equal(field.value, 'localhost');
    });

    it('should lookup name in the table (not-incremental)', function(cb) {
      var value = new Buffer('localhost');
      var header = new Buffer([
        0b00001111,
        0b00000000 | 23,
        value.length
      ]);
      decomp.write(Buffer.concat([ header, value ]));
      decomp.execute();

      var field = decomp.read();
      assert.equal(field.name, 'host');
      assert.equal(field.value, 'localhost');

      decomp.write(new Buffer([ 0b10000000 | 62 ]));
      decomp.execute(function(err) {
        assert(/field oob/i.test(err.message), err.message);
        cb();
      });
    });

    it('should evict header field from the table', function() {
      var value = new Buffer('localhost');
      var header = new Buffer([
        0b01000000 | 38,  // 38th element from static table
        value.length
      ]);
      for (var i = 0; i < 1000; i++) {
        decomp.write(Buffer.concat([ header, value ]));
        decomp.execute();
        var field = decomp.read();
        assert.equal(field.name, 'host');
        assert.equal(field.value, 'localhost');
      }

      assert(decomp._table.size < decomp._table.maxSize);
      assert.equal(decomp._table.dynamic.length, 22);
    });
  });

  describe('update size', function() {
    it('should evict header field from the table', function() {
      var value = new Buffer('localhost');
      var header = new Buffer([
        0b01000000 | 38,  // 38th element from static table
        value.length
      ]);

      decomp.write(Buffer.concat([ header, value ]));
      decomp.execute();
      var field = decomp.read();
      assert.equal(field.name, 'host');
      assert.equal(field.value, 'localhost');
      assert.equal(decomp._table.dynamic.length, 1);

      decomp.write(new Buffer([
        0b00100000
      ]));
      decomp.execute();

      assert.equal(decomp._table.dynamic.length, 0);
    });
  });

  describe('spec examples', function() {
    var decomp;
    beforeEach(function() {
      decomp = hpack.decompressor.create({
        table: {
          maxSize: 256
        }
      });
    });

    var tests = fixtures.specExamples;

    tests.forEach(function(test, i) {
      var prev = tests[i - 1];
      it('should give expected output on ' + test.id, function() {
        var startFrom = test.continuation ? prev.decomp : decomp;
        if (!startFrom)
          throw new Error('Previous test failed');
        decomp = startFrom;

        decomp.write(new Buffer(test.input.replace(/ /g, ''), 'hex'));
        decomp.execute();

        var output = [];
        for (;;) {
          var chunk = decomp.read();
          if (!chunk)
            break;

          output.push([ chunk.name, chunk.value ]);
        }

        assert.deepEqual(output, test.output);

        // Verify table contents
        assert.deepEqual(decomp._table.dynamic.map(function(header) {
          return [ header.name, header.value, header.totalSize ];
        }).reverse(), test.table);

        // Verify table size
        var expectedSize = test.table.reduce(function(acc, item) {
          return acc + item[2];
        }, 0);
        assert.equal(decomp._table.size, expectedSize);

        test.decomp = decomp;
      });
    });
  });
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0039 ]--