wmap 2.6.8 → 2.6.9

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: 5cbae048aecd25ee91bdbbf75657d8f4329e9abd2c65cd90cedd65b553659ed4
4
- data.tar.gz: 1043ec8e2dd15287c6d11b3a0094ca4b65c4684aec96cdea03085cfea431ceb8
3
+ metadata.gz: c1fcf909fd9549bdc0c1339d986ec7812563474ef4c9e6b1aa76ca3790b038a5
4
+ data.tar.gz: 2098e60fc667bf8ba02fa852242ffb2a515ebe04374177f4bf1a50bdb69a05ef
5
5
  SHA512:
6
- metadata.gz: b89c65b1ec441b0307ef85a322f8ced64e9443694a021301989a52761cc62496e3c2552fb21c709a01f1bf8e7834634f8d2e4d9ce6432521c6a197e02a9f7290
7
- data.tar.gz: 71b0beedf0e8c9f75172cde52c6f40b9620a96de5ecfc69c031908e6c86534818ca1f5208711a3eb9c5852a09c1b2beda864d25c620399737442e65016bcbf98
6
+ metadata.gz: ea7e49f2b0913ad1159226268355ea9e339468929b614fff99e24b4e1b43fc4225560466930023f2691deb5b3547eaf9a41ada8cdc9128401389e96a5ef2865a
7
+ data.tar.gz: ba6d2efe7f4ebf1b9bd761b5d4235744ddbdde8a398cefc07af7465a2c5c974e0f6c91c3dbf573659a6de2eca1b01af8434439e63c3a1b125de7b241e7d0feab
@@ -67,9 +67,17 @@ module Wmap
67
67
  string = "-"*80 + "\n" + art + "\n" + "Version: " + ver["version"] + "\tRelease Date: " + ver["date"] + "\nDesigned and developed by: " + ver["author"] + "\nEmail: " + ver["email"] + "\tLinkedIn: " + ver["linkedin"] + "\n" + "-"*80
68
68
  end
69
69
 
70
+ def data_dir(data_path)
71
+ @data_dir=data_path.to_s
72
+ end
73
+
70
74
  # Explorer to discover and inventory web application / service automatically
71
75
  def wmap(seed)
72
- cmd="bin/wmap" + " " + seed
76
+ if @data_dir
77
+ cmd = "bin/wmap" + " -d " + @data_dir + " -t " + seed
78
+ else
79
+ cmd="bin/wmap" + " -t " + seed
80
+ end
73
81
  system(cmd)
74
82
  end
75
83
 
@@ -118,6 +126,11 @@ module Wmap
118
126
  # Check if the IP is within the range of the known CIDR blocks
119
127
  def ip_trusted?(ip)
120
128
  tracker=Wmap::CidrTracker.new
129
+ if @data_dir
130
+ tracker.data_dir=@data_dir
131
+ tracker.cidr_seeds=tracker.data_dir + "/" + "cidrs"
132
+ tracker.load_cidr_blks_from_file(tracker.cidr_seeds)
133
+ end
121
134
  tracker.ip_trusted?(ip)
122
135
  end
123
136
 
@@ -125,24 +138,47 @@ module Wmap
125
138
  # NOT to confuse with the Internet 'whois' lookup
126
139
  def domain_known?(domain)
127
140
  tracker=Wmap::DomainTracker.instance
141
+ if @data_dir
142
+ tracker.data_dir=@data_dir
143
+ tracker.domains_file=tracker.data_dir + "/" + "domains"
144
+ tracker.load_domains_from_file(tracker.domains_file)
145
+ end
128
146
  tracker.domain_known?(domain)
129
147
  end
130
148
 
131
149
  # Host Tracking - check local hosts file to see if this is a hostname known from the host seed file
132
150
  # NOT to confuse with a regular DNS lookup over the internet
133
151
  def host_known?(host)
134
- tracker=Wmap::HostTracker.instance.host_known?(host)
152
+ tracker=Wmap::HostTracker.instance
153
+ if @data_dir
154
+ tracker.data_dir = data_dir
155
+ tracker.hosts_file = tracker.data_dir + "/" + "hosts"
156
+ tracker.load_known_hosts_from_file(tracker.hosts_file)
157
+ end
158
+ tracker.host_known?(host)
135
159
  end
136
160
 
137
161
  # Sub-domain tracking - check local hosts file to see if the sub-domain is already known
138
162
  def sub_domain_known?(host)
139
- tracker=Wmap::HostTracker.instance.sub_domain_known?(host)
163
+ tracker=Wmap::HostTracker.instance
164
+ if @data_dir
165
+ tracker.data_dir = data_dir
166
+ tracker.hosts_file = tracker.data_dir + "/" + "hosts"
167
+ tracker.load_known_hosts_from_file(tracker.hosts_file)
168
+ end
169
+ tracker.sub_domain_known?(host)
140
170
  end
141
171
 
142
172
  # IP Tracking - check local hosts file to see if this is an IP known from the seed file
143
173
  # NOT to confuse with a regular reverse DNS lookup over the internet
144
174
  def ip_known?(ip)
