Commit Graph

90 Commits

Author SHA1 Message Date
adfoster-r7 1ac2b3b8e1 Fix unitialized exploit driver exception 2024-01-16 22:35:15 +00:00
Dean Welch cc8fdc0427 Add alias for run_simple to exploit_simple 2023-12-04 17:55:15 +00:00
cgranleese-r7 3e327efdc4 Fixes validation for to_hanler command for Evasion and Payload modules 2023-05-23 10:16:06 +01:00
adfoster-r7 76ede9ef8f Add ruby 3.1 support 2022-03-24 21:59:02 +00:00
adfoster-r7 f3ad3e8292 Re-renamespace error handling, and validate rhost schemas 2021-09-02 13:00:05 +01:00
adfoster-r7 13a5d314de Add test for payload option validation 2021-09-02 13:00:03 +01:00
Alan Foster 112f43f798 Consolidate module argument parsing for ensuring consistency 2021-09-02 13:00:02 +01:00
Alan Foster 134fef21c4 Improve validation rhosts validation 2021-09-02 13:00:01 +01:00
dwelch-r7 8f51663545 Default simplify_module to not load_saved_config and update all references 2021-08-19 13:04:26 +01:00
dwelch-r7 bad5ccbc49 Remove msf/base requires 2021-01-05 14:59:46 +00:00
Spencer McIntyre 7303975377 Initialize the exploit UI earlier on so error messages are displayed 2020-12-01 16:36:39 -05:00
Spencer McIntyre f82ce5335d Support running local exploits from the meterpreter context 2020-12-01 15:22:48 -05:00
Alan Foster 632f1a1205 Update json rpc process request error handling 2020-07-21 18:39:02 +01:00
William Vu d494eb046d Fix RPC support by raising instead of returning 2020-07-20 14:04:38 -05:00
Brent Cook f70043bf4e check if a module has a check method first
Currently, if you run 'check' on a module that does not have a check
method, it will first complain that you have not set the 'RHOSTS'
option, whether it's an exploit module or a scanner. Then, once you set
RHOSTS (or whatever else it needs), it will then say 'Psych! I didn't
have a method in the first place!'.

This switches that logic around so that it first alerts you that the
module doesn't have support in the first place. It also similarizes more
logic between aux and exploit for some future convergence possibility.
2020-07-20 11:09:46 -05:00
Adam Galway 1a2bf98222 creates standard elog & updates exisiting usages 2020-06-22 12:48:39 +01:00
Alan Foster 2c8b5c2647 Fix edge cases in raising metasploit exceptions 2020-05-05 20:18:04 +01:00
Adam Cammack 9aafb3b306 Fix copy-pasta 2020-03-24 09:56:30 -05:00
dwelch-r7 682653e9d9 PR comments 2020-03-13 13:32:59 +00:00
dwelch-r7 6762a7b147 Fix all the tests 2020-03-13 13:32:58 +00:00
dwelch-r7 e6aa840e64 Store results as json to prevent keeping references around 2020-03-13 13:32:58 +00:00
dwelch-r7 9f76f3ef08 Use rpc specific job status tracker and add default no op tracker 2020-03-13 13:32:57 +00:00
Alan Foster 12958326b9 Track job status earlier 2020-03-13 13:32:57 +00:00
dwelch-r7 34fc7528dd Re-add original job state tracker code
This reverts commit 908ce3d3
2020-03-13 13:32:57 +00:00
Jeffrey Martin 908ce3d36b Revert "Land #12960, add ttl to job results instantiated from an RPC request"
This reverts commit ff8bb2e16f, reversing
changes made to ae28463ec6.
2020-03-02 15:58:13 -06:00
dwelch-r7 5c94910998 Add a cache to handle the ttl of job results
Remove accidental addition of gem

Remove commented out code

Remove commented out code

Remove commented out code

Refactor job tracking code, remove simple framework tests

finish renaming service to job_state_tracker

add missing require and move alias definition

fix private attr declaration

Add rspec tests

Address PR comments

Use let syntax in tests

