Commit Graph

1025 Commits (0bc27334c14d244deba107356727388fe10a6cdc)

Author SHA1 Message Date
Luke Imhoff cca82f4b36
Failing spec for Msf::Framework.new threads
MSP-11605

`Msf::Framework.new` creates 8 threads (change from 1 thread to 9 threads), but
it shouldn't create any threads.
2014-11-12 13:41:30 -06:00
Luke Imhoff 69043d51e0
Merge branch 'master' into feature/MSP-11147/thread-leak-detection
MSP-11147
2014-11-12 12:34:25 -06:00
Luke Imhoff 44f78c21b2
Tag Msfcli spec as content
MSP-11147

Tests currently use the real modules directory for test cases, so the
spec should be tagged with :content because it has same performance
issues as other content specs that can potentially load all the modules.
2014-11-12 12:27:33 -06:00
Luke Imhoff 3ff87c89fe
Clean up Msf::Framework spec thread-leaks
MSP-11147
2014-11-12 12:20:23 -06:00
Luke Imhoff 22cbc5ca02
Use named subject instead of subject
MSP-11147
2014-11-12 12:18:08 -06:00
Luke Imhoff 61109d5567
Fix thread-leaks in msfcli spec
MSP-11147
2014-11-12 12:13:53 -06:00
Luke Imhoff 1fd8fe57df
Merge staging/great-backport to master
Conflicts:
	spec/lib/msf/core/module_spec.rb
2014-11-12 11:08:18 -06:00
Luke Imhoff 8adc80fff1
Sort context entries
MSP-11147
2014-11-12 09:16:37 -06:00
Luke Imhoff 9766e61b7b
Update Msfcli#engage_mode spec style
MSP-11147
2014-11-12 09:08:36 -06:00
Luke Imhoff c0a3707c52
Update Msfcli#init_modules spec style
MSP-11147
2014-11-11 15:29:21 -06:00
Luke Imhoff bb07de3294
Update Msfcli#generate_whitelist spec style
MSP-11147
2014-11-11 14:49:48 -06:00
Luke Imhoff 965607c7dc
Update Msfcli#guess_nop_name spec style
MSP-11147
2014-11-11 14:16:55 -06:00
Luke Imhoff 577065f68d
Update Msfcli#guess_encoder_name spec style
MSP-11147
2014-11-11 14:14:50 -06:00
Luke Imhoff d36da497d0
Update Msfcli#guess_payload_name spec style
MSP-11147
2014-11-11 13:47:16 -06:00
Luke Imhoff 1f1af70047
Update Msfcli#usage spec style
MSP-11147
2014-11-11 13:22:28 -06:00
Luke Imhoff ebec5329df
Update Msfclie#dump_module_list spec style
MSP-11147
2014-11-11 13:21:06 -06:00
Luke Imhoff 56b53b0dcd
Remove redundant 'it' in text name
MSP-11147
2014-11-11 13:16:45 -06:00
Luke Imhoff 5d6aec8bed
Fix context prefix
MSP-11147

Instance methods should be prefixed with `#`, not `.`.
2014-11-11 13:14:34 -06:00
Luke Imhoff a6fed7798e
Update Msfcli#usage spec style
MSP-11147
2014-11-11 13:11:40 -06:00
Luke Imhoff c6f115d070
Update Msfcli#initialize spec style
MSP-11147
2014-11-11 13:11:05 -06:00
Luke Imhoff 86379db65c
Remove incorrect 'Class methods' context
MSP-11147
2014-11-11 12:32:22 -06:00
Luke Imhoff cf0ecd0367
Fix thread leaks in TaskManager spec
MSP-11147
2014-11-11 12:02:14 -06:00
Luke Imhoff eede74be1e
Extract 'Msf::Framework#threads cleaner'
MSP-11147

Extract from 'Msf::Simple::Framework' the `after(:each)` that kills and joins
threads from `framework.threads` into 'Msf::Framework#threads cleaner`.
2014-11-11 11:49:48 -06:00
Luke Imhoff d4d710cc3a
Merge branch 'feature/MSP-11130/metasploit-framework-spec-constants' into feature/MSP-11147/thread-leak-detection
MSP-11147

Merge to get framework instance cleanup, which should clean up a lot of
thread leaks too.

Conflicts:
	Rakefile
	lib/metasploit/framework/spec.rb
	spec/spec_helper.rb
2014-11-05 15:47:59 -06:00
Luke Imhoff 96990fdc02
Fail before suite if more than 1 thread exists
MSP-11147

Detect thread leaks in a `before(:suite)` configured by
`Metasploit::Framework::Spec::Threads::Suite.configure!` and fail if any
leaks are found.
2014-11-05 14:38:43 -06:00
jvazquez-r7 468b4a399a Fix Rex::MIME::Message specs 2014-11-05 11:43:55 -06:00
Luke Imhoff dee02fc85b
Automatically clear previous log/metasploit/framework/spec/constants/each.log
MSP-11130

Have a task, 'metasploit:framework:spec:constants:each:clean' run before
`rake spec` that removes the previous
`log/metasploit/framework/spec/constants/each.log` so that the user doesn't
have to manually remove the load when removing
`Metasploit::Framework::Spec::Constants::Each.configure!` from
`spec/spec_helper.rb`.
2014-11-04 13:58:13 -06:00
Luke Imhoff 313d86982c
Log Spec::Constants::Each error instead of flag.
MSP-11130

Instead of writing `1` to the file and then printing a verbose message
in the spec task action, log the verbose message and just print the log
in the spec task action, so other tools can just look at the log when
not using `rake spec`.

