Closed Reelix closed 11 months ago
This feature request seems out of scope for this library: its purpose is to open MySQL connections, not perform port scanning.
Since the server sends its version in the "Initial Handshake" packet, I think it would be easiest for you to read the header off the first packet the server sends when the client connects to TCP port 3306, then close the socket. That would also avoid carrying a mostly-unnecessary MySqlConnector dependency in your code.
Is your feature request related to a problem? Please describe. As it stands, you are required to successfully run a .Open with correct credentials to populate the
MySqlConnection.ServerVersion
value.Describe the solution you'd like I want a way to retrieve the version info without the Open command completing (Or even in the MySqlException class).
Describe alternatives you've considered As it stands, I can retrieve the version by initiating a raw netcat connection to the server on the port, and retrieve something that looks like
To retrieve the basic version, although this isn't exactly ideal, and I would prefer to do so using the library.
Additional context This is for a basic penetration testing scenario where you wish to retrieve the version without the credentials (Whilst nmap can do so, I would prefer do to so in an in-code form)