Repository navigation
Unable to retrieve XP_Cmdshell Output - #466
Merged
Merged
Conversation
Contributor
Author
|
Alternatively if the result from error/union based is none print a warning to tell the user to try a different technique on its own? |
stamparm
added a commit
that referenced
this pull request
Jun 18, 2013
Unable to retrieve XP_Cmdshell Output
bdamele
added a commit
that referenced
this pull request
Jun 19, 2013
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have modified the logic of the xp_cmdshell to return command line results more reliably.
At present, if both Error Based (or presumably Union or Direct) and Stacked Based queries are available the following error occurs (specifying --technique=S bypasses this):
The error message regarding the temporary directory seems to be incorrect - this branch is only followed if conf.dbmsCred is set. I have modified this to only give this error when dbmsCred is set.
There seems to be a problem with inject.getValue(query, resumeValue=False, blind=False, time=False) (/lib/request/inject.py) either in my scenario method or the way it handles. It enters the Error based branch as expected but it returns [None]. I haven't been able to work out the issue. The if statement at the top of errorUse (/lib/techniques/error.py) is particularly painful to debug!
If this occurs then we fallback to time-based blind to retrieve the user's output. This also more reliably detects if xp_cmdshell is available as echo 1 returns the correct value: