ronin-fuzzer 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b75ddebfc52f82912471833f168b9e8813af985b9443cb1c6b88a27b1c730a3b
4
- data.tar.gz: 7a0454d2ece994db0151eb7ed1df4ce0edf6ab2e05d48d12f13621930d66cd8d
3
+ metadata.gz: 0a103561af484214e0b8ab02e4da324be41eda5ebdb2eeee4d6b262125b23d19
4
+ data.tar.gz: a6db4705f1dff34a3539615feee23e5924a32136c2d0fe1b0af26c5f8dc2732f
5
5
  SHA512:
6
- metadata.gz: 508b1ede3b5ec7e9be7d1a9bccfab1add955ce60f028559d444613f6e485195ef52f95f293acab505a9493222b2ba31337901df3038a8bd2fee0a3b8668c8a43
7
- data.tar.gz: 65fdbda74f4b756e3378e1fbdc5ac533612a6aad873eff7b8b17bc0a0f1a94726bdb15525668f974f18b2a5d50feb2853077d8a8ba00040c64ed88b5a3352a3f
6
+ metadata.gz: 2da48ce9d52caa355992e4acaa196dbfe2b9d7f90dff7371939c154f884779f0fe612a4180faa92fcc6dc2d9a06f08093cd8efbf2ec81e53d6d37ef6a7e5f65a
7
+ data.tar.gz: b74295333b7749c2a7cfcde845ebcf3f19383e06a8aefe04337cd3a2761f2cf961120e980ad9b58ad26ab89716e03fd798fe658fb40d5052bffae1331e5e9d2f
data/.document CHANGED
@@ -2,4 +2,3 @@ lib/**/*.rb
2
2
  -
3
3
  ChangeLog.md
4
4
  COPYING.txt
