ronin-scanners 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ === 0.1.2 / 2009-02-08
2
+
3
+ * Added a Rubyful interface to the Nikto web scanner:
4
+ * Ronin::Scanners::Nikto.
5
+ * Ronin::Scanners::NiktoTask.
6
+
1
7
  === 0.1.1 / 2009-01-09
2
8
 
3
9
  * Require ScanDB >= 0.1.3 for the latest bug fixes.
@@ -2,9 +2,14 @@ History.txt
2
2
  Manifest.txt
3
3
  README.txt
4
4
  Rakefile
5
+ bin/ronin-scanners
5
6
  lib/ronin/scanners.rb
6
7
  lib/ronin/scanners/nmap.rb
7
- lib/ronin/scanners/nmap_task.rb
8
+ lib/ronin/scanners/nmap/nmap.rb
9
+ lib/ronin/scanners/nmap/nmap_task.rb
10
+ lib/ronin/scanners/nikto.rb
11
+ lib/ronin/scanners/nikto/nikto.rb
12
+ lib/ronin/scanners/nikto/nikto_task.rb
8
13
  lib/ronin/scanners/version.rb
9
14
  tasks/spec.rb
10
15
  spec/spec_helper.rb
data/README.txt CHANGED
@@ -41,17 +41,49 @@ of Ronin.
41
41
 
42
42
  * Provides a Rubyful interface to Nmap.
43
43
  * Allows for recording of Nmap scan results using ScanDB.
44
+ * Provides a Rubyful interface to Nikto.
44
45
 
45
46
  == REQUIREMENTS:
46
47
 
