()
Sets absolute paths for project directories and files
Sets absolute paths for project directories and files
Sets absolute paths for project directories and files
def setPaths():
    """
    Sets absolute paths for project directories and files
    """

    # sqlmap paths
    paths.SQLMAP_EXTRAS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "extra")
    paths.SQLMAP_PROCS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "procs")
    paths.SQLMAP_SHELL_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "shell")
    paths.SQLMAP_TAMPER_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "tamper")
    paths.SQLMAP_WAF_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "waf")
    paths.SQLMAP_TXT_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "txt")
    paths.SQLMAP_UDF_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "udf")
    paths.SQLMAP_XML_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "xml")
    paths.SQLMAP_XML_BANNER_PATH = os.path.join(paths.SQLMAP_XML_PATH, "banner")

    _ = os.path.join(os.path.expanduser("~"), ".sqlmap")
    paths.SQLMAP_OUTPUT_PATH = getUnicode(paths.get("SQLMAP_OUTPUT_PATH", os.path.join(_, "output")), encoding=sys.getfilesystemencoding())
    paths.SQLMAP_DUMP_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "dump")
    paths.SQLMAP_FILES_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "files")

    # sqlmap files
    paths.OS_SHELL_HISTORY = os.path.join(_, "os.hst")
    paths.SQL_SHELL_HISTORY = os.path.join(_, "sql.hst")
    paths.SQLMAP_SHELL_HISTORY = os.path.join(_, "sqlmap.hst")
    paths.GITHUB_HISTORY = os.path.join(_, "github.hst")
    paths.SQLMAP_CONFIG = os.path.join(paths.SQLMAP_ROOT_PATH, "sqlmap-%s.conf" % randomStr())
    paths.COMMON_COLUMNS = os.path.join(paths.SQLMAP_TXT_PATH, "common-columns.txt")
    paths.COMMON_TABLES = os.path.join(paths.SQLMAP_TXT_PATH, "common-tables.txt")
    paths.COMMON_OUTPUTS = os.path.join(paths.SQLMAP_TXT_PATH, 'common-outputs.txt')
    paths.SQL_KEYWORDS = os.path.join(paths.SQLMAP_TXT_PATH, "keywords.txt")
    paths.SMALL_DICT = os.path.join(paths.SQLMAP_TXT_PATH, "smalldict.txt")
    paths.USER_AGENTS = os.path.join(paths.SQLMAP_TXT_PATH, "user-agents.txt")
    paths.WORDLIST = os.path.join(paths.SQLMAP_TXT_PATH, "wordlist.zip")
    paths.ERRORS_XML = os.path.join(paths.SQLMAP_XML_PATH, "errors.xml")
    paths.PAYLOADS_XML = os.path.join(paths.SQLMAP_XML_PATH, "payloads.xml")
    paths.LIVE_TESTS_XML = os.path.join(paths.SQLMAP_XML_PATH, "livetests.xml")
    paths.QUERIES_XML = os.path.join(paths.SQLMAP_XML_PATH, "queries.xml")
    paths.GENERIC_XML = os.path.join(paths.SQLMAP_XML_BANNER_PATH, "generic.xml")
    paths.MSSQL_XML = os.path.join(paths.SQLMAP_XML_BANNER_PATH, "mssql.xml")
    paths.MYSQL_XML = os.path.join(paths.SQLMAP_XML_BANNER_PATH, "mysql.xml")
    paths.ORACLE_XML = os.path.join(paths.SQLMAP_XML_BANNER_PATH, "oracle.xml")
    paths.PGSQL_XML = os.path.join(paths.SQLMAP_XML_BANNER_PATH, "postgresql.xml")

    for path in paths.values():
        if any(path.endswith(_) for _ in (".txt", ".xml", ".zip")):
            checkFile(path)