Finish refactor moving job state tracker
2020-02-25 13:31:28 +00:00
Adam Galway f8b8dc1c80 improve dertermining module check support 2019-12-13 11:02:21 +00:00
Adam Cammack 9d41818899 Always trigger the Simple interface 2019-11-19 00:28:17 -06:00
Adam Cammack de845214d1 Add module check result tracking to RPC API
This adds a few sets and a hash to the Msf::Simple::Framework that help
keep track of running checks and their eventual results.
2019-10-29 12:45:09 -05:00
Green-m 90b98a193c Refactor the rhosts for exploit modules. 2018-09-30 16:08:49 +08:00
William Vu 654cbd198a Fix missing method when check is run
Oops, lost the "mod" when I refactored into ternary. Caught during
verification with @wchen-r7. :D
2018-07-23 14:19:48 -05:00
William Vu 5fa1ddf4eb Remove default check method 2018-07-18 16:25:46 -05:00
William Vu 2e002b24a0 Update Msf::Simple::Exploit for targeting by name
And accidentally add error checking.
2018-05-16 10:35:17 -05:00
William Vu 06de967b02 Pass NOP generator to exploit_simple
This also makes exploit_simple consistent with its documentation.
2018-04-20 18:27:53 -05:00
David Maloney a27d10c200 fixes the exception handling in #exploit_simple
The exception handling in the #exploit_simple method tries to set
error on exploit but exploit is defined within the begin block
causing a noMethodError on nilClass

MS-1608
2016-05-31 11:46:05 -05:00
wchen-r7 a16a10aaf6 Fix #6371, being able to report an exception in #job_run_proc
Fix #6371

When a browser fails to bind (probably due to an invalid port or
server IP), the module actually fails to report this exception from
exception, the method calls exploit.handle_exception(e). But since
handle_exception is not a valid method for that object, it is unable
to do so, and as a result the module fails to properly terminate
the module, or show any error on the console. For the user, this will
make it look like the module has started, the payload listener is up,
but there is no exploit job.

Rex::BindFailed actually isn't the only error that could be raised
by #job_run_proc. As far as I can tell registering the same resource
again could, too. With this patch, the user should be able to see this
error too.

Since the exploit object does not have access to the methods in
Msf::Simple::Exploit, plus there is no other code using
handle_exception and setup_fail_detail_from_exception, I decided
to move these to lib/msf/core/exploit.rb so they are actually
callable.
2015-12-22 16:35:29 -06:00
Brent Cook 6482083b6b revert WfsDelay short-circuit on exploit failure
Some exploits currently succeed, but can fail during cleanup, leading to a
false-negative. Reverting this so that the affected exploits can be fixed
first.

This reverts commits b0858e9d46 and
b3f754136e.
2015-09-22 14:43:03 -05:00
HD Moore b3f754136e Skip WfsDelay when the exploit has clearly failed 2015-09-15 08:04:23 -07:00
Fernando Arias 0bb03db786 Rework vuln lookup logic to account for vuln with no service (nexpose import vuln with -1 port)
MSP-13234
2015-09-09 13:21:05 -05:00
Fernando Arias e88a14aee6 Rework exception handler for exploit simple
MSP-13233
2015-09-09 11:51:18 -05:00
sinn3r c62beacd31 Revert #4473 - Log backtraces by default 2015-01-24 02:44:29 -06:00
Christian Mehlmauer a5b56c7d09 fix error 2015-01-08 19:48:29 +01:00
Christian Mehlmauer 6444d8ba64 use kind_of? for checking exceptions 2014-12-30 21:16:57 +01:00
Christian Mehlmauer 7b52bcb657 log errors into framework.log 2014-12-29 00:20:26 +01:00
sinn3r f6f0050f56 Fix #3886 - Backtrace for #check when session is invalid
If the user supplies an invalid session (as in not on the session
list), it will cause a backtrace, because the setup method from
Msf::PostMixin isn't actually called.

We have thought about implementing this in a new OptSession instead.
But you can't use or even pass framework to option_container.rb, so
this is NOT possible.

The original PR was #3956.
2014-12-02 17:22:46 -06:00
Tab Assassin 7e5e0f7fc8 Retab lib 2013-08-30 16:28:33 -05:00
James Lee 5dff043e3c Whitespace 2013-03-06 14:52:32 -06:00
James Lee d57c24dd5f Use framework.payloads instead of modules
When we know the module we're creating is definitely a payload, don't
bother looking in the other module sets.

Also removes an exception message that gets ignored anyway because the
exception class has a hard-coded #to_s
2012-12-05 12:30:55 -06:00
HD Moore d656e3185f Mark all libraries as defaulting to 8-bit strings 2012-06-29 00:18:28 -05:00
David Maloney 122b34c703 fix missing bock transitions
the block objects weren't being transitioned over from the class
methods properly, so the callback blocks were never getting processed.
2012-06-15 14:25:47 -05:00