The title is pretty much self explanatory
If a SQL server only allows connections from localhost
, is there any way I can access from the outside by making it think I'm actually accessing from localhost
?
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.
Sign up to join this communityObvious answer: Make a local connection.
In other words, unless the network stack (of the operating system) is buggy, or someone grossly misconfigured e.g. port forwardings on the machine your database runs on, the only way to do that is by actually opening a connection from the machine your database runs on itself.
Now, in the year 2016, I'd say it'd still be totally unacceptable to offer unauthorized access based on host alone – you simply don't do that, since there's no cost to authentication.
A proper way of doing "safe" local-only networking is to not use IP sockets, but good ol' unix sockets, which can be secured using normal file access privilege systems.
You can create a tunnel. With SSH on Linux, that would look something like ssh -TNL "3306:localhost:3306" user@server
. This would make the port 3306 on your computer connect to the remote computer (via port 22), and forward all its packets to the port 3306 on that computer as if they came from its localhost.