-1

retrieve database data with application server?

1
  • 2
    This question is rather vague. It's definitely possible, but it depends on a lot of factors. Is this a homework question, by chance? Oct 15, 2014 at 22:54

1 Answer 1

1

Possibly, yes. In many typical configurations, where servers have not had extensive security hardening, it would be possible.

Factors that might permit this:

  • The application server would naturally require a network path to the database server, therefore any firewall would be configured to allow connections.

  • The application server is likely, in a typical configuration, to be in possession of credentials for the database. These will often be stored inside the application's source code, or in a configuration file. (For example, the web.config file in ASP.NET applications.)

Therefore, the attacker could retrieve the credentials, and then use a database client on the application server to query the database.

Some factors that might guard against this:

  • Strict file permissions on the file containing the database credentials. The user account you have compromised (that you can run commands as) may not have sufficient privileges.

  • Similarly, the database credentials themselves might be encrypted, with strict file permissions on the encryption key (or an encryption key protected by a Hardware Security Module - HSM).

  • Data within the database might be encrypted, with similar protection for the key as above.

  • No credentials are stored, and authentication to the database is achieved through the application service's account credentials (e.g. via Kerberos to MSSQL). This would require a user with the correct database privileges to be compromised.

Most, if not all, of the above mechanisms could be defeated if the attacker had administrative control of the application server.

1
  • While you are correct that some applications store credentials in their source code, it's worth noting that it's almost always a bad idea. In on-prem products, all customers get the same creds - which means the creds are no longer secret. In a hosted product, you should have separation of duties between dev/qa and the prod support team. With hard coded creda, that separation is severely weakened.
    – atk
    Oct 16, 2014 at 0:35

Not the answer you're looking for? Browse other questions tagged .