Bitzu

CPSA ยท Database security

Microsoft SQL Server attack surface

Default ports, the sa account, SQL Browser, weak authentication and exposed services.

Key points

  • TCP 1433: the default instance.
  • UDP 1434: SQL Server Browser announces named instances' dynamic ports to unauthenticated requests, revealing names, versions and ports.
  • sa: well-known built-in login, often targeted; in mixed mode needs a strong password, keep disabled unless an application needs it.
  • Entry points: weak SQL logins, blank passwords, database ports reachable from untrusted networks.

Source: https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-browser-service-database-engine-and-ssas

Practice questions

Single choice

Which port does the SQL Server Browser service listen on to answer instance-discovery requests?

  1. TCP 1433
  2. UDP 1434
  3. TCP 1434
  4. UDP 1433
Show answer

Answer: B. UDP 1434

Browser claims UDP 1434. TCP 1433 is the default instance's data port, not the discovery service, and the other options are unrelated.

Select all that apply

Which findings on a SQL Server host are weaknesses a tester would report?

  1. The sa login is enabled with a weak or blank password
  2. Applications use Windows Authentication
  3. UDP 1434 is reachable from the whole user network
  4. Port 1433 is firewalled to the application servers only
  5. Mixed mode is off and sa is disabled
Show answer

Answer: A. The sa login is enabled with a weak or blank password, C. UDP 1434 is reachable from the whole user network

Reachable SQL authentication with a weak sa password and a Browser service exposed to untrusted networks are real exposures. Windows Authentication and a firewall limiting the port to application servers are good practice, not findings.

True or false

True or false: if SQL Server is set to Windows Authentication mode during setup, the sa account does not exist, so there is nothing to attack.

Show answer

Answer: False

False. Setup still creates sa in that case, but it is disabled. It can become a target if someone later switches to mixed mode and enables it.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More CPSA topics in this module