Skip to content

Commit a872c13

Browse files
authored
Merge pull request #18 from clee-r7/goliath_cleanup
Goliath Cleanup in preparation for merge to master
2 parents 4f6b1de + 8740eeb commit a872c13

File tree

11 files changed

+1964
-2045
lines changed

11 files changed

+1964
-2045
lines changed

Gemfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ source 'https://rubygems.org'
33
# spec.add_runtime_dependency '<name>', [<version requirements>]
44
gemspec name: 'metasploit-framework'
55

6-
7-
gem 'thin'
8-
gem 'sinatra'
9-
106
# separate from test as simplecov is not run on travis-ci
117
group :coverage do
128
# code coverage for tests

Gemfile.lock

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ PATH
6262
ruby_smb (= 0.0.18)
6363
rubyntlm
6464
rubyzip
65+
sinatra
6566
sqlite3
6667
sshkey
68+
thin
6769
tzinfo
6870
tzinfo-data
6971
windows_error
@@ -378,6 +380,7 @@ PLATFORMS
378380
DEPENDENCIES
379381
factory_girl_rails
380382
fivemat
383+
google-protobuf (= 3.5.1)
381384
metasploit-aggregator
382385
metasploit-framework!
383386
octokit
@@ -387,8 +390,6 @@ DEPENDENCIES
387390
rspec-rails
388391
rspec-rerun
389392
simplecov
390-
sinatra
391-
thin
392393
timecop
393394
yard
394395

documentation/modules/auxiliary/scanner/http/owa_login.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

lib/metasploit/framework/command/base.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ class Metasploit::Framework::Command::Base
4444
#
4545
# @return (see parsed_options)
4646
def self.require_environment!
47-
# TODO: Look into removing Rails.application (save ~20mb)
48-
# return self.parsed_options if ( self.parsed_options.options.database.remote_process)
49-
5047
parsed_options = self.parsed_options
51-
5248
# RAILS_ENV must be set before requiring 'config/application.rb'
5349
parsed_options.environment!
5450
ARGV.replace(parsed_options.positional)
@@ -83,9 +79,7 @@ def self.parsed_options_class_name
8379

8480
def self.start
8581
parsed_options = require_environment!
86-
is_db_remote = false # parsed_options.options.database.remote_process
87-
application = is_db_remote ? nil : Rails.application
88-
new(application: application, parsed_options: parsed_options).start
82+
new(application: Rails.application, parsed_options: parsed_options).start
8983
end
9084

9185
#

lib/msf/base/simple/framework/module_paths.rb

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,20 @@ def init_module_paths(opts={})
1212
return
1313
end
1414

15-
#is_remote_db = opts.delete(:is_remote_database)
1615
allowed_module_paths = []
17-
18-
#if (!is_remote_db)
19-
extract_engine_module_paths(Rails.application).each do |path|
20-
allowed_module_paths << path
21-
end
22-
#else
23-
# allowed_module_paths << "/home/chlee/rapid7/metasploit-framework/modules"
24-
#end
16+
extract_engine_module_paths(Rails.application).each do |path|
17+
allowed_module_paths << path
18+
end
2519

2620
if Msf::Config.user_module_directory
2721
allowed_module_paths << Msf::Config.user_module_directory
2822
end
2923

30-
#unless (is_remote_db)
31-
::Rails::Engine.subclasses.map(&:instance).each do |engine|
32-
extract_engine_module_paths(engine).each do |path|
33-
allowed_module_paths << path
34-
end
24+
::Rails::Engine.subclasses.map(&:instance).each do |engine|
25+
extract_engine_module_paths(engine).each do |path|
26+
allowed_module_paths << path
3527
end
36-
# end
28+
end
3729

3830
# If additional module paths have been defined globally, then load them.
3931
# They should be separated by semi-colons.

lib/msf/core/db_manager.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class Msf::DBManager
9494
include Msf::DBManager::Web
9595
include Msf::DBManager::Workspace
9696

97-
9897
# Provides :framework and other accessors
9998
include Msf::Framework::Offspring
10099

lib/msf/core/session_manager.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,14 @@ def initialize(framework)
113113

114114
last_seen_timer = Time.now.utc
115115

116-
if framework.db.active
117-
::ActiveRecord::Base.connection_pool.with_connection do
118-
values.each do |s|
119-
# Update the database entry on a regular basis, marking alive threads
120-
# as recently seen. This notifies other framework instances that this
121-
# session is being maintained.
122-
if s.db_record
123-
s.db_record.last_seen = Time.now.utc
124-
s.db_record.save
125-
end
116+
::ActiveRecord::Base.connection_pool.with_connection do
117+
values.each do |s|
118+
# Update the database entry on a regular basis, marking alive threads
119+
# as recently seen. This notifies other framework instances that this
120+
# session is being maintained.
121+
if s.db_record
122+
s.db_record.last_seen = Time.now.utc
123+
s.db_record.save
126124
end
127125
end
128126
end

0 commit comments

Comments
 (0)