-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathscripts.rb
152 lines (96 loc) · 3.24 KB
/
scripts.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env ruby
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
token = ENV['INVESTIGATE_TOKEN']
if not token
puts "ERROR: environment variable 'INVESTIGATE_TOKEN' not set. Invoke script with 'INVESTIGATE_TOKEN=%YourToken% ruby scripts.rb'"
exit
end
# domains/categorization
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/domains/categorization/amazon.com', headers
puts "domains/categorization: " + response
# domains/categorization (POST)
values = '[
"google.com",
"yahoo.com"
]'
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.post 'https://investigate.api.umbrella.com/domains/categorization/ ', values, headers
puts "domains/categorization(POST): " + response
# domains/categorization?showLabels
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/domains/categorization/amazon.com?showLabels', headers
puts "domains/categorization?showLabels: " + response
# domains/categories
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/domains/categories', headers
puts "domains/categories: " + response
# domains/score
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/domains/score/example.com', headers
puts "domains/score: " + response
# domains/score (POST)
values = '[
"example.org",
"example.net",
"example.com"
]'
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.post 'https://investigate.api.umbrella.com/domains/score/', values, headers
puts "domains/score(POST): " + response
# recommendations/name
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/recommendations/name/www.internetbadguys.com.json', headers
puts "recommendations/name: " + response
# links/name
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/links/name/homestarrunner.com.json', headers
puts "links/name: " + response
# security/name
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/security/name/www.internetbadguys.com.json', headers
puts "security/name: " + response
# latest_tags
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/domains/www.internetbadguys.com/latest_tags', headers
puts "latest_tags: " + response
# dnsdb/name
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/dnsdb/name/a/homestarrunner.com.json', headers
puts "dnsdb/name: " + response
# dnsdb/ip
token = ENV['INVESTIGATE_TOKEN']
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/dnsdb/ip/a/208.67.222.222.json', headers
puts "dnsdb/ip: " + response
# latest_domains
headers = {
:authorization => 'Bearer ' + token
}
response = RestClient.get 'https://investigate.api.umbrella.com/ips/208.67.222.222/latest_domains', headers
puts "latest_domains: " + response