Showing posts with label studio. Show all posts
Showing posts with label studio. Show all posts

Friday, March 30, 2012

MSSQL 2000 Server vulnerability using SQL Server Management Studio

When using SQL 2005 Management Studio Express, you can backup your database to anywhere on the local MSSQL 2000 server, which includes possibly overwriting critical system files. Users do not have this privilege when using Enterprise Manager to backup MSSQL 2000 databases. It appears that SQL 2005 Management Studio is allowing users to execute the extended stored procedure 'xp_availablemedia', but on MSSQL 2000 server only?

This vulnerability appears to allow any user logged into to the MSSQL 2000 server using SQL 2005 Management Studio Express, permission to overwrite any critical system file, when attempting to backup a database. This would be duplicated by logging into the server as a public user, right clicking on database -> tasks -> Back Up -> then 'Add' a new destination directory.

We would like to find out what is the cause of this, as it does not make sense since Enterprise Manger does not show this vulnerability when backing up. How can security be tightened to disallow this access?

Thank you

Have you checked the privilege for that user who has performed this action?

I believe the NetworkService account used by SQLExpress service and if builtin\admin has privileges on SQL Server 2000 instance then it is by default.

|||

Note that NT Authority\Network Service is an ordinary, low-privileged account that by default does not have Administrative privileges in the operating system. Running SQL Server as NT Authority\Network Service is a security best practice precisely because it is a low privileged account that can't take over the host operating system even if a user manages to elevate privileges to run as the service. If you set SQL Server 2005 to run as Network Service during setup, setup.exe grants (on behalf of the administrator performing setup) read and write privileges to the %ProgramFiles%\Microsoft SQL Server directory and its subdirectories to Network Service.

Management Studio doesn't perform impersonation, so operations run as the logged in user on the server. File system operations are not allowed by the operating system if the user does not have privileges to perform the operation in the directory, so to see a directory for backup the logged in user has to have permission in Windows to see the directory. If you log in as SA, you are running as the service account and anything the service account can do, you can do as well. This isn't an elevation of privileges in the classic sense, it is just exposing the power that sysadmins already have in the server (that is, you are not elevating your privileges to be SA if you log in as SA in the first place). For this reason, it is a good idea to perform most maintenance with a lower privilege account, in this case perhaps one that is a member of just the db_backupoperator role in the database.

To tighten up security, run your server as a low-privileged account, grant that account read and write privileges only in a restricted set of directories (that must include the SQL Server binaries and data files), create special logins for common maintenance tasks that only have sufficient privileges to perform those tasks, and avoid logging in as a member of the Administrators group in Windows or as SA in SQL Server.

Hope this helps,
Steve

Wednesday, March 28, 2012

MSSQL 2000 -> 2005 - Schema stuff?

Hi All,

I imported a database backup with no problems.
I can view the data using the Studio.
However, I noticed that all the tables are now pre-appended with a Schema name.
This also applies to Views.

How do I get 'rid' of this as my application doesn't know about the Schema and claims that it can't find the Tables and Objects I'm referenceing in the web.config.

Thanks,

-Alon

Hi,

schemas were introduced in SQL Server 2005. if the object is no in the default schema of the user, SQL Server will search for it in the dbo namespace. So, there are several options for you to make it work:

-Change default schema of the user which accesses the database to the schema the tables were imported.
-Directly import the tables to the dbo schema / or move them to the appropiate schema.
-Prefix your object in the queries with the schema name
-Schema are quite useful, you should get familiar with them, a lot to read is in the BOL. You should also consider using prefixes in your queries per se.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

While schemas are new in SQL 2005, SQL 2000 had the same basic idea (at least as far as calling the objects). In SQL 2000 objects had owners, and these were prefixed infront of the table name. In most cases dbo was the owner.

Take the application account that is logging into the database. Change it's default schema to the schema that the objects are in (probably the dbo schema) this will fix the problem. By default when you upgrade a database all users are setup with there own schema as there default schema.