NOTE: Failing specs due to unnecessary
`Metasploit::Framework::Spec::Constants::Each.configure!`
2014-11-04 13:36:52 -06:00
Luke Imhoff 45fea32c77
Use 'Metasploit::Simple::Framework#modules loading' in 'payloads can be instantiated'
MSP-11130

Use `expect_to_load_module_ancestor` and `load_and_create_module` in
favor of the custom code in 'payloads can be instantiated'.
2014-11-04 13:06:52 -06:00
Luke Imhoff c115ad3c36
Use `load_and_create_module` in modules_spec
MSP-11130

Reuse 'Msf::Simple::Framework#modules loading' context in 'all modules
with module type can be instantiated' instead of using the similar code.
2014-11-04 12:59:59 -06:00
Luke Imhoff b0f1b2a1f7
Merge branch 'master' into feature/MSP-11130/metasploit-framework-spec-constants
MSP-11130

Conflicts:
	Rakefile
2014-11-04 10:10:12 -06:00
Luke Imhoff cc4e553c11
Remove Metasploit::Framework::Spec::Constants::Each.configured!
MSP-11130

No longer needed because all before suite leaks have been fixed.
2014-11-04 09:50:16 -06:00
Luke Imhoff 0c769e2fd7
Fix constant leaks in Msf::Util::EXE spec
MSP-11130

Remove global $framework as it loads modules prior to suite run and they
are not cleaned up.
2014-11-04 09:48:55 -06:00
Luke Imhoff 78ea93044b
Fix Msf::PayloadGenerator spec constant leaks
MSP-11130

Remove the constant PAYLOAD_FRAMEWORK as it leads to a
Msf::Simple::Framework instance that is not cleaned up and loads modules
prior to the beginning of the suite run.
2014-11-04 09:48:02 -06:00
Luke Imhoff ff0391cdc7
Fix derive_module_ancestor_names
MSP-11130

Wrap :reference_name in an Array since :ancestor_reference_names is
expected to be an Array.
2014-11-04 09:40:55 -06:00
Tod Beardsley 0b39c2ed85
Land #4084, prep for Ruby 2.1 2014-11-03 13:43:50 -06:00
Luke Imhoff 9ea1240cbb
Default modules_path
MSP-11130

Default `:modules_path` to use the `#modules_path` left for
'Msf::Simple::Framework#modules#loading''s `#load_and_create_module`.
2014-11-03 11:06:49 -06:00
Luke Imhoff 0296d1784d
Derive ancestor reference names from reference name
MSP-11130

For 'Msf::Simple::Framework#modules loading''s load_and_create_modules,
don't require `:ancestor_reference_names` when the `:module_type` is not
payload as the one ancestor reference name will be the same as
`:reference_name`.
2014-11-03 10:59:01 -06:00
Luke Imhoff d97bc52d8a
Complete documentation for 'Msf::Simple::Framework::Modules loading'
MSP-11130
2014-11-03 09:47:29 -06:00
Luke Imhoff f0001eb9e6
Extract 'Msf::Simple::Framework#modules loading'
MSP-11130

'Msf::Simple::Framework#modules loading' defines
`#load_and_create_module`, which takes the :ancestor_reference_names,
:modules_path, :module_type, and :reference_name of the module whose
ancestors to load and the reference name to create. A default modules
path, the first 'modules' path for the Rails application is available in
in the `#modules_path` let.
2014-11-03 08:59:06 -06:00
Luke Imhoff 8b4767449f
Fix constant leaks in Msf::EncodedPayload spec
MSP-11130

Switch to using 'Msf::Simple::Framework' shared context and explicit
module loading instead of loading all moduels to just test with one.
2014-10-30 14:56:47 -05:00
Luke Imhoff c2bd75b587
Clean up leaked constants
MSP-11130
2014-10-29 15:50:47 -05:00
Luke Imhoff 7e2897277b
Rename shared example file to match name
MSP-11130
2014-10-29 12:54:29 -05:00
Luke Imhoff 892aeaf727
Metasploit::Framework::Spec::Constants cleaner
MSP-11130

Shared context will calls `Metasploit::Framework::Spec::Constants.clean
after each example.
2014-10-29 11:31:17 -05:00
Luke Imhoff 0d4b22ce7a
Detect constant leaks in individual examples
MSP-11130

`Metasploit::Framework::Spec::Constants::Each.configure!` will set up an
`after(:each)` callback that will fail the example if there are leaked
constants.  Leaked constants are cleaned up to prevent misattribution.
2014-10-28 15:50:24 -05:00
Luke Imhoff f9b1f2a424
Extract Metasploit::Framework::Spec::Constants::Suite
MSP-11130

`Metasploit::Framework::Spec::Constants::Suite` extracts out
`LOG_PATHNAME`, `configure!`, and `define_task` as those piece are
specific to handling constant leaks for the entire suite.  This is in
preparation for `Metasploit::Framework::Spec::Constants::Each`.
2014-10-28 15:07:32 -05:00
Joe Vennix c6bbc5bccf
Merge branch 'landing-4055' into upstream-master 2014-10-28 11:18:20 -05:00
sinn3r e31c9f579d
Land #3987 - Buffalo Linkstation NAS Login Scanner 2014-10-28 01:45:57 -05:00
James Lee 77d4623c44
Fix respond_to specs for protected methods 2014-10-27 19:39:32 -05:00
Luke Imhoff dae114a7f3
Document how to derive reference_name from ancestors
MSP-11145
2014-10-27 15:59:12 -05:00