Blame view

modules/mft.py 622 Bytes
1
from module import Module
Imanol-Mikel Barba Sabariego authored
2
3
from runcmd import runProcess
import tomb
Imanol-Mikel Barba Sabariego authored
4
import os
5
6
7
def getInstance():
    return MFTModule()
8
9
10

class MFTModule(Module):
11
    def __init__(self):
12
13
        self.name = "mft"
        self.description = "Extracts NTFS MFT"
14
15
        self.requiredVars = ["ntfsvol"]
        self.vars = {}
16
17

    def run(self):
Imanol-Mikel Barba Sabariego authored
18
19
        path = tomb.getPath() + self.name + "/"
        os.mkdir(path)
Imanol-Mikel Barba Sabariego authored
20
21
        for vol in self.vars['ntfsvol'].value:
            result = runProcess(["icat","/dev/" + vol,"0"])
Imanol-Mikel Barba Sabariego authored
22
            mftbin = open(path + vol + ".bin",'wb')
Imanol-Mikel Barba Sabariego authored
23
24
            mftbin.write(result[0])
            mftbin.close()
25