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.
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
Exploit module for CVE-2023-40044 (WS_FTP unauthenticated RCE) #18414
Exploit module for CVE-2023-40044 (WS_FTP unauthenticated RCE) #18414
Changes from 3 commits
53ed4a6
1695a12
2eacb75
1be8e02
ccd8c71
8431d11
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this method use
TARGET_URI
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
TARGET_URI
is only used in theexploit
method to trigger the vulnerability. The default value/AHT/
works, but due to the how the underlying vuln works, you can change theTARGET_URI
to be anything so long as it begins with/AHT/
. You may want to do this to affect what appears in the IIS logs.It would not make sense to use it in the
check
method as we want to get specific URI's to determine the vulnerable state of the target.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to either document this, or even better, simply use a random string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, I will add some documentation around this. My thinking on keeping the
TARGET_URI
as/AHT/
is that it looks less suspicious in the logs than using something like a random string, e.g the IIS log entry:compared to this (I manually edited the below to create an example):
However I wanted to keep the
TARGET_URI
as a user option to allow for configuration if needed (e.g. testing detection rules or whatever).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments and a better
OptString
description in 2eacb75There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inverting the condition will reduce the nested indentation level :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked how the fall through for the
check
method ends withCheckCode::Unknown
and there is no other path to returnCheckCode::Unknown
. 3 levels of indentation seems acceptable to me. Happy to do it differently if there is a preferred convention on this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer necessary. You should be able to completely remove this code, the mixin inclusion, and the target definition. Users can now use the powershell adapter payloads added in #16548 (one of
cmd/windows/powershell/*
).As a module author, the adapters allow you to simply define the command target and the framework will handle the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cool, I didn't realize this existed! Implemented in 1be8e02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be updated to use the rex-mime API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in 8431d11