Base
Base
The Generic hierarchy discovers plugins through PluginRegistry, caching the catalogue once per (Volatility version, OS). Prefer run_plugin, list_plugins, has_plugin, and plugin_info for stable callers; legacy attribute access is deprecated. See the Plugins (SDK API) tutorial.
Create generic volatility3 OS wrappers.
This module provides a way to interact with Volatility3 plugins in a more abstract way. It allows to automatically get all available plugins for a specific OS and run them with the required arguments.
Example
The module can be used as follows:
$ python3
>>> from pydfirram.core.base import Generic, OperatingSystem
>>> from pathlib import Path
>>> os = OperatingSystem.WINDOWS
>>> dumpfile = Path("tests/data/dump.raw")
>>> generic = Generic(os, dumpfile)
>>> renderer = generic.run_plugin("windows.pslist")
>>> # renderer.to_df()
Example (API explicite, recommandée) :
>>> generic = Generic(os, dumpfile)
>>> generic.run_plugin("windows.pslist").to_df()
Compatibilité : l'accès par attribut (``generic.pslist()``) reste disponible mais
émet une :exc:`DeprecationWarning`. Voir aussi :meth:`Generic.run_plugin` et
:meth:`Generic.list_plugins`.
Context
Context for a volatility3 plugin.
Attributes:
| Name | Type | Description |
|---|---|---|
os |
OperatingSystem: The operating system. |
|
dump_file |
Path: The dump file path. |
|
context |
V3Context: The volatility3 context. |
|
plugin |
PluginEntry: The plugin entry. |
Constants
KEY_LAYER_STACKER: str: The layer stacker key. KEY_STACKERS: str: The stackers key. KEY_SINGLE_LOCATION: str: The single location key.
Source code in pydfirram/core/base.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 | |
__init__(operating_system, dump_file, plugin, output_dir=None, *, workspace_paths=None, workspace_run_id=None, collision_policy='fail')
Initializes a context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operating_system
|
OperatingSystem
|
The operating system. |
required |
dump_file
|
Path
|
The dump file path. |
required |
plugin
|
PluginEntry
|
The plugin entry. |
required |
workspace_paths
|
RunWorkspacePaths | None
|
When set, artefacts are
stored under structured |
None
|
Source code in pydfirram/core/base.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
add_arguments(context, kwargs)
Handle keyword arguments and set them as context config attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kwargs
|
dict[str, Any]
|
The keyword arguments. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the attribute does not exist. |
Source code in pydfirram/core/base.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
automagics()
Returns a list of volatility3 automagics.
Returns:
| Type | Description |
|---|---|
list[AutomagicInterface]
|
List[V3AutomagicInterface]: A list of automagics. |
Raises:
| Type | Description |
|---|---|
UnsatisfiedException
|
If no automagic can be chosen. |
Source code in pydfirram/core/base.py
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | |
build()
Build a basic context for the provided plugin.
Returns:
| Type | Description |
|---|---|
PluginInterface
|
interfaces.plugins.PluginInterface: The built plugin interface. |
Raises:
| Type | Description |
|---|---|
UnsatisfiedException
|
If the plugin cannot be built. |
Source code in pydfirram/core/base.py
381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
get_available_automagics()
Returns a list of available volatility3 automagics.
Returns:
| Type | Description |
|---|---|
list[AutomagicInterface]
|
List[V3AutomagicInterface]: A list of available automagics. |
Source code in pydfirram/core/base.py
446 447 448 449 450 451 452 453 454 455 | |
get_dump_file_location()
Returns the dump file location.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The dump file location formatted as a URL. |
Source code in pydfirram/core/base.py
492 493 494 495 496 497 498 | |
os_stackers()
Returns a list of stackers for the OS.
Returns:
| Type | Description |
|---|---|
list[AutomagicInterface]
|
List[V3AutomagicInterface]: A list of (volatility3) stackers. |
Source code in pydfirram/core/base.py
481 482 483 484 485 486 487 488 489 490 | |
set_automagic()
setup the automagics
Source code in pydfirram/core/base.py
377 378 379 | |
set_context()
setup the current context
Source code in pydfirram/core/base.py
371 372 373 374 375 | |
Generic
Generic OS wrapper to be used with volatility3
This class provides a way to interact with volatility3 plugins in a more abstract way. It allows to automatically get all available plugins for a specific OS and run them with the required arguments.
It aims to be inherited by specific OS wrappers like Windows, Linux or MacOS.
Attributes:
| Name | Type | Description |
|---|---|---|
os |
OperatingSystem
|
The operating system. |
dump_file |
Path
|
The dump file path. |
context |
Context
|
The context. |
Les plugins disponibles sont découverts via :class:PluginRegistry (cache par version
Volatility3) ; :attr:plugins est une propriété lecture seule.
Source code in pydfirram/core/base.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 | |
plugins
property
Entrées plugins pour cet OS (:class:PluginRegistry mis en cache).
__getattr__(key, **kwargs)
Compatibilité : accès dynamique au style instance.pslist().
Préférer :meth:run_plugin avec un nom qualifié (ex. "windows.pslist").
Déprécié depuis la couche registre : émet une :exc:DeprecationWarning.
Source code in pydfirram/core/base.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | |
__init__(operating_system, dump_file, timeout=None, *, workspace_base=None, output_collision_policy='fail', manifest_include_dump_sha256=False, execution_runtime=None)
Initializes a generic OS.
Les plugins sont chargés depuis le cache Volatility3 à la première lecture
de :attr:plugins, :meth:get_plugin, etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operating_system
|
OperatingSystem
|
The operating system. |
required |
dump_file
|
Path
|
The dump file path. |
required |
timeout
|
float | None
|
Default plugin execution deadline in seconds. |
None
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the dump file does not exist. |
Source code in pydfirram/core/base.py
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | |
get_all_plugins()
Liste des entrées disponibles pour l'OS du wrapper (cache Volatility par version).
Source code in pydfirram/core/base.py
952 953 954 | |
get_plugin(name)
Résout un plugin par nom court ou nom qualifié Volatility.
Raises:
| Type | Description |
|---|---|
PluginNotFoundError
|
Si le nom est inconnu ou ambigu (plusieurs fq identiques courts). |
Source code in pydfirram/core/base.py
944 945 946 947 948 949 950 | |
has_plugin(plugin_name)
Indique si plugin_name est résoluble (court ou fq) pour l'OS courant.
Source code in pydfirram/core/base.py
961 962 963 | |
list_plugins(os_filter=None)
Noms qualifiés des plugins disponibles pour un OS (:class:OperatingSystem).
Source code in pydfirram/core/base.py
956 957 958 959 | |
plugin_info(plugin_name)
Métadonnées :class:PluginDescriptor pour un nom court ou qualifié.
Source code in pydfirram/core/base.py
965 966 967 | |
run_plugin(plugin, timeout=None, *, _reuse_workspace=None, _finalize_workspace=True, **plugin_kwargs)
Exécute un plugin Volatility3 et retourne un :class:Renderer.
Pour un isolement par sous-processus (timeout dur), passer
execution_runtime=SubprocessRuntime() à l'instanciation de
:class:Generic et définir un workspace_base : les journaux et le
JSON de configuration sont alors conservés sous runs/<id>/.
Permet la chaîne explicite instance.run_plugin("windows.pslist").to_df().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugin
|
str | PluginEntry | PluginDescriptor
|
Nom qualifié (ex. |
required |
timeout
|
Optional[float]
|
Éventuel délai d'exécution (secondes). |
None
|
**plugin_kwargs
|
Any
|
Arguments transmis au contexte/config du plugin. |
{}
|
Returns:
| Type | Description |
|---|---|
Renderer
|
class: |
Raises:
| Type | Description |
|---|---|
PluginNotFoundError
|
Si aucun plugin ne correspond. |
VolatilityContextError
|
Si le contexte n'a pas été construit. |
Source code in pydfirram/core/base.py
765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | |
validate_dump_file(dump_file)
Validate dump file location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dump_file
|
Path
|
The dump file path. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the file exists. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the file does not exist. |
Source code in pydfirram/core/base.py
928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | |
OperatingSystem
Bases: Enum
Supported operating system.
Attributes:
| Name | Type | Description |
|---|---|---|
WINDOWS |
Windows OS. |
|
LINUX |
Linux OS. |
|
MACOS |
MacOS OS. |
Source code in pydfirram/core/base.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
to_list()
staticmethod
Returns a list of supported operating systems. Returns: List[str]: List of supported operating systems.
Source code in pydfirram/core/base.py
128 129 130 131 132 133 134 | |
PluginDescriptor
dataclass
Métadonnées stables pour un plugin Volatility3 (nom complètement qualifié + entrée runtime).
Le nom court (suffixe après le dernier .) reste utilisé comme :attr:PluginEntry.name
pour la compatibilité avec l'API historique (:meth:Generic.get_plugin).
Source code in pydfirram/core/base.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
name
property
Nom court utilisé comme clé dynamique windows.pslist → pslist.
as_plugin_entry()
Construit l'entrée attendue par :meth:Generic.run_plugin / le contexte Volatility3.
Source code in pydfirram/core/base.py
189 190 191 | |
PluginEntry
dataclass
A plugin entry.
The interface allows to directly interact with the plugin from volatility3 functions.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
PluginType
|
PluginType: The plugin type. |
name |
str
|
str: The plugin name. |
interface |
PluginInterface
|
PluginInterface: The (volatility3) plugin interface. |
Source code in pydfirram/core/base.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | |
__repr__()
Returns a string representation of the plugin entry.
Source code in pydfirram/core/base.py
167 168 169 | |
PluginRegistry
Registre des plugins Volatility3 visibles pour un OS, mis en cache par version Volatility3.
La découverte (import + list_plugins) n'est exécutée qu'une fois par couple
(version_volatility, operating_system) tant que le cache n'est pas invalidé.
Source code in pydfirram/core/base.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
clear_cache()
classmethod
Vide le cache de découverte (tests / rechargement plugins).
Source code in pydfirram/core/base.py
262 263 264 265 266 | |
list_fq_names()
Noms plugins tels que retournés par Volatility (ex. windows.pslist).
Source code in pydfirram/core/base.py
226 227 228 | |
resolve(name)
Résout par nom court ou par nom qualifié (comparaison insensible à la casse).
Source code in pydfirram/core/base.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | |
PluginType
Bases: Enum
A volatiliry3 plugin type.
Attributes:
| Name | Type | Description |
|---|---|---|
GENERIC |
A generic plugin, can be used with any OS. |
|
SPECIFIC |
An OS-specific plugin. |
Source code in pydfirram/core/base.py
138 139 140 141 142 143 144 145 146 147 | |