473,473 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SQL 2k - xp_cmdshell

28 New Member
How do I disable xp_cmdshell?
Jan 7 '08 #1
4 2451
camel
55 New Member
You can readily deny access to non sysadmin in the standard way, i.e. you can just cut off master access to non admin users and you can grant\deny on the extended SP itself. If you are having trouble with users calling cmdshell who have no business doing so that is a matter for tightening up security e.g remote access if you are worried about hacking. In 2005 you can just disable it full stop but there will likely always be legitimate need for cmdshell for sysadmins.
Jan 8 '08 #2
goldenbear
28 New Member
You can readily deny access to non sysadmin in the standard way, i.e. you can just cut off master access to non admin users and you can grant\deny on the extended SP itself. If you are having trouble with users calling cmdshell who have no business doing so that is a matter for tightening up security e.g remote access if you are worried about hacking. In 2005 you can just disable it full stop but there will likely always be legitimate need for cmdshell for sysadmins.
I think we were hacked but don't know exactly how. I suspect they may have gotten sysadmin access because there was key loging going on and the system32 OS directory accessed, so I thought to disable it system admin and all as well. So if I deleted or disable it, how to do that and undo if needs be?Thanks
Jan 8 '08 #3
camel
55 New Member
Casting my mind back to SQL2K, when you right click on the extended SP in master db named xp_cmdshell it should tell you the name of the DLL behind it, you can then move it to another location.

This will cause any calling process that tries to execute xpcmdshell to break. I would not recommend this, for you are potentially taking a chance that legit routines you may be unaware of everything relying on xpcmdshell, i.e., MS procedures you are using may under the hood rely on xpcmdshell too.

The scenario is much, much improved in SQL2005 so if you are planning an upgrade any time soon hold on for that and tighten your external firewall, rather than risking the integrity of the SQL2K install would be my advice but up to you
Jan 9 '08 #4
goldenbear
28 New Member
Casting my mind back to SQL2K, when you right click on the extended SP in master db named xp_cmdshell it should tell you the name of the DLL behind it, you can then move it to another location.

This will cause any calling process that tries to execute xpcmdshell to break. I would not recommend this, for you are potentially taking a chance that legit routines you may be unaware of everything relying on xpcmdshell, i.e., MS procedures you are using may under the hood rely on xpcmdshell too.

The scenario is much, much improved in SQL2005 so if you are planning an upgrade any time soon hold on for that and tighten your external firewall, rather than risking the integrity of the SQL2K install would be my advice but up to you
Thanks..I used [EXEC sp_dropextendedproc 'xp_cmdshell'] on master to remove it and so far seems to have no effect on other sp's.
Jan 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Yvonne | last post by:
Would like to implement Blat on SQL Server 2000. I'm looking for example syntax for setting up BLAT with xp_cmdshell. TIA
3
by: Terri | last post by:
I'm using xp_cmdshell to output a text file from a trigger like this CREATE TRIGGER ON tblApplications FOR INSERT AS DECLARE @FirstName varchar(75) DECLARE @LastName varchar(75) Declare...
4
by: Joel Thornton | last post by:
Whenever something is inserted to a given table, I want to run some shell commands using xp_cmdshell. Would it be a bad idea to put this xp_cmdshell in the INSERT trigger of this table? I...
5
by: Narine | last post by:
Hi Folks, I am using an xp_cmdshell sp to start a C# app. This app downloads data files and imports them into DB. It has a logging functionality built-in and when executed from the command line...
2
by: Lauren Quantrell | last post by:
I have created a view named viewOutput that shows one column in a table. I insert a row into the table and then I'm using this code to create a file with the text in the single row. This code...
1
by: Micah Gentry | last post by:
Is there any way to allow a user to use the xp_cmdshell extended stored procedure without giving that user execute permissions to xp_cmdshell in SQL server 6.5? Let me clarify. Lets say I (as the...
2
by: Maddman | last post by:
Newbie here. In my database I'm needing to automate some data imports. I have the import set up as a DTS package and it works wonderfully. But I'm having trouble kicking it off as a stored...
4
by: Chris Allison | last post by:
I am getting the following error when running a command in Query Analyzer. Msg 50001, Level 1, State 50001 xpsql.cpp: Error 5 from CreateProcess on line 675 Here is the command that I am...
7
by: Terri | last post by:
I have a stored procedure that creates an xml file. It executes a SELECT statement with the FOR XML clause and then writes the xml file using bcp and xp_cmdshell. I am calling this procedure by...
2
by: darrel | last post by:
I have a simple Stored procedure that I'm using to call the command shell to execut DTSRUN (which, in turn, calls a DTS package): CREATE PROCEDURE updateDB AS Exec master..xp_cmdshell 'DTSRUN...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.