Skip to main content

Rewrite of popular tool evil-winrm in python

Project description

evil-winrm-py

evil-winrm-py is a python-based tool for executing commands on remote Windows machines using the WinRM (Windows Remote Management) protocol. It provides an interactive shell.

[!NOTE] This tool is designed strictly for educational, ethical use, and authorized penetration testing. Always ensure you have explicit authorization before accessing any system. Unauthorized access or misuse of this tool is both illegal and unethical.

Motivation

The original evil-winrm is written in Ruby, which can be a hurdle for some users. Rewriting it in Python makes it more accessible and easier to use, while also allowing us to leverage Python’s rich ecosystem for added features and flexibility.

I also wanted to learn more about winrm and its internals, so this project will also serve as a learning experience for me.

Features

  • Execute commands on remote Windows machines via an interactive shell.
  • Enable logging and debugging for better traceability.
  • Navigate command history using up/down arrow keys.
  • Display colorized output for improved readability.
  • Support for Pass-the-Hash authentication.
  • Auto-complete remote file and directory paths.
  • Lightweight and Python-based for ease of use.
  • Keyboard Interrupt (Ctrl+C) support to terminate long-running commands gracefully.
  • Support for SSL to secure communication with the remote host.
  • Support for Kerberos authentication with SPN (Service Principal Name) prefix and hostname options.
  • Support for custom WSMan URIs.

Installation (Windows/Linux)

Installation of Kerberos prerequisites on Linux

sudo apt install gcc python3-dev libkrb5-dev
# Optional: krb5-user

Install evil-winrm-py

You may use pipx instead of pip to install evil-winrm-py. pipx is a tool to install and run Python applications in isolated environments, which helps prevent dependency conflicts by keeping the tool's dependencies separate from your system's Python packages.

pip install evil-winrm-py
pip install evil-winrm-py[kerberos] # for kerberos support on Linux

or if you want to install with latest commit from the main branch you can do so by cloning the repository and installing it with pip/pipx:

git clone https://github.com/adityatelange/evil-winrm-py
cd evil-winrm-py
pip install .

Update

pip install --upgrade evil-winrm-py

Uninstall

pip uninstall evil-winrm-py

Usage

usage: evil-winrm-py [-h] -i IP -u USER [-p PASSWORD] [-H HASH] [-k] [--no-pass] [--spn-prefix SPN_PREFIX] [--spn-hostname SPN_HOSTNAME] [--uri URI] [--ssl] [--port PORT]
               [--log] [--version]

options:
  -h, --help            show this help message and exit
  -i IP, --ip IP        remote host IP or hostname
  -u USER, --user USER  username
  -p PASSWORD, --password PASSWORD
                        password
  -H HASH, --hash HASH  nthash
  -k, --kerberos        use kerberos authentication
  --no-pass             do not prompt for password
  --spn-prefix SPN_PREFIX
                        specify spn prefix
  --spn-hostname SPN_HOSTNAME
                        specify spn hostname
  --uri URI             wsman URI (default: /wsman)
  --ssl                 use ssl
  --port PORT           remote host port (default 5985)
  --log                 log session to file
  --version             show version

Example:

evil-winrm-py -i 192.168.1.100 -u Administrator -p P@ssw0rd --ssl

Credits

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

evil_winrm_py-0.0.7.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

evil_winrm_py-0.0.7-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file evil_winrm_py-0.0.7.tar.gz.

File metadata

  • Download URL: evil_winrm_py-0.0.7.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for evil_winrm_py-0.0.7.tar.gz
Algorithm Hash digest
SHA256 f75ab83a07746b1a9bb4891ac6813830761acb2e4070402eb8518fc179a96e91
MD5 82088abf4466d29046b4c8cce1991490
BLAKE2b-256 68f1d42f9446c0b15abad7f9e2c663fc1c251397815aef75a3cc8b1d0436deca

See more details on using hashes here.

File details

Details for the file evil_winrm_py-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: evil_winrm_py-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for evil_winrm_py-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ce42e426531c469775a67f8805e7c59225176be9398bd5300f51605867d67f8f
MD5 1a4fbbd03a0afe77ae98f01e1955a88a
BLAKE2b-256 96d5a9240840c8cda1966d16e606ba8aab563526d6a7e9cdad1e43f6d68a465c

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