Exemplo n.º 1
0
    def _prepare(self):

        self.__check_httpfs()

        # If not umount or just-mount URL, try installation
        if not self.args['umount_all'] and not self.args['just_mount']:

            self.__generate_httpfs()

            Upload2web._prepare(self)

        # If just mount, set remote url
        elif self.args['just_mount']:
            self.args['url'] = self.args['just_mount']
Exemplo n.º 2
0
    def _prepare(self):

        self.__check_httpfs()
    
        # If not umount or just-mount URL, try installation
        if not self.args['umount_all'] and not self.args['just_mount']:
            
            self.__generate_httpfs()
                        
            Upload2web._prepare(self)

        # If just mount, set remote url
        elif self.args['just_mount']:
            self.args['url'] = self.args['just_mount']
Exemplo n.º 3
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(self)

    def _stringify_result(self):

        Upload2web._stringify_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,
        )
Exemplo n.º 4
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(self)

    def _stringify_result(self):

        Upload2web._stringify_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)