wmap 2.6.4 → 2.6.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: bdb13c32f4c0c74ad2ab753782620391476e8f8f92e035a2fd1566e57077c91f
4
- data.tar.gz: 7ba530bf91fe8f47f527133e1095b9ed0e87f806f206c7a34e4c696cb9299ac8
3
+ metadata.gz: bbdb0202263c3525fce7e6c1f303d44e0c8310311e374c82392b7922df28292e
4
+ data.tar.gz: 8ab717ff6400d2936e288f5df870a4ca95a87dfd698e4f161d225aa340abe2d8
5
5
  SHA512:
6
- metadata.gz: 58f0db14b993f33cd25cc34d8b6de7f03b1b9103c4434c145025f869d213fc29a5828d9f026f3f709d454af79a8421a2aa3aaf72963bea5f06387098b32fb86b
7
- data.tar.gz: cbd700d85a1be4761c9398ea0ba09ecf1e3a1bfb0b8bb69fee139c13ba827b226b9dc04730d54519ce4213bf49dd236ef18b5cf0c7ddaec666cd57589fdd5ffe
6
+ metadata.gz: 7caff9a7eb4127880bb795421126bd5e8b27a4a73045856eb1972526e231a4c5e3cce3e29c2f20c10374976c130aac9e98c51f77ec62e1aa4c4c0a53ee15ce56
7
+ data.tar.gz: 608a63725be7551266f6f1b49259bc89e952a2553b4eb84c3c6b229a8d648fe35c77f69bfae2e90838a630a6d2c82dd37abefbe9bd02fac10df1792beca95d66
@@ -13,7 +13,7 @@ module Wmap
13
13
  # Class to identify and track adware within the site store
14
14
  include Wmap::Utils
15
15
  attr_accessor :signature_file, :tag_file, :verbose, :data_dir, :data_store
16
- attr_reader :tag_store, :tag_signatures
16
+ attr_reader :tag_signatures, :tag_store
17
17
 
18
18
 
19
19
  class AdwareTag < Wmap::UrlCrawler
@@ -22,15 +22,14 @@ module Wmap
22
22
  def initialize (params = {})
23
23
  @verbose=params.fetch(:verbose, false)
24
24
  @data_dir=params.fetch(:data_dir, File.dirname(__FILE__)+'/../../../data/')
25
- @tag_file=@data_dir + 'tag_sites'
26
25
  # Set default instance variables
27
26
  @signature_file=File.dirname(__FILE__) + '/../../../settings/' + 'tag_signatures'
28
27
  file=params.fetch(:signature_file, @signature_file)
29
28
  @tag_signatures=load_from_file(file)
30
- file2=params.fetch(:tag_file, @tag_file)
29
+ @tag_file=params.fetch(:tag_file, @data_dir + 'tag_sites')
31
30
  File.write(file2, "") unless File.exist?(@tag_file)
32
31
  # load the known tag store
33
- @tag_store=load_tag_from_file(file2)
32
+ load_tag_from_file(@tag_file)
34
33
  @landings = Hash.new # cache landing page to reduce redundant browsing
35
34
  end
36
35
 
@@ -65,7 +64,7 @@ module Wmap
65
64
  # load the known tag store cache into an instance variable
66
65
  def load_tag_from_file (file, lc=false)
67
66
  puts "Loading tag data file: #{file}" if @verbose
68
- data_store=Hash.new
67
+ @tag_store=Hash.new
69
68
  f = File.open(file, 'r')
70
69
  f.each_line do |line|
71
70
  puts "Processing line: #{line}" if @verbose
@@ -75,14 +74,14 @@ module Wmap
75
74
  next if line =~ /^\s*#/
76
75
  line=line.downcase if lc==true
77
76
  entry=line.split(',')
78
- if data_store.key?(entry[0])
77
+ if @tag_store.key?(entry[0])
79
78
  next
80
79
  else
81
- data_store[entry[0]]=[entry[1].strip, entry[2].strip, entry[3], entry[4]]
80
+ @tag_store[entry[0]]=[entry[1].strip, entry[2].strip, entry[3], entry[4]]
82
81
  end
83
82
  end
84
83
  f.close
85
- return data_store
84
+ return @tag_store
86
85
  rescue => ee
87
86
  puts "Exception on method #{__method__}: #{ee}" if @verbose
88
87
  return nil
