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 +4 -4
- data/.github/workflows/test.yml +0 -2
- data/README.md +13 -13
- data/lib/urlscan/clients/community.rb +10 -2
- data/lib/urlscan/clients/pro.rb +18 -4
- data/lib/urlscan/commands/community.rb +15 -2
- data/lib/urlscan/version.rb +1 -1
- data/urlscan.gemspec +2 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22f4d64dfca8b7ee22806108031b47a532dd3968e60afa641352c4a471647c51
|
4
|
+
data.tar.gz: a5b30512b61221b181e60e6712d327d92de34879b0268ea10b53cb2e0feb2748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f41fc1f52104b46aa979e822bd11618888dcadefd0bdbfab98d8428621dad1583945cbcb3b80271f4db72023307bea6283bacc830963ba2941e7afde81d6e6ea
|
7
|
+
data.tar.gz: 829b96a975ac28e5417594e67644bc9578cd48c24ce92e349007a3f427659de05dbaa8e355da4c6b1f07458062efe06117a5c45e44bc74246fadac762209c54f
|
data/.github/workflows/test.yml
CHANGED
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,
|
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,
|
8
|
-
params = {
|
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
|
|
data/lib/urlscan/clients/pro.rb
CHANGED
@@ -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
|
-
|
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 :
|
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(
|
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
|
data/lib/urlscan/version.rb
CHANGED
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 "
|
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.
|
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.
|
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
|
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:
|
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.
|
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.
|
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.
|
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.
|
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.
|
160
|
+
rubygems_version: 3.2.14
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Ruby API client for urlscan.io
|