import os import tomb from modules.module import Module from runcmd import runProcess import datetime def getInstance(): return INFOModule() class INFOModule(Module): def __init__(self): self.name = "info" self.description = "Extracts information about this machine" self.requiredVars = [] self.vars = {} def execute(self): path = tomb.getPath() + self.name + "/" if(not os.path.exists(path)): os.mkdir(path) output,code = runProcess("lshw") lshw = open(path + "lshw_" + str(datetime.datetime.now()) + ".txt", 'wb') lshw.write(output) lshw.close() output,code = runProcess("dmidecode") lshw = open(path + "dmidecode_" + str(datetime.datetime.now()) + ".txt" 'wb') lshw.write(output) lshw.close()