Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_cmdshell security

Status
Not open for further replies.

DaOtH

Technical User
Jan 22, 2002
114
SE
Hi,

We had some auditors over and they told us to stop using xp_cmdshell since it is/could become a security breach.

Now i am trying to evaluate this.
- Is it really that serious, obviously from a shell you can do quite some damage, but we only have the developers having access to enterprise manager/query analyzer.
All user access the databases and stored proc's through their VB Built front-end. No worry there, assuming offcourse the developers actually program it wisely.

- What are the alternatives for it ?
The operating system command out of a job is one, but isn't that as insecure as xp_cmdshell ? And i am not looking forward doing everything through jobs.


"In three words I can sum up everything I've learned about life: it goes on."
- Robert Frost 1874-1963
 
Develop your own xp_cmdshell (or find one on the net that somone else has authored).

Then, remove xp_cmdshell from your system and add the new xp_foobar (or whatever you name it). The fact that it has a different name will get you past most auditors audits; and for that matter any programs trying to attack your server won't know your name...security by obscurity.

You may actually be able to rename the existing xp_cmdshell, but I haven't tried that.

Also, for your version of the function can hard code it to only support a known set of commands for even more added security.

TJR
 
If you don't set the SQL Agent Proxy Account, then no-one without sysadmin rights can execute xp_cmdshell. Only sysadmins by default can execute xp_cmdshell, and no one should have access to production except the admins.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(Not quite so old any more.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top