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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/local/lib/node_modules/homebridge-camera-ui/node_modules/web-push/src/   drwxr-xr-x
Free 13.22 GB of 57.97 GB (22.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     cli.js (2.76 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#! /usr/bin/env node
/* eslint consistent-return:0 */

'use strict';

const webPush = require('../src/index.js');

const printUsageDetails = () => {
  const actions = [
    {
      name: 'send-notification',
      options: [
        '--endpoint=<url>',
        '[--key=<browser key>]',
        '[--auth=<auth secret>]',
        '[--payload=<message>]',
        '[--ttl=<seconds>]',
        '[--encoding=<encoding type>]',
        '[--vapid-subject=<vapid subject>]',
        '[--vapid-pubkey=<public key url base64>]',
        '[--vapid-pvtkey=<private key url base64>]',
        '[--gcm-api-key=<api key>]'
      ]
    }, {
      name: 'generate-vapid-keys',
      options: [
        '[--json]'
      ]
    }
  ];

  let usage = '\nUsage: \n\n';
  actions.forEach(action => {
    usage += '  web-push ' + action.name;
    usage += ' ' + action.options.join(' ');
    usage += '\n\n';
  });

  console.log(usage);
  process.exit(1);
};

const generateVapidKeys = returnJson => {
  const vapidKeys = webPush.generateVAPIDKeys();

  let outputText;
  if (returnJson) {
    outputText = JSON.stringify(vapidKeys);
  } else {
    const outputLine = '\n=======================================\n';
    outputText = outputLine + '\n'
    + 'Public Key:\n' + vapidKeys.publicKey + '\n\n'
    + 'Private Key:\n' + vapidKeys.privateKey + '\n'
    + outputLine;
  }

  console.log(outputText);
  process.exit(0);
};

const sendNotification = args => {
  if (process.env.GCM_API_KEY) {
    webPush.setGCMAPIKey(process.env.GCM_API_KEY);
  }

  const subscription = {
    endpoint: args.endpoint,
    keys: {
      p256dh: args.key || null,
      auth: args.auth || null
    }
  };

  const payload = args.payload || null;

  const options = {};

  if (args.ttl) {
    options.TTL = args.ttl;
  }

  if (argv['vapid-subject'] || argv['vapid-pubkey'] || argv['vapid-pvtkey']) {
    options.vapidDetails = {
      subject: args['vapid-subject'] || null,
      publicKey: args['vapid-pubkey'] || null,
      privateKey: args['vapid-pvtkey'] || null
    };
  }

  if (args['gcm-api-key']) {
    options.gcmAPIKey = args['gcm-api-key'];
  }

  if (args.encoding) {
    options.contentEncoding = args.encoding;
  }

  webPush.sendNotification(subscription, payload, options)
  .then(() => {
    console.log('Push message sent.');
  }, err => {
    console.log('Error sending push message: ');
    console.log(err);
  })
  .then(() => {
    process.exit(0);
  });
};

const action = process.argv[2];
const argv = require('minimist')(process.argv.slice(3));
switch (action) {
  case 'send-notification':
    if (!argv.endpoint) {
      return printUsageDetails();
    }

    sendNotification(argv);
    break;
  case 'generate-vapid-keys':
    generateVapidKeys(argv.json || false);
    break;
  default:
    printUsageDetails();
    break;
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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