Commit Graph

11878 Commits (b122dffe3d3352c4012585e97a0c1a649c3ef801)

Author SHA1 Message Date
Brent Cook 242ea8d9cd Merge branch 'master' into land-6691- 2016-03-24 22:19:57 -05:00
OJ ce8a6f57a0 Added powershell_import support 2016-03-25 12:17:03 +10:00
Brendan Watters 18604c3d44
Land #6705, Rectify MSF_CFGROOT_CONFIG comment 2016-03-24 18:21:05 -05:00
wchen-r7 57984706b8 Resolve merge conflict with Gemfile 2016-03-24 18:13:31 -05:00
James Lee dfa518b492
Whitespace 2016-03-24 15:21:03 -05:00
James Lee 0073a8f40e
Wrap comments at 78, style 2016-03-24 15:20:43 -05:00
Gregory Mikeska 7bd6d0c696
Merge branch 'master' into staging/rails-upgrade 2016-03-24 12:55:05 -05:00
Till Maas 7f002128ad Rectify MSF_CFGROOT_CONFIG comment
Also remove reference to feature request that does not seem to be
available anymore.
2016-03-23 22:23:30 +01:00
James Lee 6388578ee6
Style fixes 2016-03-23 16:15:46 -05:00
James Lee 98355c397c
Clean up some variable names 2016-03-23 15:07:00 -05:00
James Lee 685d8fc588
Use 2.x symbol literal syntax 2016-03-23 15:06:35 -05:00
James Lee effee42e2f
Raise a better exception for WSAEADDRINUSE 2016-03-23 13:15:38 -05:00
Louis Sato 0c19d89655
add more space for deprecation message 2016-03-23 11:39:42 -05:00
Metasploit e7b0c60e5c
Bump version of framework to 4.11.18 2016-03-23 07:55:29 -07:00
Adam Cammack 866c4718b0
Fix OptPort validation
Allow a port value of 0 and don't reject empty values if the option is
not required.
2016-03-22 23:01:18 -05:00
Adam Cammack ec3a0a108d
Change OptPort to inherit from OptInt
Fixes the normalize and validate methods.
2016-03-22 19:25:51 -05:00
Adam Cammack 22df7c0071
Fix datastore to validate options w/o a default
Options without a default were not pulled into the `@options` hash and
therefore were not used to validate options on assignment.

I am not entirely sure how this fix works, since it would seem that
non-override options would not get pulled in if an option was first set
in the global datastore. However, a previous value does not get
overridden and new values are validated. Anything further is merely
speculation on my part.
2016-03-22 19:12:53 -05:00
Adam Cammack 5c163960ed
Fix datastore to not freeze options on the default 2016-03-22 19:07:58 -05:00
William Vu 0c7cf2924c
Land #6686, Android dump_* -o fixes 2016-03-21 12:21:47 -05:00
RageLtMan c871ceea0a Implement consistent socket abstraction
In current nomenclature, Rex Sockets are objects created by calls
to Rex::Socket::<Transport>.create and Rex::Socket.create_...
When the LocalHost or Comm parameters are set to remotely routed
addresses (currently via Meterpreter sessions), Rex will create a
Channel which will abstract communications with the remote end of
the session. These channel based abstractions are called pivots,
and present in three separate flavors:
1 - TcpClientChannel, a fully abstracted, selectable Socket.
2 - TcpServerChannel, a virtual Channel which distributes client
channels.
3 - UdpChannel, a virtual Channel which provides common methods for
UDP socket operations, but is not a full (selectable) abstraction.

Unfortunately this differentiation results in inconsistent returns
from the aforementioned socket creation calls, as the call chain
creates parameters and supplies them to the create method on the
comm object referenced in the params. The comm object may be a
channel, and produce a virtual representation of a socket with
functional methods analogous to Sockets, but without a kernel FD.

This commit begins the work of ensuring that all calls for socket
creation return selectable Rex::Socket objects with semantics
familiar to Ruby developers who have not read into the details of
Rex::Socket and Rex::Post.

-----

Summary of changes:

Convert Rex::IO::StreamAbstraction to SocketAbstraction and use
the new mixin in StreamAbstraction and DatagramAbstraction. This
approach allows for common methods to reuse the abstraction data
flow, while initializing separate types of socket obects and an
optional monitor as needed.

In the Rex::Post::Meterpreter namespace, extract common methods
from Stream to a SocketAbstraction mixin, include that mixin in
Stream, and add Datagram with the dio_write handler override
exported from the current implementation of UdpChannel, also using
the mixin. This relies on the Rex::IO work above to implement the
proper type of socket abstraction to the Channel descendants.

