-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: add --test
flag to the ronin-exploits CLI
#123
feat: add --test
flag to the ronin-exploits CLI
#123
Conversation
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.
Good idea. The logic should be moved to the Run
command as it's own method, since it's printing to stdout. Also, should update the ## Options
documentation above the Run
class and the man/ronin-exploits-run.1.md
markdown man-page to mention the new option.
Also, since this is a new feature, it should be based off of the 1.1.0
version branch.
This did give me another idea about calling perform_test
before perform_build
and raising an exception if NotVulnerable
was returned, to prevent sending an exploit to a non-vulnerable target.
3405536
to
740de65
Compare
@postmodern I've rebased onto 1.1.0 and made most of the requested changes. I haven't tackled the "precheck" functionality you suggested mostly because I wanted to get agreement on what the feature should look like. What would you think of this:
WDYT? |
b983244
to
a27900a
Compare
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 -D
short flag disappeared, and should call exploit.perform_test
. Other than that, looks good.
print_error "Unexpected result: #{result.inspect}" | ||
end | ||
|
||
result |
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.
Do we need to return the result
here?
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 figured it was better to return it in case the caller wanted to act on the result, rather than return the case statement's value.
I'll think about this some more than open another issue. We could explicitly call |
@flavorjones see issue #124. It doesn't necessary have to be implemented in 1.1.0, and could be postponed until after 1.1.0 is released; unless you need this functionality ASAP. |
a27900a
to
9395e3d
Compare
@postmodern I've addressed your comments except for the |
@flavorjones oh good catch! I'll rename |
@flavorjones fixed in the |
Currently, to test whether a target is vulnerable, users need to run something like: ronin-exploits --file=path/to/exploit.rb --dry-run --irb and then run "test" from the REPL. This feature would allow users to instead run: ronin-exploits --file=path/to/exploit.rb --test Printed output looks like one of these lines, depending on the return type: [+] Vulnerable: <test result message> [-] NotVulnerable: <test result message> [~] Unknown: <test result message> [!] Unexpected: <other result type to_s>
9395e3d
to
1750fe5
Compare
@postmodern OK, I've rebased onto latest 1.1.0, un-removed the |
* Added the `-T,--test` option to `ronin-exploits run` to allow only running `Exploit#perform_test` to determine if the target is vulnerable or not: $ ronin-exploits --file=path/to/exploit.rb --test -p host=example.com ... * Printed output looks like one of these lines, depending on the return type: [+] Vulnerable: <test result message> [-] NotVulnerable: <test result message> [~] Unknown: <test result message> [!] Unexpected: <other result type to_s> --------- Co-authored-by: Postmodern <postmodern.mod3@gmail.com>
Oops, made a merge commit instead of a squash merge. Manually re-squash-merged the commits and made sure to preserve your authorship. 😬 |
* Added the `-T,--test` option to `ronin-exploits run` to allow only running `Exploit#perform_test` to determine if the target is vulnerable or not: $ ronin-exploits --file=path/to/exploit.rb --test -p host=example.com ... * Printed output looks like one of these lines, depending on the return type: [+] Vulnerable: <test result message> [-] NotVulnerable: <test result message> [~] Unknown: <test result message> [!] Unexpected: <other result type to_s> --------- Co-authored-by: Postmodern <postmodern.mod3@gmail.com>
* Added the `-T,--test` option to `ronin-exploits run` to allow only running `Exploit#perform_test` to determine if the target is vulnerable or not: $ ronin-exploits --file=path/to/exploit.rb --test -p host=example.com ... * Printed output looks like one of these lines, depending on the return type: [+] Vulnerable: <test result message> [-] NotVulnerable: <test result message> [~] Unknown: <test result message> [!] Unexpected: <other result type to_s> --------- Co-authored-by: Postmodern <postmodern.mod3@gmail.com>
* Added the `-T,--test` option to `ronin-exploits run` to allow only running `Exploit#perform_test` to determine if the target is vulnerable or not: $ ronin-exploits --file=path/to/exploit.rb --test -p host=example.com ... * Printed output looks like one of these lines, depending on the return type: [+] Vulnerable: <test result message> [-] NotVulnerable: <test result message> [~] Unknown: <test result message> [!] Unexpected: <other result type to_s> --------- Co-authored-by: Postmodern <postmodern.mod3@gmail.com>
* Added the `-T,--test` option to `ronin-exploits run` to allow only running `Exploit#perform_test` to determine if the target is vulnerable or not: $ ronin-exploits --file=path/to/exploit.rb --test -p host=example.com ... * Printed output looks like one of these lines, depending on the return type: [+] Vulnerable: <test result message> [-] NotVulnerable: <test result message> [~] Unknown: <test result message> [!] Unexpected: <other result type to_s> --------- Co-authored-by: Postmodern <postmodern.mod3@gmail.com>
* Added the `-T,--test` option to `ronin-exploits run` to allow only running `Exploit#perform_test` to determine if the target is vulnerable or not: $ ronin-exploits --file=path/to/exploit.rb --test -p host=example.com ... * Printed output looks like one of these lines, depending on the return type: [+] Vulnerable: <test result message> [-] NotVulnerable: <test result message> [~] Unknown: <test result message> [!] Unexpected: <other result type to_s> --------- Co-authored-by: Postmodern <postmodern.mod3@gmail.com>
Currently, to test whether a target is vulnerable, users need to run something like:
and then run "test" from the REPL.
This feature would allow users to instead run:
Printed output looks like one of these lines, depending on the return type:
What drove me to submit this feature is my thought that a flag like this would have sped up feedback loops while I was iterating on https://github.com/ronin-rb/community-pocs/blob/main/exploits/activemq/CVE-2023-46604.rb