vpndetection 5.17.1 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -7
- data/lib/vpndetection/api/account_wire_api.rb +2 -2
- data/lib/vpndetection/api/api_keys_wire_api.rb +2 -2
- data/lib/vpndetection/api/authorization_wire_api.rb +2 -2
- data/lib/vpndetection/api/database_wire_api.rb +2 -2
- data/lib/vpndetection/api/entitlement_wire_api.rb +2 -2
- data/lib/vpndetection/api/lookup_wire_api.rb +4 -4
- data/lib/vpndetection/api/organization_wire_api.rb +2 -2
- data/lib/vpndetection/api_client.rb +2 -2
- data/lib/vpndetection/api_error.rb +2 -2
- data/lib/vpndetection/api_model_base.rb +2 -2
- data/lib/vpndetection/bogon.rb +11 -2
- data/lib/vpndetection/cache.rb +31 -2
- data/lib/vpndetection/client.rb +4 -3
- data/lib/vpndetection/configuration.rb +2 -2
- data/lib/vpndetection/models/abuse_contact.rb +236 -0
- data/lib/vpndetection/models/account_create_apikey_request.rb +2 -2
- data/lib/vpndetection/models/account_created_apikey.rb +2 -2
- data/lib/vpndetection/models/account_org.rb +2 -2
- data/lib/vpndetection/models/account_org_ref.rb +2 -2
- data/lib/vpndetection/models/account_org_wrap.rb +2 -2
- data/lib/vpndetection/models/account_rc.rb +2 -2
- data/lib/vpndetection/models/account_revealed_apikey.rb +2 -2
- data/lib/vpndetection/models/account_user.rb +2 -2
- data/lib/vpndetection/models/apikey_detail.rb +2 -2
- data/lib/vpndetection/models/apikey_list.rb +2 -2
- data/lib/vpndetection/models/asn.rb +26 -6
- data/lib/vpndetection/models/batch_lookup_error.rb +2 -2
- data/lib/vpndetection/models/batch_lookup_request.rb +2 -2
- data/lib/vpndetection/models/batch_lookup_response.rb +2 -2
- data/lib/vpndetection/models/bit_torrent_detail.rb +241 -0
- data/lib/vpndetection/models/carrier_detail.rb +189 -0
- data/lib/vpndetection/models/class_detail.rb +2 -2
- data/lib/vpndetection/models/client_registration.rb +2 -2
- data/lib/vpndetection/models/client_registration_request.rb +2 -2
- data/lib/vpndetection/models/company.rb +213 -0
- data/lib/vpndetection/models/database.rb +2 -2
- data/lib/vpndetection/models/database_checksums_response.rb +2 -2
- data/lib/vpndetection/models/database_format.rb +2 -2
- data/lib/vpndetection/models/database_format_size.rb +2 -2
- data/lib/vpndetection/models/database_list.rb +2 -2
- data/lib/vpndetection/models/database_metadata.rb +2 -2
- data/lib/vpndetection/models/database_metadata_column.rb +2 -2
- data/lib/vpndetection/models/database_version.rb +2 -2
- data/lib/vpndetection/models/db_checksums.rb +2 -2
- data/lib/vpndetection/models/device_authorization.rb +2 -2
- data/lib/vpndetection/models/dns_resolver_detail.rb +199 -0
- data/lib/vpndetection/models/download.rb +2 -2
- data/lib/vpndetection/models/download_list.rb +2 -2
- data/lib/vpndetection/models/entitlement.rb +2 -2
- data/lib/vpndetection/models/entitlement_apikey.rb +2 -2
- data/lib/vpndetection/models/entitlement_error.rb +2 -2
- data/lib/vpndetection/models/entitlement_plan.rb +3 -3
- data/lib/vpndetection/models/entitlement_usage.rb +2 -2
- data/lib/vpndetection/models/error_envelope.rb +2 -2
- data/lib/vpndetection/models/identity.rb +2 -2
- data/lib/vpndetection/models/location.rb +107 -7
- data/lib/vpndetection/models/lookup_error.rb +2 -2
- data/lib/vpndetection/models/lookup_response.rb +185 -5
- data/lib/vpndetection/models/oauth_error.rb +2 -2
- data/lib/vpndetection/models/oauth_metadata.rb +2 -2
- data/lib/vpndetection/models/proxy_detail.rb +2 -2
- data/lib/vpndetection/models/pubproxy_detail.rb +2 -2
- data/lib/vpndetection/models/satellite_detail.rb +209 -0
- data/lib/vpndetection/models/smtp_detail.rb +189 -0
- data/lib/vpndetection/models/ssh_detail.rb +199 -0
- data/lib/vpndetection/models/standing.rb +2 -2
- data/lib/vpndetection/models/token_response.rb +2 -2
- data/lib/vpndetection/models/vpn_detail.rb +2 -2
- data/lib/vpndetection/models/web_detail.rb +517 -0
- data/lib/vpndetection/result.rb +182 -12
- data/lib/vpndetection/transport.rb +10 -0
- data/lib/vpndetection/version.rb +1 -1
- metadata +10 -1
data/lib/vpndetection/result.rb
CHANGED
|
@@ -13,26 +13,43 @@ module VPNDetection
|
|
|
13
13
|
# use the predicate (`hosting?`) when you only care whether the address is
|
|
14
14
|
# flagged. A predicate always answers `true` or `false`, never `nil`.
|
|
15
15
|
#
|
|
16
|
-
# A detail object that is present but empty (`{}`) means the
|
|
17
|
-
# false. A populated one always carries every one of its keys. Details are the
|
|
16
|
+
# A detail object that is present but empty (`{}`, or `web`'s `[]`) means the
|
|
17
|
+
# flag above it is false. A populated one always carries every one of its keys. Details are the
|
|
18
18
|
# wire hashes with their original string keys, so `result.vpn['provider']`.
|
|
19
19
|
class Result
|
|
20
20
|
FLAGS = %w[
|
|
21
21
|
is_vpn is_hosting is_relay is_tor is_cdn is_resproxy is_dcproxy is_mobproxy
|
|
22
|
-
is_pubproxy
|
|
22
|
+
is_pubproxy is_anycast is_carrier is_satellite is_ssh is_smtp is_web is_dns_resolver
|
|
23
|
+
is_bittorrent
|
|
23
24
|
].freeze
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
# The detail object behind each flag that has one; `is_anycast` has none.
|
|
27
|
+
DETAILS = %w[
|
|
28
|
+
vpn hosting relay tor cdn resproxy dcproxy mobproxy pubproxy carrier satellite ssh smtp dns_resolver
|
|
29
|
+
bittorrent
|
|
30
|
+
].freeze
|
|
31
|
+
|
|
32
|
+
# The details that are a list of rows rather than one object.
|
|
33
|
+
DETAIL_LISTS = %w[web].freeze
|
|
26
34
|
|
|
27
35
|
# Where the address is, and the AS announcing it: every answer carries both,
|
|
28
36
|
# with or without a key, each member present, an empty string or AS 0 where
|
|
29
|
-
# nothing is known.
|
|
37
|
+
# nothing is known. The location's finer members, from `region` down, are a
|
|
38
|
+
# paid plan's, and absent on an answer without them.
|
|
30
39
|
LOCATION = %w[
|
|
31
40
|
continent continent_name country country_name timezone currency_code currency_name currency_symbol
|
|
32
|
-
flag_emoji flag_unicode
|
|
41
|
+
flag_emoji flag_unicode region region_code city postal_code latitude longitude accuracy_radius
|
|
42
|
+
geoname_id dma_code last_changed
|
|
33
43
|
].freeze
|
|
34
44
|
|
|
35
|
-
ASN = %w[asn name domain type prefix].freeze
|
|
45
|
+
ASN = %w[asn name domain type prefix country rpki_status].freeze
|
|
46
|
+
|
|
47
|
+
# Who uses the address, and where to report abuse from it: a paid plan's,
|
|
48
|
+
# each member present whenever the object is, an empty string where no
|
|
49
|
+
# record covers the address.
|
|
50
|
+
COMPANY = %w[name domain type country].freeze
|
|
51
|
+
|
|
52
|
+
ABUSE = %w[email name phone address country network validated unvalidated_since].freeze
|
|
36
53
|
|
|
37
54
|
# The response exactly as it came off the wire, with its original names.
|
|
38
55
|
# Frozen, because the cache hands this same object to every later caller of
|
|
@@ -167,6 +184,95 @@ module VPNDetection
|
|
|
167
184
|
@raw['is_pubproxy'] == true
|
|
168
185
|
end
|
|
169
186
|
|
|
187
|
+
# Whether the address is announced from many places at once, as a public
|
|
188
|
+
# DNS resolver's or a CDN's edge is, or nil when your plan does not include
|
|
189
|
+
# it. Every answer, with or without a key.
|
|
190
|
+
def is_anycast
|
|
191
|
+
@raw['is_anycast']
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# `is_anycast` with an absent member read as false.
|
|
195
|
+
def anycast?
|
|
196
|
+
@raw['is_anycast'] == true
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Whether the address is a mobile carrier's, where many phones can share one
|
|
200
|
+
# address, or nil when your plan does not include it. On every paid plan.
|
|
201
|
+
def is_carrier
|
|
202
|
+
@raw['is_carrier']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# `is_carrier` with an absent member read as false.
|
|
206
|
+
def carrier?
|
|
207
|
+
@raw['is_carrier'] == true
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Whether the address is a satellite operator's, or nil when your plan does
|
|
211
|
+
# not include it. On every paid plan.
|
|
212
|
+
def is_satellite
|
|
213
|
+
@raw['is_satellite']
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# `is_satellite` with an absent member read as false.
|
|
217
|
+
def satellite?
|
|
218
|
+
@raw['is_satellite'] == true
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Whether an SSH server answered on the address, or nil when your plan does
|
|
222
|
+
# not include it. On every paid plan.
|
|
223
|
+
def is_ssh
|
|
224
|
+
@raw['is_ssh']
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# `is_ssh` with an absent member read as false.
|
|
228
|
+
def ssh?
|
|
229
|
+
@raw['is_ssh'] == true
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Whether a mail server answered on the address, or nil when your plan does
|
|
233
|
+
# not include it. On every paid plan.
|
|
234
|
+
def is_smtp
|
|
235
|
+
@raw['is_smtp']
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# `is_smtp` with an absent member read as false.
|
|
239
|
+
def smtp?
|
|
240
|
+
@raw['is_smtp'] == true
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Whether a web server answered on the address, on port 80 or 443, or nil
|
|
244
|
+
# when your plan does not include it. On every paid plan.
|
|
245
|
+
def is_web
|
|
246
|
+
@raw['is_web']
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# `is_web` with an absent member read as false.
|
|
250
|
+
def web?
|
|
251
|
+
@raw['is_web'] == true
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Whether an open DNS resolver answered on the address, or nil when your
|
|
255
|
+
# plan does not include it. On every paid plan.
|
|
256
|
+
def is_dns_resolver
|
|
257
|
+
@raw['is_dns_resolver']
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# `is_dns_resolver` with an absent member read as false.
|
|
261
|
+
def dns_resolver?
|
|
262
|
+
@raw['is_dns_resolver'] == true
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Whether a BitTorrent client was seen on the address in the last 90 days,
|
|
266
|
+
# or nil when your plan does not include it. On every paid plan.
|
|
267
|
+
def is_bittorrent
|
|
268
|
+
@raw['is_bittorrent']
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# `is_bittorrent` with an absent member read as false.
|
|
272
|
+
def bittorrent?
|
|
273
|
+
@raw['is_bittorrent'] == true
|
|
274
|
+
end
|
|
275
|
+
|
|
170
276
|
# Detail for `is_vpn`: provider, last_seen and confidence. Every paid plan.
|
|
171
277
|
# `method` is deprecated: no plan is answered with it since 2026-10-20.
|
|
172
278
|
def vpn
|
|
@@ -217,23 +323,87 @@ module VPNDetection
|
|
|
217
323
|
@raw['pubproxy']
|
|
218
324
|
end
|
|
219
325
|
|
|
326
|
+
# Detail for `is_carrier`: name, mcc, mnc, country and confidence. Every
|
|
327
|
+
# paid plan.
|
|
328
|
+
def carrier
|
|
329
|
+
@raw['carrier']
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Detail for `is_satellite`: provider, provider_name, orbit, segment,
|
|
333
|
+
# country, asn and confidence. Every paid plan.
|
|
334
|
+
def satellite
|
|
335
|
+
@raw['satellite']
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# Detail for `is_ssh`: port, banner, host_key_fp, session_ok, first_seen and
|
|
339
|
+
# last_seen. Every paid plan.
|
|
340
|
+
def ssh
|
|
341
|
+
@raw['ssh']
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
# Detail for `is_smtp`: port, banner, session_ok, first_seen and last_seen.
|
|
345
|
+
# Every paid plan.
|
|
346
|
+
def smtp
|
|
347
|
+
@raw['smtp']
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
# Detail for `is_web`: a row per port that answered, lowest first, and `[]`
|
|
351
|
+
# when the flag is false. Every paid plan.
|
|
352
|
+
def web
|
|
353
|
+
@raw['web']
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Detail for `is_dns_resolver`: port, recursion_available, rcode,
|
|
357
|
+
# answer_correct, first_seen and last_seen. Every paid plan.
|
|
358
|
+
def dns_resolver
|
|
359
|
+
@raw['dns_resolver']
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# Detail for `is_bittorrent`: verified, id_matches_ip, first_seen,
|
|
363
|
+
# last_seen, last_reachable, days_seen, num_ports, peak_num_ports, indexer
|
|
364
|
+
# and clients. Every paid plan.
|
|
365
|
+
def bittorrent
|
|
366
|
+
@raw['bittorrent']
|
|
367
|
+
end
|
|
368
|
+
|
|
220
369
|
# Where the address is: continent, country, timezone, the country's
|
|
221
370
|
# currency and flag, as a wire hash (`result.location['country']`). Every
|
|
222
|
-
# answer, with or without a key
|
|
371
|
+
# answer, with or without a key; the region, city, postal code, coordinates
|
|
372
|
+
# and the rest of the finer members on every paid plan.
|
|
223
373
|
def location
|
|
224
374
|
@raw['location']
|
|
225
375
|
end
|
|
226
376
|
|
|
227
|
-
# The AS announcing the address: asn, name, domain, type
|
|
228
|
-
#
|
|
377
|
+
# The AS announcing the address: asn, name, domain, type, prefix, the
|
|
378
|
+
# country its registry assigned it to and the announcement's RPKI status, as
|
|
379
|
+
# a wire hash (`result.asn['name']`), with asn 0 where none does. Every
|
|
229
380
|
# answer, with or without a key.
|
|
230
381
|
def asn
|
|
231
382
|
@raw['asn']
|
|
232
383
|
end
|
|
233
384
|
|
|
385
|
+
# Who uses the address: name, domain, type and country, as a wire hash.
|
|
386
|
+
# Every paid plan.
|
|
387
|
+
def company
|
|
388
|
+
@raw['company']
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# The name the address's reverse DNS (PTR) record points to, an empty string
|
|
392
|
+
# when it has none. Every answer, with or without a key.
|
|
393
|
+
def hostname
|
|
394
|
+
@raw['hostname']
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# Where to report abuse from the address: email, name, phone, address,
|
|
398
|
+
# country, network, validated and unvalidated_since, as a wire hash. Every
|
|
399
|
+
# paid plan.
|
|
400
|
+
def abuse
|
|
401
|
+
@raw['abuse']
|
|
402
|
+
end
|
|
403
|
+
|
|
234
404
|
# On answers to a key on the free plan only: false while its organization's
|
|
235
|
-
#
|
|
236
|
-
#
|
|
405
|
+
# trial of every field lasts, true once the answer has Unlimited's; nil on any
|
|
406
|
+
# other answer.
|
|
237
407
|
def trial_expired
|
|
238
408
|
@raw['trial_expired']
|
|
239
409
|
end
|
|
@@ -312,9 +312,19 @@ module VPNDetection
|
|
|
312
312
|
'ClassDetail' => [],
|
|
313
313
|
'ProxyDetail' => [],
|
|
314
314
|
'PubproxyDetail' => [],
|
|
315
|
+
'CarrierDetail' => [],
|
|
316
|
+
'SatelliteDetail' => [],
|
|
317
|
+
'SshDetail' => [],
|
|
318
|
+
'SmtpDetail' => [],
|
|
319
|
+
'WebDetail' => %i[port tls_ok session_ok status_code server location title cert_subject_cn
|
|
320
|
+
cert_subject_o cert_issuer_dn cert_browser_trusted tls_version first_seen last_seen],
|
|
321
|
+
'DnsResolverDetail' => [],
|
|
322
|
+
'BitTorrentDetail' => [],
|
|
315
323
|
'Location' => %i[continent continent_name country country_name timezone currency_code currency_name
|
|
316
324
|
currency_symbol flag_emoji flag_unicode],
|
|
317
325
|
'Asn' => %i[asn name domain type prefix],
|
|
326
|
+
'Company' => %i[name domain],
|
|
327
|
+
'AbuseContact' => %i[email],
|
|
318
328
|
'BatchLookupError' => %i[status error],
|
|
319
329
|
'Entitlement' => %i[org_id apikey plan usage],
|
|
320
330
|
'EntitlementApikey' => %i[id expires allowed_cidrs],
|
data/lib/vpndetection/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vpndetection
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.
|
|
4
|
+
version: 5.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mslm Dev
|
|
@@ -68,6 +68,7 @@ files:
|
|
|
68
68
|
- lib/vpndetection/middleware.rb
|
|
69
69
|
- lib/vpndetection/middleware/condition.rb
|
|
70
70
|
- lib/vpndetection/middleware/core.rb
|
|
71
|
+
- lib/vpndetection/models/abuse_contact.rb
|
|
71
72
|
- lib/vpndetection/models/account_create_apikey_request.rb
|
|
72
73
|
- lib/vpndetection/models/account_created_apikey.rb
|
|
73
74
|
- lib/vpndetection/models/account_org.rb
|
|
@@ -82,9 +83,12 @@ files:
|
|
|
82
83
|
- lib/vpndetection/models/batch_lookup_error.rb
|
|
83
84
|
- lib/vpndetection/models/batch_lookup_request.rb
|
|
84
85
|
- lib/vpndetection/models/batch_lookup_response.rb
|
|
86
|
+
- lib/vpndetection/models/bit_torrent_detail.rb
|
|
87
|
+
- lib/vpndetection/models/carrier_detail.rb
|
|
85
88
|
- lib/vpndetection/models/class_detail.rb
|
|
86
89
|
- lib/vpndetection/models/client_registration.rb
|
|
87
90
|
- lib/vpndetection/models/client_registration_request.rb
|
|
91
|
+
- lib/vpndetection/models/company.rb
|
|
88
92
|
- lib/vpndetection/models/database.rb
|
|
89
93
|
- lib/vpndetection/models/database_checksums_response.rb
|
|
90
94
|
- lib/vpndetection/models/database_format.rb
|
|
@@ -95,6 +99,7 @@ files:
|
|
|
95
99
|
- lib/vpndetection/models/database_version.rb
|
|
96
100
|
- lib/vpndetection/models/db_checksums.rb
|
|
97
101
|
- lib/vpndetection/models/device_authorization.rb
|
|
102
|
+
- lib/vpndetection/models/dns_resolver_detail.rb
|
|
98
103
|
- lib/vpndetection/models/download.rb
|
|
99
104
|
- lib/vpndetection/models/download_list.rb
|
|
100
105
|
- lib/vpndetection/models/entitlement.rb
|
|
@@ -111,9 +116,13 @@ files:
|
|
|
111
116
|
- lib/vpndetection/models/oauth_metadata.rb
|
|
112
117
|
- lib/vpndetection/models/proxy_detail.rb
|
|
113
118
|
- lib/vpndetection/models/pubproxy_detail.rb
|
|
119
|
+
- lib/vpndetection/models/satellite_detail.rb
|
|
120
|
+
- lib/vpndetection/models/smtp_detail.rb
|
|
121
|
+
- lib/vpndetection/models/ssh_detail.rb
|
|
114
122
|
- lib/vpndetection/models/standing.rb
|
|
115
123
|
- lib/vpndetection/models/token_response.rb
|
|
116
124
|
- lib/vpndetection/models/vpn_detail.rb
|
|
125
|
+
- lib/vpndetection/models/web_detail.rb
|
|
117
126
|
- lib/vpndetection/oauth_api.rb
|
|
118
127
|
- lib/vpndetection/result.rb
|
|
119
128
|
- lib/vpndetection/retries.rb
|