145
- tracker=Wmap::HostTracker.instance.ip_known?(ip)
175
+ tracker=Wmap::HostTracker.instance
176
+ if @data_dir
177
+ tracker.data_dir = data_dir
178
+ tracker.hosts_file = tracker.data_dir + "/" + "hosts"
179
+ tracker.load_known_hosts_from_file(tracker.hosts_file)
180
+ end
181
+ tracker.ip_known?(ip)
146
182
  end
147
183
 
148
184
  # DNS Brute Forcer
@@ -175,25 +211,44 @@ module Wmap
175
211
  # Search the site repository for all entries that match the pattern
176
212
  def search(pattern)
177
213
  searcher=Wmap::SiteTracker.instance
214
+ if @data_dir
215
+ searcher.data_dir = @data_dir
216
+ searcher.sites_file = searcher.data_dir + "/" + "sites"
217
+ searcher.load_site_stores_from_file(searcher.sites_file)
218
+ end
178
219
  searcher.search(pattern)
179
220
  end
180
221
 
181
222
  # Dump out the unique sites into a plain file
182
223
  def dump(file)
183
224
  store=Wmap::SiteTracker.instance
184
- store.verbose=false
225
+ if @data_dir
226
+ store.data_dir = @data_dir
227
+ store.sites_file = searcher.data_dir + "/" + "sites"
228
+ store.load_site_stores_from_file(searcher.sites_file)
229
+ end
185
230
  store.save_uniq_sites(file)
186
231
  end
187
232
 
188
233
  # Dump out the unique sites into a XML file
189
234
  def dump_xml(file)
190
235
  store=Wmap::SiteTracker.instance
191
- store.save_uniq_sites_xml(file)
236
+ if @data_dir
237
+ store.data_dir = @data_dir
238
+ store.sites_file = searcher.data_dir + "/" + "sites"
239
+ store.load_site_stores_from_file(searcher.sites_file)
240
+ end
241
+ store.save_uniq_sites_xml(file)
192
242
  end
193
243
 
194
244
  # Refresh the site information in the local data repository
195
245
  def refresh(site)
196
246
  store=Wmap::SiteTracker.instance
247
+ if @data_dir
248
+ store.data_dir = @data_dir
249
+ store.sites_file = searcher.data_dir + "/" + "sites"
250
+ store.load_site_stores_from_file(searcher.sites_file)
251
+ end
197
252
  store.refresh(site)
198
253
  store.save!
199
254
  end
@@ -201,6 +256,11 @@ module Wmap
201
256
  # Refresh the site information in the local data repository
202
257
  def refresh_all
203
258
  store=Wmap::SiteTracker.instance
259
+ if @data_dir
260
+ store.data_dir = @data_dir
261
+ store.sites_file = searcher.data_dir + "/" + "sites"
262
+ store.load_site_stores_from_file(searcher.sites_file)
263
+ end
204
264
  store.refresh_all
205
265
  store.save!
206
266
  end
@@ -219,7 +279,12 @@ module Wmap
219
279
  # Print a site's full information from the repository
220
280
  def print_all
221
281
  searcher=Wmap::SiteTracker.instance
222
- searcher.print_all_sites
282
+ if @data_dir
283
+ searcher.data_dir = @data_dir
284
+ searcher.sites_file = searcher.data_dir + "/" + "sites"
285
+ searcher.load_site_stores_from_file(searcher.sites_file)
286
+ end
287
+ searcher.print_all_sites
223
288
  end
224
289
 
225
290
  private
@@ -554,7 +554,8 @@ class Wmap::SiteTracker
554
554
  sites=Hash.new
555
555
  #uniqueness=Hash.new
556
556
  host_tracker=Wmap::HostTracker.instance
557
- host_tracker.hosts_file=@data_dir + 'hosts'
557
+ host_tracker.data_dir=@data_dir
558
+ host_tracker.hosts_file=host_tracker.data_dir + '/' + 'hosts'
558
559
  host_tracker.load_known_hosts_from_file
559
560
  @known_sites.keys.map do |key|
560
561
  port=url_2_port(key).to_s
@@ -649,6 +650,8 @@ class Wmap::SiteTracker
649
650
  sites=get_ip_sites
650
651
  host_tracker=Wmap::HostTracker.instance
651
652
  host_tracker.data_dir=@data_dir
653
+ host_tracker.hosts_file = host_tracker.data_dir + "/" + "hosts"
654
+ host_tracker.load_known_hosts_from_file
652
655
  sites.map do |site|
653
656
  puts "Work on resolve the IP site: #{site}" if @verbose
654
657
  ip=url_2_host(site)
@@ -804,6 +807,8 @@ class Wmap::SiteTracker
804
807
  host_tracker.data_dir=@data_dir
805
808
  primary_host_tracker=Wmap::HostTracker::PrimaryHost.instance
806
809
  primary_host_tracker.data_dir=@data_dir
810
+ primary_host_tracker.hosts_file = primary_host_tracker.data_dir + "/" + "prime_hosts"
811
+ primary_host_tracker.known_hosts=primary_host_tracker.load_known_hosts_from_file(@hosts_file)
807
812
  # Step 1. Retrieve the unique site list first
808
813
  sites=get_uniq_sites
809
814
  prim_uniq_sites=Array.new
@@ -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.8
7
- date = 2019-11-15
6
+ version = 2.6.9
7
+ date = 2019-12-02
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.8
4
+ version: 2.6.9
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-15 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dnsruby