예제 #1
0
def redis_connection_check():
    try:
        redis.build_connection()
    except Exception as e:
        msg = "Fail to build connection with Redis. Please modify the configure file, check the redis status and " \
              "restart. "
        logger.error(msg)
        return False
    else:
        logger.success("Build connection with redis")
        return True
예제 #2
0
    # handle result
    def return_true(payload, data):
        self.result.append("Payload : %s\nParams : " % payload + data)
        return

    def vul_verify(self, test, location):
        """ """
        threads = []
        for i in self.payloads[location]:
            threads.append(
                Thread(self.single_payload_verify, (test, location, i)))
        for i in threads:
            i.start()
        for i in threads:
            i.join()


if __name__ == "__main__":
    from lib.redisopt import redisCli
    from lib.config import load_config
    from lib.scanner.request import Request
    ''''''
    load_config()
    redisCli.build_connection()
    r = Request(redisCli.retrieve_request(b"7554697de81997581ca6e5bcfc850cd6"))
    xss_scanner = XssScan(r)
    result = xss_scanner.scan()
    print(result)

    #
예제 #3
0
            module_name = m.__name__
            self.status[module_name] = False
        logger.info("New task %s." % self.id)
        self.url = request.url

    # return if all tasks are finished
    def finished(self):
        return all(self.status.values())

    def update(self, module_name, status):
        self.status[module_name] = status
        logger.info("Update task %s scanning status: %s, %s." %
                    (self.id, module_name, status))
        return True

    def scan(self):
        for module in scanner.module_obj:
            th.queue.put([module, self.request])
        logger.success("Adding new scan for %s" % self.url)


if __name__ == "__main__":
    from lib.scanner.request import Request
    from lib.scanner.loader import load_modules
    load_modules()
    redis.build_connection()
    request = redis.get_request()
    # parse request from task
    request_obj = Request(request)
    new_task = Task(request_obj)
    print(new_task.id, new_task.status, new_task.url)