Module: Ronin::Web::Dorks
- Includes:
- GScraper
- Defined in:
- lib/ronin/web/dorks/dorks.rb,
lib/ronin/web/dorks/index.rb,
lib/ronin/web/dorks/documents.rb
Class Method Summary collapse
- .all_strings_intext(strings, options = {}, &block) ⇒ Object
- .all_strings_intitle(strings, options = {}, &block) ⇒ Object
- .all_strings_inurl(strings, options = {}, &block) ⇒ Object
- .allintext(pattern, options = {}, &block) ⇒ Object
- .allintitle(patterns, options = {}, &block) ⇒ Object
- .allinurl(patterns, options = {}, &block) ⇒ Object
- .cps(options = {}, &block) ⇒ Object
- .download_file(options = {}, &block) ⇒ Object
- .download_pdf(options = {}, &block) ⇒ Object
- .emails_xls(options = {}, &block) ⇒ Object
- .index_for_finances_xls(options = {}, &block) ⇒ Object
- .index_of(path = nil, options = {}, &block) ⇒ Object
- .index_of_cgi_bin(options = {}, &block) ⇒ Object
- .index_with_file(name, options = {}, &block) ⇒ Object
- .index_with_sql(options = {}, &block) ⇒ Object
- .intext(pattern, options = {}, &block) ⇒ Object
- .intitle(pattern, options = {}, &block) ⇒ Object
- .inurl(pattern, options = {}, &block) ⇒ Object
- .php_my_admin(options = {}, &block) ⇒ Object
- .qbw(options = {}, &block) ⇒ Object
- .receipts(options = {}, &block) ⇒ Object
- .robots_txt(options = {}, &block) ⇒ Object
-
.search(options = {}, &block) ⇒ Object
Creates either a
GScraper::Search::WebQuery
or aGScraper::Search::AJAXQuery
with the given options. - .sharepoint(options = {}, &block) ⇒ Object
- .sql_admin_dump(options = {}, &block) ⇒ Object
- .sql_dump(options = {}, &block) ⇒ Object
- .string_intext(string, options = {}, &block) ⇒ Object
- .string_intitle(string, options = {}, &block) ⇒ Object
- .string_inurl(string, options = {}, &block) ⇒ Object
- .vuln_report(options = {}, &block) ⇒ Object
Class Method Details
.all_strings_intext(strings, options = {}, &block) ⇒ Object
120 121 122 123 124 |
# File 'lib/ronin/web/dorks/dorks.rb', line 120 def Dorks.all_strings_intext(strings,={},&block) Dorks.search(.merge(:allintext => strings.map { |string| "'#{string}'" }),&block) end |
.all_strings_intitle(strings, options = {}, &block) ⇒ Object
138 139 140 141 142 |
# File 'lib/ronin/web/dorks/dorks.rb', line 138 def Dorks.all_strings_intitle(strings,={},&block) Dorks.search(.merge(:allintitle => strings.map { |string| "'#{string}'" }),&block) end |
.all_strings_inurl(strings, options = {}, &block) ⇒ Object
156 157 158 159 160 |
# File 'lib/ronin/web/dorks/dorks.rb', line 156 def Dorks.all_strings_inurl(strings,={},&block) Dorks.search(.merge(:allinurl => strings.map { |string| "'#{string}'" }),&block) end |
.allintext(pattern, options = {}, &block) ⇒ Object
112 113 114 |
# File 'lib/ronin/web/dorks/dorks.rb', line 112 def Dorks.allintext(pattern,={},&block) Dorks.search(.merge(:allintext => pattern),&block) end |
.allintitle(patterns, options = {}, &block) ⇒ Object
134 135 136 |
# File 'lib/ronin/web/dorks/dorks.rb', line 134 def Dorks.allintitle(patterns,={},&block) Dorks.search(.merge(:allintitle => patterns),&block) end |
.allinurl(patterns, options = {}, &block) ⇒ Object
152 153 154 |
# File 'lib/ronin/web/dorks/dorks.rb', line 152 def Dorks.allinurl(patterns,={},&block) Dorks.search(.merge(:allinurl => patterns),&block) end |
.cps(options = {}, &block) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/ronin/web/dorks/documents.rb', line 27 def Dorks.cps(={},&block) Dorks.search(.merge( :exact_phrase => 'Certificate Practice Statement', :inurl => '(PDF | DOC)' ),&block) end |
.download_file(options = {}, &block) ⇒ Object
202 203 204 205 206 |
# File 'lib/ronin/web/dorks/dorks.rb', line 202 def Dorks.download_file(={},&block) Dorks.search(.merge( :allinurl => ['download.php?', 'file'] ),&block) end |
.download_pdf(options = {}, &block) ⇒ Object
208 209 210 211 212 213 214 215 216 |
# File 'lib/ronin/web/dorks/dorks.rb', line 208 def Dorks.download_pdf(={},&block) Dorks.search(.merge( :allinurl => [ 'download.php?', 'file', '.pdf' ] ),&block) end |
.emails_xls(options = {}, &block) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/ronin/web/dorks/documents.rb', line 55 def Dorks.emails_xls(={},&block) Dorks.search(.merge( :filetype => 'xls', :inurl => '"email.xls"' ),&block) end |
.index_for_finances_xls(options = {}, &block) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/ronin/web/dorks/index.rb', line 49 def Dorks.index_for_finances_xls(={},&block) Dorks.search(.merge( :query => 'finances.xls', :intitle => '"Index of"' ),&block) end |
.index_of(path = nil, options = {}, &block) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/ronin/web/dorks/index.rb', line 27 def Dorks.index_of(path=nil,={},&block) if path = .merge(:intitle => "\"Index of #{path}\"") else = .merge(:intitle => '"Index of"') end return Dorks.search(,&block) end |
.index_of_cgi_bin(options = {}, &block) ⇒ Object
37 38 39 |
# File 'lib/ronin/web/dorks/index.rb', line 37 def Dorks.index_of_cgi_bin(={},&block) Dorks.index_of('/cgi-bin',&block) end |
.index_with_file(name, options = {}, &block) ⇒ Object
41 42 43 |
# File 'lib/ronin/web/dorks/index.rb', line 41 def Dorks.index_with_file(name,={},&block) Dorks.index_of(.merge(:intext => "\"#{name}\""),&block) end |
.index_with_sql(options = {}, &block) ⇒ Object
45 46 47 |
# File 'lib/ronin/web/dorks/index.rb', line 45 def Dorks.index_with_sql(={},&block) Dorks.index_of(.merge(:intext => '".sql"'),&block) end |
.intext(pattern, options = {}, &block) ⇒ Object
108 109 110 |
# File 'lib/ronin/web/dorks/dorks.rb', line 108 def Dorks.intext(pattern,={},&block) Dorks.search(.merge(:intext => pattern),&block) end |
.intitle(pattern, options = {}, &block) ⇒ Object
126 127 128 |
# File 'lib/ronin/web/dorks/dorks.rb', line 126 def Dorks.intitle(pattern,={},&block) Dorks.search(.merge(:intitle => pattern),&block) end |
.inurl(pattern, options = {}, &block) ⇒ Object
144 145 146 |
# File 'lib/ronin/web/dorks/dorks.rb', line 144 def Dorks.inurl(pattern,={},&block) Dorks.search(.merge(:inurl => pattern),&block) end |
.php_my_admin(options = {}, &block) ⇒ Object
194 195 196 197 198 199 200 |
# File 'lib/ronin/web/dorks/dorks.rb', line 194 def Dorks.php_my_admin(={},&block) Dorks.search(.merge( :with_words => ['phpMyAdmin'], :exact_phrase => 'running on', :inurl => 'main.php' ),&block) end |
.qbw(options = {}, &block) ⇒ Object
48 49 50 51 52 53 |
# File 'lib/ronin/web/dorks/documents.rb', line 48 def Dorks.qbw(={},&block) Dorks.search(.merge( :query => 'qbw', :filetype => 'QBW' ),&block) end |
.receipts(options = {}, &block) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/ronin/web/dorks/documents.rb', line 40 def Dorks.receipts(={},&block) Dorks.search(.merge( :exact_phrase => 'Thank you for your order', :with_words => ['receipt'], :filetype => :pdf ),&block) end |
.robots_txt(options = {}, &block) ⇒ Object
186 187 188 189 190 191 192 |
# File 'lib/ronin/web/dorks/dorks.rb', line 186 def Dorks.robots_txt(={},&block) Dorks.search(.merge( :exact_phrase => 'robots.txt', :with_words => ['Disallow'], :filetype => :txt ),&block) end |
.search(options = {}, &block) ⇒ Object
Creates either a GScraper::Search::WebQuery
or a GScraper::Search::AJAXQuery
with the given options. If a block is given, it will be passed the newly created query object.
options may contain the following keys:
:ajax
-
Specifies wether or not to create a
GScraper::Search::AJAXQuery
. :query
-
The search query.
:link
-
Search for results which link to the specified URI.
:related
-
Search for results which relate to the specified URI.
:info
-
Return information about the specified URI.
:site
-
Limit results to the specified site.
:filetype
-
Limit results to those with the specified file-type.
:allintitle
-
Search for results with all of the keywords appearing in the title.
:intitle
-
Search for results with the keyword appearing in the title.
:allintext
-
Search for results with all of the keywords appearing in the text.
:intext
-
Search for results with the keyword appearing in the text.
:allinanchor
-
Search for results with all of the keywords appearing in the text of links.
:inanchor
-
Search for results with the keyword appearing in the text of links.
:exact_phrase
-
Search for results containing the specified exact phrase.
:with_words
-
Search for results containing all of the specified words.
:without_words
-
Search for results not containing any of the specified words.
:numeric_range
-
Search for results contain numbers that fall within the specified Range.
:define
-
Search for results containing the definition of the specified keyword.
If the :ajax
option is not specified, then options may contain the following additional keys:
:results_per_page
-
Specifies the number of results for each page.
:language
-
Search for results in the specified language.
:region
-
Search for results from the specified region.
:within_past_day
-
Search for results that were created within the past day.
:within_past_week
-
Search for results that were created within the past week.
:within_past_month
-
Search for results that were created within the past month.
:within_past_year
-
Search for results that were created within the past year.
:occurrs_within
:rights
-
Search for results licensed under the specified license.
:filtered
-
Specifies whether or not to use SafeSearch. Defaults to
false
, if not specified.
If the :ajax
option is specified, then options may contain the following additional keys:
:language
-
The search language. Defaults to
:en
. :sig
-
The search signature. Defaults to
582c1116317355adf613a6a843f19ece
. :key
-
The search key. Defaults to
:notsupplied
. :version
-
The desired API version. Defaults to
1.0
.
100 101 102 103 104 105 106 |
# File 'lib/ronin/web/dorks/dorks.rb', line 100 def Dorks.search(={},&block) if [:ajax] == true return Search.ajax_query(,&block) else return Search.query(,&block) end end |
.sharepoint(options = {}, &block) ⇒ Object
218 219 220 221 222 |
# File 'lib/ronin/web/dorks/dorks.rb', line 218 def Dorks.sharepoint(={},&block) Dorks.search(.merge( :exact_phrase => 'all site content' ),&block) end |
.sql_admin_dump(options = {}, &block) ⇒ Object
182 183 184 |
# File 'lib/ronin/web/dorks/dorks.rb', line 182 def Dorks.sql_admin_dump(={},&block) Dorks.sql_dump(.merge(:password => 'admin'),&block) end |
.sql_dump(options = {}, &block) ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/ronin/web/dorks/dorks.rb', line 162 def Dorks.sql_dump(={},&block) query = [] query << "Host: #{[:host]}" if [:host] query << "Database: #{[:database]}" if [:database] query << [:version] if [:version] query << "\"#{[:sql]}\"" if [:sql] if [:password] query << Digest::MD5.hexdigest([:password].to_s) end return Dorks.search(.merge( :query => query, :exact_phrase => '"SQL Dump"', :filetype => :sql ),&block) end |
.string_intext(string, options = {}, &block) ⇒ Object
116 117 118 |
# File 'lib/ronin/web/dorks/dorks.rb', line 116 def Dorks.string_intext(string,={},&block) Dorks.intext("'#{string}'",,&block) end |
.string_intitle(string, options = {}, &block) ⇒ Object
130 131 132 |
# File 'lib/ronin/web/dorks/dorks.rb', line 130 def Dorks.string_intitle(string,={},&block) Dorks.intitle("'#{string}'",,&block) end |