Class: ScopesExtractor
- Inherits:
-
Object
- Object
- ScopesExtractor
- Defined in:
- lib/scopes_extractor.rb,
lib/scopes_extractor/utilities.rb
Overview
Class entrypoint to start the extractions and initializes all the objects
Defined Under Namespace
Classes: Utilities
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#results ⇒ Object
Returns the value of attribute results.
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(options = {}) ⇒ ScopesExtractor
constructor
A new instance of ScopesExtractor.
Constructor Details
#initialize(options = {}) ⇒ ScopesExtractor
Returns a new instance of ScopesExtractor.
24 25 26 27 |
# File 'lib/scopes_extractor.rb', line 24 def initialize( = {}) @options = @results = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/scopes_extractor.rb', line 21 def @options end |
#results ⇒ Object
Returns the value of attribute results.
22 23 24 |
# File 'lib/scopes_extractor.rb', line 22 def results @results end |
Instance Method Details
#extract ⇒ Object
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 |
# File 'lib/scopes_extractor.rb', line 29 def extract Utilities.log_fatal('[-] The file containing the credentials is mandatory') unless [:credz_file] Dotenv.load([:credz_file]) if [:yeswehack] jwt = YesWeHack::Auth.jwt results['YesWeHack'] = {} YesWeHack::Programs.sync(results['YesWeHack'], , jwt) end if [:intigriti] token = Intigriti::Auth.token results['Intigriti'] = {} Intigriti::Programs.sync(results['Intigriti'], , token) end if [:bugcrowd] = Bugcrowd::Auth. results['Bugcrowd'] = {} Bugcrowd::Programs.sync(results['Bugcrowd'], , ) end if [:hackerone] results['Hackerone'] = {} Hackerone::Programs.sync(results['Hackerone'], ) end File.open('extract.json', 'w') { |f| f.write(JSON.pretty_generate(results)) } if [:save] results end |