Penetration Testing mailing list archives

RE: xp_cmdshell with low permission


From: Bénoni MARTIN <Benoni.MARTIN () libertis ga>
Date: Sun, 16 Oct 2005 16:48:43 +0100

Hi !

I do not think there are other ways to use xp_cmdshell (as I don't think there are many ways to launch an cmd command 
...), but there are a couple of useful undocumented extended procedures basic MS DBAs do not get ride of when securing 
ther DBs :)

For example, "exec master..xp_dirtree" will give you the same than your "exec master.dbo.xp_cmdshell "dir"; --"

You will get more infos here: http://www.mssqlcity.com/Articles/Undoc/UndocExtSP.htm

Hope this helps !





-----Message d'origine-----
De : Frederic Charpentier [mailto:fcharpen () xmcopartners com] 
Envoyé : samedi 15 octobre 2005 15:40
À : pen-test () securityfocus com
Objet : xp_cmdshell with low permission

Hello all,

I'm conducting a pentest on a IIS/Coldfusion/MSSQL server.
I've found a sql injection flaw, but the server does not allow me to run "xp_cmdshell" commands.

I use the following trick : exec master.dbo.xp_cmdshell "dir"; --

The server response :
EXECUTE permission denied on object 'xp_cmdshell', database 'master', owner 'dbo'.

I understand the coldfusion script use a low privileged user. So, two questions :

- Is there another way to use xp_cmdshell ?
- Is it possible to change the current user ? (like http://../script?param=1';user(sa,"sa");exec master.dbo.xp_cmdshell 
"dir"; --

Thanks in advance for ideas.

FRED

------------------------------------------------------------------------------
Audit your website security with Acunetix Web Vulnerability Scanner: 

Hackers are concentrating their efforts on attacking applications on your website. Up to 75% of cyber attacks are 
launched on shopping carts, forms, login pages, dynamic content etc. Firewalls, SSL and locked-down servers are futile 
against web application hacking. Check your website for vulnerabilities to SQL injection, Cross site scripting and 
other web attacks before hackers do! 
Download Trial at:

http://www.securityfocus.com/sponsor/pen-test_050831
-------------------------------------------------------------------------------




------------------------------------------------------------------------------
Audit your website security with Acunetix Web Vulnerability Scanner:

Hackers are concentrating their efforts on attacking applications on your
website. Up to 75% of cyber attacks are launched on shopping carts, forms,
login pages, dynamic content etc. Firewalls, SSL and locked-down servers are
futile against web application hacking. Check your website for vulnerabilities
to SQL injection, Cross site scripting and other web attacks before hackers do!
Download Trial at:

http://www.securityfocus.com/sponsor/pen-test_050831
-------------------------------------------------------------------------------


Current thread: