main
rw-r--r--
31 B
rw-r--r--
4.7 KB
rw-r--r--
2.7 KB
rw-r--r--
1.9 KB
rw-r--r--
603 B
rw-r--r--
2.6 KB
rw-r--r--
64 B
rw-r--r--
3.6 MB

mysh

mysh (mɪ-ʃh) is a command-line interface for Mythic C2 servers.

demo

Installation

Building from Source

# Build for current platform
make build

# Build for all platforms
make build-all

# Development build (faster)
make dev

# Clean build artifacts
make clean

# Show all available targets
make help

Manual Build

go build -o bin/mysh .

Configuration

Both URL and authentication token are required.

Quick Setup

# Set via environment variables (recommended)
export MYTHIC_API_URL="https://your-mythic-server:7443/graphql/"
export MYTHIC_API_TOKEN="your-jwt-token-here"
mysh callbacks

Individual Configuration Options

Mythic Server URL

# Set via command line flag
mysh --url "https://your-mythic-server:7443/graphql/" callbacks

# Set via environment variable
export MYTHIC_API_URL="https://your-mythic-server:7443/graphql/"
mysh callbacks

Authentication Token

# Set via command line flag
mysh --token "your-jwt-token-here" callbacks

# Set via environment variable
export MYTHIC_API_TOKEN="your-jwt-token-here"
mysh callbacks

API via SOCKS5 Proxy

# Use SOCKS5 proxy
mysh --socks "127.0.0.1:9050" callbacks

# Set via environment variable
export MYTHIC_API_SOCKS="127.0.0.1:9050"
mysh callbacks

Usage

List Active Callbacks

mysh callbacks

Execute Commands

# Get help for all commands from callback 1
mysh task 1 help

# Get detailed help for a specific command
mysh task 1 help p

# List processes
mysh task 1 ps

# Set checkin frequency to 5 seconds
mysh task 1 sleep 5

# Create task without waiting for response
mysh task 1 ps --no-wait

Interactive Session

mysh interact 1

Project Structure

contrib Directory

The contrib/ directory contains checkouts of related Mythic repositories for reference during development:

  • contrib/Mythic/ - Main Mythic server source code
  • contrib/Mythic_Scripting/ - Python scripting library for Mythic
  • Located in this repository for easy reference when implementing GraphQL queries and mutations
  • Check contrib/Mythic/hasura-docker/metadata/metadata/actions.graphql for available GraphQL operations

GraphQL Queries Synchronization

The project maintains a 1:1 copy of GraphQL queries from the Python Mythic_Scripting library:

  • Source: contrib/Mythic_Scripting/mythic/graphql_queries.py
  • Go Version: pkg/mythic/queries.go
  • Purpose: Easier upstream synchronization and reduced raw strings in client code

To sync with upstream updates:

  1. Check the Python file for changes
  2. Update the corresponding Go constants
  3. Test client functionality