4.11.17. Microsoft SQL Server

In addition to the TDS network protocol (by default, on TCP port 1433), it is possible to query an SQL Server using the RPCnetlib interface. The RPC service is only available if the Multiprotocol transport has been configured using the SQL Server Network utility.

Protocol sequences for the RPCnetlib interface can be configured in the RPC Protocols entry in the Multiprotocol properties. In the following example, three transports were configured: ncalrpc, ncacn_np and ncacn_ip_tcp. The endpoints for each protocol sequence can be obtained by a query to the portmapper.

Z:\>rpcdump 127.0.0.1

[...]

IfId: 3f99b900-4d87-101b-99b7-aa0004007f07 version 1.0
Annotation: MS SQL Server
UUID: 00000000-0000-0000-0000-000000000000
Binding: ncalrpc:[LRPC00000d70.00000001]

IfId: 3f99b900-4d87-101b-99b7-aa0004007f07 version 1.0
Annotation: MS SQL Server
UUID: 00000000-0000-0000-0000-000000000000
Binding: ncacn_np:\\\\SERVEUR[\\pipe\\29F8A2BE40935DE9]

IfId: 3f99b900-4d87-101b-99b7-aa0004007f07 version 1.0
Annotation: MS SQL Server
UUID: 00000000-0000-0000-0000-000000000000
Binding: ncacn_ip_tcp:127.0.0.1[4103]

[...]

Z:\>ifids -p ncalrpc -e LRPC00000d70.00000001 serveur
Interfaces: 1
  3f99b900-4d87-101b-99b7-aa0004007f07 v1.0

Z:\>ifids -p ncacn_np -e \pipe\29F8A2BE40935DE9 \\.
Interfaces: 1
  3f99b900-4d87-101b-99b7-aa0004007f07 v1.0

Z:\>ifids -p ncacn_ip_tcp -e 4103 127.0.0.1
Interfaces: 1
  3f99b900-4d87-101b-99b7-aa0004007f07 v1.0

Table 4.90. RPCnetlib operations

InterfaceOperation numberOperation name
3f99b900-4d87-101b-99b7-aa0004007f07 v1.0: RPCnetlib  
 0x00RPCopen
 0x01RPCread
 0x02RPCwrite
 0x03RPCtransact
 0x04RpcCheckForData
 0x05RPCclose