def setPaths ( ) : # sqlmap paths paths . SQLMAP_EXTRAS_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "extra" ) paths . SQLMAP_PROCS_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "procs" ) paths . SQLMAP_SHELL_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "shell" ) paths . SQLMAP_TAMPER_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "tamper" ) paths . SQLMAP_WAF_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "waf" ) paths . SQLMAP_TXT_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "txt" ) paths . SQLMAP_UDF_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "udf" ) paths . SQLMAP_XML_PATH = os . path . join ( paths . SQLMAP_ROOT_PATH , "xml" ) paths . SQLMAP_XML_BANNER_PATH = os . path . join ( paths . SQLMAP_XML_PATH , "banner" ) _ = os . path . join ( os . path . expanduser ( "~" ) , ".sqlmap" ) paths . SQLMAP_OUTPUT_PATH = getUnicode ( paths . get ( "SQLMAP_OUTPUT_PATH" , os . path . join ( _ , "output" ) ) , encoding = sys . getfilesystemencoding ( ) ) paths . SQLMAP_DUMP_PATH = os . path . join ( paths . SQLMAP_OUTPUT_PATH , "%s" , "dump" ) paths . SQLMAP_FILES_PATH = os . path . join ( paths . SQLMAP_OUTPUT_PATH , "%s" , "files" ) # sqlmap files paths . OS_SHELL_HISTORY = os . path . join ( _ , "os.hst" ) paths . SQL_SHELL_HISTORY = os . path . join ( _ , "sql.hst" ) paths . SQLMAP_SHELL_HISTORY = os . path . join ( _ , "sqlmap.hst" ) paths . GITHUB_HISTORY = os . path . join ( _ , "github.hst" ) paths . SQLMAP_CONFIG = os . path . join ( paths . SQLMAP_ROOT_PATH , "sqlmap-%s.conf" % randomStr ( ) ) paths . COMMON_COLUMNS = os . path . join ( paths . SQLMAP_TXT_PATH , "common-columns.txt" ) paths . COMMON_TABLES = os . path . join ( paths . SQLMAP_TXT_PATH , "common-tables.txt" ) paths . COMMON_OUTPUTS = os . path . join ( paths . SQLMAP_TXT_PATH , 'common-outputs.txt' ) paths . SQL_KEYWORDS = os . path . join ( paths . SQLMAP_TXT_PATH , "keywords.txt" ) paths . SMALL_DICT = os . path . join ( paths . SQLMAP_TXT_PATH , "smalldict.txt" ) paths . USER_AGENTS = os . path . join ( paths . SQLMAP_TXT_PATH , "user-agents.txt" ) paths . WORDLIST = os . path . join ( paths . SQLMAP_TXT_PATH , "wordlist.zip" ) paths . ERRORS_XML = os . path . join ( paths . SQLMAP_XML_PATH , "errors.xml" ) paths . PAYLOADS_XML = os . path . join ( paths . SQLMAP_XML_PATH , "payloads.xml" ) paths . LIVE_TESTS_XML = os . path . join ( paths . SQLMAP_XML_PATH , "livetests.xml" ) paths . QUERIES_XML = os . path . join ( paths . SQLMAP_XML_PATH , "queries.xml" ) paths . GENERIC_XML = os . path . join ( paths . SQLMAP_XML_BANNER_PATH , "generic.xml" ) paths . MSSQL_XML = os . path . join ( paths . SQLMAP_XML_BANNER_PATH , "mssql.xml" ) paths . MYSQL_XML = os . path . join ( paths . SQLMAP_XML_BANNER_PATH , "mysql.xml" ) paths . ORACLE_XML = os . path . join ( paths . SQLMAP_XML_BANNER_PATH , "oracle.xml" ) paths . PGSQL_XML = os . path . join ( paths . SQLMAP_XML_BANNER_PATH , "postgresql.xml" ) for path in paths . values ( ) : if any ( path . endswith ( _ ) for _ in ( ".txt" , ".xml" , ".zip" ) ) : checkFile ( path )