wmap 2.6.2 → 2.6.3

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
  SHA256:
3
- metadata.gz: d327a4a120e75079faa038125baf0f4e39ec784129cd4886a5a81672f0ecf8da
4
- data.tar.gz: 8911764a184f1c0f73048433cae9c6848725f3fec470b5d37aab5ce83a0e2789
3
+ metadata.gz: 8f0b51534ef91a271a2093c903cc362c1a571120f0bf39a8f0086d9adece61a6
4
+ data.tar.gz: ed707fab95be7457f1bf230a7162a0e9f361f020e7248cbecb7845012e347020
5
5
  SHA512:
6
- metadata.gz: 25beef23e9ce2771603b4915454e0c40ee6e5b28dc2897c583aecd9e7fbeba2dc07363209f84ec8e596eca36b06222591e197d4a35d187b8140dccee0e16c4c7
7
- data.tar.gz: 1a223d84f04fcb1c77f8e2bbb72fa452fd1b3cef076ccce0e80dead367284ce65992125018cf87d9965893d8b418ef3b954898b1244a023305ce75639e447016
6
+ metadata.gz: a821623ebd0bae444537ded05b711ca2a034d41f460bdb62694cf2eec1b95ac5343e0ff1a57c1f37c3c2f9a1e93db7b27120b4d64b6ca7085e44e0113da919fd
7
+ data.tar.gz: e48b6a67397653d3832dcd0bc090f82f8ee5ecc2961600e2434d8a4439786862a6aae91665f8cac12379317c2b9b8b261b4012323e0f66cd547d2f626faa6cf4
data/bin/trust CHANGED
@@ -12,7 +12,7 @@ Log_dir=File.dirname(__FILE__)+'/../logs/'
12
12
  Wmap.wlog("Execute the command: trust #{ARGV[0]}","trust",Log_dir+"wmap.log")
13
13
 
14
14
  dt=Wmap::DomainTracker.instance
15
- ct=Wmap::CidrTracker.new(:verbose=>true)
15
+ ct=Wmap::CidrTracker.new(:verbose=>false)
16
16
  abort "Incorrect program argument! Proper usage: trust [domain | netblock]" unless ARGV.length==1 && (dt.is_fqdn?(ARGV[0]) || ct.is_cidr?(ARGV[0]))
17
17
 
18
18
  puts "Start the baptizing process ..."
data/bin/wmap CHANGED
@@ -154,8 +154,12 @@ else
154
154
  else
155
155
  abort "Error firing up SiteTracker instance!"
156
156
  end
157
- new_sites=inventory.adds(dis_sites.keys)
158
- inventory.save! if new_sites.size>0
157
+ new_sites=inventory.adds(dis_sites.keys-["",nil])
158
+ if new_sites.size>0 && options[:data_dir]
159
+ inventory.save!(inventory.sites_file)
160
+ elsif new_sites.size>0
161
+ inventory.save!
162
+ end
159
163
  inventory=nil
160
164
  puts "Done! New found sites are successfully saved. " if new_sites.size > 0
161
165
  end
@@ -183,8 +187,12 @@ if hosts.size > 0
183
187
  hostnames=hosts.dup.delete_if { |h| host_tracker.is_ip?(h) }
184
188
  if hostnames.size > 0
185
189
  puts "Update the local hosts data repository with: #{hostnames}"
186
- new_hosts=host_tracker.adds(hostnames)
187
- host_tracker.save! if new_hosts.size>0
190
+ new_hosts=host_tracker.adds(hostnames-["",nil])
191
+ if new_hosts.size>0 && options[:data_dir]
192
+ host_tracker.save!(host_tracker.hosts_file)
193
+ elsif new_hosts.size>0
194
+ host_tracker.save!
195
+ end
188
196
  end
189
197
  end
190
198
  host_tracker=nil
@@ -81,46 +81,33 @@ class Wmap::PortScanner
81
81
 
82
82
  # Parallel scanner - by utilizing fork manager 'parallel' to spawn numbers of child processes on multiple hosts/IPs simultaneously
83
83
  def scans (targets,num=@max_parallel)
84
- begin
85
- urls=Array.new
86
- # 10/5/2013 add additional logic to eliminate invalid /duplicate target(s)
87
- targets -= ["", nil]
88
- uniq_hosts=Hash.new
89
- targets.dup.map do |target|
90
- if is_fqdn?(target) or is_ip?(target)
91
- ip=host_2_ip(target).to_s
92
- if uniq_hosts.key?(ip)
93
- targets.delete(target)
94
- else
95
- uniq_hosts[ip]=true
96
- end
97
- end
98
- end
99
- if targets.size > 0
100
- puts "Start the parallel port scan on the target list:\n #{targets}"
101
- Parallel.map(targets.shuffle, :in_processes => num) { |target|
102
- scan(target)
103
- }.each do |process|
104
- if process.nil?
105
- next
106
- elsif process.empty?
107
- #do nothing
108
- else
109
- process.map do |url|
110
- unless @discovered_urls.key?(url)
111
- @discovered_urls[url]=true
112
- end
84
+ all_urls=Array.new
85
+ # 10/5/2013 add additional logic to eliminate invalid /duplicate target(s)
86
+ targets = targets - ["", nil]
87
+ if targets.size > 0
88
+ puts "Start the parallel port scan on the target list:\n #{targets}"
89
+ Parallel.map(targets.shuffle, :in_processes => num) { |target|
90
+ scan(target)
91
+ }.each do |process|
92
+ if process.nil?
93
+ next
94
+ elsif process.empty?
95
+ #do nothing
96
+ else
97
+ process.map do |url|
98
+ unless @discovered_urls.key?(url)
99
+ @discovered_urls[url]=true
113
100
  end
114
- urls+=process
115
101
  end
102
+ all_urls+=process
116
103
  end
117
104
  end
118
- puts "Port scanning done successfully with the found web services: #{urls}"
119
- return urls
120
- rescue Exception => ee
121
- puts "Exception on method #{__method__}: #{ee}" if @verbose
122
- return nil
123
105
  end
106
+ puts "Port scanning done successfully with the found web services: #{all_urls}"
107
+ return all_urls
108
+ rescue Exception => ee
109
+ puts "Exception on method #{__method__}: #{ee}" if @verbose
110
+ return nil
124
111
  end
125
112
 
126
113
  # Parallel scans on a list of CIDRs from the input file, return the findings as the website construct within an array
@@ -231,12 +231,12 @@ class Wmap::SiteTracker
231
231
  host_tracker=nil
232
232
  return nil
233
233
  end
234
- #rescue => ee
235
- # puts "Exception on method #{__method__}: #{ee}"
236
- # checker=nil
237
- # deact=nil
238
- # host_tracker=nil
239
- # return nil
234
+ rescue => ee
235
+ puts "Exception on method #{__method__}: #{ee}"
236
+ checker=nil
237
+ deact=nil
238
+ host_tracker=nil
239
+ return nil
240
240
  end
241
241
 
242
242
  # Setter to add site entry to the cache table in batch (from a file)
@@ -256,6 +256,7 @@ class Wmap::SiteTracker
256
256
  def bulk_add(list,num=@max_parallel)
257
257
  puts "Add entries to the local site store from list:\n #{list}"
258
258
  results=Hash.new
259
+ list = list - [nil,""]
259
260
  if list.size > 0
260
261
  puts "Start parallel adding on the sites:\n #{list}"
261
262
  Parallel.map(list, :in_processes => num) { |target|
data/version.txt CHANGED
@@ -3,8 +3,8 @@
3
3
  ###############################################################################
4
4
  package = wmap
5
5
  # wmap version 2.0 == web_discovery version 1.5.3
6
- version = 2.6.2
7
- date = 2019-11-05
6
+ version = 2.6.3
7
+ date = 2019-11-06
8
8
 
9
9
  author = Sam (Yang) Li
10
10
  email = yang.li@owasp.org
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam (Yang) Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-05 00:00:00.000000000 Z
11
+ date: 2019-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dnsruby