Class: Pastenum::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/pastenum/target.rb

Direct Known Subclasses

Gist, Github, Pastebin, Pastee, Pastie

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search_string) ⇒ Target

Returns a new instance of Target.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/pastenum/target.rb', line 7

def initialize(search_string)
  @dork ||= search_string
  
  @vendor ||= "TargetTemplate"
  @raw_url ||= "TargetRawTemplate"
  
  @results ||= Array.new
  @agent ||= Mechanize.new
  
  @raw ||= Pastenum::Defaults::Raw
  @verbose ||= Pastenum::Defaults::Verbose
  
  @max_pages ||= Pastenum::Defaults::MaxPages
end

Instance Attribute Details

#dorkObject (readonly)

Returns the value of attribute dork.



5
6
7
# File 'lib/pastenum/target.rb', line 5

def dork
  @dork
end

#max_pagesObject

Returns the value of attribute max_pages.



4
5
6
# File 'lib/pastenum/target.rb', line 4

def max_pages
  @max_pages
end

#rawObject

Returns the value of attribute raw.



4
5
6
# File 'lib/pastenum/target.rb', line 4

def raw
  @raw
end

#raw_urlObject (readonly)

Returns the value of attribute raw_url.



5
6
7
# File 'lib/pastenum/target.rb', line 5

def raw_url
  @raw_url
end

#resultsObject (readonly)

Returns the value of attribute results.



5
6
7
# File 'lib/pastenum/target.rb', line 5

def results
  @results
end

#vendorObject (readonly)

Returns the value of attribute vendor.



5
6
7
# File 'lib/pastenum/target.rb', line 5

def vendor
  @vendor
end

#verboseObject

Returns the value of attribute verbose.



4
5
6
# File 'lib/pastenum/target.rb', line 4

def verbose
  @verbose
end

Instance Method Details

#searchObject



30
31
32
# File 'lib/pastenum/target.rb', line 30

def search
  raise TargetTemplateErrorDirectCall
end

#summaryObject



34
35
36
37
38
39
40
# File 'lib/pastenum/target.rb', line 34

def summary
  if results.count == 0
    puts "[!] No Items Found on #{@vendor}, Try Harder".red if @verbose
  else
    puts "[*] Total Items found on #{@vendor}: #{@results.count}".green if @verbose
  end 
end

#verify_ssl_modeObject



22
23
24
# File 'lib/pastenum/target.rb', line 22

def verify_ssl_mode
  @agent.verify_mode
end

#verify_ssl_mode=(mode) ⇒ Object



26
27
28
# File 'lib/pastenum/target.rb', line 26

def verify_ssl_mode=(mode)
  @agent.verify_mode = mode
end