{"id":8024,"date":"2021-04-27T09:04:01","date_gmt":"2021-04-27T14:04:01","guid":{"rendered":"https:\/\/www.bhinfo.com.mx\/cursos\/?p=8024"},"modified":"2022-10-17T12:18:54","modified_gmt":"2022-10-17T17:18:54","slug":"mssql-configurar-xp_cmdshell","status":"publish","type":"post","link":"https:\/\/www.bhinfo.com.mx\/cursos\/2021\/04\/27\/mssql-configurar-xp_cmdshell\/","title":{"rendered":"MSSQL, Configurar XP_CMDSHELL"},"content":{"rendered":"<p>Script para habilitar y deshabilitar la funcion de xp_cmdshell<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\" title=\"XP_CMDSHELL\">-- To allow advanced options to be changed.\r\nEXECUTE sp_configure 'show advanced options', 1;\r\nGO\r\n-- To update the currently configured value for advanced options.\r\nRECONFIGURE;\r\nGO\r\n-- To enable the feature.\r\nEXECUTE sp_configure 'xp_cmdshell', 1;\r\nGO\r\n-- To update the currently configured value for this feature.\r\nRECONFIGURE;\r\nGO\r\n\r\n--*******************DESHABILITAR*************************\r\n\r\n-- To enable the feature.\r\nEXECUTE sp_configure 'xp_cmdshell', 0;\r\nGO\r\n-- To update the currently configured value for this feature.\r\nRECONFIGURE;\r\nGO\r\n-- To allow advanced options to be changed.\r\nEXECUTE sp_configure 'show advanced options', 0;\r\nGO\r\nRECONFIGURE;\r\nGO<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\" title=\"XP_CMDSHELL\">-- To allow advanced options to be changed.\r\nEXEC sp_xp_cmdshell_proxy_account 'domain\\user1','users1 Windows password' EXEC sp_xp_cmdshell_proxy_account 'domain\\user2','users2 Windows password'\r\n<\/pre>\n<p>Aplicar permisos para que pueda ejecutar cmdshell<\/p>\n<pre class=\"lang:default decode:true\" title=\"XP_CMDSHELL Permisos\">GRANT EXECUTE ON xp_cmdshell TO [BATTA-NET\\User]\r\n<\/pre>\n<p>Verificar si esta habilitado xp_cmdschell<\/p>\n<pre class=\"lang:default decode:true\" title=\"XP_CMDSHELL Enabled\"> \r\nUse master\r\nEXEC SP_CONFIGURE 'xp_cmdshell';\r\n<\/pre>\n<p>Lista de usuarios con permisos<\/p>\n<pre class=\"lang:default decode:true\" title=\"XP_CMDSHELL User Permisos\"> \r\n--usuarios que tienen habiilitado\r\nUse master\r\nEXEC sp_helprotect 'xp_cmdshell'\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Script para habilitar y deshabilitar la funcion de xp_cmdshell &nbsp; &#8212; To allow advanced options to be changed. EXECUTE sp_configure &#8216;show advanced options&#8217;, 1; GO &#8212; To update the currently configured value for advanced options. RECONFIGURE; GO &#8212; To enable the feature. EXECUTE sp_configure &#8216;xp_cmdshell&#8217;, 1; GO &#8212; To update the currently configured value for [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[76,404],"tags":[53,489],"class_list":["post-8024","post","type-post","status-publish","format-standard","hentry","category-como-hacer","category-sql-dessarrollo","tag-sql","tag-xp_cmdshell"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/posts\/8024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/comments?post=8024"}],"version-history":[{"count":7,"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/posts\/8024\/revisions"}],"predecessor-version":[{"id":10447,"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/posts\/8024\/revisions\/10447"}],"wp:attachment":[{"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/media?parent=8024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/categories?post=8024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bhinfo.com.mx\/cursos\/wp-json\/wp\/v2\/tags?post=8024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}