forked from kbcasurf/electrosphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopt_parser.rb
More file actions
executable file
·76 lines (63 loc) · 4.43 KB
/
opt_parser.rb
File metadata and controls
executable file
·76 lines (63 loc) · 4.43 KB
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
# frozen_string_literal: true
require 'optparse'
require 'ostruct'
module OptParser
attr_accessor :opts
def parse_opts(args)
@opts = OpenStruct.new
@opts.verbose = false
@opts.color = true
@opts.env = 'prd'
@opts.x_api_key = nil
@opts.project_id = nil
@opts.nuclei_output = nil
@opts.verify = false
@opts.file_name = Time.now.strftime("output.%m%d%Y_%H%M%S.json")
@opts.dirname = File.absolute_path(File.dirname(__FILE__))
@opts.unregistered_dir = File.join(Dir.tmpdir , 'unregistered')
opt_parser = OptionParser.new do |opts|
banner = <<-END
██████████ ████ █████ █████
░░███░░░░░█░░███ ░░███ ░░███
░███ █ ░ ░███ ██████ ██████ ███████ ████████ ██████ █████ ████████ ░███████ ██████ ████████ ██████
░██████ ░███ ███░░███ ███░░███░░░███░ ░░███░░███ ███░░███ ███░░ ░░███░░███ ░███░░███ ███░░███░░███░░███ ███░░███
░███░░█ ░███ ░███████ ░███ ░░░ ░███ ░███ ░░░ ░███ ░███░░█████ ░███ ░███ ░███ ░███ ░███████ ░███ ░░░ ░███████
░███ ░ █ ░███ ░███░░░ ░███ ███ ░███ ███ ░███ ░███ ░███ ░░░░███ ░███ ░███ ░███ ░███ ░███░░░ ░███ ░███░░░
██████████ █████░░██████ ░░██████ ░░█████ █████ ░░██████ ██████ ░███████ ████ █████░░██████ █████ ░░██████
░░░░░░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░███░░░ ░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░
░███
█████
░░░░░
Electrosphere is amazing microservice for registering
vulnerabilities found by nuclei on Conviso Platform
Developed by @rd-team
END
opts.banner = banner
opts.separator 'Options:'
opts.on('-v', '--[no-]verbose', 'Run verbosely') do |v|
@opts.verbose = v
end
opts.on('-n', '--[no-]color', 'Enable/disable coloring') do |v|
@opts.color = v
end
opts.on( '-e', '--env=ENV', ['prd', 'hml'], 'Environment to register findings, [prd, hml] defalt prd' ) do |env|
@opts.env = env
end
opts.on('-k', '--x_api_key=X_API_KEY', 'Conviso Plataform API KEY') do |x_api_key|
@opts.x_api_key = x_api_key
end
opts.on('-p', '--project_id=PROJECT_ID', 'Conviso Plataform project id') do |project_id|
@opts.project_id = project_id
end
opts.on('-i', '--nuclei_output=OUTPUT', 'Nuclei output in json format') do |nuclei_output|
@opts.nuclei_output = nuclei_output
end
opts.on('-h', '--help', 'Prints this help') do
puts opts
exit
end
end
opt_parser.parse!(args)
@opts
end
end