sqlmapproject/sqlmap · error · SqlmapDataException

unexpected connection type

Error message

unexpected connection type

What it means

Unreachable-branch sentinel in metasploit's _selectRhost: the connection type string matched neither 'bind' nor 'reverse', indicating an internal misconfiguration of the payload connection mode rather than user input error.

Solutions

  1. Set a valid connection type (bind or reverse tcp) for the metasploit payload
  2. Check that the connectionStr was built from a supported toggles combination
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/takeover/metasploit.py:280 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/816062303fc1ff28. Report an issue: GitHub.

Appendix: source

Thrown at lib/takeover/metasploit.py:280

        for connType, connStr in self._portData.items():
            if self.connectionStr.startswith(connType):
                return self._skeletonSelection(connStr, maxValue=65535, default=randomRange(1025, 65535))

    def _selectRhost(self):
        if self.connectionStr.startswith("bind"):
            message = "what is the back-end DBMS address? [Enter for '%s' (detected)] " % self.remoteIP
            address = readInput(message, default=self.remoteIP)

            if not address:
                address = self.remoteIP

            return address

        elif self.connectionStr.startswith("reverse"):
            return None

        else:
            raise SqlmapDataException("unexpected connection type")

    def _selectLhost(self):
        if self.connectionStr.startswith("reverse"):
            message = "what is the local address? [Enter for '%s' (detected)] " % self.localIP
            address = readInput(message, default=self.localIP)

            if not address:
                address = self.localIP

            return address

        elif self.connectionStr.startswith("bind"):
            return None

        else:
            raise SqlmapDataException("unexpected connection type")

    def _selectConnection(self):

View on GitHub (pinned to 0a35b20e39)