xp-cmdshell

exec xp_cmdshell bcp syntax

血红的双手。 提交于 2021-02-05 06:56:25
问题 I can't seem to find the right syntax to export data with column names using exec xp_cmdshell bcp in sql server management studio.I've tried the below variations EXEC xp_cmdshell bcp "select "a_id","b_id","c_id" union select a_id,b_id,c_id from tablename out "\\network_path\a.txt" -c -Uusername -Ppassword -Sservername" And EXEC xp_cmdshell bcp 'select 'a_id','b_id','c_id' union select a_id,b_id,c_id from tablename out '\\network_path\a.txt' -c -Uusername -Ppassword -Sservername' And EXEC xp

Access denied for enabled xp_cmdshell for the admin user

谁说胖子不能爱 提交于 2021-01-22 13:17:22
问题 I'm using xp_cmdshell within a database trigger to launch a exe file. xp_cmdshell is enabled(it can execute simple cmd command like 'echo'). But when I try to launch the exe through xp_cmdshell, the access is denied. I am the database administrator. And I can launch the exe through cmd directly. Anyone know why I get denied and how to fix it? 回答1: Likely insufficient NTFS permissions. Make sure the 'user account' that the SQL Server is running as, has permission (Read+Execute) to the *.EXE

I am getting file not found on xp_cmdshell dir on local directory

扶醉桌前 提交于 2020-06-02 07:08:27
问题 Here is what I am trying to execute: exec xp_cmdshell 'dir "D:\Data\GS Products" /AD /S /B' This works with every other folder on data that I have tried but not with the one I am trying to use. I am logged in with the admin god privs, I have done the sp_configure to enable cmdshell and I have used this with other folders that have spaces in the name. Is it permissions? And if so, how can I check that? When I look at the properties of the folder it says the admin account has FULL permissions.

I am getting file not found on xp_cmdshell dir on local directory

大兔子大兔子 提交于 2020-06-02 07:07:36
问题 Here is what I am trying to execute: exec xp_cmdshell 'dir "D:\Data\GS Products" /AD /S /B' This works with every other folder on data that I have tried but not with the one I am trying to use. I am logged in with the admin god privs, I have done the sp_configure to enable cmdshell and I have used this with other folders that have spaces in the name. Is it permissions? And if so, how can I check that? When I look at the properties of the folder it says the admin account has FULL permissions.

I am getting file not found on xp_cmdshell dir on local directory

ぃ、小莉子 提交于 2020-06-02 07:07:10
问题 Here is what I am trying to execute: exec xp_cmdshell 'dir "D:\Data\GS Products" /AD /S /B' This works with every other folder on data that I have tried but not with the one I am trying to use. I am logged in with the admin god privs, I have done the sp_configure to enable cmdshell and I have used this with other folders that have spaces in the name. Is it permissions? And if so, how can I check that? When I look at the properties of the folder it says the admin account has FULL permissions.

how can i access a file/folder over network through XP_CMDSHELL in sql server 2008?

一个人想着一个人 提交于 2020-01-14 22:54:33
问题 I am trying to access a folder/directory using 'EXEC MASTER..XP_CMDSHELL' it works for the local file/folder, how ever it can not access the folder over network. EXEC MASTER..XP_CMDSHELL 'c:\Images' --Works fine EXEC MASTER..XP_CMDSHELL '\\IPaddress\Images' -- returns "Access is denied." Please note that i can access the network location but not using sql server. Sql server is running under Winodws Authentication mode. Sql server is using 'nt authority\network service' account to access the

How to combine stored procedure and select query result?

三世轮回 提交于 2020-01-14 14:06:24
问题 I am trying to combine the results of xp_cmdshell with a select query. I have tried union & read about creating a temp table, but as my result will be having only 1 column. To be more precise i need a smaller query to combine the results of xp_cmdshell with select query as am trying to use it in union based sql injection For example: Select name from employee union exec xp_cmdshell 'whoami' I know this wont work but somewhat similar would be great :) 回答1: Create a temp table and do insert