Exemplo n.º 1
0
            # If no rpath, set content and remote final filename as random
            try:
                content = open(proxy_path, "r").read()
            except Exception, e:
                raise ProbeException(self.name, "'%s' %s" % (self.args["lpath"], WARN_NO_SUCH_FILE))

            self.args["lpath"] = randstr(4) + ".php"
            self.args["content"] = content

        else:

            # Else, set lpath as proxy filename

            self.args["lpath"] = proxy_path
            self.args["content"] = None

        Upload2web._prepare_probe(self)

    def _output_result(self):

        Upload2web._output_result(self)

        sess_filename = os.path.join(*(self.args["rpath"].split("/")[:-1] + ["sess_*"]))

        self._output = """Php proxy installed, point your browser to %s?u=http://www.google.com .
Delete '%s' and '%s' at session end.""" % (
            self.args["url"],
            self.args["rpath"],
            sess_filename,
        )