Skip to content

Various additions: format to PEP-8, enhanced documentation, nix flake support #1

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

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
156b99d
add: gitignore
theo-abel Apr 14, 2024
492cc5e
feat: updated miasm
theo-abel Apr 14, 2024
34f66fe
add: flake init
theo-abel Apr 14, 2024
eb7079c
add: flake.lock init
theo-abel Apr 14, 2024
77c0427
fmt: PEP8 formatting
theo-abel Apr 14, 2024
6d62210
fmt: imports ordering
theo-abel Apr 14, 2024
efd3dae
feat: documented description, installation and usage
theo-abel Apr 14, 2024
8cc1756
feat: renamed venv
theo-abel Apr 14, 2024
84239d9
fmt: PEP-8 compliance
theo-abel Apr 14, 2024
d832411
feat: added small indications
theo-abel Apr 14, 2024
e22df63
fix: typo in nix env
theo-abel Apr 14, 2024
fcf0f12
feat: added dataset informations
theo-abel Apr 14, 2024
ddab3dc
Merge branch 'main' of github.com:standard3/mmushell
theo-abel Apr 14, 2024
2e0345f
feat: organized imports
theo-abel Apr 14, 2024
509e272
fix: numpy installation
theo-abel Apr 14, 2024
9fe8ae5
fmt: imports ordering
theo-abel Apr 14, 2024
03631e8
feat: file organisation + not_ram precisions
theo-abel Apr 16, 2024
f0b2098
add: pylint workflow
theo-abel Apr 22, 2024
526c727
feat: moved mmushell and its components to a module
theo-abel Apr 23, 2024
923a2b6
docs: init
theo-abel Apr 23, 2024
c10387f
feat: created documentation build action
theo-abel Apr 23, 2024
6afb7b0
feat: updated organisation section paths
theo-abel Apr 23, 2024
218442d
del: deleted useless pylint action
theo-abel Apr 23, 2024
75756b5
feat: updated actions to use node v20
theo-abel Apr 23, 2024
9fa08e0
docs: moved README to documentation
theo-abel Apr 23, 2024
29afec9
docs: customized mkdocs
theo-abel Apr 23, 2024
6e85d2a
docs: documented exported modules
theo-abel Apr 23, 2024
4f06a23
docs: documented CPUReg, TableEntry
theo-abel Apr 25, 2024
597ac6e
docs: PageTable
theo-abel Apr 25, 2024
425e360
docs: continued
theo-abel Apr 25, 2024
adb0535
Update exporter.md with explanation for _explore_radixtree and _recon…
Esgr0bar Apr 24, 2024
025217d
Update exporter.md
Esgr0bar Apr 24, 2024
47e2f57
Update exporter.md to handle the _export_virtual_memory_elf function …
Esgr0bar Apr 24, 2024
aea64c3
Update exporter.md remove the doc to be handle in the commentary code
Esgr0bar Apr 24, 2024
1d3d38f
Update exporter.py to be commented in reconstruct_mappings | explore…
Esgr0bar Apr 24, 2024
4c3a51d
Update exporter.py with comments on most valuable function to better …
Esgr0bar Apr 26, 2024
b6ee67a
docs: Update exporter.py with explanation comments for some Class
Esgr0bar Apr 26, 2024
cf397a3
docs: Update exporter.py with explanation for some init Class
Esgr0bar Apr 26, 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
15 changes: 15 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: build-mkdocs
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- run: pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2
- run: mkdocs gh-deploy --force --clean --verbose
163 changes: 163 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Project specific
dataset/
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
# mmushell
MMUShell OS-Agnostic Memory Forensics Tool

Proof of concept for techniques developed by Andrea Oliveri and Davide Balzarotti in
## Description

["In the Land of MMUs: Multiarchitecture OS-Agnostic Virtual Memory Forensics"](https://doi.org/10.1145/3528102)
MMUShell is an OS-Agnostic memory morensics tool, a proof of concept for techniques developed by Andrea Oliveri and Davide Balzarotti in ["In the Land of MMUs: Multiarchitecture OS-Agnostic Virtual Memory Forensics"](https://doi.org/10.1145/3528102).

Installation:
The first step required to perform any analysis of a physical memory image is the reconstruction of the virtual address spaces, which allows translating virtual addresses to their corresponding physical offsets. However, this phase is often overlooked, and the challenges related to it are rarely discussed in the literature. Practical tools solve the problem by using a set of custom heuristics tailored on a very small number of well-known operating systems (OSs) running on few architectures.

In the whitepaper, we look for the first time at all the different ways the virtual to physical translation can be operated in 10 different CPU architectures. In each case, we study the inviolable constraints imposed by the memory management unit that can be used to build signatures to recover the required data structures from memory without any knowledge about the running OS.

This tool allows to experiment with the extraction of virtual address spaces, showing the challenges of performing an OS-agnostic virtual to physical address translation in real-world scenarios.
It was tested on a large set of 26 different OSs, 6 architectures and a use case on a real hardware device.

## Quick installation

On a standard Linux distribution :
```shell
$ python -m venv --system-site-packages --symlinks venv
$ venv/bin/pip install -r requirements.txt
```
pip install -r requirements.txt

On Nix/NixOS :
```shell
$ nix develop
# or with direnv
$ direnv allow .
```

Usage:
- Dump all the RAM areas of the machine that you want to analyze in raw format, one file per physical memory area.
- Create a YAML file describing the hardware configuration of the machine (see the examples available in the dataset).
- ```mmushell machine.yaml```
- Use the interactive shell to find MMU registers, Radix-Trees, Hash tables etc. and explore them. The ```help``` command lists all the possible actions available for the selected CPU architecture.
- [Here](https://www.s3.eurecom.fr/datasets/datasets_old_www/mmushell_dataset.tar) part of the dataset containing the memory dumps of the OSs used in the paper (only the open-source ones, due to license restrictions).
- ```/qemu/``` contains the patch for QEMU 5.0.0 in order to collect the ground truth values of the MMU registers during OSs execution.
## Documentation

You can find the updated documentation [here](https://memoscopy.github.io/mmushell), where you will find tutorials, how-to guides, references and explanations on this project.
Loading