Commit Graph

1006 Commits (5294594379dc548e8bddb134cd2d001c9f62e2c2)

Author SHA1 Message Date
William Vu a521d469ed
Land #4194, Quake protocol support 2014-11-15 17:44:19 -06:00
Trevor Rosen 3b558624f3
Merge branch 'landing/4129' into upstream-master
Landing #4129

* Detect leaked constants in spec runs
2014-11-14 12:55:56 -06:00
David Maloney ccc5bbd745
this spec needs to use the username factory
:metasploit-credential_public factory will randomly
return either a Username or BlankUsername and thus is
not appropriate for when you want tos et an explicit Username.
The :metasploit_credential_username factory should be used for this
instead

MSP-11609
2014-11-13 10:58:03 -06:00
Jon Hart ebf6fe4e56
Minor style cleanup 2014-11-12 16:44:43 -08:00
Jon Hart 07a1653e57
Add gather module for Quake servers 2014-11-12 13:32:56 -08: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
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
Luke Imhoff 485860ebfb
Uncomment specs used to cause failure
MSP-11145

Restore commented out specs so that that the untested payloads check
passes.
2014-10-27 15:27:16 -05:00
Luke Imhoff 43552a8304
Tag module specs with :content
MSP-11145

Tag content-related specs so they can be run separately in travis-ci.
2014-10-27 14:25:34 -05:00
Luke Imhoff c84febea5f
tools/missing-payload-tests.rb
MSP-11145

**NOTE: Failing specs**

Add a tool for reading `log/untested-payload.log` and
`framework.payloads` to determine `context`s to add
`spec/modules/payloads_spec.rb` to test the untested payloads.
2014-10-27 13:03:31 -05:00
Jon Hart b8c9ef96ca
Land #4003, @nstarke's Login Scanner for WD MyBook Live NAS 2014-10-27 09:57:43 -07:00
Luke Imhoff 1df82ea273
Fix typo in file name
MSP-11145
2014-10-27 11:34:26 -05:00
Luke Imhoff 605f48e58d
Detect leaked constants under Msf::Modules
MSP-11130

Detect constants leaked under Msf::Modules after the suite completes.
2014-10-27 11:13:43 -05:00
James Lee 7081026ae6 Fix some specs broken by 2.x's new rules
* default utf-8 everywhere broke tests in lib/rex/text_spec that dealt
   with binary data
 * new protected rules
2014-10-27 10:28:24 -05:00
Joshua Smith 0d449cb88d
resolves merge conflict between #4071 / #4072 2014-10-24 13:11:35 -05:00
Joshua Smith e583cce7f2 changes be_false to be_falsey in exe_spec 2014-10-24 11:11:44 -05:00
Joe Vennix 813a2f8c1c Oops, false not true. 2014-10-24 10:48:58 -05:00
Joe Vennix 028fb3279f Add spec for ensuring is_eicar_corrupted? is false. 2014-10-24 10:48:58 -05:00
Joshua Smith 34f29f218c really resolve merge conflicts 2014-10-23 21:51:33 -05:00
Trevor Rosen 75333702a2
Merge branch 'land/4028' into upstream-master
Land #4028
2014-10-23 12:36:35 -05:00
Luke Imhoff 48d6880f1d
Add docs for untested payload testing
MSP-11145

Add docs to rake task, shared examples, and share contexts for how to
use all 3 together.
2014-10-23 11:17:05 -05:00
Luke Imhoff 2a82f45f06
Remove unneeded section comment
MSP-11145
2014-10-23 10:53:24 -05:00
Luke Imhoff a7317cb86c
Extract 'untested payloads' shared context
MSP-11145

Detects if payloads are untested when using the 'payload can be
instantiated' shared examples.
2014-10-23 09:55:14 -05:00
Luke Imhoff 6c3c830efb
Extract 'payload can be instantiated' shared example
MSP-11145

Extracted so that pro can use it.
2014-10-23 09:35:52 -05:00
Luke Imhoff 88839e841a
Extract 'all modules with module type can be instantiated' shared example
MSP-11145

Extracted so it can be used by pro.
2014-10-23 09:31:44 -05:00
sinn3r 42cd288bc0
Land #4057 - Bring back TCP::max_send_size and TCP::send_delay options
Fix #3967
2014-10-22 16:23:15 -05:00