Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mssqlexec - Check for existing values before execution #416

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Kahvi-0
Copy link
Contributor

@Kahvi-0 Kahvi-0 commented Sep 12, 2024

Changes to how mssqlexec functions. Before, this module would enable both 'show advanced options' and 'xp_cmdshell' and after execution disable both regardless of prior settings. I have added a small check prior to command execution that saves the values of both options. The function to disable both settings now sets the values of both options based off the initial enumeration.

Here are scenarios of settings and how mssql now handles them. These screenshots have more verbose logs showing just for demonstration.

Both settings disabled
00

'show advanced options' disabled and 'xp_cmdshell' enabled
01

'show advanced options' enabled and 'xp_cmdshell' disabled
10

Both settings enabled
11

Here is the final output with less logging
Final

This is typically inconsequential, however I think its better to revert values to what they were before.

@mpgn
Copy link
Collaborator

mpgn commented Sep 12, 2024

Hello, thanks for the PR, do you think it's a duplicate of #405 ?

@Kahvi-0
Copy link
Contributor Author

Kahvi-0 commented Sep 12, 2024

Hello, thanks for the PR, do you think it's a duplicate of #405 ?

Oh, I did not see this one. It seems like it achieves the same thing as mine. The only difference I can see is that mine also checks for the status of 'show advanced options' as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants