diff --git a/lib/takeover/xp_cmdshell.py b/lib/takeover/xp_cmdshell.py index d4b9cac86..56743b9ec 100644 --- a/lib/takeover/xp_cmdshell.py +++ b/lib/takeover/xp_cmdshell.py @@ -76,10 +76,9 @@ class xp_cmdshell: logger.debug(debugMsg) if mode == 1: - cmd = "EXEC master..sp_addextendedproc 'xp_cmdshell', " - cmd += "@dllname='xplog70.dll'" + cmd = getSPQLSnippet(DBMS.MSSQL, "enable_xp_cmdshell_2000", ENABLE=str(mode)) else: - cmd = "EXEC master..sp_dropextendedproc 'xp_cmdshell'" + cmd = getSPQLSnippet(DBMS.MSSQL, "disable_xp_cmdshell_2000", ENABLE=str(mode)) return cmd diff --git a/procs/mssqlserver/disable_xp_cmdshell_2000.txt b/procs/mssqlserver/disable_xp_cmdshell_2000.txt new file mode 100644 index 000000000..ae22febdc --- /dev/null +++ b/procs/mssqlserver/disable_xp_cmdshell_2000.txt @@ -0,0 +1 @@ +EXEC master..sp_dropextendedproc 'xp_cmdshell'; diff --git a/procs/mssqlserver/enable_xp_cmdshell_2000.txt b/procs/mssqlserver/enable_xp_cmdshell_2000.txt new file mode 100644 index 000000000..52e1044a7 --- /dev/null +++ b/procs/mssqlserver/enable_xp_cmdshell_2000.txt @@ -0,0 +1 @@ +EXEC master..sp_addextendedproc 'xp_cmdshell', @dllname='xplog70.dll';