Commit Graph

6052 Commits (d386e6e568983d3dd267421ceb2a569122cb8056)

Author SHA1 Message Date
James Lee 26b40666ce Merge branch 'rapid7' into feature/stage_encoding 2013-01-15 15:10:58 -06:00
Royce Davis 7361e1041f Merge commit '5e8f388ab8425bf2ef4c2fe33e6133b99ceb46d4' into psexec-mixin2 2013-01-15 14:49:21 -06:00
Royce Davis 6f17ed96db Merge https://github.com/rapid7/metasploit-framework into psexec-mixin2 2013-01-15 14:48:20 -06:00
James Lee af2b1ec25b Clean up doc comments 2013-01-15 14:22:11 -06:00
James Lee ee14c1c613 Merge remote-tracking branch 'R3dy/psexec-mixin2' into rapid7 2013-01-15 12:58:50 -06:00
James Lee 4883cf4b01 Minor doc comment additions 2013-01-15 12:49:43 -06:00
James Lee d36e38fca6 Move encoding into handle_connection
* Allows payloads that override generate_stage to still take advantage
  of stage encoding
* Also adds doc comments for a few methods
2013-01-15 10:34:31 -06:00
Tod Beardsley 9d4366fdab Merge remote-tracking branch 'wchen-r7/irb_terminatelineinput' 2013-01-15 01:50:15 -08:00
Tod Beardsley 6064dfcb71 Merge remote-tracking branch 'wchen-r7/fail_to_reload_fix' 2013-01-15 01:43:07 -08:00
kernelsmith 9ad726167e changes to address scriptjunkie's rpc concerns
as described in https://github.com/rapid7/metasploit-framework/pull/820
2013-01-14 17:14:48 -06:00
James Lee a1e853500f Merge branch 'bug/optint_empty' into feature/stage_encoding 2013-01-14 15:50:39 -06:00
James Lee 21c18b78e6 Don't bother nil check, to_s handles it 2013-01-14 15:47:58 -06:00
James Lee 0c90171fa7 Deal with alread-normalized ints
[See #1308][See #1304]
2013-01-14 15:31:14 -06:00
James Lee fb19ec1005 Merge branch 'rapid7' into feature/stage_encoding 2013-01-14 15:20:23 -06:00
sinn3r b2ecb18a71 Allow OptInt to pass "" for special reasons
Cheap fix
2013-01-14 14:55:48 -06:00
kernelsmith 9bb2dddf99 adds @todo for when tab_comp norm is completed
tab_completion normalization is RM7649
2013-01-14 14:53:31 -06:00
sinn3r 07d15baf89 Merge branch 'bug/opt_int_hex' of github.com:jlee-r7/metasploit-framework into jlee-r7-bug/opt_int_hex 2013-01-14 14:40:25 -06:00
James Lee bbb3fa25be Allow negative values for OptInt
[FixRM #7540]
2013-01-14 14:18:56 -06:00
kernelsmith 7ca9a216f4 Merge remote-tracking branch 'upstream/master' into msfconsole-grep 2013-01-14 14:15:32 -06:00
kernelsmith 3c44769bd8 attempt to add nested tab completion 2013-01-14 14:15:13 -06:00
James Lee b3b68c1b90 Make stage encoding possible
* Fixes a bug in shikata where input greater than 0xffff length would
  still use 16-bit counter
* Short circuits finding bad xor keys if there are no bad characters to
  avoid
* Fixes huge performance issue with large inputs to xor-based encoders
  due to the use of String#+ instead of String#<< in a loop. It now
  takes ~3 seconds on modern hardware to encode a 750kB buffer with
  shikata where it used to take more than 10 minutes. The decoding side
  takes a similar amount of time and will increase the wait between
  sending the second stage and opening a usable session by several
  seconds.

I believe this addresses the intent of pull request 905

[See #905]
2013-01-13 21:07:39 -06:00
James Lee 0d34e0b249 Fix regex for hex numbers 2013-01-13 20:53:40 -06:00
sinn3r 90b0a7035b Recover the prompt again 2013-01-13 13:24:48 -06:00
kernelsmith 7f90082bec grep tab complete is working, but not fully
options tab complete, but not the commands at the end
2013-01-13 03:06:56 -06:00
kernelsmith d9990829d9 fixes some issues with -k and -s 2013-01-13 02:39:56 -06:00
kernelsmith 1646fc8faa Merge remote-tracking branch 'upstream/master' into msfconsole-grep 2013-01-13 02:18:54 -06:00
kernelsmith e7372250d2 added -k keep and -s skip 2013-01-13 02:18:45 -06:00
James Lee 4703a6f737 Unbreak OptInt hex syntax
* Fix spec for no-longer-pending tests
* Fix regex in OptInt#valid? to allow hex syntax again

[See #1293][See #1296]
2013-01-12 14:17:29 -06:00
sinn3r 2f2a5c1d47 [FixRM: #2100] Rescue TerminateLineInput in irb
In irb, when you hit ^c, you will get an ugly backtrace. This
fix handles that exception.
2013-01-12 01:43:40 -06:00
sinn3r b388f2357c Reset modules_cached flag when database disconnects 2013-01-12 00:08:30 -06:00
HD Moore 06fb8f5443 Merge pull request #1293 from wchen-r7/optint_valid
Fix OptInt's valid?() function
2013-01-11 17:29:27 -08:00
sinn3r 8c04df4a47 [FixRM: #7535] Missing normalize() in OptPort
[FixRM: #7535] - Sometimes OptPort can return as a String instead
of Fixnum because OptPort is missing the normalize() function.
2013-01-11 18:34:27 -06:00
sinn3r 0347b173eb Fix OptInt's valid?() function
[FixRM #7539] - The valid?() function will first normalize() the
user-supplied input before validation.  The problem is that the
normalize() function will ALWAYS convert data to integer, therefore
whatever you validate, you will always get true.  For example:
when I do "yomama".to_i, that returns 0, and of course will pass
integer validation.
2013-01-11 16:27:33 -06:00
sinn3r 4546d147d0 Merge branch 'master' of github.com:stephenfewer/metasploit-framework into stephenfewer-master 2013-01-11 01:43:45 -06:00
sinn3r aa36b65aee [FixRM #7673] "Failed to reload" error.
When db_disconnect is issued, this funtion does not update the status
of self.migrated to false.  So when another reload command is used,
the update_module_details function will still try to connect to the
database, which causes the "Failed to reload" error.
2013-01-11 01:10:56 -06:00
James Lee 19ff7f93ae Merge remote-tracking branch 'wchen-r7/encoder_fixes' into rapid7 2013-01-10 17:41:08 -06:00
James Lee 0f346dde9e Some whitespace and ruby -c fixes 2013-01-10 17:29:54 -06:00
James Lee ab64c428ab Merge remote-tracking branch 'kernelsmith/RM7676-migrate-h' into rapid7 2013-01-10 17:24:11 -06:00
James Lee d4854606f2 Cosmetic fixes
[FixRM #7223][See #1283]
2013-01-10 17:18:25 -06:00
sinn3r 192279544b BufferRegister should be validated.
If BufferRegister is in lower-case, then gen_decoder_prefix will
return nil.  When the return value is nil, other functions like
gen_decoder() will backtrace due to a "undefined method "+" for nil"
error.  Therefore, this input should NOT be case-sensitive.

Also, if for some reason the user supplies an invalid BufferRegister,
the function should be aware of that and warn the user about the
bad input.
2013-01-10 17:14:38 -06:00
James Lee afb12983ab Merge branch 'rapid7' into kernelsmith-msfconsole-suspend 2013-01-10 16:40:27 -06:00
kernelsmith e8c239dc81 changed TODO to @todo per egypt 2013-01-10 16:35:01 -06:00
Royce Davis b702263bbf Added fix form Eric Milam to simple.disconnect 2013-01-10 16:33:03 -06:00
kernelsmith b3266823ba Addressed egypt's comments
-changed the suspend/resume loop logic to reduce code duplication.
-fixed up some print_*'s to remove embedded \n's
-changed formatting on some error messages
-switched comment to a TODO:
-change host_processes.select (blah} to use .find instead
-adjusted code due to remvoal of the pids.dup, resulting in arr_pids
disappearing
2013-01-10 15:40:54 -06:00
James Lee 7fd3440c1a Fix hd's attempt to rename ruby payloads 2013-01-10 15:25:50 -06:00
James Lee 4fcb8b6f8d Revert "Rename again to be consistent with payload naming"
This reverts commit 0fa2fcd811.
2013-01-10 15:24:25 -06:00
kernelsmith b11f941387 cleaned up at validate_pids conversion, fixed YARD doc
in validate_pids no longer need dup as conversion to ints was cleaned
up to use map.  Which also improved readability and allowed adding uniq
and compact, thanks egypt.
YARD doc on cmd_suspend was incorrectly organized
2013-01-10 14:59:02 -06:00
Tod Beardsley 6a10857daf Merge remote-tracking branch 'bturner-r7/set_gem_path' 2013-01-10 12:55:55 -08:00
HD Moore 0fa2fcd811 Rename again to be consistent with payload naming 2013-01-10 14:16:37 -06:00
HD Moore 88b08087bf Renamed and made more robust 2013-01-10 14:05:29 -06:00
Stephen Fewer 8e6e1bc164 open up the bloxor encoder. 2013-01-10 17:39:40 +00:00
kernelsmith 92e8def889 adds suspend to meterp and adds full pid validation
This fully fixes RM7223 and adds the suspend command to the meterpreter
interface.
Suspend allows you to suspend and resume running processes on the
targethost.  It was originally written as a post module (and the dll
version will be submitted as such later), but egypt suggested I add it
to meterpreter
2013-01-09 23:25:32 -06:00
HD Moore 4c1e501ed0 Exploit for CVE-2013-0156 and new ruby-platform modules 2013-01-09 23:10:13 -06:00
Tod Beardsley 950902f856 Add a tasteful URL to some banners. 2013-01-09 22:33:30 -06:00
Tod Beardsley 6f26e9efb2 More banner sanity checking. 2013-01-09 22:32:53 -06:00
Royce Davis 13140d05b1 Added some methods for checkout output and cleanup 2013-01-09 21:14:19 -06:00
Tod Beardsley 12f0501f2f Add a little erorr checking, another cow 2013-01-09 20:38:14 -06:00
Tod Beardsley a0ba2f4951 Seperate data from code
Banners are content more than anything.
2013-01-09 19:54:08 -06:00
kernelsmith 4728a59189 fixes RM7676 migrate -h doesn't produce help
also adds YARD doc to cmd_migrate in collusion with egypt.
low threat change, but still tested on Win7-32 sp0, ruby 1.9.3-p125,
Framework Version: 4.6.0-dev just for kicks
2013-01-09 16:28:04 -06:00
sinn3r a158611c95 Merge branch 'tasos-r7-web-modules' 2013-01-09 16:14:16 -06:00
sinn3r 8b25599feb Merge branch 'web-modules' of github.com:tasos-r7/metasploit-framework into tasos-r7-web-modules 2013-01-09 16:14:04 -06:00
kernelsmith 3b8914c270 skeleton & YARD doc for cmd_suspend added
functionality untested atm.
cmd_suspend_help also added
2013-01-09 15:34:04 -06:00
jvazquez-r7 7a1a9985d5 Merge branch 'mysql_login_exceptions' of https://github.com/wchen-r7/metasploit-framework into wchen-r7-mysql_login_exceptions 2013-01-09 18:21:03 +01:00
sinn3r 6490af720b Make failures more verbose so people know what's going on 2013-01-09 11:11:26 -06:00
Tasos Laskos 5ac6060fc1 Auxiliary::Web::HTTP_request: Updated to return an empty response on reset connections 2013-01-09 19:06:51 +02:00
Tasos Laskos 74cdd918af Auxiliary::Web::HTTP#run: don't allow connection or callback errors to abort the whole operation 2013-01-09 18:38:09 +02:00
Royce Davis c262288541 Fixed msftidy issues 2013-01-08 15:35:20 -06:00
Royce Davis 3e1ea25207 Added Yard documentation 2013-01-08 15:20:13 -06:00
James Lee 95a95d45ec Fix importing msfxml files containing a session
[See #1179][SeeRM #7669]
2013-01-08 12:13:20 -06:00
Royce Davis c236e4e6e3 I took a stab at generating Yard documentation. I have never done it before... 2013-01-08 11:57:59 -06:00
Royce Davis 4fd196c0de Fixed typo, capitalization and column space 2013-01-08 11:52:40 -06:00
sinn3r be36c4ebef Some machines are sensitive about this. 2013-01-07 22:32:43 -06:00
sinn3r 1d3c1ec7fc Merge branch 'master' of github.com:CharlieEriksen/metasploit-framework into CharlieEriksen-master 2013-01-07 19:03:35 -06:00
sinn3r 824bd84990 I forgot to add this exception 2013-01-07 18:06:39 -06:00
sinn3r fc48cc117d Merge branch 'bug/rm7665-netsparker-import' of github.com:jlee-r7/metasploit-framework into jlee-r7-bug/rm7665-netsparker-import 2013-01-07 17:19:52 -06:00
sinn3r 83ce282a75 Merge branch 'bug/rm7665-netsparker-import' of github.com:jlee-r7/metasploit-framework into jlee-r7-bug/rm7665-netsparker-import 2013-01-07 17:18:04 -06:00
James Lee a0e6c7043b Add actual cdata handler
Netsparker puts requests, responses, and info for vulns inside a cdata
(which makes sense because it's usually html snippets). This commit
handles that so report_web_vuln will actually be somewhat useful. Note
that the request is ignored by report_web_vuln despite there being a
place for it in the WebVuln model.

[SeeRM #7665]
2013-01-07 17:16:48 -06:00
James Lee 8bfca52941 Clear state for new vulns
[FixRM #7665]
2013-01-07 16:27:40 -06:00
sinn3r 5bc1066c69 Change how modules use the mysql login functions 2013-01-07 16:12:10 -06:00
sinn3r 261e095e5e Handle exceptions in mysql_login 2013-01-07 16:02:59 -06:00
sinn3r 268de941c7 Merge branch 'tasos-r7-web-modules' 2013-01-07 13:37:32 -06:00
sinn3r b53e8c794f Fix indent level 2013-01-07 13:36:55 -06:00
James Lee 3f9c459545 Fix ArgumentError when importing netsparker xml 2013-01-07 12:21:08 -06:00
Royce Davis 7dd9d30363 Added a new mixin psexec.rb 2013-01-07 11:05:23 -06:00
Rob Fuller 986435c598 Fix typo
Typo found by @schierlm but mentioned after the commit of pull request #1187
Info: https://github.com/rapid7/metasploit-framework/pull/1187#commitcomment-2340457
2013-01-06 01:47:15 -05:00
sinn3r 3d3799d38d Ok... even more explicit 2013-01-05 13:39:31 -06:00
Charlie Eriksen 25cadf8b87 Adding exploit for CVE 2012-4915
Initial commit.

Major functionality working. A bit of polish is still needed in a few
spots to handle exceptions and such.
2013-01-05 14:21:02 +00:00
sinn3r 4ff186c23d Change the .text-too-small error message.
The original error message apparently confuses people, and this
can be easily improved.  See the following:
https://community.rapid7.com/thread/2356
2013-01-05 01:57:41 -06:00
Tasos Laskos e1885cab0b Merge remote-tracking branch 'upstream/master' into web-modules 2013-01-04 21:33:17 +02:00
Tasos Laskos 3d4d6e9860 Crawler aux mixin updated to catch the mysterious and anonymous timeout exception and re-raise it as a Timeout::Error 2013-01-04 21:32:18 +02:00
Meatballs1 04714893c8 Add force option to reboot command 2013-01-04 09:20:56 +00:00
sinn3r d17a6f99e5 Merge branch 'feature/deprecated-module-mixin' of github.com:jlee-r7/metasploit-framework into jlee-r7-feature/deprecated-module-mixin 2013-01-04 00:38:01 -06:00
jvennix-r7 2f0e4cbd39 Merge pull request #1179 from rapid7/bug/bap-compro-hosts
Changes to BAP session storage
2013-01-03 14:27:13 -08:00
James Lee d9947a1515 Add a mixin for marking deprecated modules
* This mixin standardizes the previously ad-hoc deprecation warnings on
  modules that have been moved.

* Uses the mixin in 3 existing modules that already have (or should have
  had) deprecation warnings.
2013-01-02 19:14:44 -06:00
Brandon Turner 5777968c19 Set GEM_PATH when using built-in gemcache
This allows rubygems to work with gems loaded from lib/gemcache.
2013-01-01 21:25:24 -06:00
Meatballs1 0b3143ff45 Fix railgun EOL 2012-12-30 16:32:15 +00:00
sinn3r e05b55f32d Add new functions 2012-12-28 03:48:35 -06:00
Tod Beardsley c695f429d5 Mirror upstream PacketFu fix on ICMP size 2012-12-27 14:56:49 -06:00
sinn3r d2dc7ebc2d Merge branch 'feature/windows-postgres-payload-dll' of git://github.com/jlee-r7/metasploit-framework into jlee-r7-feature/windows-postgres-payload-dll 2012-12-26 11:18:21 -06:00
Tod Beardsley 179e4cf870 Moving up to 4.6.0-dev 2012-12-24 08:40:29 -06:00
James Lee 20cc2fa38d Make Windows postgres_payload more generic
* Adds Exploit::EXE to windows/postgres/postgres_payload. This gives us
  the ability to use generate_payload_dll() which generates a generic dll
  that spawns rundll32 and runs the shellcode in that process. This is
  basically what the linux version accomplishes by compiling the .so on
  the fly. On major advantage of this is that the resulting DLL will
  work on pretty much any version of postgres

* Adds Exploit::FileDropper to windows version as well. This gives us
  the ability to delete the dll via the resulting session, which works
  because the template dll contains code to shove the shellcode into a
  new rundll32 process and exit, thus leaving the file closed after
  Postgres calls FreeLibrary.

* Adds pre-auth fingerprints for 9.1.5 and 9.1.6 on Ubuntu and 9.2.1 on
  Windows

* Adds a check method to both Windows and Linux versions that simply
  makes sure that the given credentials work against the target service.

* Replaces the version-specific lo_create method with a generic
  technique that works on both 9.x and 8.x

* Fixes a bug when targeting 9.x; "language C" in the UDF creation query
  gets downcased and subsequently causes postgres to error out before
  opening the DLL

* Cleans up lots of rdoc in Exploit::Postgres
2012-12-22 00:30:09 -06:00
sinn3r 9b768a2c62 Merge branch 'cleanup/post-windows-services' of git://github.com/jlee-r7/metasploit-framework into jlee-r7-cleanup/post-windows-services 2012-12-21 23:42:17 -06:00
David Maloney be7da83feb Adds EHLO domain to smtp deliver
Allow the user to set the EHLO domain for the smtp deliver module.
This is needed for Pro functionality

[story #41549217]
2012-12-21 14:22:21 -06:00
Tod Beardsley 2bb7b5ea11 Fixes error message for badchar
Note that only a custom module that allows for users to pass arguments
to nmap would be capable of hitting the error condition. Right now, only
auxiliary/scanner/oracle/oracle_login traverses the codepath, and that
doesn't allow for arbitrary args passed to nmap.

So... without contriving an example, it should be impossible to
experience or test.

[FixRM #7641]
2012-12-21 09:59:54 -06:00
sinn3r be85cf54ab Why in a quote? 2012-12-20 10:47:23 -06:00
Sherif Eldeeb f0991f3b3b make "resp.body" as an advanced option
created a new advanced option "HttpUknownRequestResponse" that will be sent back in the HTML body of unknown requests instead of the old static "No site configured at this address" message.
2012-12-20 12:35:00 +03:00
sinn3r 0344c568fd Merge branch 'smb_fixes' of git://github.com/alexmaloteaux/metasploit-framework into alexmaloteaux-smb_fixes 2012-12-18 11:38:14 -06:00
sinn3r 4b56e3c862 Merge branch 'tasos-r7-web-modules' 2012-12-18 10:38:00 -06:00
sinn3r 7602e6f3ca Merge branch 'patch-6' of git://github.com/mubix/metasploit-framework into mubix-patch-6 2012-12-18 01:15:01 -06:00
Tod Beardsley 10511e8281 Merge remote branch 'origin/bug/fix-double-slashes'
Ran the new normalize_uri() specs, all passes, so I'm quite confident in
this change.
2012-12-17 13:29:19 -06:00
Meatballs1 378038afab Merge remote-tracking branch 'upstream/master' into wldap32_railgun 2012-12-17 17:23:43 +00:00
Meatballs1 6a92bd609a Tidying and refactoring 2012-12-17 15:29:04 +00:00
Meatballs1 b5fd3463d7 Initial working AD_LDAP lookup 2012-12-17 14:07:35 +00:00
Rob Fuller b3118afcbb Correct Railgun WriteProcessMemory var type
This is described here:
https://dev.metasploit.com/redmine/issues/7237

After change operates as expected.
2012-12-15 23:11:52 -05:00
HD Moore 36bcc1f7f5 Just show the relevant part of the error message
The full error is already in elog/dlog
2012-12-15 13:16:00 -06:00
Samuel Huckins 4f3c6f973d Changes to BAP session storage.
[SEERM #7294]
[Bug #40937817]

* exploit/multi/handler no longer filtered out from vuln creation and
other steps
* Name changed to parent module's name in session storage so we show something more helpful
than generic handler
* Same for vuln and attempt creation
2012-12-13 15:35:34 -06:00
sinn3r f81ef9b68e Merge branch 'bug/reload_all' of git://github.com/jlee-r7/metasploit-framework into jlee-r7-bug/reload_all 2012-12-13 12:33:39 -06:00
James Lee d7f6b0c373 Remove vestiges of ModuleManager's ModuleSet origins 2012-12-13 11:23:49 -06:00
Meatballs1 3127808f76 Revert/remove unnecessary files 2012-12-13 11:02:54 +00:00
Meatballs1 e60d10bd3d Repackage as single module pull 2012-12-13 09:40:36 +00:00
sinn3r c0b214c287 Merge branch 'bindaddress' of git://github.com/corelanc0d3r/metasploit-framework into corelanc0d3r-bindaddress 2012-12-13 02:06:23 -06:00
Tod Beardsley e762ca0d9b Merge remote branch 'jlee-r7/midnitesnake-postgres_payload' 2012-12-12 15:30:56 -06:00
Tod Beardsley 0d8d5baf6d Resolve merge conflict from jlee-r7 2012-12-12 14:24:47 -06:00
James Lee 6b4e021607 Make ModuleManager Enumerable
Fixes tools/module_* and probably some other lurking bugs
2012-12-12 13:41:04 -06:00
Tod Beardsley e09f4e609c Merge remote branch 'jlee-r7/bug/rm7037-hash-iteration-redux' 2012-12-11 16:08:28 -06:00
James Lee a673c363fd Use a more descriptive variable name
Also removes commented-out code.
2012-12-10 13:36:09 -06:00
kernelsmith 11fec0bc07 adds rudimentary validity checking to pids for meterp kill
addresses redmine https://dev.metasploit.com/redmine/issues/7223, but
may not be a truly encompassing solution.  'good bandaid' as egypt put
it
2012-12-05 13:17:33 -06:00
James Lee bc7cd4b452 Loop through module sets like super used to do
... since super doesn't exist any more.

Also changes to using ModuleSet#[] inside ModuleManager#[] instead of
ModuleSet#create to mimic original behavior when ModuleManager was a
subclass of ModuleSet.
2012-12-05 12:59:35 -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
Tasos Laskos 62782f0273 Auxiliary::Web::Fuzzable: removed confusing HTTP response status messages [SEERM #7586] 2012-12-05 18:49:07 +02:00
James Lee 77af4ba559 Missed a file in previous commit, thanks, travis! 2012-12-03 22:37:50 -06:00
James Lee f4476cb1b7 Really fix payload recalculation
Instead of deleting all non-symbolics before the re-adding phase of
PayloadSet#recalculate, store a list of old module names, populate a
list of new ones during the re-adding phase, and finally remove any
non-symbolic module that was in the old list but wasn't in the new list.

Also includes a minor refactoring to make ModuleManager its own thing
instead of being an awkard subclass of ModuleSet. Now PayloadSet doesn't
need to know about the existence of framework.modules, which makes the
separation a little more natural.

[FixRM #7037]
2012-12-03 22:23:40 -06:00
Tasos Laskos beffd1feda Auxiliary::Web::Analysis::Taint#taint_analysis: added a bit of differential logic to avoid false positives in case the default responce matches the pattern we're looking for [FIXRM #7559] 2012-12-04 00:09:54 +02:00
Tasos Laskos dafa984166 Auxiliary::Web::Fuzzable#submit: bugfixed to call http.request instead of http.request_async 2012-12-04 00:06:17 +02:00
Tasos Laskos f6c27a4494 Auxiliary::Web#find_proof: updated doc comments 2012-12-04 00:05:12 +02:00
HD Moore 30d7de3157 The db search already prints results, return after 2012-12-02 01:14:56 -06:00
HD Moore 3ae47e2089 Move the thread tracking into the update method 2012-12-02 01:07:40 -06:00
HD Moore 51673ca152 Search reference values as well (ms08-067,etc) 2012-12-02 00:44:25 -06:00
HD Moore f17ea91d7c Whitespace changes only 2012-12-02 00:44:03 -06:00
Brandon Turner 7f822fabd7 Fix typo 2012-12-01 15:53:51 -06:00
Tod Beardsley 7ada8aeac1 Correct bug number 2012-12-01 14:16:24 -06:00
Tod Beardsley 725b085ef2 If there are no search results, try harder.
Sometimes, the database is active but the cache isn't filled out, or
doesn't contain the module you want. This can come up especially when
msfconsole first starts and you are programmatically searching for
modules, for whatever reason.

This allows for falling back to the regular (slow) search in the event
no hits have been returned. It does not actually address the caching
problem seen in QA, but it's generally going to be Good Enough. Search
is getting overhauled Real Soon Now anyway.

[FixRM #7533]
2012-12-01 14:06:32 -06:00
James Lee bc63ee9c46 Merge branch 'jvazquez-r7-file_dropper_support_local' into rapid7 2012-11-30 13:43:02 -06:00
James Lee 1da3388194 Fix missing require
[Closes #1106]
2012-11-30 13:42:31 -06:00
HD Moore a3c8e54d0a Catch exceptions from broken modules 2012-11-30 11:04:23 -08:00
HD Moore fee6ad9799 Bump to 4.5.0-release for testing 2012-11-30 11:04:23 -08:00
Brandon Turner fc2feaaea3 Don't set BUNDLE_GEMFILE env var if already set
This allows setting BUNDLE_GEMFILE with `bundle exec` or some other
command in special cases.
2012-11-30 00:54:36 -06:00
HD Moore 213b3352fa This adds report_last_detail() to Nexpose 2012-11-29 13:07:31 -08:00
Alexandre Maloteaux c0c3dff4e6 Several fixes for smb, mainly win 8 compatibility 2012-11-28 22:49:40 +01:00
jvazquez-r7 087ff328b6 correct comments documentation 2012-11-28 22:18:56 +01:00
jvazquez-r7 17518f035c support for local exploits on file_dropper 2012-11-28 22:17:27 +01:00
Tod Beardsley 95f084b296 Use cvedetails not mitre. 2012-11-28 13:24:08 -06:00
James Lee 17d8d3692b Merge branch 'rapid7' into midnitesnake-postgres_payload 2012-11-27 11:14:54 -06:00
sinn3r 541ecd49d6 Merge branch 'web-modules' of git://github.com/tasos-r7/metasploit-framework into tasos-r7-web-modules 2012-11-26 12:17:24 -06:00
sinn3r d95220da59 Merge branch 'jlee-r7-bug/rm7499-fastlib-1.8.7' 2012-11-21 20:39:11 -06:00
Tasos Laskos 26b3b4577d Merge remote-tracking branch 'upstream/master' into web-modules 2012-11-21 23:57:42 +02:00
Tasos Laskos b656554769 Exploit::Remote::Web: moved status printing calls out of #perform_request and into #exploit 2012-11-21 23:28:26 +02:00
James Lee 3640a344d4 Fix whitespace and long lines 2012-11-20 19:29:12 -06:00
James Lee 084398b611 Fix 1.8.7 incompatibility
::File.find did not return an Enumerable when not given a block in
1.8.7; instead it un-idiomatically just raised an exception.  The
solution is just to give the block directly to .find instead of trying
to call #each on its return value.

[FixRM #7499]
2012-11-20 19:28:33 -06:00
James Lee fcf1c87f64 Fix alignment of one of the banners
Lots of backslashes in a string make it hard to see in the code what it
will look like on on the console. Use single quotes and unescaped
backslashes.
2012-11-20 17:22:38 -06:00
HD Moore f5c7f4c41a Remove trailing whitespace 2012-11-19 19:42:22 -06:00
sinn3r 527ba0e401 Merge branch 'feature/automatic-fs-cleanup' of git://github.com/jlee-r7/metasploit-framework into jlee-r7-feature/automatic-fs-cleanup 2012-11-19 15:59:19 -06:00
James Lee 2526dce20a Add attrib.exe for removing read-only files
This really should be a standard part of session.fs.file.rm
2012-11-19 15:18:03 -06:00
Meatballs1 e057467329 Initial attempt 2012-11-18 21:24:49 +00:00
sinn3r d4749ff009 Merge branch 'feature/automatic-fs-cleanup' of git://github.com/jlee-r7/metasploit-framework into jlee-r7-feature/automatic-fs-cleanup 2012-11-16 19:02:46 -06:00
James Lee c81a289d5d Fix a few bad tabs and some 1.9-only syntax 2012-11-16 16:07:12 -06:00
James Lee 591b085858 Add support for shell sessions in FileDropper 2012-11-16 15:51:54 -06:00
Tasos Laskos c659b37c94 Updated indentation to use tabs 2012-11-16 23:11:48 +02:00
James Lee 3363475f99 Fix backwards order of @param comment 2012-11-15 17:55:17 -06:00
James Lee 83708a5a48 Add a FileDropper mixin for recording cleanup targets
Doesn't cover shell sessions yet, so needs a bit more work
2012-11-15 17:52:10 -06:00
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
Tasos Laskos 7032ef0f6f Merge remote-tracking branch 'upstream/master' into web-modules 2012-11-09 00:21:38 +02:00
jvazquez-r7 b75c622813 Merge branch 'master' into feature/udp-scanner-mixin 2012-11-08 20:15:25 +01:00
HD Moore 4d2147f392 Adds normalize_uri() and fixes double-slash typos 2012-11-08 07:16:51 -06: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
James Lee 7a6ccb92ab Unfubar the threading for #service_list
Also makes the test for service_start a little more resilient in case
W32Time is already started
2012-11-06 18:29:42 -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
James Lee 34bc92584b Refactor WindowsServices
* Pulls common code up from several methods into #open_sc_manager
* Deprecates the name Windows::WindowsServices in favor of
  Windows::Services. The platform is already clear from the namespace.
* Makes the post/test/services test module actually work

[See #1007]
[See #1012]
2012-11-06 17:30:04 -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
Tod Beardsley 23cc2bd1a1 Merge remote branch 'origin/master' 2012-11-05 15:56:21 -06:00
Tod Beardsley 6a4d398b5d Merge remote branch 'origin/feature/addp-modules' 2012-11-05 15:55:30 -06: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
HD Moore 0d6acad1a0 Updates for PR #981 (cleanup) 2012-11-02 15:47:52 -05:00
HD Moore 0bf5f63d67 Merge branch 'master' into feature/addp-modules 2012-11-02 15:41:03 -05:00
HD Moore 52f0bca9be Merge branch 'master' into feature/addp-modules 2012-11-02 15:40:36 -05:00
Tasos Laskos 33502b52b0 Rex::Text.refine: removed redundant Array operations 2012-11-02 16:10:42 +02:00
James Lee 4a1087d3fa Merge branch 'rapid7' into bug/wrong-file_changed-argument 2012-11-01 16:53:06 -05:00
Tasos Laskos 0d2ad8734e #report_web_vuln: updated to include an owner and payload 2012-11-01 22:23:56 +02:00
Tasos Laskos a88031a02a added web exploit mixin 2012-11-01 21:37:12 +02:00
Tasos Laskos 4cdd26d579 added Anemone path extractors 2012-11-01 21:18:05 +02:00
Tasos Laskos 385d225305 Updated support for Web modules and analysis techniques (committing to new clean branch due to corruption) 2012-11-01 21:14:38 +02: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
Luke Imhoff 558b8b0fcf File renames and restructuring for metasploit_data_models 0.3.0 2012-11-01 08:43:06 -05:00
Luke Imhoff 6aed38f309 Update metasploit_data_models paths for version 0.3.0 2012-11-01 08:39:18 -05:00
David Maloney dd7ab11e38 Minor cleanup 2012-10-31 16:14:34 -05:00
jvazquez-r7 c27a4d5de2 Merge branch 'master' into bug/handle-100-continue 2012-10-31 18:56:33 +01: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
HD Moore 6ec392c4cf Add Rex::Text.sha1 and Rex::Text.sha1_raw 2012-10-28 23:49:21 -05:00
HD Moore adc9532ec7 Reset this back to master's copy, fixes this pull 2012-10-28 23:13:32 -05:00
HD Moore 3a42eb3f73 New modules and library for the ADDP protocol 2012-10-28 23:04:18 -05:00
HD Moore 43fe219a05 This improves handling of 100-continue responses 2012-10-28 22:57:18 -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
David Maloney e08cedec2e Requested revisions/cleanup
minor fixes to spacing, some typos, and abse64 switched to Rex
2012-10-22 17:01:00 -05:00
sinn3r af918b84a0 Merge branch 'standardize_authorship' of git://github.com/mubix/metasploit-framework into mubix-standardize_authorship 2012-10-22 16:47:03 -05:00
Rob Fuller 28f47e9aa0 fix spacing for all authors 2012-10-22 17:22:37 -04:00
Rob Fuller a13a88ce28 fix spacing 2012-10-22 17:07:58 -04:00
Rob Fuller 7437d9844b standardizing author info 2012-10-22 17:01:58 -04:00
James Lee dafb56f6b6 Merge branch 'dmaloney-r7-findpids' into rapid7
[Closes #950]
2012-10-22 15:52:07 -05:00
corelanc0d3r 7733843bf3 added option ReverseListenerBindAddress 2012-10-22 22:17:50 +02:00
James Lee 651f9b9c8f Use opts.usage instead of a Table 2012-10-22 15:16:55 -05:00
HD Moore 2436ac3a58 Revert "Merge branch 'migrator' of git://github.com/scriptjunkie/metasploit-framework into scriptjunkie-migrator"
This reverts commit ca07bdbad6, reversing
changes made to ed3f87b738.
2012-10-20 22:38:31 -05:00
HD Moore 04e1856a4f Fix a copypasta error triggered by a failed load 2012-10-20 15:00:11 -05:00
sinn3r c80005b85f Merge branch 'WinRM_piecemeal' of git://github.com/dmaloney-r7/metasploit-framework into dmaloney-r7-WinRM_piecemeal 2012-10-19 17:46:15 -05:00
David Maloney 57514e5407 Msftidyness 2012-10-19 16:56:52 -05:00
sinn3r 51c03bbf47 Merge branch 'WinRM_piecemeal' of git://github.com/dmaloney-r7/metasploit-framework into dmaloney-r7-WinRM_piecemeal 2012-10-19 15:44:05 -05:00
sinn3r ca07bdbad6 Merge branch 'migrator' of git://github.com/scriptjunkie/metasploit-framework into scriptjunkie-migrator 2012-10-19 15:25:45 -05:00
David Maloney 56cbe6a67e Some minor fixups 2012-10-19 15:25:03 -05:00
David Maloney 3a8dd261ae WinRM mixin and basic discovery module 2012-10-19 15:08:58 -05:00
Tod Beardsley b7652b44d5 Adding prepend_migrate? 2012-10-19 14:24:13 -05:00
James Lee ffa4373242 Merge branch 'rapid7' into wchen-r7-print_warning
[Closes #899]
2012-10-19 13:49:32 -05:00
jvazquez-r7 205dc8870a Merge branch 'prependsetguid' of https://github.com/mephos/metasploit-framework into mephos-prependsetguid 2012-10-19 10:33:56 +02:00
James Lee 768d2c5921 Go back to old behavior for unknown versions
May not be correct, but it's what we used to do, so probably better than
just raising.

Also documents things a bit better.
2012-10-18 16:57:40 -05:00
James Lee 1eccb24bf8 Raise if the version isn't what we expect
Also adds some clarifying commentation and adds todb to the list of
authors since he wrote the original module for windows upon which this
one is based.
2012-10-18 15:55:55 -05:00
James Lee 0221f75f39 Merge branch 'rapid7' into midnitesnake-postgres_payload 2012-10-18 13:57:25 -05:00
Meatballs e1a4ec2fcc Fix to SMB Client when using find_first on a directory with exactly 20 files. 2012-10-17 21:58:20 +01:00
scriptjunkie 0564a6eaa7 Add migrate stub option to Windows x86 payloads.
Migrate stub spawns payload in new process.
2012-10-16 20:53:36 -05:00
Tod Beardsley dd1a352ae1 Merge remote branch 'jlee-r7/dont-require-dot-rb' 2012-10-15 18:41:16 -05:00
James Lee 45a60b6bdd Clarify why we need to sleep.
[Closes #911][FixRM #7344]
2012-10-15 17:54:18 -05:00
Raphael Mudge f4b151f63d Detect and mitigate CPU starvation condition [SeeRM #7344] 2012-10-15 17:54:18 -05:00
James Lee 46ed888ffe Don't require .rb 2012-10-15 17:27:23 -05:00
Tod Beardsley 932b8ba841 Require, not load, msf, not lib/msf 2012-10-15 07:11:15 -05:00
James Lee 9c6fdbe9d7 Compile a .so instead of being version-specific
This makes it possible to use payloads for the appropriate architecture

NOTE: need to test windows and make sure I didn't break it
2012-10-13 15:18:25 -05:00
sinn3r d36f642edc Add print_warning() 2012-10-12 21:48:15 -05:00
James Lee ad1870d819 Merge branch 'rapid7' into midnitesnake-postgres_payload 2012-10-12 14:18:34 -05:00
James Lee 13a5892e95 Add a mixin for uploading/executing bins with PHP
And use it in three modules that had copy-paste versions of the same
idea.
2012-10-12 02:57:41 -05:00
Tod Beardsley 7d848c7147 Merge remote branch 'origin/bug/fastlib-nested-pathnames' 2012-10-10 17:31:36 -05:00
m m 90b948ffb3 add PrependSet[re]gid support for unix payloads 2012-10-10 12:14:00 +02:00
sinn3r 5ce26c4524 Merge branch 'bug/activerecord-dep' of https://github.com/jlee-r7/metasploit-framework into jlee-r7-bug/activerecord-dep 2012-10-09 11:18:02 -05:00
sinn3r 1ba57af00a Merge branch 'master' into bug/windows-pro-modules 2012-10-09 11:15:45 -05:00
Luke Imhoff 2d1fd1c305 Pass file size to read for faster reads on Windows 2012-10-09 11:04:05 -05:00
James Lee 592851e155 Add requires for active_support deps in use
Hash for #assert_valid_keys, Module for #parent.
2012-10-09 02:05:08 -05:00
James Lee b3e27b16d5 Derp, include is a class method 2012-10-09 01:52:19 -05:00
James Lee 227418bd11 Make AR a soft dependency again
Ensures that the absence of activerecord does not prevent msfconsole
from loading. This returns us to the previous state of affairs where it
is possible to use the framework entirely without a database.

To test:
  1. rm -rf lib/gemcache/ruby/1.9.1/gems/activerecord*
  2. remove any locally installed versions of activerecord
  3. msfconsole

msfconsole should load up with a warning like so:

[-] ***
[-] * WARNING: No database support: LoadError cannot load such file -- active_record
[-] ***

... and should still be functional.
2012-10-08 23:07:04 -05:00
HD Moore 8f07a18d74 Fix comment indentation 2012-10-08 17:29:36 -05:00
HD Moore eb0f0fee0c Correct an extra parenthesis 2012-10-08 17:20:25 -05:00
HD Moore 8cdb76d269 Switch to normal String API vs ActiveSupport method 2012-10-08 17:18:40 -05:00
HD Moore 2dce6e6347 FIXRM #7292 by using hex class names 2012-10-08 17:03:41 -05:00
Luke Imhoff 93469604a7 Fix missed rename when adding fastlib under directory
I missed a spot where I referenced the nested_paths as nested_pathnams
after I renamed the variable.  Now, Msf::ModuleManager#add_module_paths
has rspec tests.

Rspec can be invoked with `rake` as the default task or `rake spec`
explicitly.

I changed RuntimeError to ArgumentError since that error  was more
specific to having a bad argument error.  I adding missing dependencies
to the Gemfile and a require to msf/core/db_manager.rb where it errored
out trying to access Msf::Config when I just did require 'msf/core' in
the spec.
2012-10-08 16:14:37 -05:00
HD Moore 6bb1b83de3 Align the comments with the space indents for now 2012-10-08 16:09:12 -05:00
Tod Beardsley 114b7886fa Add back EOF newlines 2012-10-08 12:42:34 -05:00
James Lee 10dafcd09f Fix 1.8 compat with Module#const_defined?
Before 1.9, const_defined? only takes one parameter.
2012-10-08 12:40:18 -05:00
Luke Imhoff ef6dad2bc3 Fix loading binary modules on Windows
[#36737359, #36401509]

Failed to follow HACKING guideline #5, open files in binary mode, so
Pro modules were being truncated on Windows installs.
2012-10-08 09:12:23 -05:00
Tod Beardsley 95fef5d607 Merge remote branch 'dalton/master' 2012-10-08 08:28:23 -05:00
HD Moore 70061223d3 The use of to_path fails on OS X, switch to to_s 2012-10-06 23:40:08 -05:00
Rob Fuller b984d33996 add RunAs ask module 2012-10-06 00:51:44 -04:00
sinn3r 40b2c04c36 Add a redmine link 2012-10-05 00:53:23 -05:00
sinn3r d13878498d Merge branch 'post_file_rename2' of https://github.com/kernelsmith/metasploit-framework into kernelsmith-post_file_rename2 2012-10-05 00:51:53 -05:00
James Lee 9d4427270e Merge branch 'rapid7' into bug/active_support/dependencies-compatibility
[Closes #843]
2012-10-04 17:18:07 -05:00
Luke Imhoff df9db42c32 Fix module reloading
[#36737359]

The merging of reload_module and the various load_module methods
resulted in the module loading from disk, but because the Hash entry in
the module manager was not deleted before on_module_load was called, the
newly reloaded module was logged as an ambiguous module name instead of
a reload.  In order to report the reload errors correctly, I determined
that module_load_error_by_reference_name should really be
module_load_error_by_path.  I eliminated faild in favor of this new name
since failed was just calling the attribute and the attribute's name is
clearer about the format of the data.

Tested by run rexploit and then exiting over and over with
ms08_067_netapi.  When I messed up the file so it couldn't load, by
adding `inclde Exploit` (note mispelling of `include`), it reported the
error to msfconsole.  When I removed the bad line and added a puts
"RELOADING <n>", where I kept incrementing n and saving the file, the
new number appeared during each rexploit.
2012-10-04 16:32:12 -05:00
Luke Imhoff daf9f9abe8 Module load backtraces in log, but not in console
[#36737359]

Write the module_eval backtrace to the log, but only the error's class
and name to Msf::ModuleManager#module_load_error_by_reference_name as
the contents of the Hash are printed in the console, which should never
recieve backtraces.
2012-10-04 13:25:22 -05:00
Luke Imhoff ff46b15871 Fix inverted logic when checking for module load success
[#36737359]

klass should have gone to klass.nil? and and to or when I changed the
test from if to unless.
2012-10-04 11:22:57 -05:00
Luke Imhoff fb266d5eb9 Refactor demand_load_module
[#36737359]

Refactor the behavior of loading symbolic modules from cache by renaming
methods so it's clearer what they do and ensure that cached modules from
Fastlibs and directories can both be loaded, which was not previously
possible since the demand_load_module only called load_module_from_file.
2012-10-04 11:14:08 -05:00
Luke Imhoff b9bf0e6c28 Reuse Msf::Modules::Loader::Base methods
[#36737359]

Use typed_paths method instead of inlining adding MODULE_EXTENSION and
type directory to module_reference_name.
2012-10-03 17:20:23 -05:00
Luke Imhoff 1fd9659c59 Use MODULE_SEPARATOR constant
[#36737359]

Replace literal '::' with pre-existing MODULE_SEPARATOR constant that
was created specifically for this purpose.
2012-10-03 17:20:14 -05:00
Luke Imhoff 9c5350606b Fully-qualify Msf constants.
[#36737359]

On Linux, some of the unqualified constants that resolve on Mac OS X,
don't resolve, so to prevent errors (and because I can't justify why the
unqualified constants should resolve on OS X), I'm qualifying all the
Msf constants that are referenced in the code I've refactored.
2012-10-03 17:17:18 -05:00
Luke Imhoff a21c9b9832 Fix return and calling convention in Msf::ModuleManager::Reloading
[#36737359]

Fix the YARD docs to document the return values and make them consistent
with the modules being called.  Ensure the force flag is passed as an
option to load_modules instead of a positional argument.
2012-10-03 16:48:55 -05:00
Luke Imhoff 7443fed86d Explicitly require 'active_support/concern'
[#36737359]

When starting msfconsole, 'bundler/setup' is not required, the
'msf/env/gemcache' is required instead. Unlike 'bundler/setup' the
msf/env gemcache does not do the automatic requires for gems in the
cache, so explicit requires on 'active_support/concern' is needed to get
ActiveSupport::Concern defined.  (I could have done require
'active_support' to match the behavior of 'bundler/setup', but a smaller
require seemed more appropriate.
2012-10-03 15:42:14 -05:00
kernelsmith 2eef83453d remove unnecessary parens and better comments
removes unnecessary parens (and yes I confirmed they are properly
paired), and adds some comments regarding this as not being an ideal
solution, but rather a stopgap
2012-10-03 15:38:06 -05:00
sinn3r 858fd9ff43 Merge branch 'ropdb' of https://github.com/wchen-r7/metasploit-framework 2012-10-03 15:21:11 -05:00
Luke Imhoff 249a251f26 Remove duplicate reloading message 2012-10-02 18:25:05 -05:00
Luke Imhoff ca0fc0f950 Fully qualify constants in Msf::ModuleSet
Changed lexical scope when I changed the declaration from module Msf;
class ModuleSet to class Msf::ModuleSet so that constants in Msf would
not automatically resolve.
2012-10-02 18:21:24 -05:00
Luke Imhoff 21397a0479 Restructure module_set.rb for easier diff
Taking egypt's advice for making module_set.rb so it will compare
correctly to master branch for diffing.
2012-10-02 16:38:25 -05:00
Luke Imhoff 2d252ab094 Remove unused extend ActiveSupport::Concern
I wasn't using any the features of ActiveSupport::Concern in
Msf::ModuleManager::Reloading, so remove the extend and just include it
as a regular module.
2012-10-02 16:33:11 -05:00
Luke Imhoff 41a0e58b16 Improved docs for ModuleManager and ModuleSet. 2012-10-02 16:26:57 -05:00
sinn3r 2a88aab209 set mode 2012-10-02 15:46:16 -05:00
sinn3r 6d815bce4e Haters gon hate, Windows' gotta be Windows. 2012-10-02 15:27:13 -05:00
sinn3r 8d6e858604 What open()? This open()! 2012-10-02 15:20:38 -05:00
sinn3r e141a84f6b Not having a newline at the end of the file is a crime 2012-10-02 15:19:12 -05:00
sinn3r ba1b65742e Separate XML for various DLLs. 2012-10-02 11:27:10 -05:00
sinn3r a526e3d360 Unbreak yourself! 2012-10-01 21:48:05 -05:00
kernelsmith 3d999f13c4 add rename_file method to Msf::Post::File
Came up on IRC, I'm not attached to it, but this commit adds the
rename_file method to lib/msf/core/post/file.rb and aliases it to
move_file and mv_file
2012-10-01 18:14:44 -05:00
sinn3r d832aac629 msftidy caught the space I left in there. 2012-10-01 17:27:00 -05:00
sinn3r f2c7731b39 Add RopDb mixin 2012-10-01 17:09:01 -05:00
Luke Imhoff 555a9f2559 Refactor Msf::ModuleManager
[Fixes #36737359]

Refactor Msf::ModuleManager into concerns so its easier to understand and
duplicate code can be made DRY.  The refactoring also ensures that when
loading from directories, Fastlibs, or reloading, the wrapper module will
always be named so that activesupport/dependencies will function.
2012-10-01 13:09:30 -05:00
HD Moore 49dd19d91d Fallback to system JTR when bundle isnt available 2012-09-30 19:30:16 -07:00
Luke Imhoff 8a2dc0a09f Give ruby Modules that wrap Metasploit modules a name
[#36737359]

active_support/dependencies cannot resolve missing constants in Metasploit
modules because the wrapper module is anonymous.  In order to make the
wrapper module non-anonymous, the module must be assigned to a constant.
Since we don't want modules colliding, the wrapper module needs a unique
name, so use the module lookup name to derive the proper nested module names
to namespace the wrapper module.  All derived modules are nested under
Msf::Modules.  The name derivation handles invalid characters for constant
names such as digits as the first character or non-alphanumeric character.
The invalid constant name characters are converted to their hex value and
prefixed with X, so '-' in a name become 'X2d'.
2012-09-27 12:52:09 -05:00
kernelsmith 267221bca7 adds the -A and -B options to grep
-A arg, show arg lines after match
-B arg, show arg lines before match
example:
grep -i -A 2 Reverse show advanced
2012-09-24 13:40:12 -05:00
sinn3r 8b8da0b370 Merge branch 'http_client_encode_params' of https://github.com/wchen-r7/metasploit-framework into wchen-r7-http_client_encode_params 2012-09-24 10:23:20 -05:00
joe 848f9ac9bb Re-add rails-3.2.8 gemspec to gemcache. 2012-09-24 10:01:57 -05:00
kernelsmith 77a6469291 implements a simple grep feature for msfconsole
example usage:
grep https show payloads
grep -i iPhone show exploits
grep -i sp3 show targets
grep '^[\s]*generic/c' show payloads

Usage: grep [options] pattern cmd

Grep the results of a console command (similar to Linux grep command)

OPTIONS:
    -c        Only print a count of matching lines.
    -h        Help banner.
    -i        Ignore case.
    -m <opt>  Stop after arg matches.
    -v        Invert match.
2012-09-21 15:55:43 -05:00
David Maloney 4511dead88 Fix up the ps help 2012-09-21 13:45:09 -05:00
David Maloney 5738d808ba Add a bunch of extra filter options 2012-09-21 13:27:16 -05:00
Tod Beardsley b1ce969c95 Merge remote branch 'kernelsmith/msfconsole-s' 2012-09-20 14:31:55 -05:00
Tod Beardsley cf8edf8570 Touchups to msfconsole command parsing
Move from -s to -x and use a semicolon.
2012-09-20 13:40:01 -05:00
kernelsmith 56d5c13755 adds -s <string> Execute the specified string as console commands to msfconsole
for convenience when you don't need/want a full resource file, you just
want to run something quick
example usage:
# say you have a saved config ready to go on load
./msfconsole -s 'exploit -j'
# you can run multiple commands too
./msfconsole -s 'set ConsoleLogging true\nshow options'
2012-09-20 12:23:48 -05:00
David Maloney f75ff8987c updated all my authour refs to use an alias 2012-09-19 21:46:14 -05:00
Ramon de C Valle 11f82de098 Update author information 2012-09-19 14:00:51 -03:00
David Maloney 14c94e4f03 rolled changes into existing ps command
Some users requested this be added to the ps
command via a -S opt instead of creating a new command.
This limits the search to only one search parameter at a time
but with the ability to pass RegEx I think that's fine
2012-09-19 08:28:36 -05:00
David Maloney 4dbe7767ca Merge branch 'master' into findpids 2012-09-19 07:55:54 -05:00
joe 4d63218c08 Bump rails-related gem versions to 3.2.8. 2012-09-17 14:15:14 -05:00
sinn3r 1828857a63 Change conditions
When 'encod_params' is set to true explicitly, or does not have a
value, we make sure it's true. Otherwise, false.
2012-09-15 18:08:29 -05:00
sinn3r 0967d1bfc4 Allow modules to disable URI encoding for GET/POST variables
Often in HTTP modules, people are forced to to use 'data' instead
of 'vars_get' or 'vars_post', because the parameters (especially
the names) are URI-encoded, and the application actually may not
recognize the names/values.  The new 'encode_params' option allows
that feature to be disabled.  However, to make sure we're not
changing existing HTTP modules' behaviors, 'encode_params' is
still true by default (which is the original behavior we've always
been using).
2012-09-15 17:40:42 -05:00
Samuel Huckins 7f03e37cc3 Removing unneeded user-agent gem from cache 2012-09-14 12:33:02 -05:00
Samuel Huckins 578b507dc7 Adding new user-agent gem. 2012-09-13 12:52:33 -05:00
sinn3r c6c59b6df6 Merge branch 'jlee-r7-bug/redmine-7226-rhost-dns' 2012-09-13 11:04:51 -05:00
sinn3r 1f58458073 Merge branch 'udev_netlink' of https://github.com/jlee-r7/metasploit-framework into jlee-r7-udev_netlink 2012-09-13 10:37:52 -05:00
midnitesnake 9629ea5d05 Got rid of methods upload_elf, write_to_disk_elf, as module uses cmd injection payload, rather than binary payload. 2012-09-13 14:42:10 +01:00
David Maloney 71e57a6067 Moved help text into cmd_findpids_help 2012-09-12 08:26:31 -05:00
Adam Dalton 0b0af0a4f5 updating sleep to allow nil arguments 2012-09-11 11:20:03 -04:00
HD Moore 221eb88313 Make filename easy to override 2012-09-10 15:59:01 -05:00
James Lee bbeb6cc97a Add a privilege escalation exploit for udev < 1.4.1
Also includes a new ```rm_f``` method for Post::File for deleting remote
files in a platform-independent way.
2012-09-10 12:32:14 -05:00