Commit Graph

121 Commits

Author SHA1 Message Date
Kent 'picat' Gruber bcf78e6067 use tr instead of gsub 2018-09-17 09:45:52 -04:00
William Vu 8e6a1d203b Futureproof FingerprintCheck until we delete it 2018-07-25 21:39:02 -05:00
William Vu 25ef422168 Handle connection errors and fail_with in check
Also fix FingerprintCheck to tell us when it doesn't receive a response.
2018-07-25 21:11:40 -05:00
Green-m f5b8b4dd7c Update send_request_cgi/raw 2018-07-12 23:51:41 -04:00
Green-m 65627e06e2 Update send_request_cgi/raw 2018-07-12 23:51:18 -04:00
Christian Mehlmauer f17140bdc3 fix nil error in HttpTrace 2018-05-26 10:04:26 +02:00
William Vu 2565ad6a27 Handle IPv6 addresses in full_uri (add brackets) 2017-12-07 12:56:55 -06:00
RageLtMan a3912e4913 Provide disconnect option to send_request_cgi
The HTTP client mixin provides a #send_request_cgi method which
forcibly disconnects the client after receiving a response. This
terminates certain types of resulting sessions which depend on the
connection from the client to maintain a subprocess housing the
shell invocation.

Provide a disconnect boolean option to #send_request_cgi which
is checked in the disconnect(c) call after receiving the response.

Testing:
  Locally tested on in-house exploit module written for disclosure
report.

TODO:
  Discuss possibility of implementing fully asynchronous methods
like #send_request_cgi_async which won't bother getting a response
for cases such as the module mentioned above which is a command
injection via unfiltered POST var.
2017-10-19 21:22:31 -04:00
Brent Cook 5d05ca154a added http client 'download' method and updates to pdf author module from @bcoles 2017-08-14 01:08:53 -04:00
RageLtMan 7e487ec745 fix request_ops per bcoles 2017-07-13 01:16:27 -04:00
RageLtMan 5473b2132d Implement :request_url for Msf HttpClient mixin
To round out implementation of a simple path for users to access
HttpClient like Open or Net::HTTP, create :request_url method which
takes a single URL parameter, uses :request_opts_from_url to build
the request configuration for Rex::Proto::Http::Client, executes
a GET request with it, and disconnects the client unless keepalive
is specified as the second parameter to :request_url.

Example usage of functionality is implemented in http_pdf_authors.
2017-07-11 16:07:13 -04:00
RageLtMan df697aa23c Implement HttpClient options generation from URL
To address the complexity which comes with the flexibility offered
by Rex::Proto::Http::Client and its Msf mixin descendant, a simple
process needs to be implemented for issuing a request using only
the URL string in order to provide ease of access to users who may
not have the time to study how these clients work in detail.

Implement :request_opts_from_url in Msf's HttpClient mixin such as
to extract the options required for :send_request_* from a URL
string passed into the method. This approach reduces HTTP requests
in the mixin to `send_request_raw(request_opts_from_url(url))` when
`url` is just a string.

Implement this approach in the http_pdf_authors gather module to
further reduce infrastructure complexity around the simple need to
acquire PDF files via HTTP/S.

Testing:
  Local to this module only, and in Pry of course. Seems to work...
