About Me

Barking, Essex, United Kingdom
MCITP DBA ,MCITP BI & Oracle OCP 11G

Monday, November 9, 2015

Revoke Execute access to the extended store procedure

DECLARE       @portNumber   NVARCHAR(10)

EXEC   xp_instance_regread
@rootkey    = 'HKEY_LOCAL_MACHINE',
@key        =
'Software\Microsoft\Microsoft SQL Server\MSSQLServer\SuperSocketNetLib\Tcp\IpAll',
@value_name = 'TcpDynamicPorts',
@value      = @portNumber OUTPUT

SELECT [Port Number] = @portNumber
GO

Due to the security reason we can disable the below two extended proc granted to the public role.


USE master
go
REVOKE EXECUTE ON xp_regread FROM public
REVOKE EXECUTE ON xp_instance_regread FROM public



No comments:

Post a Comment