From 9faa13820ace5340d7b591074767af443fa01b94 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sun, 22 May 2016 19:21:24 +0100 Subject: [PATCH] Since we're a forensics program, make sure we only read unless we know the user REALLY wants to write. --- volatility/framework/layers/physical.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/volatility/framework/layers/physical.py b/volatility/framework/layers/physical.py index d200ffd54..64709c436 100644 --- a/volatility/framework/layers/physical.py +++ b/volatility/framework/layers/physical.py @@ -62,7 +62,9 @@ class FileLayer(interfaces.layers.DataLayerInterface): def __init__(self, context, config_path, name, filename): interfaces.layers.DataLayerInterface.__init__(self, context, config_path, name) - self._file = open(filename, "r+b") + # FIXME: Add "+" to the mode once we've determined whether write mode is enabled + mode = "rb" + self._file = open(filename, mode) self._size = os.path.getsize(filename) @property