2017-07-10 04:19:26 -04:00
Jeffrey Martin 63b6ab5355 simplify valid credential storage 2017-05-04 22:51:40 -05:00
Christian Mehlmauer 3c260ea452 fix #7921, HttpTrace and chunked encoding 2017-04-05 22:58:11 +02:00
William Vu b06895b604 Hide RPORT more intelligently 2017-02-08 09:40:42 -06:00
William Vu 31f93de150 Update HttpClient and WordPress mixins 2017-02-06 04:40:26 -06:00
wchen-r7 180795f209 Fix #7743, nil @cnonce in rex/proto/http/client.rb
Fix #7743
2017-01-04 11:50:31 -06:00
Jin Qian 9f4784354a Disconnect after making the HTTP transaction in send_request_cgi
Add a disconnect call after cgi is done.
2016-11-23 11:20:10 -06:00
Brendan a30711ddcd Land #7279, Use the rubyntlm gem (again) 2016-09-07 16:33:35 -05:00
Pearce Barry 226ded8d7e Land #6921, Support basic and form auth at the same time 2016-08-25 16:31:26 -05:00
William Vu 61f1e7e9c2 Add server_port to HTTP fingerprint
MS-1982
2016-08-24 13:24:24 -05:00
James Lee 91417e62a8 Cleanup docs 2016-08-18 10:40:32 -05:00
wchen-r7 498657ab35 Fix #3860, tearing down TCP connection for send_request_cgi
Fix #3860
2016-08-15 15:45:52 -05:00
wchen-r7 4055fd1930 Do e.message instead of e.to_s 2016-08-05 14:12:50 -05:00
wchen-r7 d59b6d99ee Make the debug output more readable 2016-08-05 13:20:53 -05:00
wchen-r7 a8d9a5c02c Print exceptions if needed 2016-08-04 18:14:22 -05:00
wchen-r7 7538b3dcf8 Fix #7170, Add HttpTrace option for HttpClient
Fix #7170
2016-08-04 16:09:17 -05:00
James Lee cfb56211e7 Revert "Revert "Land #7009, egypt's rubyntlm cleanup""
This reverts commit 1164c025a2.
2016-07-07 15:00:41 -05:00
James Lee 1164c025a2 Revert "Land #7009, egypt's rubyntlm cleanup"
This reverts commit d90f0779f8, reversing
changes made to e3e360cc83.
2016-07-05 15:22:44 -05:00
James Lee 4b3f6c5d29 Use rubyntlm for mssql login scanner 2016-06-22 10:15:22 -05:00
wchen-r7 61f9cc360b Correct casing - should be HttpUsername and HttpPassword 2016-05-27 18:31:54 -05:00
wchen-r7 4dcddb2399 Fix #4885, Support basic and form auth at the same time
When a module uses the HttpClient mixin but registers the USERNAME
and PASSWORD datastore options in order to perform a form auth,
it ruins the ability to also perform a basic auth (sometimes it's
possible to see both). To avoid option naming conflicts, basic auth
options are now HTTPUSERNAME and HTTPPASSWORD.

Fix #4885
2016-05-27 16:25:42 -05:00
wchen-r7 47d52a250e Fix #6806 and #6820 - Fix send_request_cgi! redirection
This patch fixes two problems:

1. 6820 - If the HTTP server returns a relative path
   (example: /test), there is no host to extract, therefore the HOST
   header in the HTTP request ends up being empty. When the web
   server sees this, it might return an HTTP 400 Bad Request, and
   the redirection fails.

2. 6806 - If the HTTP server returns a relative path that begins
   with a dot, send_request_cgi! will literally send that in the
   GET request. Since that isn't a valid GET request path format,
   the redirection fails.

Fix #6806
Fix #6820
2016-04-25 14:30:46 -05:00
James Lee 1375600780 Land #6644, datastore validation on assignment 2016-03-17 11:16:12 -05:00
James Lee c21bad78e8 Fix some more String defaults 2016-03-16 14:13:18 -05: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
Christian Mehlmauer 0871fe25e8 change text 2016-01-22 07:38:44 +01:00
Christian Mehlmauer e0de78280d move SSL to the default options 2016-01-22 07:05:23 +01:00
Jon Hart 0bb9324c8d Pass HTTP::version_random_valid and HTTP::version_random_invalid
Fixes #5871
2015-08-20 10:05:42 -07:00
jvazquez-r7 035c0a8a38 Fix #5078 by improving actual_timeout calculation 2015-07-20 11:27:48 -05:00
jvazquez-r7 1a9664fcba Delete default option 2015-07-20 09:54:51 -05:00
g0tmi1k 72794e4c1a Removed double spaces 2015-03-20 01:16:49 +00:00
jvazquez-r7 e0d9ee062f Use HttpClientTimeout 2015-05-22 13:35:37 -05:00
wchen-r7 c29bb35e28 Change datastore name 2015-05-21 10:15:03 -05:00
wchen-r7 93900087c7 Resolve #5219, user-configurable HTTP timeout
Resolve #5219
2015-05-20 13:30:45 -05:00
HD Moore 888c718f40 Fix two typos 2015-02-22 02:45:50 -06:00
HD Moore 8e8a366889 Pass Http::Client parameters into LoginScanner::Http (see #4803) 2015-02-22 02:26:15 -06:00
sinn3r 79d393c5aa Resolve merge conflicts
Conflicts:
	lib/msf/core/exploit/smb.rb
	lib/msf/core/exploit/tcp.rb
	modules/auxiliary/scanner/http/axis_login.rb
2014-10-21 13:06:35 -05:00
James Lee 1064488ada Whitespace 2014-10-15 14:21:39 -05:00
HD Moore a762d871bf Autonegotiate SSL/TLS versions when not explicit 2014-10-15 13:26:40 -05:00