featherduster.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:featherduster 作者: nccgroup 项目源码 文件源码
def run(self, line):
      def _formatOutput(res):
         if isinstance(res, str):
            return res
         else:
             try:
                 return "\n".join(_formatOutput(r) for r in res)
             except TypeError:
                 return str(res)

      ishellCompleter = readline.get_completer()
      readline.set_completer_delims(' \t\n;')
      readline.parse_and_bind("tab: complete")
      readline.set_completer(completer.complete)

      filePath =  raw_input("Please specify a path to the output file: ").strip()

      readline.set_completer(ishellCompleter)
      if os.path.isfile(filePath):
         confirm = raw_input("File already exists and will be overwritten, confirm? [y/N] ")
         if confirm is "" or confirm[0] not in ("y", "Y"):
            print "Canceled."
            return

      with open(filePath, "w+") as handle:
        handle.write(_formatOutput(feathermodules.results))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号