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.4.5.tar.gz (41.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.4.5-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file wish_command_execution-0.4.5.tar.gz.

File metadata

  • Download URL: wish_command_execution-0.4.5.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for wish_command_execution-0.4.5.tar.gz
Algorithm Hash digest
SHA256 cf93949ad4ff8f105dd6191c596a557858e6c3ff1b08c8b6c93b08dae9251b8e
MD5 3daf20d7e9c3d7f50f5ff22e5c2d221e
BLAKE2b-256 6f0e3665a41ebb3734de2c1147f93a239a6992c1bac7fdafa87aa3fcbab7da06

See more details on using hashes here.

File details

Details for the file wish_command_execution-0.4.5-py3-none-any.whl.

File metadata

File hashes

Hashes for wish_command_execution-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4b192484eaaf3105e8c195e0b8c70967e05fbca796b7d7837a4fb279a91bf6e3
MD5 ebb42ef2bc5e25eef297b39a0235ada2
BLAKE2b-256 448c8013e0ab39263af52a47213f348c3a127513adc83470db0855057be0bf90

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