Skip to content

Commit e60956f

Browse files
committed
Add verification
1 parent 406cf48 commit e60956f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

MSSQLand/Actions/Execution/ObjectLinkingEmbedding.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ public override void ValidateArguments(string additionalArguments)
3030
{
3131
Logger.TaskNested($"Executing OLE command: {_command}");
3232

33-
// Enable 'Ole Automation Procedures'
34-
databaseContext.ConfigService.SetConfigurationOption("Ole Automation Procedures", 1);
33+
// Ensure 'Ole Automation Procedures' are enabled
34+
if (!databaseContext.ConfigService.SetConfigurationOption("Ole Automation Procedures", 1))
35+
{
36+
Logger.Error("[!] Unable to enable Ole Automation Procedures. Ensure you have the necessary permissions.");
37+
return null;
38+
}
3539

3640
// Generate two random string of 3 to 12 chars
3741
string output = Guid.NewGuid().ToString("N").Substring(0, 6);

0 commit comments

Comments
 (0)