urlscan 0.7.0 → 0.8.0

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: 0d83b308d78e0bd41123a1a6d37a4cec0d947dcb97dc9a79176a44b142c1c00d
4
- data.tar.gz: 6912d1c6cbdc4099d1cd391b364c6e19ee98b9976ce0a6928c22ec333f43d33a
3
+ metadata.gz: 22f4d64dfca8b7ee22806108031b47a532dd3968e60afa641352c4a471647c51
4
+ data.tar.gz: a5b30512b61221b181e60e6712d327d92de34879b0268ea10b53cb2e0feb2748
5
5
  SHA512:
6
- metadata.gz: 447e4250c9f685716e981caccde9020c1c3f1f7cf6c00d89db553e541b174046cc3458800962e6fa8c1bcd407d6b5106cd20031864a5fcc63bde4aee30e29a8e
7
- data.tar.gz: 910c24d8f9457e0736b6b11604150af4fb644c396d7da9f285e63e6006ec492ae0fb24155c705169bb1e97afd5f6e1df143404cd8eee2783cbf0c7b5a445e1c0
6
+ metadata.gz: f41fc1f52104b46aa979e822bd11618888dcadefd0bdbfab98d8428621dad1583945cbcb3b80271f4db72023307bea6283bacc830963ba2941e7afde81d6e6ea
7
+ data.tar.gz: 829b96a975ac28e5417594e67644bc9578cd48c24ce92e349007a3f427659de05dbaa8e355da4c6b1f07458062efe06117a5c45e44bc74246fadac762209c54f
@@ -20,6 +20,4 @@ jobs:
20
20
  bundler-cache: true
21
21
  - name: Build and test with Rake
22
22
  run: |
23
- gem install bundler
24
- bundle install
25
23
  bundle exec rake
data/README.md CHANGED
@@ -40,22 +40,22 @@ res = api.search("wikipedia.org")
40
40
 
41
41
  ## Supported API endpoints
42
42
 
43
- | HTTP Method | URI | API method |
44
- |-------------|-------------------------|-----------------------------------------------------------------------|
45
- | POST | /scan | `UrlScan::Clients::Community#submit(url, is_public = true)` |
46
- | GET | /result/`uuid`/ | `UrlScan::Clients::Community#result(uuid)` |
47
- | GET | /dom/`uuid`/ | `UrlScan::Clients::Community#dom(uuid)` |
48
- | GET | /screenshots/`uuid`.png | `UrlScan::Clients::Community#screenshot(uuid)` |
49
- | GET | /search | `UrlScan::Clients::Community#search(q, size: 100, search_after: nil)` |
43
+ | HTTP Method | URI | API method |
44
+ |-------------|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
45
+ | POST | /scan | `UrlScan::Clients::Community#submit(url, customagent: nil, referer: nil, visibility: nil, tags: nil, override_safety: nil, country: nil))` |
46
+ | GET | /result/`uuid`/ | `UrlScan::Clients::Community#result(uuid)` |
47
+ | GET | /dom/`uuid`/ | `UrlScan::Clients::Community#dom(uuid)` |
48
+ | GET | /screenshots/`uuid`.png | `UrlScan::Clients::Community#screenshot(uuid)` |
49
+ | GET | /search | `UrlScan::Clients::Community#search(q, size: 100, search_after: nil)` |
50
50
 
51
51
  ### Pro
52
52
 
53
- | HTTP Method | URI | API method |
54
- |-------------|-------------------------|---------------------------------------|
55
- | GET | /brands | `UrlScan::Clients::Pro#brands` |
56
- | GET | /kits | `UrlScan::Clients::Pro#kits` |
57
- | GET | /phishfeed | `UrlScan::Clients::Pro#phishfeed` |
58
- | GET | /result/`uuid`/similar/ | `UrlScan::Clients::Pro#similar(uuid)` |
53
+ | HTTP Method | URI | API method |
54
+ |-------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
55
+ | GET | /brands | `UrlScan::Clients::Pro#brands` |
56
+ | GET | /kits | `UrlScan::Clients::Pro#kits` |
57
+ | GET | /phishfeed | `UrlScan::Clients::Pro#phishfeed(q: "result.task.time:>now-24h", format: "json", limit: ni)` |
58
+ | GET | /result/`uuid`/similar/ | `UrlScan::Clients::Pro#similar(uuid, q: nil, size: nil, search_after: nil, threshold: nil, min_size: nil, method: nil, resource_types: nil))` |
59
59
 
