ronin-scanners 0.1.4 → 1.0.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +4 -0
- data/.gemtest +0 -0
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/.yardopts +2 -0
- data/COPYING.txt +339 -0
- data/{History.txt → ChangeLog.md} +7 -7
- data/Gemfile +45 -0
- data/README.md +125 -0
- data/Rakefile +39 -14
- data/bin/ronin-scan-dork +20 -0
- data/bin/ronin-scan-nmap +20 -0
- data/bin/ronin-scan-proxies +20 -0
- data/bin/ronin-scan-spider +20 -0
- data/bin/ronin-scanner +20 -0
- data/bin/ronin-scanners +13 -5
- data/gemspec.yml +31 -0
- data/lib/ronin/database/migrations/scanners.rb +25 -0
- data/lib/ronin/database/migrations/scanners/1.0.0.rb +51 -0
- data/lib/ronin/scanners.rb +7 -5
- data/lib/ronin/scanners/dork.rb +173 -0
- data/lib/ronin/scanners/host_name_scanner.rb +67 -0
- data/lib/ronin/scanners/http_scanner.rb +195 -0
- data/lib/ronin/scanners/ip_scanner.rb +75 -0
- data/lib/ronin/scanners/nmap.rb +303 -5
- data/lib/ronin/scanners/{nikto/nikto.rb → proxies.rb} +11 -26
- data/lib/ronin/scanners/resolv_scanner.rb +73 -0
- data/lib/ronin/scanners/reverse_lookup_scanner.rb +76 -0
- data/lib/ronin/scanners/scanner.rb +371 -0
- data/lib/ronin/scanners/{nikto.rb → scanners.rb} +8 -5
- data/lib/ronin/scanners/site_map.rb +62 -0
- data/lib/ronin/scanners/spider.rb +117 -0
- data/lib/ronin/scanners/tcp_port_scanner.rb +72 -0
- data/lib/ronin/scanners/udp_port_scanner.rb +72 -0
- data/lib/ronin/scanners/url_scanner.rb +79 -0
- data/lib/ronin/scanners/version.rb +3 -4
- data/lib/ronin/ui/cli/commands/scan/dork.rb +39 -0
- data/lib/ronin/ui/cli/commands/scan/nmap.rb +105 -0
- data/lib/ronin/ui/cli/commands/scan/proxies.rb +82 -0
- data/lib/ronin/ui/cli/commands/scan/spider.rb +71 -0
- data/lib/ronin/ui/cli/commands/scanner.rb +43 -0
- data/lib/ronin/ui/cli/scanner_command.rb +118 -0
- data/ronin-scanners.gemspec +60 -0
- data/spec/scanners/host_name_scanner_spec.rb +24 -0
- data/spec/scanners/ip_scanner_spec.rb +24 -0
- data/spec/scanners/resolv_scanner_spec.rb +26 -0
- data/spec/scanners/reverse_lookup_scanner_spec.rb +26 -0
- data/spec/scanners/scanner_spec.rb +89 -0
- data/spec/scanners/scanners_spec.rb +9 -0
- data/spec/scanners/tcp_port_scanner_spec.rb +27 -0
- data/spec/scanners/udp_port_scanner_spec.rb +27 -0
- data/spec/scanners/url_scanner_spec.rb +37 -0
- data/spec/spec_helper.rb +4 -3
- metadata +261 -116
- data.tar.gz.sig +0 -1
- data/Manifest.txt +0 -16
- data/README.txt +0 -106
- data/lib/ronin/scanners/nikto/nikto_task.rb +0 -183
- data/lib/ronin/scanners/nmap/nmap.rb +0 -74
- data/lib/ronin/scanners/nmap/nmap_task.rb +0 -290
- data/spec/scanners_spec.rb +0 -11
- data/tasks/spec.rb +0 -9
- metadata.gz.sig +0 -0
data/Rakefile
CHANGED
@@ -1,19 +1,44 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
1
|
require 'rubygems'
|
4
|
-
require 'hoe'
|
5
|
-
require 'hoe/signing'
|
6
|
-
require './tasks/spec.rb'
|
7
2
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
begin
|
4
|
+
require 'bundler'
|
5
|
+
rescue LoadError => e
|
6
|
+
warn e.message
|
7
|
+
warn "Run `gem install bundler` to install Bundler."
|
8
|
+
exit -1
|
9
|
+
end
|
10
|
+
|
11
|
+
begin
|
12
|
+
Bundler.setup(:development)
|
13
|
+
rescue Bundler::BundlerError => e
|
14
|
+
warn e.message
|
15
|
+
warn "Run `bundle install` to install missing gems"
|
16
|
+
exit e.status_code
|
17
|
+
end
|
18
|
+
|
19
|
+
require 'rake'
|
20
|
+
|
21
|
+
require 'rubygems/tasks'
|
22
|
+
Gem::Tasks.new(:sign => {:checksum => true, :pgp => true}) do |tasks|
|
23
|
+
tasks.console.command = 'ripl'
|
24
|
+
tasks.console.options = %w[
|
25
|
+
-rripl/multi_line
|
26
|
+
-rripl/auto_indent
|
27
|
+
-rripl/color_result
|
16
28
|
]
|
17
29
|
end
|
18
30
|
|
19
|
-
|
31
|
+
require 'rspec/core/rake_task'
|
32
|
+
RSpec::Core::RakeTask.new
|
33
|
+
task :test => :spec
|
34
|
+
task :default => :spec
|
35
|
+
|
36
|
+
require 'dm-visualizer/rake/graphviz_task'
|
37
|
+
DataMapper::Visualizer::Rake::GraphVizTask.new(
|
38
|
+
:bundle => [:runtime],
|
39
|
+
:include => ['lib'],
|
40
|
+
:require => ['ronin/scanners']
|
41
|
+
)
|
42
|
+
|
43
|
+
require 'yard'
|
44
|
+
YARD::Rake::YardocTask.new
|
data/bin/ronin-scan-dork
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root,'.git'))
|
7
|
+
Dir.chdir(root) do
|
8
|
+
begin
|
9
|
+
require 'bundler/setup'
|
10
|
+
rescue LoadError => e
|
11
|
+
warn e.message
|
12
|
+
warn "Run `gem install bundler` to install Bundler"
|
13
|
+
exit -1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'ronin/ui/cli/commands/scan/dork'
|
19
|
+
|
20
|
+
Ronin::UI::CLI::Commands::Scan::Dork.start
|
data/bin/ronin-scan-nmap
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root,'.git'))
|
7
|
+
Dir.chdir(root) do
|
8
|
+
begin
|
9
|
+
require 'bundler/setup'
|
10
|
+
rescue LoadError => e
|
11
|
+
warn e.message
|
12
|
+
warn "Run `gem install bundler` to install Bundler"
|
13
|
+
exit -1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'ronin/ui/cli/commands/scan/nmap'
|
19
|
+
|
20
|
+
Ronin::UI::CLI::Commands::Scan::Nmap.start
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root,'.git'))
|
7
|
+
Dir.chdir(root) do
|
8
|
+
begin
|
9
|
+
require 'bundler/setup'
|
10
|
+
rescue LoadError => e
|
11
|
+
warn e.message
|
12
|
+
warn "Run `gem install bundler` to install Bundler"
|
13
|
+
exit -1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'ronin/ui/cli/commands/scan/proxies'
|
19
|
+
|
20
|
+
Ronin::UI::CLI::Commands::Scan::Proxies.start
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root,'.git'))
|
7
|
+
Dir.chdir(root) do
|
8
|
+
begin
|
9
|
+
require 'bundler/setup'
|
10
|
+
rescue LoadError => e
|
11
|
+
warn e.message
|
12
|
+
warn "Run `gem install bundler` to install Bundler"
|
13
|
+
exit -1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'ronin/ui/cli/commands/scan/spider'
|
19
|
+
|
20
|
+
Ronin::UI::CLI::Commands::Scan::Spider.start
|
data/bin/ronin-scanner
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root,'.git'))
|
7
|
+
Dir.chdir(root) do
|
8
|
+
begin
|
9
|
+
require 'bundler/setup'
|
10
|
+
rescue LoadError => e
|
11
|
+
warn e.message
|
12
|
+
warn "Run `gem install bundler` to install Bundler"
|
13
|
+
exit -1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'ronin/ui/cli/commands/scanner'
|
19
|
+
|
20
|
+
Ronin::UI::CLI::Commands::Scanner.start
|
data/bin/ronin-scanners
CHANGED
@@ -2,13 +2,21 @@
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
|
6
|
+
if File.directory?(File.join(root,'.git'))
|
7
|
+
Dir.chdir(root) do
|
8
|
+
begin
|
9
|
+
require 'bundler/setup'
|
10
|
+
rescue LoadError => e
|
11
|
+
warn e.message
|
12
|
+
warn "Run `gem install bundler` to install Bundler"
|
13
|
+
exit -1
|
14
|
+
end
|
15
|
+
end
|
8
16
|
end
|
9
17
|
|
10
|
-
require 'ronin/ui/command_line/commands/console'
|
11
18
|
require 'ronin/ui/console'
|
19
|
+
require 'ronin/ui/cli/commands/console'
|
12
20
|
|
13
21
|
Ronin::UI::Console.auto_load << 'ronin/scanners'
|
14
|
-
Ronin::UI::
|
22
|
+
Ronin::UI::CLI::Commands::Console.start
|
data/gemspec.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
name: ronin-scanners
|
2
|
+
summary:
|
3
|
+
A Ruby library for Ronin that provides Ruby interfaces to various
|
4
|
+
third-party security scanners.
|
5
|
+
|
6
|
+
description:
|
7
|
+
Ronin Scanners is a Ruby library for Ronin that provides Ruby interfaces
|
8
|
+
to various third-party security scanners.
|
9
|
+
|
10
|
+
license: GPL-2
|
11
|
+
authors: Postmodern
|
12
|
+
email: postmodern.mod3@gmail.com
|
13
|
+
homepage: http://ronin-ruby.github.com/scanners/
|
14
|
+
has_yard: true
|
15
|
+
|
16
|
+
dependencies:
|
17
|
+
open_namespace: ~> 0.3
|
18
|
+
# Ronin Scanners dependencies:
|
19
|
+
ruby-nmap: ~> 0.5
|
20
|
+
net-http-persistent: ~> 2.0
|
21
|
+
nokogiri: ~> 1.4
|
22
|
+
spidr: ~> 0.3
|
23
|
+
gscraper: ~> 0.4
|
24
|
+
# Ronin dependencies:
|
25
|
+
ronin-support: ~> 0.5
|
26
|
+
ronin: ~> 1.5
|
27
|
+
|
28
|
+
development_dependencies:
|
29
|
+
bundler: ~> 1.0
|
30
|
+
yard: ~> 0.7
|
31
|
+
yard-parameters: ~> 0.1
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#
|
2
|
+
# Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
|
3
|
+
# various third-party security scanners.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2008-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
|
6
|
+
#
|
7
|
+
# This program is free software; you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation; either version 2 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with this program; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/database/migrations/scanners/1.0.0'
|
23
|
+
require 'ronin/database/database'
|
24
|
+
|
25
|
+
Ronin::Database.upgrade!
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#
|
2
|
+
# Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
|
3
|
+
# various third-party security scanners.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2008-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
|
6
|
+
#
|
7
|
+
# This program is free software; you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation; either version 2 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with this program; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/database/migrations'
|
23
|
+
|
24
|
+
module Ronin
|
25
|
+
module Database
|
26
|
+
module Migrations
|
27
|
+
migration(
|
28
|
+
:create_scanners_table,
|
29
|
+
:needs => [:create_licenses_table, :create_script_paths_table]
|
30
|
+
) do
|
31
|
+
up do
|
32
|
+
create_table :ronin_scanners_scanners do
|
33
|
+
column :id, Integer, :serial => true
|
34
|
+
column :type, String, :not_null => true
|
35
|
+
column :name, String, :not_null => true
|
36
|
+
column :version, String, :default => '0.1'
|
37
|
+
column :description, Text
|
38
|
+
column :license_id, Integer
|
39
|
+
column :script_path_id, Integer
|
40
|
+
end
|
41
|
+
|
42
|
+
create_index :ronin_scanners_scanners, :name
|
43
|
+
end
|
44
|
+
|
45
|
+
down do
|
46
|
+
drop_table :ronin_scanners_scanners
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/ronin/scanners.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
#
|
2
|
-
#--
|
3
2
|
# Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
|
4
3
|
# various third-party security scanners.
|
5
4
|
#
|
6
|
-
# Copyright (c) 2008-
|
5
|
+
# Copyright (c) 2008-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
6
|
#
|
8
7
|
# This program is free software; you can redistribute it and/or modify
|
9
8
|
# it under the terms of the GNU General Public License as published by
|
@@ -18,9 +17,12 @@
|
|
18
17
|
# You should have received a copy of the GNU General Public License
|
19
18
|
# along with this program; if not, write to the Free Software
|
20
19
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
21
|
-
#++
|
22
20
|
#
|
23
21
|
|
24
|
-
require 'ronin/scanners
|
25
|
-
|
22
|
+
require 'ronin/database/migrations/scanners'
|
23
|
+
|
24
|
+
require 'ronin/scanners/scanners'
|
26
25
|
require 'ronin/scanners/version'
|
26
|
+
require 'ronin/config'
|
27
|
+
|
28
|
+
Ronin::Config.load :scanners
|
@@ -0,0 +1,173 @@
|
|
1
|
+
#
|
2
|
+
# Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
|
3
|
+
# various third-party security scanners.
|
4
|
+
#
|
5
|
+
# Copyright (c) 2008-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
|
6
|
+
#
|
7
|
+
# This program is free software; you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation; either version 2 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with this program; if not, write to the Free Software
|
19
|
+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/scanners/url_scanner'
|
23
|
+
|
24
|
+
require 'gscraper/search'
|
25
|
+
|
26
|
+
module Ronin
|
27
|
+
module Scanners
|
28
|
+
class Dork < URLScanner
|
29
|
+
|
30
|
+
# The query types and their `GScraper::Search::Query` classes
|
31
|
+
QUERY_TYPES = {
|
32
|
+
:web => GScraper::Search::WebQuery,
|
33
|
+
:ajax => GScraper::Search::AJAXQuery
|
34
|
+
}
|
35
|
+
|
36
|
+
# The host to submit queries to
|
37
|
+
parameter :search_host, :type => String,
|
38
|
+
:default => GScraper::Search::Query::DEFAULT_HOST,
|
39
|
+
:description => 'The host to submit queries to'
|
40
|
+
|
41
|
+
# The type of query to perform (`:web` or `:ajax`)
|
42
|
+
parameter :query_type, :type => Symbol,
|
43
|
+
:default => :web,
|
44
|
+
:description => "The type of query to perform ('web' or 'ajax')"
|
45
|
+
|
46
|
+
# Number of seconds to pause between queries
|
47
|
+
parameter :query_pause, :type => Integer,
|
48
|
+
:default => 2,
|
49
|
+
:description => 'Number of seconds to pause between queries'
|
50
|
+
|
51
|
+
# The raw query
|
52
|
+
parameter :raw_query, :type => String,
|
53
|
+
:description => 'The raw query'
|
54
|
+
|
55
|
+
# The search language
|
56
|
+
parameter :language, :type => String,
|
57
|
+
:description => 'The search language'
|
58
|
+
|
59
|
+
# Search 'link' modifier
|
60
|
+
parameter :link, :type => String,
|
61
|
+
:description => "Search 'link' modifier"
|
62
|
+
|
63
|
+
# Search 'related' modifier
|
64
|
+
parameter :related, :type => String,
|
65
|
+
:description => "Search 'related' modifier"
|
66
|
+
|
67
|
+
# Search 'info' modifier
|
68
|
+
parameter :info, :type => String,
|
69
|
+
:description => "Search 'info' modifier"
|
70
|
+
|
71
|
+
# Search 'site' modifier
|
72
|
+
parameter :site, :type => String,
|
73
|
+
:description => "Search 'site' modifier"
|
74
|
+
|
75
|
+
# Search 'filetype' modifier
|
76
|
+
parameter :filetype, :type => String,
|
77
|
+
:description => "Search 'filetype' modifier"
|
78
|
+
|
79
|
+
# Search 'allintitle' modifier
|
80
|
+
parameter :allintitle, :type => Array[String],
|
81
|
+
:description => "Search 'allintitle' modifier"
|
82
|
+
|
83
|
+
# Search 'intitle' modifier
|
84
|
+
parameter :intitle, :type => String,
|
85
|
+
:description => "Search 'intitle' modifier"
|
86
|
+
|
87
|
+
# Search 'allinurl' modifier
|
88
|
+
parameter :allinurl, :type => Array[String],
|
89
|
+
:description => "Search 'allinurl' modifier"
|
90
|
+
|
91
|
+
# Search 'inurl' modifier
|
92
|
+
parameter :inurl, :type => String,
|
93
|
+
:description => "Search 'inurl' modifier"
|
94
|
+
|
95
|
+
# Search 'allintext' modifier
|
96
|
+
parameter :allintext, :type => Array[String],
|
97
|
+
:description => "Search 'allintext' modifier"
|
98
|
+
|
99
|
+
# Search 'intext' modifier
|
100
|
+
parameter :intext, :type => String,
|
101
|
+
:description => "Search 'intext' modifier"
|
102
|
+
|
103
|
+
# Search for results containing the exact phrase
|
104
|
+
parameter :exact_phrase, :type => String,
|
105
|
+
:description => 'Search for results containing the exact phrase'
|
106
|
+
|
107
|
+
# Search for results with the words
|
108
|
+
parameter :with_words, :type => Array[String],
|
109
|
+
:description => 'Search for results with the words'
|
110
|
+
|
111
|
+
# Search for results with-out the words
|
112
|
+
parameter :without_words, :type => Array[String],
|
113
|
+
:description => 'Search for results with-out the words'
|
114
|
+
|
115
|
+
# Search for results containing the definitions of the keywords
|
116
|
+
parameter :define, :type => String,
|
117
|
+
:description => 'Search for results containing the definitions of the keywords'
|
118
|
+
|
119
|
+
# Search for results containing numbers between the range
|
120
|
+
parameter :numeric_range, :type => String,
|
121
|
+
:description => 'Search for results containing numbers between the range'
|
122
|
+
|
123
|
+
protected
|
124
|
+
|
125
|
+
def search_options
|
126
|
+
{
|
127
|
+
:search_host => self.search_host,
|
128
|
+
:query => self.raw_query,
|
129
|
+
:language => self.language,
|
130
|
+
:link => self.link,
|
131
|
+
:related => self.related,
|
132
|
+
:info => self.info,
|
133
|
+
:site => self.site,
|
134
|
+
:filetype => self.filetype,
|
135
|
+
:allintitle => self.allintitle,
|
136
|
+
:intitle => self.intitle,
|
137
|
+
:allinurl => self.allinurl,
|
138
|
+
:inurl => self.inurl,
|
139
|
+
:allintext => self.allintext,
|
140
|
+
:intext => self.intext,
|
141
|
+
:exact_phrase => self.exact_phrase,
|
142
|
+
:with_words => self.with_words,
|
143
|
+
:without_words => self.without_words,
|
144
|
+
:define => self.without_words,
|
145
|
+
:numeric_range => self.numeric_range
|
146
|
+
}
|
147
|
+
end
|
148
|
+
|
149
|
+
#
|
150
|
+
# Performs the Google Dork and passes back every URL from the search
|
151
|
+
# results.
|
152
|
+
#
|
153
|
+
# @yield [url]
|
154
|
+
# Every URL from every Page.
|
155
|
+
#
|
156
|
+
# @yieldparam [URI::HTTP] url
|
157
|
+
# A URL from the search results.
|
158
|
+
#
|
159
|
+
# @see http://rubydoc.info/gems/gscraper
|
160
|
+
#
|
161
|
+
def scan(&block)
|
162
|
+
QUERY_TYPES.fetch(self.query_type).new(search_options) do |search|
|
163
|
+
search.each do |page|
|
164
|
+
page.each_url(&block)
|
165
|
+
|
166
|
+
sleep(self.query_pause)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|