Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #52

Merged
merged 36 commits into from
Jul 25, 2024
Merged

Dev #52

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c903fee
Enhance documentation for the project (#41)
Ston14 Jul 2, 2024
39d1bfe
Add build docs
Jul 2, 2024
cc0b93d
Add more docs (#42)
Ston14 Jul 2, 2024
3400634
Add references (#43)
Ston14 Jul 2, 2024
7cef323
Add references
Jul 2, 2024
b0c2112
Add title
Jul 2, 2024
84e5bad
Title 2
Jul 2, 2024
6c5480f
add : mkdocs navigation references
Jul 2, 2024
a81ed48
document codes
Jul 2, 2024
da1076a
fix typo
Jul 2, 2024
738acfc
typo
Jul 2, 2024
d1bd493
fix typo
Jul 2, 2024
53a97d0
fix typo in utils
Jul 2, 2024
f2fd43f
fix docs in tutorials.md
Jul 2, 2024
0c4456c
add : How to use documentation
Jul 3, 2024
feec9b1
Add other OS documentation
Jul 3, 2024
50504a2
fix how to
Jul 3, 2024
965c4e2
fix : typo in docs
Jul 3, 2024
1567869
fix : typo
Jul 3, 2024
4af47a7
fix: typo in index
Jul 3, 2024
045a091
add : dark mode
Jul 3, 2024
79d61ab
add : colors on documentation
Jul 3, 2024
4d11ea9
fix: diataxis
Jul 3, 2024
05da208
Fix colors
Jul 3, 2024
f51db37
fix readme
Jul 3, 2024
40aa52a
Fix dumpfiles (#46)
Ston14 Jul 11, 2024
cdd3f55
fix: fix error, function without parameter return an error
Jul 12, 2024
df89499
sorry
Jul 12, 2024
1f51127
fix typing information (#47)
YannMagnin Jul 19, 2024
8d7b9d4
Fix/get plugins (#48)
Ston14 Jul 23, 2024
b9771ec
Fix: Correct dict.get() usage in TreeGrid_to_json renderer and remove…
Jul 23, 2024
8adc5aa
oops
Jul 23, 2024
1eb8a72
fix to dataframe
Jul 23, 2024
d8516d2
add test for volatility (#49)
Ston14 Jul 24, 2024
728f451
Merge branch 'master' into dev
Ston14 Jul 25, 2024
ec9ae6c
fix: poetry lock
Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- dev
jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ print(output.to_df())
print(win.pslist().to_json())
```

All supported features are documented, check it out on [our documentation](https://pydfir.github.io/pyDFIRRam/) !
All supported features are documented, check it out on [our documentation](https://pydfir.github.io/pyDFIRRam) !

## Objectives

Expand Down
15 changes: 10 additions & 5 deletions docs/tutorials.md → docs/Usage/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
## Quick installation

### Prerequisites
Install python3.10
TODO
Install : poetry
TODO
- Python
- Poetry (for dev)
- pip

### From source
On a standard Linux distribution :
Expand All @@ -15,8 +14,14 @@ git clone https://github.com/pydfir/pydfirram
poetry shell
poetry install
```
### From pip
### From pip stable

```shell
pip install pydfirram
```
### From pip dev

```bash
pip install -i https://test.pypi.org/simple/ pydfirram
```

58 changes: 58 additions & 0 deletions docs/Usage/linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Using pyDFIRRam for Linux or macOS

### Introduction

`pyDFIRRam` is a tool under development aimed at utilizing Volatility plugins for memory forensics on Linux and macOS systems.

### Initial Setup

1. **Installation**:
- Ensure Python 3.10 (or compatible version) is installed.
- Install `pyDFIRRam` using Poetry or manually. Example:
```
pip install pydfirram
```

2. **Setting up a Profile**:
- Currently, there's no direct method via Python interface to add a profile. If you have a profile, place it in the Volatility symbols directory:
- For Linux/macOS:
```
$HOME/.local/lib/python3.10/site-packages/volatility3/symbols/
```
- For Poetry virtual environments:
```
$HOME/.cache/pypoetry/virtualenvs/pydfirram-qv9SWnlF-py3.10/lib/python3.10/site-packages/volatility3/symbols/
```

### Using pyDFIRRam

3. **Creating an Object**:
- Import necessary modules and create an object for your memory dump:
```python
from pydfirram.core.base import Generic, OperatingSystem
from pathlib import Path

os = OperatingSystem.LINUX # Set to OperatingSystem.MACOS for macOS
dumpfile = Path("dump.raw") # Replace with your actual memory dump path
generic = Generic(os, dumpfile)
```

4. **Listing Available Functions**:
- To list all available Volatility plugins:
```python
generic.get_all_plugins()
```

5. **Using Plugins**:
- Refer to Volatility plugin documentation for parameters. Example using `pslist` plugin:
```python
generic.pslist(pid=[4]).to_list()
```

6. **Formatting Output**:
- The return from Volatility functions provides a `Rendering` class, allowing customization of output format.

### Notes

- Ensure your memory dump file (`dump.raw` in the example) is correctly specified.
- Adjust paths and settings based on your specific environment and Python setup.
Empty file added docs/Usage/usage.md
Empty file.
45 changes: 45 additions & 0 deletions docs/Usage/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# How to Use pyDFIRRam for Windows

This guide provides a brief and concise demonstration of how to use the pyDFIRRam tool for Windows.

## Introduction

Currently, the project is under development. To use the Volatility-related functions for Windows, follow these steps:

### Initial Setup

First, create an object for your memory dump:

```python
from pydfirram.modules.windows import Windows
from pathlib import Path

dump = Path("/home/dev/image.dump")
win = Windows(dump)
```

### Listing Available Functions

The available functions are all the Volatility plugins (located in the Volatility plugin path).

To list all available functions:

```python
win.get_all_plugins()
```

You can use this function to retrieve all the plugins.

### Using Parameters

If you want to use Volatility parameters, refer to the plugin documentation. The parameters expected are generally the same with the same names.

For example, to use the `pslist` plugin with a parameter:

```python
win.pslist(pid=4).to_list()
```

### Note

On the return of the Volatility functions, a `Rendering` class is retrieved. This allows us to format our output as desired.
1 change: 0 additions & 1 deletion docs/how-to-guides.md

This file was deleted.

5 changes: 2 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ project documentation as described by Daniele Procida
in the [Diátaxis documentation framework](https://diataxis.fr/)
and consists of four separate parts:

1. [Tutorials](tutorials.md)
2. [How-To Guides](how-to-guides.md)
1. [Tutorials](./Usage/installation.md)
2. [How-To Guides](./Usage/usage.md)
3. [Reference](reference/reference.md)
4. [Explanation](explanation.md)
5. [Test](test.md)

Quickly find what you're looking for depending on
your use case by looking at the different pages.
3 changes: 3 additions & 0 deletions docs/reference/base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Base

::: pydfirram.core.base
3 changes: 3 additions & 0 deletions docs/reference/handler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Handler

::: pydfirram.core.handler
9 changes: 4 additions & 5 deletions docs/reference/reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- This part of the project documentation focuses on
an **information-oriented** approach. Use it as a
reference for the technical implementation of the
`calculator` project code. -->

<!-- This part of the project documentation focuses on
an **information-oriented** approach. Use it as a
reference for the technical implementation of the
`calculator` project code. -->
3 changes: 3 additions & 0 deletions docs/reference/renderer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Renderer

::: pydfirram.core.renderer
53 changes: 53 additions & 0 deletions docs/reference/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Test Documentation

## Project Structure
The project is organized as follows:
```bash
.
├── __init__.py
├── config.py
├── data
│   └── dump.raw
├── test_core_base.py
├── test_core_rendering.py
└── test_volatility_windows_function.py
```

### Files Description

- **config.py**
This file contains configuration settings. You need to set the path of your dump file here before running the tests.

- **test_core_base.py**
This script tests the core functionalities used in `pydfirram/core/base.py`.

- **test_core_rendering.py**
This script tests the core functionalities used in `pydfirram/core/renderer.py`.

- **test_volatility_windows_function.py**
This script tests all(Not All configuration an plugins for the moment) plugins of Volatility.

### Test Data
- **data/dump.raw**
This is where your test dump file should be located.

## Running the Tests

### Prerequisites
1. Download the Windows XP image from the Volatility Foundation:
[Win XP Image](https://downloads.volatilityfoundation.org/volatility3/images/win-xp-laptop-2005-06-25.img.gz).

2. Extract the downloaded image and place it in the `data` directory. Rename it to `dump.raw`.

### Configuration
1. Open `config.py`.
2. Set the path of your dump file in the configuration.

### Running the Tests
To run the tests, use the following command:
```bash
pytest
```

## Notes
- The current tests only support Windows architectures. Linux architectures are not supported yet.
3 changes: 3 additions & 0 deletions docs/reference/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Utils

::: pydfirram.core.utils
3 changes: 3 additions & 0 deletions docs/reference/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Windows

::: pydfirram.modules.windows
8 changes: 0 additions & 8 deletions docs/test.md

This file was deleted.

31 changes: 27 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,22 @@ repo_url: https://github.com/PyDFIR/PyDFIRRam
edit_uri: edit/main/docs/

theme:
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode

- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
name: material
color_mode: auto
user_color_mode_toggle: true
locale: en
features:
- search.suggest
- search.highlight
Expand Down Expand Up @@ -39,11 +54,19 @@ markdown_extensions:

nav:
- index.md
- tutorials.md
- how-to-guides.md
- explanation.md
- Usage:
- Installation : Usage/installation.md
- Windows : Usage/windows.md
- Linux/Mac : Usage/linux.md
- Reference:
- Index: reference/reference.md
- explanation.md
- Base: reference/base.md
- Handler: reference/handler.md
- Renderer: reference/renderer.md
- Utils: reference/utils.md
- Windows : reference/windows.md
- Testing : reference/test.md

extra:
version:
Expand All @@ -53,4 +76,4 @@ extra:
link: https://github.com/PyDFIR/pyDFIRRam
name: Github
- icon: material/email
link: "mailto:alexis.debrito@ecole2600.com"
link: "mailto:alexis.debrito@ecole2600.com"
4 changes: 3 additions & 1 deletion pydfirram/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#For poetry builds
"""
pydfirram - simplify and enhance memory forensics tasks
"""
3 changes: 3 additions & 0 deletions pydfirram/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
pydfirram.core - pydfirram core
"""
Loading
Loading