Class: Pastenum::Pastee

Inherits:
Target
  • Object
show all
Defined in:
lib/pastenum/targets/pastee.rb

Instance Attribute Summary

Attributes inherited from Target

#dork, #max_pages, #raw, #raw_url, #results, #vendor, #verbose

Instance Method Summary collapse

Methods inherited from Target

#summary, #verify_ssl_mode, #verify_ssl_mode=

Constructor Details

#initialize(dork) ⇒ Pastee

Returns a new instance of Pastee.



12
13
14
15
16
17
# File 'lib/pastenum/targets/pastee.rb', line 12

def initialize(dork)
  @dork = dork
  @vendor = "https://pastee.org"

  super
end

Instance Method Details

#searchObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/pastenum/targets/pastee.rb', line 19

def search
  puts "[*] Searching Pastee.org (Limit: First #{@max_pages} Pages)".green if @verbose
  q = GScraper::Search.query(:query => @dork + " intitle:'Paste' ", :site => 'pastee.org')
  print "[*] Parsing pages:".green if @verbose
  begin
    for i in 1..@max_pages do
      print ".".green if @verbose
      page = q.page(i)
      page.each do |result|
        if result.url.to_s.match(/[0-9a-zA-Z]+$/)
          #code = result.url.to_s.split("/").last
          #code -> "9gxe6"
          @results << result.url.to_s
        end
      end
    end
  rescue
    raise TargetUnreachable, "[!] ERROR: Google search unreachable , Maybe the googles banned you?"
  end
  puts "\n" if @verbose
  return @results.uniq!
end