wmap 2.6.3 → 2.6.4

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: 8f0b51534ef91a271a2093c903cc362c1a571120f0bf39a8f0086d9adece61a6
4
- data.tar.gz: ed707fab95be7457f1bf230a7162a0e9f361f020e7248cbecb7845012e347020
3
+ metadata.gz: bdb13c32f4c0c74ad2ab753782620391476e8f8f92e035a2fd1566e57077c91f
4
+ data.tar.gz: 7ba530bf91fe8f47f527133e1095b9ed0e87f806f206c7a34e4c696cb9299ac8
5
5
  SHA512:
6
- metadata.gz: a821623ebd0bae444537ded05b711ca2a034d41f460bdb62694cf2eec1b95ac5343e0ff1a57c1f37c3c2f9a1e93db7b27120b4d64b6ca7085e44e0113da919fd
7
- data.tar.gz: e48b6a67397653d3832dcd0bc090f82f8ee5ecc2961600e2434d8a4439786862a6aae91665f8cac12379317c2b9b8b261b4012323e0f66cd547d2f626faa6cf4
6
+ metadata.gz: 58f0db14b993f33cd25cc34d8b6de7f03b1b9103c4434c145025f869d213fc29a5828d9f026f3f709d454af79a8421a2aa3aaf72963bea5f06387098b32fb86b
7
+ data.tar.gz: cbd700d85a1be4761c9398ea0ba09ecf1e3a1bfb0b8bb69fee139c13ba827b226b9dc04730d54519ce4213bf49dd236ef18b5cf0c7ddaec666cd57589fdd5ffe
data/bin/refresh CHANGED
@@ -3,24 +3,70 @@
3
3
  # This is useful as site information may change over the time
4
4
  ## Usage: refresh [a site|all]
5
5
  require "wmap"
6
+ require "optparse"
6
7
 
8
+ # program helper
7
9
  def print_usage
8
- puts "Program to refresh the website entry in the local data repository. Usage: refresh [a site|all]"
10
+ puts "Program to refresh the website entry in the local data repository. Usage: refresh --target [a site|all] --data_dir [path ]"
11
+ end
12
+
13
+ # program command line options
14
+ options = {:data_dir => nil, :target => nil}
15
+ parser = OptionParser.new do|opts|
16
+ opts.banner = Wmap.banner
17
+ opts.on('-d', '--data_dir data_dir', 'Web Mapper local cache data directory') do |data_dir|
18
+ options[:data_dir] = data_dir;
19
+ end
20
+ opts.on('-t', '--target target', 'Web Mapper target') do |target|
21
+ options[:target] = target;
22
+ end
23
+ opts.on('-h', '--help', 'Displays Help') do
24
+ print Wmap.banner,"\n"
25
+ print_usage
26
+ exit 0
27
+ end
28
+ end
29
+ parser.parse!
30
+
31
+ # print program banner
32
+ puts Wmap.banner
33
+ print_usage unless options[:target]
34
+ store=Wmap::SiteTracker.instance
35
+ store.verbose = true
36
+
37
+ # Preparing - check out the working logs directory
38
+ if options[:data_dir]
39
+ # Log to the instance running directory
40
+ Log_dir = Pathname.new(options[:data_dir]).join('logs')
41
+ store.data_dir = options[:data_dir]
42
+ sites_file = options[:data_dir] + '/' + 'sites'
43
+ #puts "sites_file: #{sites_file}"
44
+ store.load_site_stores_from_file(sites_file)
45
+ else
46
+ # Log the command entry
47
+ Log_dir=Pathname.new(Gem.loaded_specs['wmap'].full_gem_path).join('logs')
9
48
  end
10
49
 
11
50
  puts Wmap.banner
12
51
  print_usage
13
- Log_dir=File.dirname(__FILE__)+'/../logs/'
52
+ # Log_dir=File.dirname(__FILE__)+'/../logs/'
14
53
  Wmap.wlog("Execute the command: refresh #{ARGV[0]}","refresh",Log_dir+"wmap.log")
15
54
 
16
- abort "Incorrect program argument! Proper Usage: refresh [site]" unless ARGV.length==1
55
+ #puts "Captured command argument"
56
+ if options[:target]
57
+ if options[:target]=="all"
58
+ # magic token 'all' to refresh all sites in the store
59
+ # puts "Refresh all sites: #{store.known_sites.keys}"
60
+ store.refresh_all
61
+ else
62
+ # abort "Error: incorrect site syntax! It must be in http(s):://xxx.xxx/ format." unless Wmap::SiteTracker.instance.is_site?(ARGV[0])
63
+ store.refresh(options[:target])
64
+ end
65
+ end
17
66
 
18
- #puts "Captured command argument: #{ARGV[0]}"
19
- if ARGV[0]=="all"
20
- # magic token 'all' to refresh all sites in the store
21
- Wmap.refresh_all
67
+ # please
68
+ if options[:data_dir]
69
+ store.save!(sites_file)
22
70
  else
23
- abort "Error: incorrect site syntax! It must be in http(s):://xxx.xxx/ format." unless Wmap::SiteTracker.instance.is_site?(ARGV[0])
24
- st=nil
25
- Wmap.refresh(ARGV[0])
71
+ store.save!
26
72
  end
data/bin/wmap CHANGED
@@ -10,24 +10,23 @@ require "optparse"
10
10
  def print_usage
11
11
  abort "Program to perform website asset discovery and tracking. \nUsage: wmap -t <Target Host | URL | IP | CIDR | or a seed file with any of the above combo> -d <Optional Discovery Result Directory>"
12
12
  end
13
- options = {:data_dir => nil, :target => nil}
14
13
 
14
+ # program command line options
15
+ options = {:data_dir => nil, :target => nil}
15
16
  parser = OptionParser.new do|opts|
16
17
  opts.banner = Wmap.banner
17
18
  opts.on('-d', '--data_dir data_dir', 'Web Mapper local cache data directory') do |data_dir|
18
19
  options[:data_dir] = data_dir;
19
20
  end
20
-
21
21
  opts.on('-t', '--target target', 'Web Mapper target') do |target|
22
22
  options[:target] = target;
23
23
  end
24
-
25
24
  opts.on('-h', '--help', 'Displays Help') do
26
- Wmap.banner
25
+ print Wmap.banner,"\n"
27
26
  print_usage
27
+ exit 0
28
28
  end
29
29
  end
30
-
31
30
  parser.parse!
32
31
 
33
32
  # print program banner
@@ -343,8 +343,8 @@ class Wmap::SiteTracker
343
343
  else
344
344
  puts "Error: no entry is loaded. Please check your list and try again."
345
345
  end
346
- rescue => ee
347
- puts "Exception on method #{__method__}: #{ee}" if @verbose
346
+ #rescue => ee
347
+ # puts "Exception on method #{__method__}: #{ee}" if @verbose
348
348
  end
349
349
  alias_method :dels, :bulk_delete
350
350
 
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.3
7
- date = 2019-11-06
6
+ version = 2.6.4
7
+ date = 2019-11-11
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.3
4
+ version: 2.6.4
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-06 00:00:00.000000000 Z
11
+ date: 2019-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dnsruby