5
- man/*.md
@@ -12,11 +12,12 @@ jobs:
12
12
  - '3.0'
13
13
  - '3.1'
14
14
  - '3.2'
15
+ - '3.3'
15
16
  - jruby
16
17
  - truffleruby
17
18
  name: Ruby ${{ matrix.ruby }}
18
19
  steps:
19
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v4
20
21
  - name: Set up Ruby
21
22
  uses: ruby/setup-ruby@v1
22
23
  with:
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /coverage
2
+ /data/completions/ronin-fuzzer
2
3
  /doc
3
4
  /pkg
4
5
  /man/*.[1-9]
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-3.1
1
+ ruby-3.3
data/ChangeLog.md CHANGED
@@ -1,4 +1,11 @@
1
- ### 0.1.0 / 2023-XX-XX
1
+ ### 0.2.0 / 2024-07-22
2
+
3
+ #### CLI
4
+
5
+ * Added the `ronin-fuzzer completion` command to install shell completion files
6
+ for all `ronin-fuzzer` commands for Bash and Zsh shells.
7
+
8
+ ### 0.1.0 / 2023-02-01
2
9
 
3
10
  * Initial release:
4
11
  * Require `ruby` >= 3.0.0.
data/Gemfile CHANGED
@@ -16,7 +16,7 @@ end
16
16
  # Ronin dependencies
17
17
  # gem 'ronin-support', '~> 1.0', github: "ronin-rb/ronin-support",
18
18
  # branch: 'main'
19
- # gem 'ronin-core', '~> 0.1', github: "ronin-rb/ronin-core",
19
+ # gem 'ronin-core', '~> 0.2', github: "ronin-rb/ronin-core",
20
20
  # branch: 'main'
21
21
 
22
22
  group :development do
@@ -28,7 +28,7 @@ group :development do
28
28
 
29
29
  gem 'kramdown', '~> 2.0'
30
30
  gem 'redcarpet', platform: :mri
31
- gem 'kramdown-man', '~> 0.1'
31
+ gem 'kramdown-man', '~> 1.0'
32
32
 
33
33
  gem 'yard', '~> 0.9'
34
34
  gem 'yard-spellcheck', require: false
@@ -36,4 +36,6 @@ group :development do
36
36
  gem 'dead_end', require: false
37
37
  gem 'sord', require: false, platform: :mri
38
38
  gem 'stackprof', require: false, platform: :mri
39
+
40
+ gem 'command_kit-completion', '~> 0.2', require: false
39
41
  end
data/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  * [Issues](https://github.com/ronin-rb/ronin-fuzzer/issues)
10
10
  * [Documentation](https://ronin-rb.dev/docs/ronin-fuzzer/frames)
11
11
  * [Discord](https://discord.gg/6WAb3PsVX9) |
12
- [Twitter](https://twitter.com/ronin_rb) |
13
12
  [Mastodon](https://infosec.exchange/@ronin_rb)
14
13
 
15
14
  ## Description
@@ -33,12 +32,26 @@ Fuzzes an input file and generates output bad files for testing:
33
32
  $ ronin-fuzzer fuzz -i http_request.txt -o bad.txt -r unix_path:bad_strings
34
33
  ```
35
34
 
35
+ ## Examples
36
+
37
+ Replace every `e`, `i`, `o`, `u` with `(`, 100 `A`s and a `\0`:
38
+
39
+ ```ruby
40
+ require 'ronin/fuzzing'
41
+
42
+ "the quick brown fox".fuzz(/[eiou]/ => ['(', ('A' * 100), "\0"]) do |str|
43
+ p str
44
+ end
45
+ ```
46
+
47
+ For more examples, please see the [API documentation](https://ronin-rb.dev/docs/ronin-fuzzer/String.html).
48
+
36
49
  ## Requirements
37
50
 
38
51
  * [Ruby] >= 3.0.0
39
52
  * [combinatorics] ~> 0.4
40
53
  * [ronin-support] ~> 1.0
41
- * [ronin-core] ~> 0.1
54
+ * [ronin-core] ~> 0.2
42
55
 
43
56
  ## Install
44
57
 
@@ -63,7 +76,7 @@ gem.add_dependency 'ronin-fuzzer', '~> 0.1'
63
76
  1. [Fork It!](https://github.com/ronin-rb/ronin-fuzzer/fork)
64
77
  2. Clone It!
65
78
  3. `cd ronin-fuzzer/`
66
- 4. `bundle install`
79
+ 4. `./scripts/setup`
67
80
  5. `git checkout -b my_feature`
68
81
  6. Code It!
69
82
  7. `bundle exec rake spec`
@@ -71,7 +84,7 @@ gem.add_dependency 'ronin-fuzzer', '~> 0.1'
71
84
 
72
85
  ## License
73
86
 
74
- Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3@gmail.com)
87
+ Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3@gmail.com)
75
88
 
76
89
  This file is part of ronin-fuzzer.
77
90
 
data/Rakefile CHANGED
@@ -32,3 +32,12 @@ task :docs => :yard
32
32
 
33
33
  require 'kramdown/man/task'
34
34
  Kramdown::Man::Task.new
35
+
36
+ require 'command_kit/completion/task'
37
+ CommandKit::Completion::Task.new(
38
+ class_file: 'ronin/fuzzer/cli',
39
+ class_name: 'Ronin::Fuzzer::CLI',
40
+ output_file: 'data/completions/ronin-fuzzer'
41
+ )
42
+
43
+ task :setup => %w[man command_kit:completion]
@@ -0,0 +1,55 @@
1
+ # ronin-fuzzer completion -*- shell-script -*-
2
+
3
+ # This bash completions script was generated by
4
+ # completely (https://github.com/dannyben/completely)
5
+ # Modifying it manually is not recommended
6
+
7
+ _ronin-fuzzer_completions_filter() {
8
+ local words="$1"
9
+ local cur=${COMP_WORDS[COMP_CWORD]}
10
+ local result=()
11
+
12
+ if [[ "${cur:0:1}" == "-" ]]; then
13
+ echo "$words"
14
+
15
+ else
16
+ for word in $words; do
17
+ [[ "${word:0:1}" != "-" ]] && result+=("$word")
18
+ done
19
+
20
+ echo "${result[*]}"
21
+
22
+ fi
23
+ }
24
+
25
+ _ronin-fuzzer_completions() {
26
+ local cur=${COMP_WORDS[COMP_CWORD]}
27
+ local compwords=("${COMP_WORDS[@]:1:$COMP_CWORD-1}")
28
+ local compline="${compwords[*]}"
29
+
30
+ case "$compline" in
31
+ 'fuzz'*'--input')
32
+ while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A file -- "$cur")
33
+ ;;
34
+
35
+ 'completion'*)
36
+ while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_ronin-fuzzer_completions_filter "--print --install --uninstall")" -- "$cur")
37
+ ;;
38
+
39
+ 'fuzz'*'-i')
40
+ while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -A file -- "$cur")
41
+ ;;
42
+
43
+ 'fuzz'*)
44
+ while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_ronin-fuzzer_completions_filter "--input -i --rules -r --output -o --command -c --tcp -t --udp -u --pause -p")" -- "$cur")
45
+ ;;
46
+
47
+ *)
48
+ while read -r; do COMPREPLY+=("$REPLY"); done < <(compgen -W "$(_ronin-fuzzer_completions_filter "--version -V help completion fuzz")" -- "$cur")
49
+ ;;
50
+
51
+ esac
52
+ } &&
53
+ complete -F _ronin-fuzzer_completions ronin-fuzzer
54
+
55
+ # ex: filetype=sh
data/gemspec.yml CHANGED
@@ -18,6 +18,8 @@ metadata:
18
18
  rubygems_mfa_required: 'true'
19
19
 
20
20
  generated_files:
21
+ - data/completions/ronin-fuzzer
22
+ - man/ronin-fuzzer-completion.1
21
23
  - man/ronin-fuzzer-fuzz.1
22
24
 
23
25
  required_ruby_version: ">= 3.0.0"
@@ -26,7 +28,7 @@ dependencies:
26
28
  combinatorics: ~> 0.4
27
29
  # Ronin dependencies:
28
30
  ronin-support: ~> 1.0
29
- ronin-core: ~> 0.1
31
+ ronin-core: ~> 0.2
30
32
 
31
33
  development_dependencies:
32
34
  bundler: ~> 2.0
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -0,0 +1,64 @@
1
+ #
2
+ # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
+ #
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
+ #
6
+ # This file is part of ronin-fuzzer.
7
+ #
8
+ # ronin-fuzzer is free software: you can redistribute it and/or modify
9
+ # it under the terms of the GNU Lesser General Public License as published
10
+ # by the Free Software Foundation, either version 3 of the License, or
11
+ # (at your option) any later version.
12
+ #
13
+ # ronin-fuzzer 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 Lesser General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU Lesser General Public License
19
+ # along with ronin-fuzzer. If not, see <https://www.gnu.org/licenses/>.
20
+ #
21
+
22
+ require 'ronin/fuzzer/root'
23
+ require 'ronin/core/cli/completion_command'
24
+
25
+ module Ronin
26
+ module Fuzzer
27
+ class CLI
28
+ module Commands
29
+ #
30
+ # Manages the shell completion rules for `ronin-fuzzer`.
31
+ #
32
+ # ## Usage
33
+ #
34
+ # ronin-fuzzer completion [options]
35
+ #
36
+ # ## Options
37
+ #
38
+ # --print Prints the shell completion file
39
+ # --install Installs the shell completion file
40
+ # --uninstall Uninstalls the shell completion file
41
+ # -h, --help Print help information
42
+ #
43
+ # ## Examples
44
+ #
45
+ # ronin-fuzzer completion --print
46
+ # ronin-fuzzer completion --install
47
+ # ronin-fuzzer completion --uninstall
48
+ #
49
+ # @since 0.2.0
50
+ #
51
+ class Completion < Core::CLI::CompletionCommand
52
+
53
+ completion_file File.join(ROOT,'data','completions','ronin-fuzzer')
54
+
55
+ man_dir File.join(ROOT,'man')
56
+ man_page 'ronin-fuzzer-completion.1'
57
+
58
+ description 'Manages the shell completion rules for ronin-fuzzer'
59
+
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -21,6 +21,10 @@
21
21
 
22
22
  require 'command_kit/commands'
23
23
  require 'command_kit/commands/auto_load'
24
+ require 'command_kit/options/version'
25
+
26
+ require 'ronin/core/cli/command'
27
+ require 'ronin/core/cli/help/banner'
24
28
 
25
29
  module Ronin
26
30
  module Fuzzer
@@ -31,8 +35,11 @@ module Ronin
31
35
  dir: "#{__dir__}/cli/commands",
32
36
  namespace: "#{self}::Commands"
33
37
  )
38
+ include CommandKit::Options::Version
39
+ include Core::CLI::Help::Banner
34
40
 
35
41
  command_name 'ronin-fuzzer'
42
+ version Ronin::Fuzzer::VERSION
36
43
 
37
44
  end
38
45
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -22,6 +22,6 @@
22
22
  module Ronin
23
23
  module Fuzzer
24
24
  # ronin-fuzzer version
25
- VERSION = '0.1.0'
25
+ VERSION = '0.2.0'
26
26
  end
27
27
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -33,7 +33,8 @@ class String
33
33
  #
34
34
  # @param [Array(<String,Symbol,Enumerable>, <Integer,Array,Range>)] fields
35
35
  # The fields which defines the string or character sets which will
36
- # make up parts of the String.
36
+ # make up parts of the String. Symbols corresponds to
37
+ # [Chars method names](https://rubydoc.info/gems/chars/Chars).
37
38
  #
38
39
  # @yield [string]
39
40
  # The given block will be passed each unique String.
@@ -51,8 +52,6 @@ class String
51
52
  # A given string set was not a String, Symbol or Enumerable.
52
53
  # A given string set length was not an Integer or Enumerable.
53
54
  #
54
- # @example Generate Strings with ranges of repeating sub-strings:
55
- #
56
55
  # @example Generate Strings with three alpha chars and one numeric chars:
57
56
  # String.generate([:alpha, 3], :numeric) do |password|
58
57
  # puts password
@@ -140,7 +139,9 @@ class String
140
139
  # Incrementally fuzzes the String.
141
140
  #
142
141
  # @param [Hash{Regexp,String,Symbol => Enumerable,Symbol}] substitutions
143
- # Patterns and their substitutions.
142
+ # Patterns and their substitutions. Symbols are resolved to
143
+ # [Ronin::Support::Text::Patterns](https://ronin-rb.dev/docs/ronin-support/Ronin/Support/Text/Patterns.html)
144
+ # constants.
144
145
  #
145
146
  # @yield [fuzz]
146
147
  # The given block will be passed every fuzzed String.
@@ -162,7 +163,7 @@ class String
162
163
  # end
163
164
  #
164
165
  # @example Replace a `Regexp::UNIX_PATH` with {Ronin::Fuzzing#format_strings}:
165
- # "GET /downloads/".fuzz(unix_path: :format_string)
166
+ # "GET /downloads/".fuzz(unix_path: :format_strings)
166
167
  #
167
168
  # @api public
168
169
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
data/lib/ronin/fuzzing.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ronin-fuzzer - A Ruby library for generating, mutating, and fuzzing data.
3
3
  #
4
- # Copyright (c) 2006-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ # Copyright (c) 2006-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
5
5
  #
6
6
  # This file is part of ronin-fuzzer.
7
7
  #
@@ -0,0 +1,76 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-fuzzer-completion 1 "2024-01-01" Ronin Fuzzer "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-fuzzer\-completion \- Manages shell completion rules for \fBronin\-fuzzer\fR
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-fuzzer completion\fR \[lB]\fIoptions\fP\[rB]
10
+ .SH DESCRIPTION
11
+ .PP
12
+ The \fBronin\-fuzzer completion\fR command can print, install, or uninstall shell
13
+ completion rules for the \fBronin\-fuzzer\fR command\.
14
+ .PP
15
+ Supports installing completion rules for Bash or Zsh shells\.
16
+ Completion rules for the Fish shell is currently not supported\.
17
+ .SS ZSH SUPPORT
18
+ .PP
19
+ Zsh users will have to add the following lines to their \fB\[ti]\[sl]\.zshrc\fR file in
20
+ order to enable Zsh\[cq]s Bash completion compatibility layer:
21
+ .PP
22
+ .RS 4
23
+ .EX
24
+ autoload \-Uz \[pl]X compinit && compinit
25
+ autoload \-Uz \[pl]X bashcompinit && bashcompinit
26
+ .EE
27
+ .RE
28
+ .SH OPTIONS
29
+ .TP
30
+ \fB\-\-print\fR
31
+ Prints the shell completion file\.
32
+ .TP
33
+ \fB\-\-install\fR
34
+ Installs the shell completion file\.
35
+ .TP
36
+ \fB\-\-uninstall\fR
37
+ Uninstalls the shell completion file\.
38
+ .TP
39
+ \fB\-h\fR, \fB\-\-help\fR
40
+ Prints help information\.
41
+ .SH ENVIRONMENT
42
+ .TP
43
+ \fIPREFIX\fP
44
+ Specifies the root prefix for the file system\.
45
+ .TP
46
+ \fIHOME\fP
47
+ Specifies the home directory of the user\. Ronin will search for the
48
+ \fB\[ti]\[sl]\.cache\[sl]ronin\-fuzzer\fR cache directory within the home directory\.
49
+ .TP
50
+ \fIXDG\[ru]DATA\[ru]HOME\fP
51
+ Specifies the data directory to use\. Defaults to \fB\[Do]HOME\[sl]\.local\[sl]share\fR\.
52
+ .SH FILES
53
+ .TP
54
+ \fB\[ti]\[sl]\.local\[sl]share\[sl]bash\-completion\[sl]completions\[sl]\fR
55
+ The user\-local installation directory for Bash completion files\.
56
+ .TP
57
+ \fB\[sl]usr\[sl]local\[sl]share\[sl]bash\-completion\[sl]completions\[sl]\fR
58
+ The system\-wide installation directory for Bash completions files\.
59
+ .TP
60
+ \fB\[sl]usr\[sl]local\[sl]share\[sl]zsh\[sl]site\-functions\[sl]\fR
61
+ The installation directory for Zsh completion files\.
62
+ .SH EXAMPLES
63
+ .TP
64
+ \fBronin\-fuzzer completion \-\-print\fR
65
+ Prints the shell completion rules instead of installing them\.
66
+ .TP
67
+ \fBronin\-fuzzer completion \-\-install\fR
68
+ Installs the shell completion rules for \fBronin\-fuzzer\fR\.
69
+ .TP
70
+ \fBronin\-fuzzer completion \-\-uninstall\fR
71
+ Uninstalls the shell completion rules for \fBronin\-fuzzer\fR\.
72
+ .SH AUTHOR
73
+ .PP
74
+ Postmodern
75
+ .MT postmodern\.mod3\[at]gmail\.com
76
+ .ME
@@ -0,0 +1,78 @@
1
+ # ronin-fuzzer-completion 1 "2024-01-01" Ronin Fuzzer "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-fuzzer-completion - Manages shell completion rules for `ronin-fuzzer`
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-fuzzer completion` [*options*]
10
+
11
+ ## DESCRIPTION
12
+
13
+ The `ronin-fuzzer completion` command can print, install, or uninstall shell
14
+ completion rules for the `ronin-fuzzer` command.
15
+
16
+ Supports installing completion rules for Bash or Zsh shells.
17
+ Completion rules for the Fish shell is currently not supported.
18
+
19
+ ### ZSH SUPPORT
20
+
21
+ Zsh users will have to add the following lines to their `~/.zshrc` file in
22
+ order to enable Zsh's Bash completion compatibility layer:
23
+
24
+ autoload -Uz +X compinit && compinit
25
+ autoload -Uz +X bashcompinit && bashcompinit
26
+
27
+ ## OPTIONS
28
+
29
+ `--print`
30
+ : Prints the shell completion file.
31
+
32
+ `--install`
33
+ : Installs the shell completion file.
34
+
35
+ `--uninstall`
36
+ : Uninstalls the shell completion file.
37
+
38
+ `-h`, `--help`
39
+ : Prints help information.
40
+
41
+ ## ENVIRONMENT
42
+
43
+ *PREFIX*
44
+ : Specifies the root prefix for the file system.
45
+
46
+ *HOME*
47
+ : Specifies the home directory of the user. Ronin will search for the
48
+ `~/.cache/ronin-fuzzer` cache directory within the home directory.
49
+
50
+ *XDG_DATA_HOME*
51
+ : Specifies the data directory to use. Defaults to `$HOME/.local/share`.
52
+
53
+ ## FILES
54
+
55
+ `~/.local/share/bash-completion/completions/`
56
+ : The user-local installation directory for Bash completion files.
57
+
58
+ `/usr/local/share/bash-completion/completions/`
59
+ : The system-wide installation directory for Bash completions files.
60
+
61
+ `/usr/local/share/zsh/site-functions/`
62
+ : The installation directory for Zsh completion files.
63
+
64
+ ## EXAMPLES
65
+
66
+ `ronin-fuzzer completion --print`
67
+ : Prints the shell completion rules instead of installing them.
68
+
69
+ `ronin-fuzzer completion --install`
70
+ : Installs the shell completion rules for `ronin-fuzzer`.
71
+
72
+ `ronin-fuzzer completion --uninstall`
73
+ : Uninstalls the shell completion rules for `ronin-fuzzer`.
74
+
75
+ ## AUTHOR
76
+
77
+ Postmodern <postmodern.mod3@gmail.com>
78
+
@@ -1,95 +1,80 @@
1
- .\" Generated by kramdown-man 0.1.8
1
+ .\" Generated by kramdown-man 1.0.1
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
3
  .TH ronin-fuzzer-fuzz 1 "2022-01-01" Ronin Fuzzer "User Manuals"
4
- .LP
4
+ .SH NAME
5
+ .PP
6
+ ronin\-fuzzer\-fuzz \- Performs basic fuzzing of files
5
7
  .SH SYNOPSIS
6
- .LP
7
- .HP
8
- \fBronin-fuzzer fuzz\fR \[lB]\fIoptions\fP\[rB] \[lB]\fITEMPLATE\fP\[rB]
9
- .LP
8
+ .PP
9
+ \fBronin\-fuzzer fuzz\fR \[lB]\fIoptions\fP\[rB] \[lB]\fITEMPLATE\fP\[rB]
10
10
  .SH DESCRIPTION
11
- .LP
12
11
  .PP
13
12
  Fuzzes data read from a \fIFILE\fP or from \fBSTDIN\fR\. The fuzzed data can be written
14
13
  to output files, run in commands or sent to TCP\[sl]UDP services\.
15
- .LP
16
14
  .SH OPTIONS
17
- .LP
18
15
  .TP
19
- \fB-v\fR, \fB--[no-]verbose\fR
16
+ \fB\-v\fR, \fB\-\-\[lB]no\-\[rB]verbose\fR
20
17
  Enable verbose output\.
21
- .LP
22
18
  .TP
23
- \fB-q\fR, \fB--[no-]quiet\fR
19
+ \fB\-q\fR, \fB\-\-\[lB]no\-\[rB]quiet\fR
24
20
  Disable verbose output\.
25
- .LP
26
21
  .TP
27
- \fB--[no-]silent\fR
22
+ \fB\-\-\[lB]no\-\[rB]silent\fR
28
23
  Silence all output\.
29
- .LP
30
24
  .TP
31
- \fB-i\fR, \fB--input\fR \fIFILE\fP
25
+ \fB\-i\fR, \fB\-\-input\fR \fIFILE\fP
32
26
  The input text FILE to parse\. Data will be read from \fBSTDIN\fR by default\.
33
- .LP
34
- .HP
35
- \fB-r\fR, \fB--rule\fR \[lB]\fIPATTERN\fP\[or]\fI\[sl]REGEXP\[sl]\fP\[or]STRING\[rB]:\[lB]\fIMETHOD\fP\[or]\fISTRING\fP\fI*N\fP\[lB]\-\fIM\fP\[rB]\[rB]
36
- The rule to apply to the \fIINPUT\fP\. Fuzzer rules consist of a pattern and
27
+ .TP
28
+ \fB\-r\fR, \fB\-\-rule\fR \[lB]\fIPATTERN\fP\[or]\fI\[sl]REGEXP\[sl]\fP\[or]STRING\[rB]:\[lB]\fIMETHOD\fP\[or]\fISTRING\fP\fI*N\fP\[lB]\-\fIM\fP\[rB]\[rB]
29
+ The rule to apply to the \fIINPUT\fP\. Fuzzer rules consist of a pattern and
37
30
  substitution\. Patterns may be one of the following:
38
- .LP
39
- .nf
40
- * A name of a Ronin Regular Expression (ex: \`unix\[ru]path\`)
41
- * A custom Regular Expression (ex: \`\[sl]\ed\[pl]\[sl]\`)
42
- * A plain String (ex: \`example\.com\`)\.
43
-
44
- Substitutions may be one of the following:
45
-
46
- * A method from \`Ronin::Fuzzer\` (ex: \`bad\[ru]strings\`)
47
- * A *STRING*, repeated *N* or *M* times (ex: \`A*100\-200\`)\.
48
- .fi
49
- .LP
31
+ .RS
32
+ .RS
33
+ .IP \(bu 2
34
+ A name of a Ronin Regular Expression (ex: \fBunix\[ru]path\fR)
35
+ .IP \(bu 2
36
+ A custom Regular Expression (ex: \fB\[sl]\ed\[pl]\[sl]\fR)
37
+ .IP \(bu 2
38
+ A plain String (ex: \fBexample\.com\fR)\.
39
+ .IP \( 2
40
+ Substitutions may be one of the following:
41
+ .IP \(bu 2
42
+ A method from \fBRonin::Fuzzer\fR (ex: \fBbad\[ru]strings\fR)
43
+ .IP \(bu 2
44
+ A \fISTRING\fP, repeated \fIN\fP or \fIM\fP times (ex: \fBA*100\-200\fR)\.
45
+ .RE
46
+ .RE
50
47
  .TP
51
- \fB-o\fR, \fB--output\fR \fIPATH\fP
48
+ \fB\-o\fR, \fB\-\-output\fR \fIPATH\fP
52
49
  The output PATH to write the fuzzer to\.
53
- .LP
54
50
  .TP
55
- \fB-c\fR, \fB--command\fR \fICOMMAND\fP
56
- The command to run with the fuzzed data\. All occurrences of \fB#string#\fR
57
- will be replaced with the fuzzed data, and occurrences of \fB#path#\fR will
51
+ \fB\-c\fR, \fB\-\-command\fR \fICOMMAND\fP
52
+ The command to run with the fuzzed data\. All occurrences of \fB\[sh]string\[sh]\fR
53
+ will be replaced with the fuzzed data, and occurrences of \fB\[sh]path\[sh]\fR will
58
54
  be replaced with the path to the fuzzed data\.
59
- .LP
60
55
  .TP
61
- \fB-t\fR, \fB--tcp\fR \fIHOST\fP:\fIPORT\fP
56
+ \fB\-t\fR, \fB\-\-tcp\fR \fIHOST\fP:\fIPORT\fP
62
57
  The TCP service to send the fuzzed data to\.
63
- .LP
64
58
  .TP
65
- \fB-u\fR, \fB--udp\fR \fIHOST\fP:\fIPORT\fP
59
+ \fB\-u\fR, \fB\-\-udp\fR \fIHOST\fP:\fIPORT\fP
66
60
  The UDP service to send the fuzzed data to\.
67
- .LP
68
61
  .TP
69
- \fB-p\fR, \fB--pause\fR \fISECONDS\fP
62
+ \fB\-p\fR, \fB\-\-pause\fR \fISECONDS\fP
70
63
  Pause in between mutations\.
71
- .LP
72
64
  .SH EXAMPLES
73
- .LP
74
65
  .TP
75
- \fBronin-fuzzer fuzz -i http_request.txt -o bad.txt -r unix_path:bad_strings\fR
66
+ \fBronin\-fuzzer fuzz \-i http\[ru]request\.txt \-o bad\.txt \-r unix\[ru]path:bad\[ru]strings\fR
76
67
  Fuzzes a HTTP request, replacing every occurrence of a UNIX path, with
77
- strings from the \fBbad_strings\fR method\.
78
- .LP
68
+ strings from the \fBbad\[ru]strings\fR method\.
79
69
  .SH LINKS
80
- .LP
81
- .PP
70
+ .TP
82
71
  Ronin Regular Expressions
83
72
  https:\[sl]\[sl]ronin\-rb\.dev\[sl]docs\[sl]ronin\-support\[sl]Regexp\.html
84
- .LP
85
73
  .TP
86
74
  \fBRonin::Fuzzer\fR
87
75
  https:\[sl]\[sl]ronin\-rb\.dev\[sl]docs\[sl]ronin\-fuzzer\[sl]Ronin\[sl]Fuzzer\.html
88
- .LP
89
76
  .SH AUTHOR
90
- .LP
91
77
  .PP
92
78
  Postmodern
93
79
  .MT postmodern\.mod3\[at]gmail\.com
94
80
  .ME
95
- .LP
@@ -1,5 +1,9 @@
1
1
  # ronin-fuzzer-fuzz 1 "2022-01-01" Ronin Fuzzer "User Manuals"
2
2
 
3
+ ## NAME
4
+
5
+ ronin-fuzzer-fuzz - Performs basic fuzzing of files
6
+
3
7
  ## SYNOPSIS
4
8
 
5
9
  `ronin-fuzzer fuzz` [*options*] [*TEMPLATE*]
@@ -12,20 +16,20 @@ to output files, run in commands or sent to TCP/UDP services.
12
16
  ## OPTIONS
13
17
 
14
18
  `-v`, `--[no-]verbose`
15
- Enable verbose output.
19
+ : Enable verbose output.
16
20
 
17
21
  `-q`, `--[no-]quiet`
18
- Disable verbose output.
22
+ : Disable verbose output.
19
23
 
20
24
  `--[no-]silent`
21
- Silence all output.
25
+ : Silence all output.
22
26
 
23
27
  `-i`, `--input` *FILE*
24
- The input text FILE to parse. Data will be read from `STDIN` by default.
28
+ : The input text FILE to parse. Data will be read from `STDIN` by default.
25
29
 
26
30
  `-r`, `--rule` [*PATTERN*|*/REGEXP/*|STRING]:[*METHOD*|*STRING***N*[-*M*]]
27
- The rule to apply to the *INPUT*. Fuzzer rules consist of a pattern and
28
- substitution. Patterns may be one of the following:
31
+ : The rule to apply to the *INPUT*. Fuzzer rules consist of a pattern and
32
+ substitution. Patterns may be one of the following:
29
33
 
30
34
  * A name of a Ronin Regular Expression (ex: `unix_path`)
31
35
  * A custom Regular Expression (ex: `/\d+/`)
@@ -37,35 +41,35 @@ to output files, run in commands or sent to TCP/UDP services.
37
41
  * A *STRING*, repeated *N* or *M* times (ex: `A*100-200`).
38
42
 
39
43
  `-o`, `--output` *PATH*
40
- The output PATH to write the fuzzer to.
44
+ : The output PATH to write the fuzzer to.
41
45
 
42
46
  `-c`, `--command` *COMMAND*
43
- The command to run with the fuzzed data. All occurrences of `#string#`
44
- will be replaced with the fuzzed data, and occurrences of `#path#` will
45
- be replaced with the path to the fuzzed data.
47
+ : The command to run with the fuzzed data. All occurrences of `#string#`
48
+ will be replaced with the fuzzed data, and occurrences of `#path#` will
49
+ be replaced with the path to the fuzzed data.
46
50
 
47
51
  `-t`, `--tcp` *HOST*:*PORT*
48
- The TCP service to send the fuzzed data to.
52
+ : The TCP service to send the fuzzed data to.
49
53
 
50
54
  `-u`, `--udp` *HOST*:*PORT*
51
- The UDP service to send the fuzzed data to.
55
+ : The UDP service to send the fuzzed data to.
52
56
 
53
57
  `-p`, `--pause` *SECONDS*
54
- Pause in between mutations.
58
+ : Pause in between mutations.
55
59
 
56
60
  ## EXAMPLES
57
61
 
58
62
  `ronin-fuzzer fuzz -i http_request.txt -o bad.txt -r unix_path:bad_strings`
59
- Fuzzes a HTTP request, replacing every occurrence of a UNIX path, with
60
- strings from the `bad_strings` method.
63
+ : Fuzzes a HTTP request, replacing every occurrence of a UNIX path, with
64
+ strings from the `bad_strings` method.
61
65
 
62
66
  ## LINKS
63
67
 
64
68
  Ronin Regular Expressions
65
- https://ronin-rb.dev/docs/ronin-support/Regexp.html
69
+ : https://ronin-rb.dev/docs/ronin-support/Regexp.html
66
70
 
67
71
  `Ronin::Fuzzer`
68
- https://ronin-rb.dev/docs/ronin-fuzzer/Ronin/Fuzzer.html
72
+ : https://ronin-rb.dev/docs/ronin-fuzzer/Ronin/Fuzzer.html
69
73
 
70
74
  ## AUTHOR
71
75
 
data/scripts/setup ADDED
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env bash
2
+
3
+ #
4
+ # Prints a log message.
5
+ #
6
+ function log()
7
+ {
8
+ if [[ -t 1 ]]; then
9
+ echo -e "\x1b[1m\x1b[32m>>>\x1b[0m \x1b[1m$1\x1b[0m"
10
+ else
11
+ echo ">>> $1"
12
+ fi
13
+ }
14
+
15
+ #
16
+ # Prints a warn message.
17
+ #
18
+ function warn()
19
+ {
20
+ if [[ -t 1 ]]; then
21
+ echo -e "\x1b[1m\x1b[33m***\x1b[0m \x1b[1m$1\x1b[0m" >&2
22
+ else
23
+ echo "*** $1" >&2
24
+ fi
25
+ }
26
+
27
+ #
28
+ # Prints an error message.
29
+ #
30
+ function error()
31
+ {
32
+ if [[ -t 1 ]]; then
33
+ echo -e "\x1b[1m\x1b[31m!!!\x1b[0m \x1b[1m$1\x1b[0m" >&2
34
+ else
35
+ echo "!!! $1" >&2
36
+ fi
37
+ }
38
+
39
+ #
40
+ # Prints an error message and exists with -1.
41
+ #
42
+ function fail()
43
+ {
44
+ error "$@"
45
+ exit -1
46
+ }
47
+
48
+ # default to installing gems into vendor/bundle
49
+ if [[ ! -f .bundle/config ]]; then
50
+ bundle config set --local path vendor/bundle >/dev/null || \
51
+ fail "Failed to run 'bundle config'"
52
+ fi
53
+
54
+ log "Installing gems ..."
55
+ bundle install || fail "Failed to run 'bundle install'!"
56
+
57
+ log "Setting up the project ..."
58
+ bundle exec rake setup || "Failed to run 'rake setup'!"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ronin-fuzzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Postmodern
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-01 00:00:00.000000000 Z
11
+ date: 2024-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: combinatorics
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.1'
47
+ version: '0.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.1'
54
+ version: '0.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -90,9 +90,11 @@ files:
90
90
  - README.md
91
91
  - Rakefile
92
92
  - bin/ronin-fuzzer
93
+ - data/completions/ronin-fuzzer
93
94
  - gemspec.yml
94
95
  - lib/ronin/fuzzer/cli.rb
95
96
  - lib/ronin/fuzzer/cli/command.rb
97
+ - lib/ronin/fuzzer/cli/commands/completion.rb
96
98
  - lib/ronin/fuzzer/cli/commands/fuzz.rb
97
99
  - lib/ronin/fuzzer/root.rb
98
100
  - lib/ronin/fuzzer/version.rb
@@ -103,9 +105,12 @@ files:
103
105
  - lib/ronin/fuzzing/mutator.rb
104
106
  - lib/ronin/fuzzing/repeater.rb
105
107
  - lib/ronin/fuzzing/template.rb
108
+ - man/ronin-fuzzer-completion.1
109
+ - man/ronin-fuzzer-completion.1.md
106
110
  - man/ronin-fuzzer-fuzz.1
107
111
  - man/ronin-fuzzer-fuzz.1.md
108
112
  - ronin-fuzzer.gemspec
113
+ - scripts/setup
109
114
  homepage: https://ronin-rb.dev/
110
115
  licenses:
111
116
  - LGPL-3.0
@@ -130,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
135
  - !ruby/object:Gem::Version
131
136
  version: '0'
132
137
  requirements: []
133
- rubygems_version: 3.3.26
138
+ rubygems_version: 3.5.11
134
139
  signing_key:
135
140
  specification_version: 4
136
141
  summary: A highly configurable fuzzing library and CLI for Ruby.