def do_runexp(self, line): '''Run the exploit using''' if not self._check_before_running(): return if exp: print 'Exploit Running...' os.chdir(exp.frame_path) sys.path.append(exp.frame_path) if hasattr(exp, 'in_new_terminal') and exp.in_new_terminal: if magicfork() == 0: exp.run() return True else: return False else: exp.run() sys.path.remove(exp.frame_path) os.chdir(root_path) print 'Script Finished.' else: print 'No exploit using. Nothing to do.'
def do_runvul(self, line): '''Run the vulnerability using''' if not self._check_before_running(): return False if vul: print 'Vulnerability Running...' os.chdir(vul.frame_path) sys.path.append(vul.frame_path) if hasattr(vul, 'in_new_terminal') and vul.in_new_terminal: if magicfork() == 0: vul.run() return True else: return False else: vul.run() sys.path.remove(vul.frame_path) os.chdir(root_path) print 'Script Finished.' else: print 'No vulnerability using. Nothing to do.' return False