In Rex::Post::Meterpreter::Extensions::Stdapi::Net, convert the
UdpChannel to inherit from the Rex::Post::Meterpreter::Datagram
class, implementing only the send method at this tier. Convert
create_udp_channel to return the local socket side of the datagram
abstraction presented analogous to the TcpClientChannel approach
used before.

-----

Notes and intricacies:

In order to implement recvfrom on the UDP abstraction, a shim layer
has been put in place to forward the sockaddr information from the
remote peer to the local UDP socketpair in the abstraction. This
information takes up buffer space in the UDP socket, and in order
to maintain compatibility with consumers, the dio_write_handler
pushes the data buffer, and in a separate send call, he sockaddr
information from the remote socket. On the abstraction side, the
recvfrom_nonblock call of the real UDPSocket has been overriden
via the mixed in module to call the real method twice, once for
the data buffer, and once for the packed sockaddr data. The Rex
level consumer for recvfrom calls the underlying nonblock method
and expects this exact set of returns (as opposed to what standard
library UDPSocket.recvfrom returns, which is a data buffer and an
Array of sockaddr data).

-----

Testing:
  Local and lab testing only so far.
  Test RC script to be added in GH comments.

-----

Issues:
  Currently, sendto on a remote socket does not appear to honor
LocalPort which causes DNS responses (#6611) to come from the
wrong port to remote clients being serviced over a pivot socket.
2016-03-21 03:32:52 -04:00
OJ 80e0bbeb68 Add the interactive shell prompt with sessions 2016-03-21 15:44:20 +10:00
Metasploit 6e12e74e02
Bump version of framework to 4.11.17 2016-03-18 14:12:18 -07:00
Adam Cammack 67b9d053ec
Land #6679, remove unreachable sanity checks 2016-03-18 11:25:51 -05:00
Brent Cook 9219efa512 remove unreachable ruby 1.x check 2016-03-18 11:16:44 -05:00
James Lee 1375600780
Land #6644, datastore validation on assignment 2016-03-17 11:16:12 -05:00
Brent Cook df2d0f7826 Indicate that output options take parameters 2016-03-17 11:13:34 -05:00
Brent Cook 1790f039c3
Land #6684, remove obsolete warn_about_rubies 2016-03-17 08:26:57 -05:00
William Vu 59a55dec5b
Land #6676, new Postgres fingerprints 2016-03-16 16:32:10 -05:00
Adam Cammack 32fe9ae55d
Remove dead version check in db_manager.rb
The check appears to have been orphaned in the db_manager refactor, but
I can't track down the exact commit.
2016-03-16 15:24:55 -05:00
James Lee 79c36c4f53
RPORT should be an OptPort 2016-03-16 14:13:19 -05:00
James Lee c21bad78e8
Fix some more String defaults 2016-03-16 14:13:18 -05:00
James Lee a878926f31
Remove unused datastore option 2016-03-16 14:13:17 -05:00
William Vu adb275520b
Land #6680, old SVN code deletion 2016-03-16 10:15:06 -05:00
Brent Cook 44e1fefa2e when normalizing a string type, ensure we have a string first 2016-03-16 06:44:36 -05:00
Brent Cook 5a72f2df16 remove subversion support 2016-03-15 22:00:32 -05:00
Brent Cook 63263773d1 simplify sanity checks for Ruby 1.x 2016-03-15 21:55:25 -05:00
Brent Cook 3b6a3374ae prefer explicit defaults to implicit 2016-03-15 20:58:14 -05:00
Brent Cook 87074c0638
Land #6651, add android sqlite_query option, update metasploit-payloads 2016-03-15 18:27:49 -05:00
Brent Cook 257c8f4058 handle a sqlite table being empty 2016-03-15 18:26:38 -05:00
Adam Cammack 05f585157d
Land #6646, add SSL SNI and unify SSLVersion opts 2016-03-15 16:35:22 -05:00
David Maloney 3cbc5684e1
iadd some preuath fps for postgres 9.4
the preauth fingerprinting for postgres is somewhat
unmaintainable, but due to a specific customer request
i have added these two FPs for 9.4.1-5

MS-1102
2016-03-15 14:50:07 -05:00
Brent Cook 654590911b Enforce integrity of datastore options on assignment 2016-03-15 14:00:32 -05:00
OJ d8c850aaf0 Add support for the execution of single powershell commands 2016-03-14 17:13:12 +10:00
OJ f8f61e8d83 Basic shell of the MSF Powershell extension functionality 2016-03-14 12:55:58 +10:00
HD Moore 42689df6b3 Fix a stack trace with ``set PAYLOAD`` in ``msf>`` context 2016-03-13 14:56:54 -05:00
Christian Mehlmauer 4f09246c78
reenable module loader warnings 2016-03-13 20:04:05 +01:00
Brent Cook dabe5c8465
Land #6655, use MetasploitModule as module class name 2016-03-13 13:48:31 -05:00
Metasploit e059f42094
Bump version of framework to 4.11.16 2016-03-11 14:17:28 -08:00
Adam Cammack 6f85c82dc0
Fix Nexpose import to truncate long vuln names
A warning is emitted since there is a potential for data loss, but since
we reference vulns by their ID, the data-integrity risk is small.
Initially triggered by some Nexpose data, this should probably be
properly fixed by removing the length bound on the field.

MS-1184
2016-03-11 11:02:55 -06:00
wchen-r7 5554138fac Change the firing order
Ubuntu has this glib bug (g_slice_set_config) that results us
seeing a bunch of warnings when we call system("firefox") in
Ruby. It doesn't look like our fault, but since this generates
a lot of text on msfconsole, we try to avoid that.
2016-03-09 23:08:19 -06:00
Tim dfd51a7032 Merge branch 'master' into android_sqlite_read 2016-03-10 01:46:30 +00:00
wchen-r7 38bc8c88ae Fix open_webrtc_browser
Fix a bug where the code might spawn multiple browsers.
2016-03-09 17:10:22 -06:00
David Maloney ca18996272
setup rails staging branch
rails 4.1 baby!
2016-03-09 15:35:00 -06:00
David Maloney 15ba85bac2
fix missed deprecations
missed some deprecation warnings
2016-03-09 13:29:35 -06:00
David Maloney 88697a5d3f
Merge branch 'master' into staging/rails-upgrade 2016-03-08 15:22:04 -06:00
wchen-r7 f831d58c1c Support tables 2016-03-08 12:19:27 -06:00
wchen-r7 698f425821 Auto <hr> 2016-03-08 11:25:15 -06:00
wchen-r7 b91ee232ff Change HTML parsing 2016-03-08 10:25:29 -06:00
wchen-r7 58b8c35146 Escape HTML for KB and update rspec 2016-03-08 10:10:10 -06:00
Christian Mehlmauer 3123175ac7
use MetasploitModule as a class name 2016-03-08 14:02:44 +01:00
Tim 5e83b2de51
remove extra new line 2016-03-07 23:17:45 +00:00
Tim f6c06bedfe
fix e.g output 2016-03-07 23:15:05 +00:00
wchen-r7 c2f99b559c Add documentation for auxiliary/scanner/http/tomcat_enum
Also fix a typo in normalizer
2016-03-07 15:39:15 -06:00
William Vu 3e0f8d67c9 Use #strip to more correctly simulate #blank?
See f900d9cf26.
2016-03-07 13:14:37 -06:00
Brent Cook 289f43bb80
Land #4848, remove some reliance on rails libraries from rex 2016-03-07 07:38:30 -06:00
Brent Cook eea8fa86dc unify the SSLVersion fields between modules and mixins
Also actually handle the 'Auto' option that we had in the crawler and remove
hardcoded defaults in modules that do not need them.
2016-03-06 22:06:27 -06:00
Brent Cook 05a91f1d82 set SNI if the SSL peer is specified as a hostname 2016-03-06 21:12:15 -06:00
Brent Cook 5a0bec81cb
disable warnings for now, to be reenabled when the module base class is updated 2016-03-06 17:19:05 -06:00
Brent Cook a2c3b05416
Land #6405, prefer default module base class of simply 'Metasploit' 2016-03-06 17:10:55 -06:00
Brent Cook 0fc4ebf4ab
Land #6618, Improve Content-Length behavior in Rex HTTP 2016-03-06 16:38:44 -06:00
Brent Cook a1190f4344
Land #6598, add post module for setting wallpaper 2016-03-06 15:00:10 -06:00
Spencer McIntyre a8ac078586
Land #6636, fix met finalizers to not double close 2016-03-06 12:55:39 -05:00
Brent Cook 85acfabfca remove various library workarounds for the datastore not preserving types 2016-03-05 23:10:57 -06:00
Brent Cook 694f7f0a65 stop turning all default options into strings
we need to adjust vprint* functions, since they now fallthrough to the
'framework.datastore' checks because the false case actually triggers.
2016-03-05 23:09:14 -06:00
wchen-r7 c811ed8d60 Correct name: PAYLOAD_DEMO_TEMPLATE 2016-03-05 00:42:36 -06:00
Metasploit a5cdd7e17f
Bump version of framework to 4.11.15 2016-03-04 16:56:02 -08:00
Metasploit ce675330c0
Bump version of framework to 4.11.14 2016-03-04 14:49:55 -08:00
Gregory Mikeska 7f2400dd1b Merge branch 'jbarnett-r7-feature/MS-833/ms08-067-automation' into upstream-master 2016-03-04 12:34:00 -06:00
Brent Cook dcba20ff60 only cleanup processes once too 2016-03-04 12:08:19 -06:00
Tim 2cfc9073a0 fixup sqlite_query 2016-03-04 11:56:37 +00:00
Tim b7fe500788 sqlite_read -> sqlite_query 2016-03-04 11:56:23 +00:00
wchen-r7 934f8de9b7 Update the conditions of is_remote_exploit? 2016-03-03 00:53:00 -06:00
Brent Cook c250740a81 Fixup finalizers to not double-close Meterpreter objects
We add finalizers to an assortment of Meterpreter-managed objects in order to
clean things up in the event that a post module crashes and does not clean
things up. However, this also means that even a properly-written post module
can lead to an object getting double-closed on the Meterpreter session when the
garbage collector kicks in. This can lead to quite non-deterministic behavior
and crashes.

This change modifies the instance close methods to unregister the finalizer on
close, ensuring we cannot do a double-close automatically if one is requested
explicitly first. As an additional measure, we check an instance variable to
see if we called close directly twice as well. This is not sufficient in
itself, since we do not have a reference to 'self' in the finalizer proc to
check the close state.

This also removes a couple of references to 'self' in the finalizer proc
itself, which may cure some memory leaks as well due to circular references.
2016-03-02 21:43:51 -06:00
wchen-r7 11964c5c1a Add remote exploit demo and web_delivery doc 2016-03-02 19:52:11 -06:00
wchen-r7 5f510df2ab Resolve merge conflict with upstream's Gemfile.lock 2016-03-01 22:06:17 -06:00
wchen-r7 f27d24fd60 Add module documentation for psexec 2016-03-01 18:52:47 -06:00
Brian Patterson 30043bc519
Changed .all to .load in workspace.rb in order to eager load the relation and fix the 4.0 rails deprecation 2016-03-01 11:48:55 -06:00
William Vu c5a9d59455
Land #6612, one final missing change 2016-02-29 15:08:42 -06:00
William Vu cb0493e5bb Recreate Msf::Exploit::Remote::Fortinet
To match the path, even though it's kinda lame including it just for the
monkeypatch.
2016-02-29 15:04:02 -06:00
William Vu 300fdc87bb Move Fortinet backdoor to module and library 2016-02-29 12:06:33 -06:00
wchen-r7 2950996cb8
Land #6612, Add aux module for Fortinet backdoor 2016-02-29 12:02:49 -06:00
William Vu 53d703355f Move Fortinet backdoor to module and library 2016-02-29 11:57:42 -06:00
wchen-r7 bff4b4d5fc Fix #6609 and #6587 - Change Content-Length behavior in Rex HTTP
This patches changes two things:

1. If a module has a custom Content-Length, it will respect that
   instead of forcing its own.

2. If a request does not have anything in the body, the
   Content-Length header will not be set.

Fix #6609
Fix #6587
2016-02-29 10:50:21 -06:00
Tim afc6f6ff74 fix options 2016-02-29 15:21:33 +00:00
Tim bd6fdbb545 android sqlite_read command 2016-02-29 15:05:57 +00:00
Fernando Arias c4c5944b25
Merge branch 'staging/rails-upgrade' into staging/MS-888/engines-is-deprecated
Conflicts:
	Gemfile.lock
	metasploit-framework.gemspec
2016-02-26 15:35:34 -06:00
Brent Cook 7acba69e37
Land #6577, add controls for Android ringer 2016-02-26 07:02:49 -06:00
Brent Cook 5899b8afc8 make help show up when things are not specified correctly 2016-02-26 06:09:05 -06:00
HD Moore 9010dac7bc Wrap up the current WIP, still not functional 2016-02-26 05:36:40 +00:00
HD Moore 5bf308e720 WIP checkin 2016-02-26 05:36:40 +00:00