File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
modules/exploits/windows/mssql Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,13 @@ def get_exploit_version(sql_version_string)
96
96
end
97
97
98
98
def set_trustworthy ( on )
99
- mssql_query ( "ALTER DATABASE [#{ datastore [ 'DATABASE' ] } ] SET TRUSTWORTHY #{ on ? 'ON' : 'OFF' } " , false )
99
+ result = mssql_query ( "ALTER DATABASE [#{ datastore [ 'DATABASE' ] } ] SET TRUSTWORTHY #{ on ? 'ON' : 'OFF' } " , false )
100
+ unless result [ :errors ] . empty?
101
+ result [ :errors ] . each do |err |
102
+ vprint_error ( err )
103
+ end
104
+ fail_with ( Failure ::Unknown , "Failed to change Trustworthy setting" )
105
+ end
100
106
end
101
107
102
108
def is_trustworthy
@@ -112,7 +118,13 @@ def enable_clr(enable)
112
118
EXEC sp_configure 'clr enabled', #{ enable ? 1 : 0 } ;
113
119
RECONFIGURE;
114
120
^
115
- mssql_query ( query , false )
121
+ result = mssql_query ( query , false )
122
+ unless result [ :errors ] . empty?
123
+ result [ :errors ] . each do |err |
124
+ vprint_error ( err )
125
+ end
126
+ fail_with ( Failure ::Unknown , "Failed to change CLR setting" )
127
+ end
116
128
end
117
129
118
130
def is_clr_enabled
You can’t perform that action at this time.
0 commit comments