60
60
  ## CLI usage
61
61
 
@@ -4,8 +4,16 @@ module UrlScan
4
4
  module Clients
5
5
  class Community < Base
6
6
  # @return [Hash]
7
- def submit(url, is_public = true)
8
- params = { url: url, public: is_public ? "on" : "off" }
7
+ def submit(url, customagent: nil, referer: nil, visibility: nil, tags: nil, override_safety: nil, country: nil)
8
+ params = {
9
+ url: url,
10
+ customagent: customagent,
11
+ referer: referer,
12
+ visibility: visibility,
13
+ tags: tags,
14
+ overrideSafety: override_safety,
15
+ country: country
16
+ }.compact
9
17
  post("/scan/", params) { |json| json }
10
18
  end
11
19
 
@@ -17,14 +17,28 @@ module UrlScan
17
17
  end
18
18
 
19
19
  # @return [Hash]
20
- def phishfeed(q: "result.task.time:>now-24h", format: "json")
21
- params = { q: q, format: format }
20
+ def phishfeed(q: "result.task.time:>now-24h", format: "json", limit: nil)
21
+ params = { q: q, format: format, limit: limit }.compact
22
22
  get("/phishfeed", params) { |json| json }
23
23
  end
24
24
 
25
25
  # @return [Hash]
26
- def similar(uuid)
27
- get("/result/#{uuid}/similar/") { |json| json }
26
+ def similar(uuid, q: nil, size: nil, search_after: nil, threshold: nil, min_size: nil, method: nil, resource_types: nil)
27
+ params = {
28
+ q: q,
29
+ size: size,
30
+ search_after: search_after,
31
+ threshold: threshold,
32
+ minSize: min_size,
33
+ method: method,
34
+ resourceTypes: resource_types
35
+ }.compact
36
+ get("/result/#{uuid}/similar/", params) { |json| json }
37
+ end
38
+
39
+ # @return [Hash]
40
+ def scanners
41
+ get("/livescan/scanners/") { |json| json }
28
42
  end
29
43
 
30
44
  private
@@ -4,10 +4,23 @@ module UrlScan
4
4
  module Commands
5
5
  class Community < Base
6
6
  desc "submit [URL]", "submit a scan to [URL]"
7
- method_option :public, type: :boolean, default: true
7
+ method_option :customagent, type: :string
8
+ method_option :referer, type: :string
9
+ method_option :visibility, type: :string
10
+ method_option :tags, type: :array
11
+ method_option :override_safety, type: :string
12
+ method_option :country, type: :string
8
13
  def submit(url)
9
14
  with_error_handling do
10
- res = api.submit(url, options[:public])
15
+ res = api.submit(
16
+ url,
17
+ customagent: options[:customagent],
18
+ referer: options[:referer],
19
+ visibility: options[:visibility],
20
+ tags: options[:tags],
21
+ override_safety: options[:override_safety],
22
+ country: options[:country]
23
+ )
11
24
  puts JSON.pretty_generate(res)
12
25
  end
13
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UrlScan
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
data/urlscan.gemspec CHANGED
@@ -22,11 +22,11 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 2.2"
25
- spec.add_development_dependency "coveralls", "~> 0.8"
25
+ spec.add_development_dependency "coveralls_reborn", "~> 0.23"
26
26
  spec.add_development_dependency "rake", "~> 13.0"
27
27
  spec.add_development_dependency "rspec", "~> 3.10"
28
28
  spec.add_development_dependency "vcr", "~> 6.0"
29
- spec.add_development_dependency "webmock", "~> 3.12"
29
+ spec.add_development_dependency "webmock", "~> 3.14"
30
30
 
31
31
  spec.add_runtime_dependency "thor", "~> 1.1"
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urlscan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-17 00:00:00.000000000 Z
11
+ date: 2021-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: coveralls
28
+ name: coveralls_reborn
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.8'
33
+ version: '0.23'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.8'
40
+ version: '0.23'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.12'
89
+ version: '3.14'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.12'
96
+ version: '3.14'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: thor
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  requirements: []
160
- rubygems_version: 3.2.15
160
+ rubygems_version: 3.2.14
161
161
  signing_key:
162
162
  specification_version: 4
163
163
  summary: Ruby API client for urlscan.io