Skip to main content

Command execution package for wish

Project description

wish-command-execution

Command execution package for wish.

Overview

wish-command-execution is a Python package that provides command execution functionality for the wish ecosystem. It allows executing commands on different backend shells (bash, Sliver C2, etc.) and tracking their execution status.

Installation

pip install wish-command-execution

Or for development:

git clone https://github.com/SecDev-Lab/wish.git
cd wish/wish-command-execution
uv pip install -e .

Usage

Basic Usage

from wish_models import Wish
from wish_command_execution import CommandExecutor
from wish_command_execution.backend import BashBackend

def main():
    # Create a wish
    wish = Wish.create("List files")
    
    # Create a backend
    backend = BashBackend()
    
    # Create a command executor
    executor = CommandExecutor(backend)
    
    # Execute a command
    cmd_num = 1
    executor.execute_command(wish, "ls -la", cmd_num)
    
    # Check running commands
    executor.check_running_commands()
    
    # Print the result when completed
    for result in wish.command_results:
        print(f"Command: {result.command}")
        print(f"Exit code: {result.exit_code}")
        print(f"State: {result.state}")

if __name__ == "__main__":
    main()

Using Different Backends

from wish_command_execution.backend import create_backend
from wish_command_execution.backend.factory import BashConfig, SliverConfig

# Using Bash backend with custom log summarizer
def my_log_summarizer(log_files):
    return "Custom log summary"

config = BashConfig(log_summarizer=my_log_summarizer)
backend = create_backend(config)

# Using Sliver backend (future implementation)
config = SliverConfig(
    session_id="your-session-id",
    client_config_path="/path/to/sliver/config"
)
backend = create_backend(config)  # Will raise NotImplementedError currently

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wish_command_execution-0.0.2a3.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wish_command_execution-0.0.2a3-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file wish_command_execution-0.0.2a3.tar.gz.

File metadata

File hashes

Hashes for wish_command_execution-0.0.2a3.tar.gz
Algorithm Hash digest
SHA256 bf2a5e4c2f64eb938c8e1d7255dd1fc92cab83126f7e25cde46cf7428c0f1ddc
MD5 830149dfd1c9c193cee45828090a780a
BLAKE2b-256 bde14ac58daf2271a681a6fd23158da45dbfe7f74cabe855526d8aa8928220d0

See more details on using hashes here.

File details

Details for the file wish_command_execution-0.0.2a3-py3-none-any.whl.

File metadata

File hashes

Hashes for wish_command_execution-0.0.2a3-py3-none-any.whl
Algorithm Hash digest
SHA256 69437b1ab99072d7fec5a7b399788cb93634f6afe699c92f65be772a8f59b1a9
MD5 ba93f1f17de8dcca8bc6577a2c5990f7
BLAKE2b-256 cc292d04a522fddce2f6d110c2f8bf7271290b06157890c9c820589681ab56e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page