Name | pybashproof JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Conceptual bash-shell tracking |
upload_time | 2024-12-09 13:48:29 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.6 |
license | MIT License Copyright (c) 2024 bitdruid Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
bash
shell
tracking
logging
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![PyPI](https://img.shields.io/pypi/v/pybashproof)](https://pypi.org/project/pybashproof/)
![Python Version](https://img.shields.io/badge/Python-3.6-blue)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# 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 only shows how one step of documentation COULD be done as a small part of the whole project. 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.
# 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 -----------
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pybashproof",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "bash, shell, tracking, logging",
"author": null,
"author_email": "bitdruid <bitdruid@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/fc/9f/1c5eabb4675916c5ee90ac8a664e58f1535ba01ab7390cac5f9a47a49cde/pybashproof-0.1.0.tar.gz",
"platform": null,
"description": "[![PyPI](https://img.shields.io/pypi/v/pybashproof)](https://pypi.org/project/pybashproof/)\n![Python Version](https://img.shields.io/badge/Python-3.6-blue)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# bashproof\n\nThis little project is just a conceptual work used for my thesis about documentation of forensic processes.\n\nIt'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.\n\nHowever, this project is just a CONCEPT - it only shows how one step of documentation COULD be done as a small part of the whole project. 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.\n\nThere is the Linux `script` utility, but it lacks good timestamping and readability.\n\n# Usage\n\n- Run with `bashproof`\n- Stores log in your home dir `bashproof.log`\n- Leave Session with `CTRL+C`\n- Close Case with `bashproof --close`\n - Renames to `bashproof_closed.log`\n - Creates `bashproof_sha256.log` with SHA for `bashproof.log`\n\n# Example log\n\n```\n[2024-12-09 11:27:01] \n[2024-12-09 11:27:01] ----------------------------------\n[2024-12-09 11:27:01] STARTED SHELL-TRACKING\n[2024-12-09 11:27:01] ----------------------------------\n[2024-12-09 11:27:01] HOST: somehost; USER: someuser\n[2024-12-09 11:27:01] ----------------------------------\n[2024-12-09 11:27:01] \n[2024-12-09 11:27:09] --> [ stdIN] lsblk\n[2024-12-09 11:27:09] \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n[2024-12-09 11:27:09] <-- [stdOUT] NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS\n[2024-12-09 11:27:09] <-- [stdOUT] device0 259:0 0 XXXXXX 0 disk\n[2024-12-09 11:27:09] <-- [stdOUT] \u251c\u2500device0p1 259:1 0 XXXM 0 part /boot/efi\n[2024-12-09 11:27:09] <-- [stdOUT] \u251c\u2500device0p2 259:2 0 XXXXXG 0 part /var/log\n[2024-12-09 11:27:09] <-- [stdOUT] \u2502 /home\n[2024-12-09 11:27:09] <-- [stdOUT] \u2502 /var/cache\n[2024-12-09 11:27:09] <-- [stdOUT] \u2502 /\n[2024-12-09 11:27:09] <-- [stdOUT] \u251c\u2500device0p3 259:3 0 XXM 0 part\n[2024-12-09 11:27:09] <-- [stdOUT] \u2514\u2500device0p4 259:4 0 XXXXXG 0 part\n[2024-12-09 11:27:09] \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n[2024-12-09 11:27:25] --> [ stdIN] wget google.com\n[2024-12-09 11:27:25] \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n[2024-12-09 11:27:25] <-- [stdERR] --2024-12-09 11:27:25-- http://google.com/\n[2024-12-09 11:27:25] <-- [stdERR] Resolving google.com (google.com)... 0000:0000:0000:000::0000, 172.217.16.174\n[2024-12-09 11:27:25] <-- [stdERR] Connecting to google.com (google.com)|0000:0000:0000:000::0000|:80... connected.\n[2024-12-09 11:27:25] <-- [stdERR] HTTP request sent, awaiting response... 301 Moved Permanently\n[2024-12-09 11:27:25] <-- [stdERR] Location: http://www.google.com/ [following]\n[2024-12-09 11:27:25] <-- [stdERR] --2024-12-09 11:27:25-- http://www.google.com/\n[2024-12-09 11:27:25] <-- [stdERR] Resolving www.google.com (www.google.com)... 0000:0000:0000:000::0000, 142.251.37.4\n[2024-12-09 11:27:25] <-- [stdERR] Connecting to www.google.com (www.google.com)|0000:0000:0000:000::0000|:80... connected.\n[2024-12-09 11:27:25] <-- [stdERR] HTTP request sent, awaiting response... 200 OK\n[2024-12-09 11:27:25] <-- [stdERR] Length: unspecified [text/html]\n[2024-12-09 11:27:25] <-- [stdERR] Saving to: \u2018index.html\u2019\n[2024-12-09 11:27:25] <-- [stdERR] \n[2024-12-09 11:27:25] <-- [stdERR] 0K .......... ......... 376K=0,05s\n[2024-12-09 11:27:25] <-- [stdERR] \n[2024-12-09 11:27:25] <-- [stdERR] 2024-12-09 11:27:25 (376 KB/s) - \u2018index.html\u2019 saved [19563]\n[2024-12-09 11:27:25] <-- [stdERR] \n[2024-12-09 11:27:25] \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n[2024-12-09 11:27:30] \n[2024-12-09 11:27:30] ----------------------------------\n[2024-12-09 11:27:30] TERMINATED SHELL-TRACKING\n[2024-12-09 11:27:30] ----------------------------------\n[2024-12-09 11:27:32] ----------------------------------\n[2024-12-09 11:27:32] ------------ CASE DONE -----------\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 bitdruid Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Conceptual bash-shell tracking",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/bitdruid/bash-terminal-tracking"
},
"split_keywords": [
"bash",
" shell",
" tracking",
" logging"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d54c12c9be04f662e83409aa748a1186c9644ec2c39aaf31aeec36d140292d23",
"md5": "c0dbb4a2d3b51948e98294d9a23fd959",
"sha256": "d9ce31c4262768e656ce0cae33b4a23a7760cd7500abd39fd945d1fb86fb33b4"
},
"downloads": -1,
"filename": "pybashproof-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c0dbb4a2d3b51948e98294d9a23fd959",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6017,
"upload_time": "2024-12-09T13:48:28",
"upload_time_iso_8601": "2024-12-09T13:48:28.013298Z",
"url": "https://files.pythonhosted.org/packages/d5/4c/12c9be04f662e83409aa748a1186c9644ec2c39aaf31aeec36d140292d23/pybashproof-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fc9f1c5eabb4675916c5ee90ac8a664e58f1535ba01ab7390cac5f9a47a49cde",
"md5": "cdcc4b773233de5df3c9fd1bcf6a1ab5",
"sha256": "b8c18adaebd2046a34629923346aa8feb6a5d47d3b46ca502d2c7a69f604c451"
},
"downloads": -1,
"filename": "pybashproof-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "cdcc4b773233de5df3c9fd1bcf6a1ab5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5039,
"upload_time": "2024-12-09T13:48:29",
"upload_time_iso_8601": "2024-12-09T13:48:29.568779Z",
"url": "https://files.pythonhosted.org/packages/fc/9f/1c5eabb4675916c5ee90ac8a664e58f1535ba01ab7390cac5f9a47a49cde/pybashproof-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-09 13:48:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bitdruid",
"github_project": "bash-terminal-tracking",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pybashproof"
}