Commit Graph

3823 Commits (3db72e9b4b23ebbc35401e30edf3b611c3ba51de)

Author SHA1 Message Date
David Maloney 55b38ad089
Land #6398, content length header
lands wei's content length header pr
2016-05-04 11:53:46 -05:00
OJ 60f81a69ea Remove the pfservice close call on shutdown 2016-05-03 12:03:37 +10:00
OJ d136844d3b Add error handling around double-bind of ports 2016-05-03 10:42:41 +10:00
wchen-r7 d4b89edf9c Fix #6398, Missing Content-Length header in HTTP POST
RFC-7230 states that a Content-Length header is normally sent in
a POST request even when the value (length) is 0, indicating an
empty payload body. Rex HTTP client failed to follow this spec,
and caused some modules to fail (such as winrm_login).

Fix #6398
2016-04-28 11:44:10 -05:00
OJ c15a2e8787
Merge branch 'upstream/master' into reverse-port-forward
Signed-off-by: OJ <oj@buffered.io>
2016-04-26 09:48:40 +10:00
Brent Cook 12a47b7fab prefer && 2016-04-24 11:56:32 -04:00
Brent Cook 194a84c793 Modify stdapi so it also uses exist? over exists? for ruby parity
Also add an alias for backward compatibility.
2016-04-23 17:31:22 -04:00
William Vu 7f8491149f Fix minor whitespace issues 2016-04-22 17:18:10 -05:00
OJ 540409e735 Add `resolve` to the meterpreter command line
I'm aware that this already exists as a post module, but there's nothing more annoying than having to bail out of Meterpreter, use the right module, set up the host list, etc all to just fire off a one-liner.

So this commit adds the command directly to Meterpreter's command line so that you don't have to do all that. This doesn't support specifying a file with the hosts in it (the post module does that). This is intended for quick resolution of particular hosts quickly.
2016-04-22 13:21:19 +10:00
wchen-r7 98f89ca23a
Land #6794, Fixed yard doc errors 2016-04-21 13:16:45 -05:00
thao doan 5e36a3128c Fix #5197, Fixed yard doc errors
Fix #5197 Fixed issues that caused errors during yard doc generation
2016-04-21 13:06:00 -05:00
Brent Cook 57ab974737 File.exists? must die 2016-04-21 00:47:07 -04:00
OJ b95267997d Fix LURI support for stageless, transport add/change and code tidies 2016-04-18 08:24:41 -05:00
Brian Patterson 11d6740e7f
Modify syntax in burp_issue_nokogiri.rb to conform to code style guidelines 2016-04-12 17:33:20 -05:00
OJ 5c2e5398ad Fix issue with flushing rev port forwards 2016-04-11 10:41:12 +10:00
OJ 866cb5a23b Fix usage of lport/rport while tracking rev forwards 2016-04-06 16:36:41 +10:00
OJ 6d504316ae Add MSF-side support for reverse port forwards
This includes changes to the portfwd command so that the output is
nicer, things are easier to use, and users have the ability to create
reverse port forwards.
2016-04-06 15:38:39 +10:00
Brian Patterson e5ee5b903b Merge branch 'master' of github.com:rapid7/metasploit-framework into bug/MS-247/OpenVas-default-workspace 2016-04-05 09:36:27 -05:00
Brian Patterson 2a7e3fb600
Fix an error in the OpenVas and Burp Issue importers where the vuln and host info would import into the default workspace instead of the current workspace 2016-04-04 17:35:31 -05:00
greg.mikeska@rapid7.com 5e8ed09b66 Merge branch 'task/MS-1354/OpenVAS-Nessus-Importer' of https://github.com/bpatterson-r7/metasploit-framework into bpatterson-r7-task/MS-1354/OpenVAS-Nessus-Importer 2016-04-04 17:07:05 -05:00
wchen-r7 72d631a255
Land #6745, open_webrtc_browser fix for Windows 2016-04-02 13:54:05 -05:00
Brent Cook c6bdc3fa14 fix the path quoting in open_webrtc_browser 2016-04-02 13:18:23 -05:00
Brent Cook 3d995546d9 check for true before empty string 2016-04-01 21:30:11 -05:00
OJ 2a9f813bcd Don't interpreter blank string as error 2016-04-01 09:53:25 +10:00
OJ 9f299f4f0c
Merge branch 'upstream/master' into powershell-meterpreter-bindings 2016-04-01 09:32:32 +10:00
Brian Patterson 8f0d664a38
Modify the open_vas importer to support both results.xml and reports.xml open_vas exports and modify the nessus importer to import what it can when it can't find a properly formatted port number 2016-03-30 17:44:26 -05:00
thao doan 587f1ee7b3 Land #6708, module documentation for msfconsole 2016-03-29 11:30:55 -07:00
James Lee 9d86a49c51
Land #6692, udp socket abstraction 2016-03-25 13:05:10 -05:00
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
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
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
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
Brent Cook df2d0f7826 Indicate that output options take parameters 2016-03-17 11:13:34 -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
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
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
Tim 5e83b2de51
remove extra new line 2016-03-07 23:17:45 +00:00