sqlmapproject/sqlmap · error · SqlmapFilePathException

the specified list of targets is not a file nor a directory

Error message

the specified list of targets is not a file nor a directory

What it means

Type guard at the end of _setMultipleTargets(): the -l value exists but is neither a regular file nor a directory (e.g. a socket, broken symlink or special device), so sqlmap cannot iterate it for targets.

Solutions

  1. Point -l at a valid requests log file or a directory containing Burp-style *-request files
  2. Fix broken symlinks and avoid special files
  3. Re-export the request log from your proxy
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at lib/core/option.py:269 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/9d2ff6957a2b1271. Report an issue: GitHub.

Appendix: source

Thrown at lib/core/option.py:269

    elif os.path.isdir(conf.logFile):
        files = os.listdir(conf.logFile)
        files.sort()

        for reqFile in files:
            if not re.search(r"([\d]+)\-request", reqFile):
                continue

            for target in parseRequestFile(os.path.join(conf.logFile, reqFile)):
                url, _, data, _, _ = target
                key = re.sub(r"(\w+=)[^%s ]*" % (conf.paramDel or DEFAULT_GET_POST_DELIMITER), r"\g<1>", "%s %s" % (url, data))
                if key not in seen:
                    kb.targets.add(target)
                    seen.add(key)

    else:
        errMsg = "the specified list of targets is not a file "
        errMsg += "nor a directory"
        raise SqlmapFilePathException(errMsg)

    updatedTargetsCount = len(kb.targets)

    if updatedTargetsCount > initialTargetsCount:
        infoMsg = "sqlmap parsed %d " % (updatedTargetsCount - initialTargetsCount)
        infoMsg += "(parameter unique) requests from the "
        infoMsg += "targets list ready to be tested"
        logger.info(infoMsg)

def _adjustLoggingFormatter():
    """
    Solves problem of line deletition caused by overlapping logging messages
    and retrieved data info in inference mode
    """

    if hasattr(FORMATTER, '_format'):
        return

View on GitHub (pinned to 0a35b20e39)