Skip to content

Commit d53be87

Browse files
Updating master to metasploit/master
2 parents bef7562 + 69de8b9 commit d53be87

File tree

123 files changed

+4051
-2268
lines changed

Some content is hidden

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

123 files changed

+4051
-2268
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.6
1+
2.1.7

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ script:
2525
- git diff --exit-code db/schema.rb && bundle exec rake $RAKE_TASKS
2626
sudo: false
2727
rvm:
28-
- '2.1.6'
28+
- '2.1.7'
2929

3030
notifications:
3131
irc: "irc.freenode.org#msfnotify"

COPYING

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Redistribution and use in source and binary forms, with or without modification,
55
are permitted provided that the following conditions are met:
66

77
* Redistributions of source code must retain the above copyright notice,
8-
this list of conditions and the following disclaimer.
8+
this list of conditions and the following disclaimer.
99

1010
* Redistributions in binary form must reproduce the above copyright notice,
11-
this list of conditions and the following disclaimer in the documentation
12-
and/or other materials provided with the distribution.
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
1313

1414
* Neither the name of Rapid7, Inc. nor the names of its contributors
15-
may be used to endorse or promote products derived from this software
16-
without specific prior written permission.
15+
may be used to endorse or promote products derived from this software
16+
without specific prior written permission.
1717

1818
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1919
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PATH
2525
activerecord (>= 4.0.9, < 4.1.0)
2626
metasploit-credential (= 1.0.1)
2727
metasploit-framework (= 4.11.4)
28-
metasploit_data_models (= 1.2.7)
28+
metasploit_data_models (= 1.2.9)
2929
pg (>= 0.11)
3030
metasploit-framework-pcap (4.11.4)
3131
metasploit-framework (= 4.11.4)
@@ -126,7 +126,7 @@ GEM
126126
activesupport (>= 4.0.9, < 4.1.0)
127127
railties (>= 4.0.9, < 4.1.0)
128128
metasploit-payloads (1.0.15)
129-
metasploit_data_models (1.2.7)
129+
metasploit_data_models (1.2.9)
130130
activerecord (>= 4.0.9, < 4.1.0)
131131
activesupport (>= 4.0.9, < 4.1.0)
132132
arel-helpers

lib/metasploit/framework/version.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ def self.get_hash
1818
hash = '-' + version_info['build_framework_rev']
1919
else
2020
# determine if git is installed
21-
void = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL' : '/dev/null'
22-
git_installed = system("git --version >>#{void} 2>&1")
21+
null = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL' : '/dev/null'
22+
git_installed = system("git --version > #{null} 2>&1")
2323

2424
# get the hash of the HEAD commit
2525
if git_installed && File.exist?(File.join(root, '.git'))
26-
hash = '-' + `git rev-parse HEAD`[0, 8]
26+
hash = '-' + `git rev-parse --short HEAD`
2727
end
2828
end
2929
hash.strip

lib/msf/base/serializer/readable_text.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,10 @@ def self.dump_sessions_verbose(framework, opts={})
638638
# @param col [Integer] the column wrap width.
639639
# @return [String] the formatted list of running jobs.
640640
def self.dump_jobs(framework, verbose = false, indent = DefaultIndent, col = DefaultColumnWrap)
641-
columns = [ 'Id', 'Name' ]
641+
columns = [ 'Id', 'Name', "Payload", "LPORT" ]
642642

643643
if (verbose)
644-
columns << "Payload"
645-
columns << "LPORT"
646-
columns << "URIPATH"
647-
columns << "Start Time"
644+
columns += [ "URIPATH", "Start Time" ]
648645
end
649646

650647
tbl = Rex::Ui::Text::Table.new(
@@ -653,16 +650,19 @@ def self.dump_jobs(framework, verbose = false, indent = DefaultIndent, col = Def
653650
'Columns' => columns
654651
)
655652

656-
657653
# jobs are stored as a hash with the keys being a numeric job_id.
658654
framework.jobs.keys.sort{|a,b| a.to_i <=> b.to_i }.each { |k|
655+
# Job context is stored as an Array with the 0th element being
656+
# the running module. If that module is an exploit, ctx will also
657+
# contain its payload.
658+
ctx = framework.jobs[k].ctx
659659
row = [ k, framework.jobs[k].name ]
660+
row << (ctx[1].nil? ? (ctx[0].datastore['PAYLOAD'] || "") : ctx[1].refname)
661+
row << (ctx[0].datastore['LPORT'] || "")
662+
660663
if (verbose)
661-
ctx = framework.jobs[k].ctx
662664
uripath = ctx[0].get_resource if ctx[0].respond_to?(:get_resource)
663665
uripath = ctx[0].datastore['URIPATH'] if uripath.nil?
664-
row << (ctx[1].nil? ? (ctx[0].datastore['PAYLOAD'] || "") : ctx[1].refname)
665-
row << (ctx[0].datastore['LPORT'] || "")
666666
row << (uripath || "")
667667
row << (framework.jobs[k].start_time || "")
668668
end

lib/msf/core.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ module Msf
7272
require 'msf/http/typo3'
7373
require 'msf/http/jboss'
7474

75-
# Kerberos Support
76-
require 'msf/kerberos/client'
77-
78-
# Java RMI Support
79-
require 'msf/java/rmi/util'
80-
require 'msf/java/rmi/client'
81-
8275
# Drivers
8376
require 'msf/core/exploit_driver'
8477

lib/msf/core/db_manager/vuln.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,4 @@ def vulns(wspace=workspace)
230230
wspace.vulns
231231
}
232232
end
233-
end
233+
end

lib/msf/core/encoded_payload.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,18 @@ def generate_sled
342342
self.nop_sled = nop.generate_sled(self.nop_sled_size,
343343
'BadChars' => reqs['BadChars'],
344344
'SaveRegisters' => save_regs)
345+
346+
if nop_sled && nop_sled.length == nop_sled_size
347+
break
348+
else
349+
dlog("#{pinst.refname}: Nop generator #{nop.refname} failed to generate sled for payload", 'core', LEV_1)
350+
end
345351
rescue
346352
dlog("#{pinst.refname}: Nop generator #{nop.refname} failed to generate sled for payload: #{$!}",
347353
'core', LEV_1)
348354

349355
self.nop = nil
350356
end
351-
352-
break
353357
}
354358

355359
if (self.nop_sled == nil)

lib/msf/core/exploit.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,12 +1034,16 @@ def make_nops(count)
10341034
nop_sled = nop.generate_sled(count,
10351035
'BadChars' => payload_badchars || '',
10361036
'SaveRegisters' => save_regs)
1037+
1038+
if nop_sled && nop_sled.length == count
1039+
break
1040+
else
1041+
wlog("#{self.refname}: Nop generator #{nop.refname} failed to generate sled for exploit", 'core', LEV_0)
1042+
end
10371043
rescue
10381044
wlog("#{self.refname}: Nop generator #{nop.refname} failed to generate sled for exploit: #{$!}",
10391045
'core', LEV_0)
10401046
end
1041-
1042-
break
10431047
}
10441048

10451049
nop_sled

0 commit comments

Comments
 (0)