metasploit_data_models 0.21.2-java → 0.21.3-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5d014244a6ceb23191cb6cfbb5a164d76443659
4
- data.tar.gz: 7716d163221b3a3a50de7f4943c5091a6b0a7c18
3
+ metadata.gz: d11998218afd52a63a8d7805857fb8ec4ed0a675
4
+ data.tar.gz: cb54f6b261e068f2d98ffcf2021f3e2f762a022c
5
5
  SHA512:
6
- metadata.gz: f7c311fd18000e55dcd1e8d7551cfee13b2ff119930fa2c9d37160dfc2bdfe2299160ff886a3e8190f099f52a278f6ed8a459d6b125b5f348d29e459dbf5b5fe
7
- data.tar.gz: 46f5e6ae510c54b334121290c8b5d5d861ddf691e16e80713d803a6df934822831fcbecf0c13a4c643faa8b1e9555238fdd16ad07e701837378a70a11c677441
6
+ metadata.gz: b422d4bddff84eff324abf564b2ef7aced4eaf33e2ba577afd3ac0da6032e53000bf6fe4a44d3d0a82ca141ce429206a83780ba6ad2406cd5487e618b8c5c51a
7
+ data.tar.gz: 66b99190854648ad22caf0ca9c84ce33a1da8f38d4633d202839925bd8d542f2bac442a35772c303d938b96270df8a9fc307a0d58e342d544c190c440d9e17fe
@@ -12,6 +12,8 @@ class Mdm::NexposeConsole < ActiveRecord::Base
12
12
  foreign_key: :nx_console_id,
13
13
  inverse_of: :nexpose_console
14
14
 
15
+ before_save :strip_protocol
16
+
15
17
  #
16
18
  # Serializations
17
19
  #
@@ -28,6 +30,10 @@ class Mdm::NexposeConsole < ActiveRecord::Base
28
30
  validates :port, :numericality => { :only_integer => true }, :inclusion => {:in => 1..65535}
29
31
  validates :username, :presence => true
30
32
 
33
+ def strip_protocol
34
+ self.address.gsub!(/^http(s)*:\/\//i,'')
35
+ end
36
+
31
37
  Metasploit::Concern.run(self)
32
38
  end
33
39
 
@@ -6,7 +6,7 @@ module MetasploitDataModels
6
6
  # The minor version number, scoped to the {MAJOR} version number.
7
7
  MINOR = 21
8
8
  # The patch number, scoped to the {MINOR} version number.
9
- PATCH = 2
9
+ PATCH = 3
10
10
 
11
11
  # The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the `PRERELEASE` in the
12
12
  # {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format.
@@ -121,4 +121,14 @@ describe Mdm::NexposeConsole do
121
121
 
122
122
  end
123
123
 
124
+ context 'callbacks' do
125
+ describe '#strip_protocol' do
126
+ it 'should strip protocol handlers from the front of the address' do
127
+ nexpose_console = FactoryGirl.create(:mdm_nexpose_console, :address => 'https://foo.bar.com')
128
+ expect(nexpose_console.address).to eq 'foo.bar.com'
129
+ end
130
+
131
+ end
132
+ end
133
+
124
134
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.2
4
+ version: 0.21.3
5
5
  platform: java
6
6
  authors:
7
7
  - Samuel Huckins
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-11-14 00:00:00.000000000 Z
14
+ date: 2014-12-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake