Add protocol based flag handling #267
Open
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.
Closes #234
Allows for protocols to have explicit flags that will resolve when they get defined. For example, if your exploit defines "HTTP" as it's protocol, this change automatically applies the "user-agent" flag to the cli args and if it does not it will not appear.
I of course wanted to support multi-protocol or sub-protocol situations, so this also adds the
cli.AddProtocolFlags
function that will allow for manually adding flags where applicable.Also adds a few checks for whether to print the Global User-Agent string based on that
and a quick Warning check for if proxies are supported.Here's the negative test case where a CVE does not use HTTP so the flag no longer appears:
And here's the positive test case where a CVE does use HTTP so the flag appears: