wmap 2.5.4 → 2.5.5

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: ae590c812b4919eb1b66841f6eb873de93727cbf8847fe6392dc19c94e4ef158
4
- data.tar.gz: 7530a5c491a7d87289e41c4ef4b0df6f201495c107270892e5e6d22f9584da9b
3
+ metadata.gz: 9b7418c10fec65599e729f381e47814776b8e9641a3e1d27d5b11084e2d87f3d
4
+ data.tar.gz: 8534aa535bbba34f58fab3edd1e73cad1b85d2c95d294d2e6bbd894960c1f885
5
5
  SHA512:
6
- metadata.gz: fa9211e5e14e74a24266677b8993071f9be1e75b9387d35a36233192c885521abbb8ecd31b0b0dc2d65db4de50cb0513e0a4cd214bed18672a1cf3b1b9cd52f6
7
- data.tar.gz: 70d6dc893be0273b16b4f8dd78d9fe4f3ec7bf5310ea0c8b299100535300053a19f8d936ac6422cffd5251d0dc2fae991eeaa41ac31f0a639d52994bf9a5d645
6
+ metadata.gz: 8992d8b673bf2fddfb5a1097b26a947fb109fb68bccf677310fee4b7e4530358ef48da75eb128f70c0f8e609914c91f3c5f0348de9417d38683db1ed1de1fd3e
7
+ data.tar.gz: c8664f0216f971f48f454bdced1a5566cb0feaa699c2a366fd34e72f84b6744e54e623d3c959e1369d2aea751eb5cbbd92e2d3bf78dc621821d5f5b953e2dd7f
data/bin/wmap CHANGED
@@ -11,12 +11,12 @@ end
11
11
 
12
12
  # preparing - spit out the program banner
13
13
  puts Wmap.banner
14
- if ARGV.length == 1
15
- # Log the command entry
16
- Log_dir=File.dirname(__FILE__)+'/../logs/'
17
- elsif ARGV.length == 2
14
+ if ARGV.length == 2
18
15
  # Log to the instance running directory
19
16
  Log_dir=File.dirname(__FILE__)+'/../logs/'+ARGV[1]
17
+ else
18
+ # Log the command entry
19
+ Log_dir=File.dirname(__FILE__)+'/../logs/'
20
20
  end
21
21
  Dir.mkdir(Log_dir) unless Dir.exist?(Log_dir)
22
22
 
@@ -50,6 +50,7 @@ class Wmap::WpTracker
50
50
  line=line.downcase if lc==true
51
51
  entry=line.split(',')
52
52
  site = entry[0].strip()
53
+ next if site.nil?
53
54
  if known_wp_sites.key?(site)
54
55
  next
55
56
  else
@@ -74,7 +75,7 @@ class Wmap::WpTracker
74
75
  f=File.open(file_wps, 'w')
75
76
  f.write "# Local wps file created by class #{self.class} method #{__method__} at: #{timestamp}\n"
76
77
  f.write "# WP Site URL, WP Version, Redirection \n"
77
- wps.keys.sort.map do |key|
78
+ (wps.keys - [nil,'']).sort.map do |key|
78
79
  f.write "#{key}, #{wps[key]['version']}, #{wps[key]['redirection']}\n"
79
80
  end
80
81
  f.close
@@ -84,7 +85,7 @@ class Wmap::WpTracker
84
85
  end
85
86
  alias_method :save!, :save_to_file!
86
87
 
87
- # 'setter' to add wordpress entry to the cache one at a time
88
+ # Add wordpress entry to the cache one at a time
88
89
  def add(url, use_cache=true)
89
90
  puts "Add entry to the local cache table: #{url}" if @verbose
90
91
  site=url_2_site(url)
@@ -93,13 +94,23 @@ class Wmap::WpTracker
93
94
  else
94
95
  record=Hash.new
95
96
  redirection = landing_location(site)
96
- if is_wp?(redirection)
97
- version = wp_ver(site)
98
- record['site'] = site
99
- record['version'] = version
100
- record['redirection'] = redirection
101
- @known_wp_sites[site]=record
102
- puts "Entry loaded: #{record}"
97
+ if not [nil, ''].include?(redirection)
98
+ if is_wp?(redirection)
99
+ version = wp_ver(redirection)
100
+ record['site'] = site
101
+ record['version'] = version
102
+ record['redirection'] = redirection
103
+ @known_wp_sites[site]=record
104
+ puts "Entry added: #{record}"
105
+ end
106
+ else
107
+ if is_wp?(site)
108
+ version = wp_ver(site)
109
+ record['version'] = version
110
+ record['redirection'] = redirection
111
+ @known_wp_sites[site]=record
112
+ puts "Entry added: #{record}"
113
+ end
103
114
  end
104
115
  end
105
116
  return record
@@ -272,15 +283,20 @@ class Wmap::WpTracker
272
283
  # Extract the WordPress version
273
284
  def wp_ver(url)
274
285
  if !wp_ver_readme(url).nil?
286
+ puts "WordPress version found by wp_ver_readme method. " if @verbose
275
287
  return wp_ver_readme(url)
276
- elsif !wp_ver_meta(url).nil?
277
- return wp_ver_meta(url)
278
288
  elsif !wp_ver_login(url,"login.min.css").nil?
289
+ puts "WordPress version found by login.min.css file. " if @verbose
279
290
  return wp_ver_login(url,"login.min.css")
280
291
  elsif !wp_ver_login(url,"buttons.min.css").nil?
292
+ puts "WordPress version found by buttons.min.css file. " if @verbose
281
293
  return wp_ver_login(url,"buttons.min.css")
282
294
  elsif !wp_ver_login(url,"wp-admin.min.css").nil?
295
+ puts "WordPress version found by wp-admin.min.css file. " if @verbose
283
296
  return wp_ver_login(url,"wp-admin.min.css")
297
+ elsif !wp_ver_meta(url).nil?
298
+ puts "WordPress version found by wp_ver_meta method. " if @verbose
299
+ return wp_ver_meta(url)
284
300
  else
285
301
  return nil
286
302
  end
@@ -326,10 +342,10 @@ class Wmap::WpTracker
326
342
  meta=doc.css('meta')
327
343
  #puts meta.inspect
328
344
  meta.each do |tag|
329
- if tag.to_s =~ /wordpress/i
345
+ if tag['content'].to_s =~ /wordpress/i
330
346
  #puts tag.to_s
331
347
  k=nil
332
- return tag.to_s.scan(/[\d+\.]+\d+/).first
348
+ return tag['content'].to_s.scan(/[\d+\.]+\d+/).first
333
349
  end
334
350
  end
335
351
  end
data/logs/wmap.log CHANGED
@@ -14,3 +14,4 @@ A test
14
14
  2019-04-13 11:45:43 -0400: trust: Execute the command: trust /tmp/test
15
15
  2019-04-13 11:46:54 -0400: trust: Execute the command: trust /tmp/test
16
16
  2019-04-13 12:03:24 -0400: wmap: Execute the command: wmap www.lcbhome.com
17
+ 2019-08-15 09:39:36 -0400: wmap: Execute the command: wmap
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.5.4
7
- date = 2019-07-09
6
+ version = 2.5.5
7
+ date = 2019-08-15
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.5.4
4
+ version: 2.5.5
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-07-09 00:00:00.000000000 Z
11
+ date: 2019-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dnsruby