(msg)
return retVal
Masks sensitive data in the supplied message
Masks sensitive data in the supplied message
Masks sensitive data in the supplied message
def maskSensitiveData(msg):
    """
    Masks sensitive data in the supplied message
    """

    retVal = getUnicode(msg)

    for item in filter(None, map(lambda x: conf.get(x), ("hostname", "data", "googleDork", "authCred", "proxyCred", "tbl", "db", "col", "user", "cookie", "proxy", "rFile", "wFile", "dFile"))):
        regex = SENSITIVE_DATA_REGEX % re.sub("(\W)", r"\\\1", getUnicode(item))
        while extractRegexResult(regex, retVal):
            value = extractRegexResult(regex, retVal)
            retVal = retVal.replace(value, '*' * len(value))

    if not conf.get("hostname"):
        match = re.search(r"(?i)sqlmap.+(-u|--url)(\s+|=)([^ ]+)", retVal)
        if match:
            retVal = retVal.replace(match.group(3), '*' * len(match.group(3)))

    if getpass.getuser():
        retVal = re.sub(r"(?i)\b%s\b" % re.escape(getpass.getuser()), "*" * len(getpass.getuser()), retVal)

    return retVal
def maskSensitiveData ( msg ) : retVal = getUnicode ( msg ) for item in filter ( None , map ( lambda x : conf . get ( x ) , ( "hostname" , "data" , "googleDork" , "authCred" , "proxyCred" , "tbl" , "db" , "col" , "user" , "cookie" , "proxy" , "rFile" , "wFile" , "dFile" ) ) ) : regex = SENSITIVE_DATA_REGEX % re . sub ( "(\W)" , r"\\\1" , getUnicode ( item ) ) while extractRegexResult ( regex , retVal ) : value = extractRegexResult ( regex , retVal ) retVal = retVal . replace ( value , '*' * len ( value ) ) if not conf . get ( "hostname" ) : match = re . search ( r"(?i)sqlmap.+(-u|--url)(\s+|=)([^ ]+)" , retVal ) if match : retVal = retVal . replace ( match . group ( 3 ) , '*' * len ( match . group ( 3 ) ) ) if getpass . getuser ( ) : retVal = re . sub ( r"(?i)\b%s\b" % re . escape ( getpass . getuser ( ) ) , "*" * len ( getpass . getuser ( ) ) , retVal ) return retVal