47
- * Scandb
48
- * RProgram >= 0.1.4
49
- * Ronin >= 0.1.2
48
+ * {scandb}[http://scandb.rubyforge.org/]
49
+ * {rprogram}[http://rprogram.rubyforge.org/] >= 0.1.4
50
+ * {ronin}[http://ronin.rubyforge.org/] >= 0.1.2
50
51
 
51
52
  == INSTALL:
52
53
 
53
54
  $ sudo gem install ronin-scanners
54
55
 
56
+ == SYNOPSIS:
57
+
58
+ * Start the Ronin console with Ronin Scanners preloaded:
59
+
60
+ $ ronin-scanners
61
+
62
+ == EXAMPLES:
63
+
64
+ * Calling Nmap from Ruby:
65
+
66
+ require 'ronin/scanners/nmap'
67
+
68
+ Scanners::Nmap.scan(:targets => 'www.google.com', :ports => [80,21,25], :service_scan => true)
69
+ # Starting Nmap 4.68 ( http://nmap.org ) at 2009-01-09 16:51 PST
70
+ # Interesting ports on mh-in-f99.google.com (209.85.173.99):
71
+ # PORT STATE SERVICE VERSION
72
+ # 21/tcp filtered ftp
73
+ # 25/tcp filtered smtp
74
+ # 80/tcp open http Google httpd 1.3 (GFE)
75
+ # Service Info: OS: Linux
76
+ #
77
+ # Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
78
+ # Nmap done: 1 IP address (1 host up) scanned in 11.627 seconds
79
+ # => nil
80
+
81
+ * Calling Nikto from Ruby:
82
+
83
+ require 'ronin/scanners/nikto'
84
+
85
+ Scanners::Nikto.scan(:host => 'www.example.com')
86
+
55
87
  == LICENSE:
56
88
 
57
89
  Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+
5
+ require 'ronin/ui/command_line/commands/default'
6
+ require 'ronin/ui/console'
7
+
8
+ Ronin::UI::Console.auto_load << 'ronin/scanners'
9
+ Ronin::UI::CommandLine::DefaultCommand.run(*ARGV)
@@ -22,4 +22,5 @@
22
22
  #
23
23
 
24
24
  require 'ronin/scanners/nmap'
25
+ require 'ronin/scanners/nikto'
25
26
  require 'ronin/scanners/version'
@@ -0,0 +1,25 @@
1
+ #
2
+ #--
3
+ # Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
4
+ # various third-party security scanners.
5
+ #
6
+ # Copyright (c) 2008-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of the GNU General Public License as published by
10
+ # the Free Software Foundation; either version 2 of the License, or
11
+ # (at your option) any later version.
12
+ #
13
+ # This program is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with this program; if not, write to the Free Software
20
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
+ #++
22
+ #
23
+
24
+ require 'ronin/scanners/nikto/nikto_task'
25
+ require 'ronin/scanners/nikto/nikto'
@@ -0,0 +1,54 @@
1
+ #
2
+ #--
3
+ # Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
4
+ # various third-party security scanners.
5
+ #
6
+ # Copyright (c) 2008-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of the GNU General Public License as published by
10
+ # the Free Software Foundation; either version 2 of the License, or
11
+ # (at your option) any later version.
12
+ #
13
+ # This program is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with this program; if not, write to the Free Software
20
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
+ #++
22
+ #
23
+
24
+ require 'ronin/scanners/nikto/nikto_task'
25
+
26
+ require 'rprogram/program'
27
+
28
+ module Ronin
29
+ module Scanners
30
+ class Nikto < RProgram::Program
31
+
32
+ name_program 'nikto'
33
+ alias_program 'nikto.pl'
34
+
35
+ #
36
+ # Perform a Nikto scan using the given _options_ and _block_.
37
+ # If a _block_ is given, it will be passed a newly created
38
+ # NiktoTask object.
39
+ #
40
+ def self.scan(options={},&block)
41
+ self.find.scan(options,&block)
42
+ end
43
+
44
+ #
45
+ # Perform a Nikto scan using the given _options_ and _block_.
46
+ # If a _block_ is given, it will be passed a newly created
47
+ # NiktoTask object.
48
+ #
49
+ def scan(options={},&block)
50
+ run_task(NiktoTask.new(options,&block))
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,183 @@
1
+ #
2
+ #--
3
+ # Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
4
+ # various third-party security scanners.
5
+ #
6
+ # Copyright (c) 2008-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of the GNU General Public License as published by
10
+ # the Free Software Foundation; either version 2 of the License, or
11
+ # (at your option) any later version.
12
+ #
13
+ # This program is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with this program; if not, write to the Free Software
20
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
+ #++
22
+ #
23
+
24
+ require 'rprogram/task'
25
+
26
+ module Ronin
27
+ module Scanners
28
+ #
29
+ # == Nikto options:
30
+ # <tt>-h</tt>:: <tt>nikto.host</tt>
31
+ # <tt>-config</tt>:: <tt>nikto.config</tt>
32
+ # <tt>-Cgidirs</tt>:: <tt>nikto.cgi_dirs</tt>
33
+ # <tt>-cookies</tt>:: <tt>nikto.print_cookies</tt>
34
+ # <tt>-evasion</tt>:: <tt>nikto.evasion</tt>
35
+ # <tt>-findonly</tt>:: <tt>nikto.evasion</tt>
36
+ # <tt>-Format</tt>:: <tt>nikto.format</tt>
37
+ # <tt>-generic</tt>:: <tt>nikto.full_scan</tt>
38
+ # <tt>-id</tt>:: <tt>nikto.http_auth</tt>
39
+ # <tt>-mutate</tt>:: <tt>nikto.mutate_checks</tt>
40
+ # <tt>-nolookup</tt>:: <tt>nikto.no_lookup</tt>
41
+ # <tt>-output</tt>:: <tt>nikto.output</tt>
42
+ # <tt>-port</tt>:: <tt>nikto.port</tt>
43
+ # <tt>-root</tt>:: <tt>nikto.root</tt>
44
+ # <tt>-ssl</tt>:: <tt>nikto.ssl</tt>
45
+ # <tt>-timeout</tt>:: <tt>nikto.timeout</tt>
46
+ # <tt>-useproxy</tt>:: <tt>nikto.enable_proxy</tt>
47
+ # <tt>-vhost</tt>:: <tt>nikto.vhost</tt>
48
+ # <tt>-Version</tt>:: <tt>nikto.version</tt>
49
+ # <tt>-404</tt>:: <tt>nikto.not_found_message</tt>
50
+ # <tt>-dbcheck</tt>:: <tt>nikto.validate_checks</tt>
51
+ # <tt>-debug</tt>:: <tt>nikto.debug</tt>
52
+ # <tt>-update</tt>:: <tt>nikto.update</tt>
53
+ # <tt>-verbose</tt>:: <tt>nikto.verbose</tt>
54
+ #
55
+ class NiktoTask < RProgram::Task
56
+
57
+ short_option :flag => '-h', :name => :host
58
+ short_option :flag => '-config', :name => :config
59
+ short_option :flag => '-Cgidirs', :name => :cgi_dirs
60
+ short_option :flag => '-cookies', :name => :print_cookies
61
+ short_option :flag => '-evasion', :name => :evasion
62
+
63
+ #
64
+ # Enable random URI encoding.
65
+ #
66
+ def random_uri_encoding!
67
+ self.evasion ||= ''
68
+ self.evasion << '1'
69
+ end
70
+
71
+ #
72
+ # Enable adding self-referencing directories (<tt>/./</tt>) to the
73
+ # request.
74
+ #
75
+ def directory_self_reference!
76
+ self.evasion ||= ''
77
+ self.evasion << '2'
78
+ end
79
+
80
+ #
81
+ # Enable premature URL ending.
82
+ #
83
+ def premature_url_ending!
84
+ self.evasion ||= ''
85
+ self.evasion << '3'
86
+ end
87
+
88
+ #
89
+ # Enable prepend long random strings to the request.
90
+ #
91
+ def prepend_random_strings!
92
+ self.evasion ||= ''
93
+ self.evasion << '4'
94
+ end
95
+
96
+ #
97
+ # Enable fake parameters to files.
98
+ #
99
+ def fake_params_to_files!
100
+ self.evasion ||= ''
101
+ self.evasion << '5'
102
+ end
103
+
104
+ #
105
+ # Enable using a tab character as the request spacer, instead of
106
+ # spaces.
107
+ #
108
+ def tab_request_spacer!
109
+ self.evasion ||= ''
110
+ self.evasion << '6'
111
+ end
112
+
113
+ #
114
+ # Enable random case sensitivity.
115
+ #
116
+ def random_casing!
117
+ self.evasion ||= ''
118
+ self.evasion << '7'
119
+ end
120
+
121
+ #
122
+ # Enable use of Windows style directory separators
123
+ # (<tt>\\</tt> instead of <tt>/</tt>).
124
+ #
125
+ def windows_directories!
126
+ self.evasion ||= ''
127
+ self.evasion << '8'
128
+ end
129
+
130
+ #
131
+ # Enable session splicing.
132
+ #
133
+ def session_splicing!
134
+ self.evasion ||= ''
135
+ self.evasion << '9'
136
+ end
137
+
138
+ short_option :flag => '-findonly', :name => :only_find
139
+ short_option :flag => '-Format', :name => :format
140
+
141
+ #
142
+ # Sets the report format to +HTM+.
143
+ #
144
+ def html_format!
145
+ self.format = 'HTM'
146
+ end
147
+
148
+ #
149
+ # Sets the report format to +TXT+.
150
+ #
151
+ def text_format!
152
+ self.format = 'TXT'
153
+ end
154
+
155
+ #
156
+ # Sets the report format to +CVS+.
157
+ #
158
+ def csv_format!
159
+ self.format = 'CSV'
160
+ end
161
+
162
+ short_option :flag => '-generic', :name => :full_scan
163
+ short_option :flag => '-id', :name => :http_auth
164
+ short_option :flag => '-mutate', :name => :mutate_checks
165
+ short_option :flag => '-nolookup', :name => :no_lookup
166
+ short_option :flag => '-output', :name => :output
167
+ short_option :flag => '-port', :name => :port
168
+ short_option :flag => '-root', :name => :root
169
+ short_option :flag => '-ssl', :name => :ssl
170
+ short_option :flag => '-timeout', :name => :timeout
171
+ short_option :flag => '-useproxy', :name => :enable_proxy
172
+ short_option :flag => '-vhost', :name => :vhost
173
+ short_option :flag => '-Version', :name => :version
174
+
175
+ short_option :flag => '-404', :name => :not_found_message
176
+ short_option :flag => '-dbcheck', :name => :validate_checks
177
+ short_option :flag => '-debug', :name => :debug
178
+ short_option :flag => '-update', :name => :update
179
+ short_option :flag => '-verbose', :name => :verbose
180
+
181
+ end
182
+ end
183
+ end
@@ -21,50 +21,5 @@
21
21
  #++
22
22
  #
23
23
 
24
- require 'ronin/scanners/nmap_task'
25
-
26
- require 'rprogram/program'
27
- require 'scandb'
28
- require 'tempfile'
29
-
30
- module Ronin
31
- module Scanners
32
- class Nmap < RProgram::Program
33
-
34
- name_program 'nmap'
35
-
36
- #
37
- # Perform an Nmap scan using the given _options_ and _block_.
38
- #
39
- def self.scan(options={},&block)
40
- self.find.scan(options,&block)
41
- end
42
-
43
- #
44
- # Perform an Nmap scan using the given _options_ and _block_.
45
- #
46
- def scan(options={},&block)
47
- run_task(NmapTask.new(options,&block))
48
- end
49
-
50
- #
51
- # Perform an Nmap scan using the given _options_ and save
52
- # the resulting scan information into ScanDB. If a _block_ is given,
53
- # it will be passed each ScanDB::Host object from the scan.
54
- #
55
- def import_scan(options={},&block)
56
- file = Tempfile.new('nmap',Config::TMP_DIR)
57
-
58
- # perform the scan
59
- scan(options.merge(:xml => file))
60
-
61
- # import the xml file into ScanDB
62
- hosts = ScanDB::Nmap.import_xml(file,&block)
63
-
64
- file.delete
65
- return hosts
66
- end
67
-
68
- end
69
- end
70
- end
24
+ require 'ronin/scanners/nmap/nmap_task'
25
+ require 'ronin/scanners/nmap/nmap'
@@ -0,0 +1,74 @@
1
+ #
2
+ #--
3
+ # Ronin Scanners - A Ruby library for Ronin that provides Ruby interfaces to
4
+ # various third-party security scanners.
5
+ #
6
+ # Copyright (c) 2008-2009 Hal Brodigan (postmodern.mod3 at gmail.com)
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of the GNU General Public License as published by
10
+ # the Free Software Foundation; either version 2 of the License, or
11
+ # (at your option) any later version.
12
+ #
13
+ # This program is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with this program; if not, write to the Free Software
20
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
+ #++
22
+ #
23
+
24
+ require 'ronin/scanners/nmap/nmap_task'
25
+
26
+ require 'rprogram/program'
27
+ require 'scandb'
28
+ require 'tempfile'
29
+
30
+ module Ronin
31
+ module Scanners
32
+ class Nmap < RProgram::Program
33
+
34
+ name_program 'nmap'
35
+
36
+ #
37
+ # Perform an Nmap scan using the given _options_ and _block_.
38
+ # If a _block_ is given, it will be passed a newly created
39
+ # NmapTask object.
40
+ #
41
+ def self.scan(options={},&block)
42
+ self.find.scan(options,&block)
43
+ end
44
+
45
+ #
46
+ # Perform an Nmap scan using the given _options_ and _block_.
47
+ # If a _block_ is given, it will be passed a newly created
48
+ # NmapTask object.
49
+ #
50
+ def scan(options={},&block)
51
+ run_task(NmapTask.new(options,&block))
52
+ end
53
+
54
+ #
55
+ # Perform an Nmap scan using the given _options_ and save
56
+ # the resulting scan information into ScanDB. If a _block_ is given,
57
+ # it will be passed each ScanDB::Host object from the scan.
58
+ #
59
+ def import_scan(options={},&block)
60
+ file = Tempfile.new('nmap',Config::TMP_DIR)
61
+
62
+ # perform the scan
63
+ scan(options.merge(:xml => file))
64
+
65
+ # import the xml file into ScanDB
66
+ hosts = ScanDB::Nmap.import_xml(file,&block)
67
+
68
+ file.delete
69
+ return hosts
70
+ end
71
+
72
+ end
73
+ end
74
+ end
@@ -23,6 +23,6 @@
23
23
 
24
24
  module Ronin
25
25
  module Scanners
26
- VERSION = '0.1.1'
26
+ VERSION = '0.1.2'
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-scanners
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-09 00:00:00 -08:00
12
+ date: 2009-02-08 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -50,13 +50,13 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 1.8.2
53
+ version: 1.8.3
54
54
  version:
55
55
  description: Ronin Scanners is a Ruby library for Ronin that provides Ruby interfaces to various third-party security scanners. Ronin is a Ruby platform designed for information security and data exploration tasks. Ronin allows for the rapid development and distribution of code over many of the common Source-Code-Management (SCM) systems.
56
56
  email:
57
57
  - postmodern.mod3@gmail.com
58
- executables: []
59
-
58
+ executables:
59
+ - ronin-scanners
60
60
  extensions: []
61
61
 
62
62
  extra_rdoc_files:
@@ -68,9 +68,14 @@ files:
68
68
  - Manifest.txt
69
69
  - README.txt
70
70
  - Rakefile
71
+ - bin/ronin-scanners
71
72
  - lib/ronin/scanners.rb
72
73
  - lib/ronin/scanners/nmap.rb
73
- - lib/ronin/scanners/nmap_task.rb
74
+ - lib/ronin/scanners/nmap/nmap.rb
75
+ - lib/ronin/scanners/nmap/nmap_task.rb
76
+ - lib/ronin/scanners/nikto.rb
77
+ - lib/ronin/scanners/nikto/nikto.rb
78
+ - lib/ronin/scanners/nikto/nikto_task.rb
74
79
  - lib/ronin/scanners/version.rb
75
80
  - tasks/spec.rb
76
81
  - spec/spec_helper.rb