Skip to main content

PyPI Python Version License: MIT Ubuntu

bashproof

This little project is just a conceptual work used for my thesis about documentation of forensic processes.

It's purpose is to log the input/output of the bash terminal in a readable and evidentiary way. Forensic staff would be able to prove any of their actions when confronted with digital evidence.

However, this project is just a CONCEPT - it shows how one step of documentation COULD be done - or moreover, what kind of output would be useful - as a small part of the overall forensic process. One problem is that the script does not directly start an interactive shell in the traditional sense, but simulates one by creating a custom shell-like environment. A sub-process is used to pipe the input to bash and receive stdout/stderr accordingly. Because of this, you cannot use auto-completion. Also, I have not tested complex input.

There is the Linux script utility, but it lacks good timestamping and readability.

Installation

pip install pybashproof

Usage

  • Run with bashproof
  • Stores log in your home dir bashproof.log
  • Leave Session with CTRL+C
  • Close Case with bashproof --close
    • Renames to bashproof_closed.log
    • Creates bashproof_sha256.log with SHA for bashproof.log

Example log

[2024-12-09 11:27:01] 
[2024-12-09 11:27:01] ----------------------------------
[2024-12-09 11:27:01] STARTED SHELL-TRACKING
[2024-12-09 11:27:01] ----------------------------------
[2024-12-09 11:27:01] HOST: somehost; USER: someuser
[2024-12-09 11:27:01] ----------------------------------
[2024-12-09 11:27:01] 
[2024-12-09 11:27:09] --> [ stdIN] lsblk
[2024-12-09 11:27:09] ────────────────────────────────────────────────────
[2024-12-09 11:27:09] <-- [stdOUT] NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
[2024-12-09 11:27:09] <-- [stdOUT] device0     259:0    0 XXXXXX  0 disk
[2024-12-09 11:27:09] <-- [stdOUT] ├─device0p1 259:1    0   XXXM  0 part /boot/efi
[2024-12-09 11:27:09] <-- [stdOUT] ├─device0p2 259:2    0 XXXXXG  0 part /var/log
[2024-12-09 11:27:09] <-- [stdOUT] │                                     /home
[2024-12-09 11:27:09] <-- [stdOUT] │                                     /var/cache
[2024-12-09 11:27:09] <-- [stdOUT] │                                     /
[2024-12-09 11:27:09] <-- [stdOUT] ├─device0p3 259:3    0    XXM  0 part
[2024-12-09 11:27:09] <-- [stdOUT] └─device0p4 259:4    0 XXXXXG  0 part
[2024-12-09 11:27:09] ────────────────────────────────────────────────────
[2024-12-09 11:27:25] --> [ stdIN] wget google.com
[2024-12-09 11:27:25] ────────────────────────────────────────────────────
[2024-12-09 11:27:25] <-- [stdERR] --2024-12-09 11:27:25--  http://google.com/
[2024-12-09 11:27:25] <-- [stdERR] Resolving google.com (google.com)... 0000:0000:0000:000::0000, 172.217.16.174
[2024-12-09 11:27:25] <-- [stdERR] Connecting to google.com (google.com)|0000:0000:0000:000::0000|:80... connected.
[2024-12-09 11:27:25] <-- [stdERR] HTTP request sent, awaiting response... 301 Moved Permanently
[2024-12-09 11:27:25] <-- [stdERR] Location: http://www.google.com/ [following]
[2024-12-09 11:27:25] <-- [stdERR] --2024-12-09 11:27:25--  http://www.google.com/
[2024-12-09 11:27:25] <-- [stdERR] Resolving www.google.com (www.google.com)... 0000:0000:0000:000::0000, 142.251.37.4
[2024-12-09 11:27:25] <-- [stdERR] Connecting to www.google.com (www.google.com)|0000:0000:0000:000::0000|:80... connected.
[2024-12-09 11:27:25] <-- [stdERR] HTTP request sent, awaiting response... 200 OK
[2024-12-09 11:27:25] <-- [stdERR] Length: unspecified [text/html]
[2024-12-09 11:27:25] <-- [stdERR] Saving to: ‘index.html’
[2024-12-09 11:27:25] <-- [stdERR] 
[2024-12-09 11:27:25] <-- [stdERR] 0K .......... .........                                    376K=0,05s
[2024-12-09 11:27:25] <-- [stdERR] 
[2024-12-09 11:27:25] <-- [stdERR] 2024-12-09 11:27:25 (376 KB/s) - ‘index.html’ saved [19563]
[2024-12-09 11:27:25] <-- [stdERR] 
[2024-12-09 11:27:25] ────────────────────────────────────────────────────
[2024-12-09 11:27:30] 
[2024-12-09 11:27:30] ----------------------------------
[2024-12-09 11:27:30] TERMINATED SHELL-TRACKING
[2024-12-09 11:27:30] ----------------------------------
[2024-12-09 11:27:32] ----------------------------------
[2024-12-09 11:27:32] ------------ CASE DONE -----------

Metadata

Release files for pybashproof 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybashproof 0.1.2
File Size Uploaded Provenance Actions
pybashproof-0.1.2.tar.gz 5.2 kB Without provenance Details for pybashproof-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybashproof 0.1.2
File Interpreter ABI Platform Actions
pybashproof-0.1.2-py3-none-any.whl Python 3 none any Details for pybashproof-0.1.2-py3-none-any.whl

Total release size: 11.4 kB

Release files / pybashproof-0.1.2.tar.gz

Download URL pybashproof-0.1.2.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
45f30fbca5ff741f4552618802508ed40d278722babb5f78c21d5586c630b8af
BLAKE2b-256 checksum
How to use checksums
a8c9d64cc668b28294c1e277fb627be6f5f7978550dbe820b33d723c3bbb5ed1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / pybashproof-0.1.2-py3-none-any.whl

Download URL pybashproof-0.1.2-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d86794f3b3515b7803b8d0c6086c913f021b04fcfe7ff5ff79c35ce82207680c
BLAKE2b-256 checksum
How to use checksums
c3dff304ab0dcbe83b58a6be54314ac562594c51d35c871b03138aa1623ada56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Security for pybashproof 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page