diff --git b/.idea/gravedigger.iml a/.idea/gravedigger.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ a/.idea/gravedigger.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git b/.idea/misc.xml a/.idea/misc.xml new file mode 100644 index 0000000..aa314da --- /dev/null +++ a/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git b/.idea/modules.xml a/.idea/modules.xml new file mode 100644 index 0000000..b8f2444 --- /dev/null +++ a/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git b/.idea/vcs.xml a/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ a/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git b/.idea/workspace.xml a/.idea/workspace.xml new file mode 100644 index 0000000..2e0bb3b --- /dev/null +++ a/.idea/workspace.xml @@ -0,0 +1,596 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1477294531575 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git b/__pycache__/module.cpython-34.pyc a/__pycache__/module.cpython-34.pyc new file mode 100644 index 0000000..637b63c --- /dev/null +++ a/__pycache__/module.cpython-34.pyc diff --git b/__pycache__/modulevar.cpython-34.pyc a/__pycache__/modulevar.cpython-34.pyc new file mode 100644 index 0000000..eab07dc --- /dev/null +++ a/__pycache__/modulevar.cpython-34.pyc diff --git b/digger.py a/digger.py new file mode 100644 index 0000000..b88a818 --- /dev/null +++ a/digger.py @@ -0,0 +1,65 @@ +#! /usr/bin/env python3 + +import locale +from dialog import Dialog +import glob +import os +import sys +import subprocess as sp + +sys.path.append('modules') +sys.path.append('vars') + +vars = {} + +def getModules(): + choiceList = [] + modules = [] + for filename in glob.glob('./modules/*.py'): + modules.append(os.path.splitext(os.path.basename(filename))[0]) + modules.remove('__init__') + + for modname in modules: + try: + module = __import__(modname) + instance = module.getInstance(vars) + choiceList.append((instance.name,instance.description,False)) + del instance + del module + sys.modules.pop(modname) + except Exception as e: + print("Exception raised while importing " + modname) + + choiceList.append(("all","Execute all modules",False)) + return choiceList + +def prepareModule(moduleName): + module = __import__(moduleName).getInstance(vars) + module.getVars() + return module + +locale.setlocale(locale.LC_ALL, '') +d = Dialog(dialog="dialog",autowidgetsize=True) +d.set_background_title("My little program") + +moduleList = getModules() +code, tags = d.checklist("Select modules to execute", + choices=moduleList, + title="Module selection") +if code == d.OK: + runlist = [] + if "All" in tags: + for module in moduleList: + runlist.append(prepareModule(module)) + else: + for tag in tags: + runlist.append(prepareModule(tag)) + + sp.call('clear', shell=True) + + for module in runlist: + print("Running " + module.name + "...") + try: + module.run() + except Exception as e: + print("Exception raised while running " + module.name + ": " + str(e)) diff --git b/module.py a/module.py new file mode 100644 index 0000000..b1737ef --- /dev/null +++ a/module.py @@ -0,0 +1,21 @@ +from abc import ABCMeta, abstractmethod + +class Module(object): + __metaclass__ = ABCMeta + + sharedVars = {} + name = "" + description = "" + vars = [] + + @abstractmethod + def run(self): + pass + + def getVars(self): + for var in self.vars: + if var in self.sharedVars: + continue + modvar = __import__(var).getInstance() + modvar.query() + self.sharedVars[modvar.name] = modvar \ No newline at end of file diff --git b/modules/__init__.py a/modules/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ a/modules/__init__.py diff --git b/modules/__pycache__/mft.cpython-34.pyc a/modules/__pycache__/mft.cpython-34.pyc new file mode 100644 index 0000000..d8f8de0 --- /dev/null +++ a/modules/__pycache__/mft.cpython-34.pyc diff --git b/modules/mft.py a/modules/mft.py new file mode 100644 index 0000000..db8e6a0 --- /dev/null +++ a/modules/mft.py @@ -0,0 +1,16 @@ +from module import Module + +def getInstance(vars): + return MFTModule(vars) + +class MFTModule(Module): + + def __init__(self,vars): + self.sharedVars = vars + self.name = "mft" + self.description = "Extracts NTFS MFT" + self.vars = ["ntfsvol"] + + def run(self): + pass + diff --git b/modulevar.py a/modulevar.py new file mode 100644 index 0000000..2b30870 --- /dev/null +++ a/modulevar.py @@ -0,0 +1,15 @@ +from abc import ABCMeta,abstractmethod + +class Modulevar(object): + __metaclass__ = ABCMeta + + name = "" + description = "" + value = None + + def setValue(self,value): + self.value = value + + @abstractmethod + def query(self): + pass \ No newline at end of file diff --git b/scripts/dig.service a/scripts/dig.service new file mode 100644 index 0000000..e333294 --- /dev/null +++ a/scripts/dig.service @@ -0,0 +1,15 @@ +[Unit] +Description=Gravedigger's start script +After=getty@tty1.service + +[Service] +Type=simple +ExecStart=/usr/local/bin/digger.sh +ExecReload=/usr/local/bin/digger.sh +StandardInput=tty +StandardOutput=tty +TTYPath=/dev/tty1 +Restart=always + +[Install] +WantedBy=default.target diff --git b/scripts/digger.sh a/scripts/digger.sh new file mode 100644 index 0000000..7ee8ca9 --- /dev/null +++ a/scripts/digger.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +GD_PATH="/opt/gravedigger" + +#set tty +/bin/stty -echoprt + +/usr/bin/env python3 $GD_PATH/digger.py \ No newline at end of file diff --git b/vars/__pycache__/ntfsvol.cpython-34.pyc a/vars/__pycache__/ntfsvol.cpython-34.pyc new file mode 100644 index 0000000..977e840 --- /dev/null +++ a/vars/__pycache__/ntfsvol.cpython-34.pyc diff --git b/vars/ntfsvol.py a/vars/ntfsvol.py new file mode 100644 index 0000000..0dda38f --- /dev/null +++ a/vars/ntfsvol.py @@ -0,0 +1,14 @@ +from modulevar import Modulevar + +def getInstance(): + return NTFSVol() + +class NTFSVol(Modulevar): + + def __init__(self): + self.name = "ntfsvol" + self.description = "NTFS Volume" + self.value = None + + def query(self): + print("WHAT IS VAR " + self.name) \ No newline at end of file