예제 #1
0
    def execute_command(self, cmd, timeout):
        ret = None
        if self.debugging_interface is None:
            cmd_obj = TimeoutCommand(cmd)
            ret = cmd_obj.run(timeout=self.timeout)
            if cmd_obj.stderr is not None:
                print cmd_obj.stderr
        else:
            self.iface.timeout = self.timeout
            if not has_pykd or self.iface != pykd_iface:
                if self.iface == asan_iface:
                    crash = self.iface.main(
                        asan_symbolizer_path=self.asan_symbolizer_path,
                        args=cmd)
                else:
                    crash = self.iface.main(cmd)
            else:
                # Avoid network timeouts and unnecessary delays when using pykd
                os.putenv("_NT_SYMBOL_PATH", "")
                crash = pykd_iface.main([cmd],
                                        timeout,
                                        mode=self.mode,
                                        windbg_path=self.windbg_path,
                                        exploitable_path=self.exploitable_path)

            if crash is not None:
                self.last_crash = crash
                ret = 0xC0000005  # Access violation in Windows

        return ret
예제 #2
0
 def launch_debugger(self, timeout, command, filename):
   self.iface.timeout = int(timeout)
   
   if command.find("@@") > -1:
     cmd = [command.replace("@@", filename), ]
   else:
     cmd = [command, filename]
   
   log("Launching debugger with command %s" % " ".join(cmd))
   if self.iface != pykd_iface:
     crash = self.iface.main(" ".join(cmd))
   else:
     reload(pykd_iface)
     crash = pykd_iface.main(cmd, mode=self.mode, windbg_path=self.windbg_path, exploitable_path=self.exploitable_path)
   return crash
예제 #3
0
  def execute_command(self, cmd, timeout):
    ret = None
    if self.debugging_interface is None:
      cmd_obj = TimeoutCommand(cmd)
      ret = cmd_obj.run(timeout=self.timeout)
    else:
      self.iface.timeout = self.timeout
      if self.iface != pykd_iface:
        crash = self.iface.main(cmd)
      else:
        crash = pykd_iface.main([cmd], mode=self.mode, windbg_path=self.windbg_path, exploitable_path=self.exploitable_path)

      if crash is not None:
        ret = 0xC0000005 # Access violation in Windows

    return ret
예제 #4
0
  def launch_debugger(self, timeout, command, filename):
    if command.find("@@") > -1:
      cmd = [command.replace("@@", filename), ]
    else:
      cmd = [command, filename]

    log("Launching debugger with command %s" % " ".join(cmd))
    if not has_pykd or self.iface != pykd_iface:
      self.iface.timeout = int(timeout)
      if self.debugging_interface == "asan":
        crash = self.iface.main(asan_symbolizer_path=self.asan_symbolizer_path, args=cmd)
      else:
        crash = self.iface.main(cmd)
    else:
      reload(pykd_iface)
      crash = pykd_iface.main(cmd, self.timeout, mode=self.mode, windbg_path=self.windbg_path, exploitable_path=self.exploitable_path)
    return crash
예제 #5
0
  def launch_debugger(self, timeout, command, filename):
    if command.find("@@") > -1:
      cmd = [command.replace("@@", filename), ]
    else:
      cmd = [command, filename]

    log("Launching debugger with command %s" % " ".join(cmd))
    if not has_pykd or self.iface != pykd_iface:
      self.iface.timeout = int(timeout)
      if self.debugging_interface == "asan":
        crash = self.iface.main(asan_symbolizer_path=self.asan_symbolizer_path, args=cmd)
      else:
        crash = self.iface.main(" ".join(cmd))
    else:
      reload(pykd_iface)
      crash = pykd_iface.main(cmd, self.timeout, mode=self.mode, windbg_path=self.windbg_path, exploitable_path=self.exploitable_path)
    return crash
예제 #6
0
  def execute_command(self, cmd, timeout):
    ret = None
    if self.debugging_interface is None:
      cmd_obj = TimeoutCommand(cmd)
      ret = cmd_obj.run(timeout=self.timeout)
      if cmd_obj.stderr is not None:
        print cmd_obj.stderr
    else:
      self.iface.timeout = self.timeout
      if not has_pykd or self.iface != pykd_iface:
        crash = self.iface.main(cmd)
      else:
        os.putenv("_NT_SYMBOL_PATH", "")
        crash = pykd_iface.main([cmd], timeout, mode=self.mode, windbg_path=self.windbg_path, exploitable_path=self.exploitable_path)

      if crash is not None:
        ret = 0xC0000005 # Access violation in Windows

    return ret
예제 #7
0
    def execute_command(self, cmd, timeout):
        ret = None
        if self.debugging_interface is None:
            cmd_obj = TimeoutCommand(cmd)
            ret = cmd_obj.run(timeout=self.timeout)
        else:
            self.iface.timeout = self.timeout
            if self.iface != pykd_iface:
                crash = self.iface.main(cmd)
            else:
                crash = pykd_iface.main([cmd],
                                        mode=self.mode,
                                        windbg_path=self.windbg_path,
                                        exploitable_path=self.exploitable_path)

            if crash is not None:
                ret = 0xC0000005  # Access violation in Windows

        return ret
예제 #8
0
    def launch_debugger(self, timeout, command, filename):
        self.iface.timeout = int(timeout)

        if command.find("@@") > -1:
            cmd = [
                command.replace("@@", filename),
            ]
        else:
            cmd = [command, filename]

        log("Launching debugger with command %s" % " ".join(cmd))
        if self.iface != pykd_iface:
            crash = self.iface.main(" ".join(cmd))
        else:
            reload(pykd_iface)
            crash = pykd_iface.main(cmd,
                                    mode=self.mode,
                                    windbg_path=self.windbg_path,
                                    exploitable_path=self.exploitable_path)
        return crash
예제 #9
0
    def execute_command(self, cmd, timeout):
        ret = None
        if self.debugging_interface is None:
            cmd_obj = TimeoutCommand(cmd)
            ret = cmd_obj.run(timeout=self.timeout)
            if cmd_obj.stderr is not None:
                print cmd_obj.stderr
        else:
            self.iface.timeout = self.timeout
            if not has_pykd or self.iface != pykd_iface:
                crash = self.iface.main(cmd)
            else:
                os.putenv("_NT_SYMBOL_PATH", "")
                crash = pykd_iface.main([cmd],
                                        timeout,
                                        mode=self.mode,
                                        windbg_path=self.windbg_path,
                                        exploitable_path=self.exploitable_path)

            if crash is not None:
                ret = 0xC0000005  # Access violation in Windows

        return ret
예제 #10
0
  def execute_command(self, cmd, timeout):
    ret = None
    if self.debugging_interface is None:
      cmd_obj = TimeoutCommand(cmd)
      ret = cmd_obj.run(timeout=self.timeout)
      if cmd_obj.stderr is not None:
        print cmd_obj.stderr
    else:
      self.iface.timeout = self.timeout
      if not has_pykd or self.iface != pykd_iface:
        if self.iface == asan_iface:
          crash = self.iface.main(asan_symbolizer_path=self.asan_symbolizer_path, args=cmd)
        else:
          crash = self.iface.main(cmd)
      else:
        # Avoid network timeouts and unnecessary delays when using pykd
        os.putenv("_NT_SYMBOL_PATH", "")
        crash = pykd_iface.main([cmd], timeout, mode=self.mode, windbg_path=self.windbg_path, exploitable_path=self.exploitable_path)

      if crash is not None:
        self.last_crash = crash
        ret = 0xC0000005 # Access violation in Windows

    return ret