You may want to remove any unneeded schemas from the database so that objects don't get created in the wrong schema.

Monday, February 20, 2012

MSDN SQL 2005 versions

I'm a MSDN subscriber and recently installed SQL 2005 developer edition and
noticed it installed a version of visual studio. I'd prefer to install VS
pro edition seperate from SQL 2005. Should I install SQL 2005 Standard
version instead of developer edition and then install Visual Studio Pro
edition?
I couldn't find in the SQL 2005 developer edition install options where to
choose not to install the visual studio version.If you do not want the VS part to be installed, during installation, you can
opt out of installing the Business Intelligence Development Studio. But, you
can install this becuase it gives you access to SSIS, SQLCLR, Analysis
Services projects. Once you install the VS 2005 version, you can use either
of them to do your work.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Scott" <sbailey@.mileslumber.com> wrote in message
news:%23Mc5DHY8FHA.4076@.tk2msftngp13.phx.gbl...
> I'm a MSDN subscriber and recently installed SQL 2005 developer edition
> and noticed it installed a version of visual studio. I'd prefer to install
> VS pro edition seperate from SQL 2005. Should I install SQL 2005 Standard
> version instead of developer edition and then install Visual Studio Pro
> edition?
> I couldn't find in the SQL 2005 developer edition install options where to
> choose not to install the visual studio version.
>|||"SriSamp" <ssampath@.sct.co.in> wrote in
news:ucxBvVY8FHA.3952@.TK2MSFTNGP12.phx.gbl:

> If you do not want the VS part to be installed, during installation,
> you can opt out of installing the Business Intelligence Development
> Studio. But, you can install this becuase it gives you access to SSIS,
> SQLCLR, Analysis Services projects.
Actually, I do not believe the VS isntalled with SQL Server gives you
access to the SQLCLR projects - I'm not 100% though.
Niels
****************************************
**********
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb@.no-spam.develop.com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
****************************************
**********|||Niels Berglund <nielsb@.develop.com> wrote in
news:Xns9719520FAE996nielsbdevelopcom@.20
7.46.248.16:

> Actually, I do not believe the VS isntalled with SQL Server gives you
> access to the SQLCLR projects - I'm not 100% though.
I am. You cannot open SQLCLR projects with BIDS.
Ole Kristian Bangs
MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging|||Sorry about that. Since what SQL Server installs is anyways BI related, I
guess SQLCLR is not allowed.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Ole Kristian Bangs" <olekristian.bangas@.masterminds.no> wrote in message
news:Xns971961B226E4Dolekristianbangaas@.
207.46.248.16...
> Niels Berglund <nielsb@.develop.com> wrote in
> news:Xns9719520FAE996nielsbdevelopcom@.20
7.46.248.16:
>
> I am. You cannot open SQLCLR projects with BIDS.
> --
> Ole Kristian Bangs
> MCT, MCDBA, MCDST, MCSE:Security, MCSE:Messaging|||If I install VS 2005 1st, will SQL 2005 pick up on that and not install it's
VS version?
"SriSamp" <ssampath@.sct.co.in> wrote in message
news:ucxBvVY8FHA.3952@.TK2MSFTNGP12.phx.gbl...
> If you do not want the VS part to be installed, during installation, you
> can opt out of installing the Business Intelligence Development Studio.
> But, you can install this becuase it gives you access to SSIS, SQLCLR,
> Analysis Services projects. Once you install the VS 2005 version, you can
> use either of them to do your work.
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "Scott" <sbailey@.mileslumber.com> wrote in message
> news:%23Mc5DHY8FHA.4076@.tk2msftngp13.phx.gbl...
>|||"Scott" <sbailey@.mileslumber.com> wrote in message
news:uCaM73d8FHA.2644@.TK2MSFTNGP10.phx.gbl...
> If I install VS 2005 1st, will SQL 2005 pick up on that and not install
> it's VS version?
>
Yes, and vice versa. Both products share the VS shell and just install
different components.
David