Commit Graph

3621 Commits (0e7c3a82f5fd892fee3b43bcafa2cf6c6a1e27fa)

Author SHA1 Message Date
James Lee 0e7c3a82f5 Prepend unlink instead of appending
Makes it work when using meterpreter.  Because "quit" or "exit" in the
console ends up calling die() instead of falling through to whatever's
left in the file, a meterpreter session would never reach the code to
delete itself before this change.
2012-11-15 16:22:21 -06:00
jvazquez-r7 b75c622813 Merge branch 'master' into feature/udp-scanner-mixin 2012-11-08 20:15:25 +01:00
HD Moore 0e8a3f0ea6 Merge branch 'master' into feature/udp-scanner-mixin 2012-11-08 06:09:22 -06:00
James Lee 2ebe2fa08e Merge branch 'rapid7' into bug/rm7037-hash-iteration 2012-11-07 19:27:11 -06:00
James Lee 8a4fb07a0c Merge branch 'bug/read-module-content-errno-enoent' into rapid7
Really [Closes #1025]
2012-11-07 19:25:39 -06:00
James Lee 26a145e527 Always overwrite the old module even when ambiguous 2012-11-07 18:51:12 -06:00
James Lee 3a572625f5 return inside a block returns from outer method
So no need to check its return value.
2012-11-07 17:43:22 -06:00
James Lee aaa5a3c0bb Add "Call stack:" to the log when a module load fails 2012-11-07 12:48:55 -06:00
David Maloney 04a80e0648 Fixes to the WMI setup 2012-11-07 11:26:48 -06:00
David Maloney 208e706307 Module title fixes 2012-11-07 10:33:14 -06:00
Tod Beardsley 81ed0bbcce Avoiding 1.8.7 variable assignment incompat.
Reported on twitter:

http://twitter.com/SoapyWetDish/status/266155915256938496
2012-11-07 10:10:13 -06:00
Luke Imhoff 3ad00f7c63 Merge branch 'master' into bug/read-module-content-errno-enoent 2012-11-06 17:39:55 -06:00
Luke Imhoff 16407f91c8 Rescue Errno::ENOENT from File.open in read_module_content
[Fixes #38426061, #38097411]

Msf::Modules::Loader::Directory#read_module_content may calculate a non-existent
module_path that gets passed to File.open causing an Errno::ENOENT exception
to be raised when using the module cache with a module that has been
moved to a new path (as is the case that originally found this bug) or
deleted.  Now, the exception is rescued and read_module_content returns
an empty string (''), which load_module detects with
module_content.empty? and returns earlier without attempting to module
eval the (empty) content.

As having Msf::Modules::Loader::Directory#read_module_content rescue the
exception, meant there was another place that needed to log and error
and store an error in Msf::ModuleManager#module_load_error_by_path, I
refactored the error reporting to call
Msf::Modules::Loader::Base#load_error, which handles writing to the log
and setting the Hash, so the error reporting is consistent across the
loaders.

The exception hierarchy was also refactored so that
namespace_module.metasploit_class now has an error raising counter-part:
namespace_module.metasploit_class! that can be used with
Msf::Modules::Loader::Base#load_error as it requires an exception, and
not just a string so the exception class, message, and backtrace can be
logged.
2012-11-06 17:38:38 -06:00
jvazquez-r7 9166d12179 Merge branch 'WinRM_piecemeal' of https://github.com/dmaloney-r7/metasploit-framework into dmaloney-r7-WinRM_piecemeal 2012-11-05 23:08:59 +01:00
jvazquez-r7 0f5f5f966b Merge branch 'master' into feature/realport-modules 2012-11-05 22:52:38 +01:00
HD Moore 3d7e0b7b3d Fix bad indent that snuck into the comments 2012-11-04 22:50:47 -06:00
HD Moore ae9b462b99 Fix baud rate (see PR #1008) 2012-11-04 22:38:16 -06:00
David Maloney fca8208171 Some minor code cleanup 2012-11-04 14:45:15 -06:00
David Maloney f69ccc779f Unified smarter module 2012-11-04 13:14:02 -06:00
David Maloney c30ada5eac Adds temp vbs mod and tweaked decoder stub 2012-11-04 12:49:15 -06:00
HD Moore 752ae33135 Minor tweak (kill useless variable, fix gsub) 2012-11-04 01:18:40 -05:00
HD Moore 99ab722aca Dont forget our actual mixin 2012-11-04 01:14:08 -05:00
HD Moore 910a91a0f6 First commit of a udp_mixin and modified scanners 2012-11-04 01:13:38 -05:00
HD Moore 963fdd6430 Initial commit for Digi RealPort modules 2012-11-03 17:44:53 -05:00
James Lee 4a1087d3fa Merge branch 'rapid7' into bug/wrong-file_changed-argument 2012-11-01 16:53:06 -05:00
David Maloney 519eb0c2be Behold the King of Typos in all my glory 2012-11-01 11:30:52 -05:00
David Maloney 0eccfaf1bb Add a disclosure date 2012-11-01 10:24:28 -05:00
Luke Imhoff a745c3a4a0 metasploit_data_models 0.3.0 installed in gemcache 2012-11-01 08:56:00 -05:00
David Maloney dd7ab11e38 Minor cleanup 2012-10-31 16:14:34 -05:00
Luke Imhoff de07ca5f07 Merge branch 'bug/wrong-file_changed-argument' of github.com:/rapid7/metasploit-framework into bug/wrong-file_changed-argument 2012-10-31 11:49:02 -05:00
Luke Imhoff 471ac6d15d Use typed_enable?(type) instead of protected enablement_by_type[type]
Msf::Modules::Loader::Archive#each_module_reference_name tried to check
the enabled types for the module_manager by accessing the
enabledment_by_type Hash, which is protected.  Instead, it should use
the public type_enabled? method.

Add specs to test all of Msf::Modules::Loader::Archive while testing
each_module_reference_name.  In order to properly test that modules
could be found in archives, I had to produce a fastlib archive, so there
is now a spec for FastLib.dump and FastLib.load.  Some specs are marked
pending as I found a bug in FastLib, which has a work-around.  The bug
is filed in PivotalTracker as
https://www.pivotaltracker.com/story/show/38730815 and the pending tests
include the URL also in their tags.
2012-10-31 11:43:28 -05:00
James Lee be57f7ca74 Merge branch 'bug/wrong-file_changed-argument' of github.com:rapid7/metasploit-framework into bug/wrong-file_changed-argument 2012-10-30 13:07:07 -05:00
Luke Imhoff 6c11b870da Check for payload in :type instead of :modification_time
Just had a brain fart when converting the hash key names and translated
:mtype to :modification_time instead of the correct :type.  Correct key
names are in
Msf::ModuleManager::Cache#module_info_by_path_from_database!.
2012-10-30 12:10:31 -05:00
James Lee d402b3fd08 Merge branch 'bug/wrong-file_changed-argument' of github.com:rapid7/metasploit-framework into bug/wrong-file_changed-argument 2012-10-30 10:54:26 -05:00
Luke Imhoff 5709ffc42b Use Msf::Config.install_root instead of Msf.root
Msf::Config.install_root already existed, but I didn't know about it
until egypt pointed it out, so remove the new Msf.root and use
Msf::Config.install_root in the specs instead.
2012-10-30 10:46:02 -05:00
James Lee 2f41452879 Merge branch 'rapid7' into bug/wrong-file_changed-argument 2012-10-30 10:11:06 -05:00
James Lee d0650dfb25 Put a bandaid over getsockname
Depending on how a socket was created, #getsockname will return either a
struct sockaddr as a String (the default ruby Socket behavior) or an
Array (the extend'd Rex::Socket::Tcp behavior). Avoid the ambiguity when
generating SSL certificates for meterpreter handlers by always picking a
random hostname.

This is by no means a proper fix for the underlying problem of
Socket#getsockname having ambiguous behavior before and after being
extended with Rex::Socket::Tcp. It does, however, solve the immediate
problem of not being able to create tunneled meterpreter sessions over
http(s) sessions.

[SeeRM #7350]
2012-10-29 22:45:46 -05:00
sinn3r 7a1c3e7cf6 Merge branch 'dmaloney-r7-WinRM_piecemeal' 2012-10-27 18:55:24 -05:00
scriptjunkie 3efa4186df Fix search error when platform not in target name 2012-10-27 16:28:38 -05:00
Luke Imhoff 055f95898d Merge branch 'master' into bug/wrong-file_changed-argument
Conflicts:
	lib/msf/core/modules/loader/base.rb
2012-10-24 15:25:49 -05:00
Luke Imhoff 69a8739d52 Pass module_path instead of parent_path to file_changed?
[Fixes #37630057]

Modules were always being detected as having file changes because the
parent_path directory, instead of the actual module_path, was being
passed to module_manager.file_changed?, which caused the modification
times to not match.

To ensure this change fixes the ambiguous module warnings, a full spec
for Msf::Core::Modules::Loader::Base has been written.

spec/msf has moved to spec/lib/msf to match conventional spec layout and
allow for the spec/support directory to not be confused as a lib
subdirectory being tested.
2012-10-24 15:11:53 -05:00
David Maloney bfbae5fbb7 Merge branch 'upstream-master' into WinRM_piecemeal
Conflicts:
	lib/msf/core/exploit/winrm.rb
2012-10-24 14:12:28 -05:00
David Maloney 1dcbbdf162 changed indent level 2012-10-24 13:50:44 -05:00
David Maloney a15c35091d Add the WinRM login module 2012-10-24 11:25:39 -05:00
sinn3r 77c8548855 Merge branch 'dmaloney-r7-WinRM_piecemeal' 2012-10-23 16:33:16 -05:00
sinn3r 8c1304557f Code cleanup 2012-10-23 16:32:26 -05:00
sinn3r 67c46fc97a Merge branch 'WinRM_piecemeal' of git://github.com/dmaloney-r7/metasploit-framework into dmaloney-r7-WinRM_piecemeal 2012-10-23 14:03:44 -05:00
David Maloney e19f2d235c Actually use the timeout in winrm cmd 2012-10-23 11:29:32 -05:00
sinn3r f71f83095b Merge branch 'WinRM_piecemeal' of git://github.com/dmaloney-r7/metasploit-framework into dmaloney-r7-WinRM_piecemeal 2012-10-22 17:13:37 -05:00
David Maloney 04fd990741 bad indent 2012-10-22 17:03:40 -05:00