@@ -26,20 +26,19 @@ class Wmap::WpTracker
26
26
  @verbose=params.fetch(:verbose, false)
27
27
  @data_dir=params.fetch(:data_dir, File.dirname(__FILE__)+'/../../data/')
28
28
  Dir.mkdir(@data_dir) unless Dir.exist?(@data_dir)
29
- wp_sites=@data_dir+'wp_sites'
30
- @file_wps=params.fetch(:sites_wp, wp_sites)
29
+ @sites_wp=params.fetch(:sites_wp, @data_dir+"wp_sites")
31
30
  @http_timeout=params.fetch(:http_timeout, 5000)
32
31
  @max_parallel=params.fetch(:max_parallel, 40)
33
32
  Dir.mkdir(@data_dir) unless Dir.exist?(@data_dir)
34
33
  @log_file=@data_dir + "wp_checker.log"
35
- @known_wp_sites=load_from_file(@file_wps)
34
+ File.write(@sites_wp, "") unless File.exist?(@sites_wp)
35
+ load_from_file(@sites_wp)
36
36
  end
37
37
 
38
-
39
38
  # 'setter' to load the known wordpress sites into an instance variable
40
39
  def load_from_file (file=@file_stores, lc=true)
41
40
  puts "Loading trusted file: #{file}" if @verbose
42
- known_wp_sites=Hash.new
41
+ @known_wp_sites=Hash.new
43
42
  f_wp_sites=File.open(file, 'r')
44
43
  f_wp_sites.each_line do |line|
45
44
  puts "Processing line: #{line}" if @verbose
@@ -51,25 +50,24 @@ class Wmap::WpTracker
51
50
  entry=line.split(',')
52
51
  site = entry[0].strip()
53
52
  next if site.nil?
54
- if known_wp_sites.key?(site)
53
+ if @known_wp_sites.key?(site)
55
54
  next
56
55
  else
57
- known_wp_sites[site] = Hash.new
58
- known_wp_sites[site]['site'] = site
59
- known_wp_sites[site]['version'] = entry[1].strip()
60
- known_wp_sites[site]['redirection'] = entry[2].strip()
56
+ @known_wp_sites[site] = Hash.new
57
+ @known_wp_sites[site]['site'] = site
58
+ @known_wp_sites[site]['version'] = entry[1].strip()
59
+ @known_wp_sites[site]['redirection'] = entry[2].strip()
61
60
  end
62
-
63
61
  end
64
62
  f_wp_sites.close
65
- return known_wp_sites
63
+ return @known_wp_sites
66
64
  rescue => ee
67
65
  puts "Exception on method #{__method__}: #{ee}" if @verbose
68
66
  return Hash.new
69
67
  end
70
68
 
71
69
  # Save the current hash table into a file
72
- def save_to_file!(file_wps=@file_wps, wps=@known_wp_sites)
70
+ def save_to_file!(file_wps=@sites_wp, wps=@known_wp_sites)
73
71
  puts "Saving the current wordpress site table from memory to file: #{file_wps} ..." if @verbose
74
72
  timestamp=Time.now
75
73
  f=File.open(file_wps, 'w')
@@ -148,7 +146,7 @@ class Wmap::WpTracker
148
146
  def refreshs (num=@max_parallel,use_cache=false)
149
147
  puts "Add entries to the local cache table from site tracker: " if @verbose
150
148
  results=Hash.new
151
- wps=Wmap::SiteTracker.instance.known_sites.keys
149
+ wps=@known_wp_sites.keys
152
150
  if wps.size > 0
153
151
  Parallel.map(wps, :in_processes => num) { |target|
154
152
  refresh(target,use_cache)
@@ -170,9 +168,9 @@ class Wmap::WpTracker
170
168
  end
171
169
  wps=nil
172
170
  return results
173
- rescue => ee
174
- puts "Exception on method #{__method__}: #{ee}" if @verbose
175
- return Hash.new
171
+ #rescue => ee
172
+ # puts "Exception on method #{__method__}: #{ee}" if @verbose
173
+ # return Hash.new
176
174
  end
177
175
 
178
176
  # Wordpress detection checkpoint - readme.html
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.4
7
- date = 2019-11-11
6
+ version = 2.6.5
7
+ date = 2019-11-12
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.4
4
+ version: 2.6.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-11-11 00:00:00.000000000 Z
11
+ date: 2019-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dnsruby