sqlmapproject/sqlmap · error · SqlmapGenericException

missing function 'tamper(payload, **kwargs)' in tamper scrip

Error message

missing function 'tamper(payload, **kwargs)' in tamper script '%s'

What it means

Error "missing function 'tamper(payload, **kwargs)' in tamper script '%s'" thrown in sqlmapproject/sqlmap.

Source

Thrown at lib/core/option.py:944

                        check_priority = False

                    priorities.append((priority, function))
                    last_priority = priority

                    break
                elif name == "dependencies":
                    try:
                        function()
                    except Exception as ex:
                        errMsg = "error occurred while checking dependencies "
                        errMsg += "for tamper module '%s' ('%s')" % (getUnicode(filename[:-3]), getSafeExString(ex))
                        raise SqlmapGenericException(errMsg)

            if not found:
                errMsg = "missing function 'tamper(payload, **kwargs)' "
                errMsg += "in tamper script '%s'" % script
                raise SqlmapGenericException(errMsg)

        if kb.tamperFunctions and len(kb.tamperFunctions) > 3:
            warnMsg = "using too many tamper scripts is usually not "
            warnMsg += "a good idea"
            logger.warning(warnMsg)

        # tamper scripts rewrite SQL injection payloads; the self-contained non-SQL engines do not run
        # payloads through the tampering hook, so warn instead of silently ignoring the user's
        # '--tamper'. One tuple drives both the test and the name lookup - keeping two lists in step is
        # exactly how this raised StopIteration, and leaving an engine OUT (as '--hql' was) is how the
        # warning silently stops covering one.
        _nonSqlEngines = ("graphql", "nosql", "ldap", "xpath", "ssti", "xslt", "xxe", "hql", "sparql", "odata")
        if kb.tamperFunctions and any(conf.get(_) for _ in _nonSqlEngines):
            engine = next(_ for _ in _nonSqlEngines if conf.get(_))
            warnMsg = "tamper scripts are applied to SQL injection payloads only and "
            warnMsg += "will be ignored by the '--%s' engine" % engine
            logger.warning(warnMsg)

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at lib/core/option.py:944 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/c4f358708d1740e6. Report an issue: GitHub.