Skip to main content

Logs the output of commands, so that it can be replayed later

Project description

Shell command logger (scl)

PyPI version License Python versions

This program uses the linux script and scriptreplay commands to record and replay the output of any desired commands.

Documentation

This README just contains basic usage information. For more please consult the documentation. It is also provided in the docs folder and can be locally viewed by following these steps:

  1. Install development dependencies (only required once):
    python3 -m pip install -r requirements-dev.txt
    
  2. Building the documentation and starting a local webserver:
    mkdocs serve
    
  3. Open localhost:8000

Installation

Install via pip:

pip install shell-command-logger[full]

Usage

To record a command, you just prefix it with scl log:

scl log ls -1 /

You can use scl replay to interactively choose and replay a file. With scl search you can search logged commands. For more information see the documentation or run scl --help.

Known issues

  • script does strange things to input (I think to \r), so you should not wrap any netcat variants (nc, ncat, netcat).
  • Ctrl+C kills scl, even if the program you call would handle the key combination. This is especially annoying with tools like msfconsole.

Notable changes

Version 0.4.1

  • By default do not attempt to deal with "unnecessary" \r added by script ay more. It caused too many troubles. If you want/need the old behavior, set the environment variable SCL_STRIP_CR to the value 1.
  • Pass SIGINT signals (usually triggered by Ctrl-C) to the process being logged instead of being interrupted -> logging things like shells should work (better)
  • Removed aliases for problematic tools (msfconsole, nc, ncat, netcat)

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

shell-command-logger-0.4.1.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

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

shell_command_logger-0.4.1-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file shell-command-logger-0.4.1.tar.gz.

File metadata

  • Download URL: shell-command-logger-0.4.1.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for shell-command-logger-0.4.1.tar.gz
Algorithm Hash digest
SHA256 158f053fbf590c1e58165e46f226ef5338ca0696f8e85ff78e7ea66f64170c3e
MD5 978e84609501ce8f7ec412bb0719488a
BLAKE2b-256 6ee1664b347247e673b5d586021c63e214793a126b9058baeb3f75aa92543a00

See more details on using hashes here.

File details

Details for the file shell_command_logger-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for shell_command_logger-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7badd305ac777fdacff4ec8c443562d4f4ca49e824e2736a901ebc8ae4a02021
MD5 ac1e6e2c64fdd6e82821d82871ba7033
BLAKE2b-256 d6bef95beac71bf8733ee597e406d2169c9ebda83d935f6c416f4c2da705ee6e

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