ronin-repos 0.1.1 → 0.2.0.rc1

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.document +0 -1
  3. data/.github/workflows/ruby.yml +3 -2
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +4 -0
  6. data/ChangeLog.md +15 -0
  7. data/Gemfile +5 -3
  8. data/README.md +19 -5
  9. data/Rakefile +10 -0
  10. data/data/completions/ronin-repos +139 -0
  11. data/data/completions/ronin-repos.yml +10 -0
  12. data/gemspec.yml +11 -2
  13. data/lib/ronin/repos/cache_dir.rb +1 -1
  14. data/lib/ronin/repos/class_dir.rb +5 -4
  15. data/lib/ronin/repos/cli/command.rb +1 -1
  16. data/lib/ronin/repos/cli/commands/completion.rb +61 -0
  17. data/lib/ronin/repos/cli/commands/install.rb +2 -2
  18. data/lib/ronin/repos/cli/commands/list.rb +15 -18
  19. data/lib/ronin/repos/cli/commands/new.rb +6 -2
  20. data/lib/ronin/repos/cli/commands/purge.rb +2 -2
  21. data/lib/ronin/repos/cli/commands/remove.rb +1 -1
  22. data/lib/ronin/repos/cli/commands/show.rb +93 -0
  23. data/lib/ronin/repos/cli/commands/update.rb +2 -2
  24. data/lib/ronin/repos/cli.rb +5 -4
  25. data/lib/ronin/repos/exceptions.rb +1 -1
  26. data/lib/ronin/repos/repository.rb +30 -1
  27. data/lib/ronin/repos/root.rb +1 -1
  28. data/lib/ronin/repos/version.rb +2 -2
  29. data/lib/ronin/repos.rb +19 -5
  30. data/man/ronin-repos-completion.1 +76 -0
  31. data/man/ronin-repos-completion.1.md +78 -0
  32. data/man/ronin-repos-install.1 +18 -32
  33. data/man/ronin-repos-install.1.md +14 -10
  34. data/man/ronin-repos-list.1 +18 -28
  35. data/man/ronin-repos-list.1.md +14 -10
  36. data/man/ronin-repos-new.1 +14 -19
  37. data/man/ronin-repos-new.1.md +8 -4
  38. data/man/ronin-repos-purge.1 +17 -28
  39. data/man/ronin-repos-purge.1.md +12 -8
  40. data/man/ronin-repos-remove.1 +16 -28
  41. data/man/ronin-repos-remove.1.md +12 -8
  42. data/man/ronin-repos-show.1 +48 -0
  43. data/man/ronin-repos-show.1.md +48 -0
  44. data/man/ronin-repos-update.1 +17 -31
  45. data/man/ronin-repos-update.1.md +14 -10
  46. data/man/ronin-repos.1 +17 -31
  47. data/man/ronin-repos.1.md +16 -12
  48. data/scripts/setup +58 -0
  49. metadata +17 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f165cb9c5c8eda828d18f33114a9407ccae14fb6d5a7edc84fbc5159ba26aad
4
- data.tar.gz: 6518e8a7dc2b29c778bf82d8ce32efc692e85b0d3ab108f3575724181b689bd4
3
+ metadata.gz: b43c676948f9c9db4f57ccea422578e0704a9d7fb1514753b7493fa6e199c27f
4
+ data.tar.gz: 5fb086f975e9f32d318ecffea62277b925637e7cb1ae5a0489bee86be5fcc052
5
5
  SHA512:
6
- metadata.gz: 0a827887a127c7a8165087e71cd3e8098b154f1ecd72dd0136f66ef640562db59a401ded921ac74877a981974ab16570cc431850f12f8d184291b5834c9d998d
7
- data.tar.gz: 4c6e43043c8a93b69b0f55a1a8016e6014e4343b338b90b9a85d6cc9477b93f8c413d5e3d98bf71bf39115731a13bdfc4e3a46e2d40aa9302029089edf502b6c
6
+ metadata.gz: 6a91bc01c3266d23b53f27270537fafe9d2c71db686f83e13aac733ac8fc5ee23a18c2c5c4b736ca42297baff252fe376ef5560c9eae1f99c6a41a024213f8ea
7
+ data.tar.gz: 85450d4e6c41a38b7272d440f95d0fad05bb8cd3bad14e7ded9e10f6348f22d789c86abc562febb6b63bc008669debf497c150d16cccc725f65c331f9de4becc
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:
@@ -31,7 +32,7 @@ jobs:
31
32
  rubocop:
32
33
  runs-on: ubuntu-latest
33
34
  steps:
34
- - uses: actions/checkout@v2
35
+ - uses: actions/checkout@v4
35
36
  - name: Set up Ruby
36
37
  uses: ruby/setup-ruby@v1
37
38
  with:
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /coverage
2
+ /data/completions/ronin-repos
2
3
  /doc
3
4
  /pkg
4
5
  /man/*.[1-9]
data/.rubocop.yml CHANGED
@@ -15,3 +15,7 @@ Lint/EmptyFile:
15
15
  - 'spec/fixtures/class_dir/file1.rb'
16
16
  - 'spec/fixtures/class_dir/file2.rb'
17
17
  - 'spec/fixtures/class_dir/only_in_class_dir.rb'
18
+
19
+ Style/MapIntoArray:
20
+ Exclude:
21
+ - 'spec/cache_dir_spec.rb'
data/ChangeLog.md CHANGED
@@ -1,3 +1,18 @@
1
+ ### 0.2.0 / 2024-XX-XX
2
+
3
+ * Added {Ronin::Repos::Repository#url}.
4
+ * Added {Ronin::Repos::Repository#last_updated_at}.
5
+ * Added {Ronin::Repos.cache_dir}.
6
+
7
+ #### CLI
8
+
9
+ * Added the `ronin-repos show` command.
10
+ * Changed `ronin-repos list` to fuzzy match repo names.
11
+ * Changed `ronin-repos new` to also create empty `exploits/`, `payloads/`,
12
+ `recon/`, and `brute/`.
13
+ * Added the `ronin-repos completion` command to install shell completion files
14
+ for all `ronin-repos` commands for Bash and Zsh shells.
15
+
1
16
  ### 0.1.1 / 2023-06-09
2
17
 
3
18
  * Fixed a bug in {Ronin::Repos::ClassDir::ClassMethods#list_files} where the
data/Gemfile CHANGED
@@ -9,10 +9,10 @@ platform :jruby do
9
9
  end
10
10
 
11
11
  # Ronin dependencies:
12
- # gem 'ronin-core', '~> 0.1', github: 'ronin-rb/ronin-core',
12
+ # gem 'ronin-core', '~> 0.2', github: 'ronin-rb/ronin-core',
13
13
  # branch: 'main'
14
14
 
15
- # gem 'command_kit', '~> 0.4', github: 'postmodern/command_kit.rb',
15
+ # gem 'command_kit', '~> 0.5', github: 'postmodern/command_kit.rb',
16
16
  # branch: 'main'
17
17
 
18
18
  group :development do
@@ -22,7 +22,7 @@ group :development do
22
22
  gem 'simplecov', '~> 0.20'
23
23
 
24
24
  gem 'kramdown', '~> 2.0'
25
- gem 'kramdown-man', '~> 0.1'
25
+ gem 'kramdown-man', '~> 1.0'
26
26
 
27
27
  gem 'redcarpet', platform: :mri
28
28
  gem 'yard', '~> 0.9'
@@ -33,4 +33,6 @@ group :development do
33
33
  gem 'stackprof', require: false, platform: :mri
34
34
  gem 'rubocop', require: false, platform: :mri
35
35
  gem 'rubocop-ronin', require: false, platform: :mri
36
+
37
+ gem 'command_kit-completion', '~> 0.2', require: false
36
38
  end
data/README.md CHANGED
@@ -9,13 +9,23 @@
9
9
  * [Issues](https://github.com/ronin-rb/ronin-repos/issues)
10
10
  * [Documentation](https://ronin-rb.dev/docs/ronin-repos/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
16
15
 
17
16
  ronin-repos provides a repository system for installing, managing, and accessing
18
- third-party git repositories, which can contain code or other data.
17
+ third-party git repositories, that can contain additional Ruby code or other
18
+ data.
19
+
20
+ Third-party git repositories can be used to extend parts of Ronin. Other Ronin
21
+ libraries can then list and load additional third-party Ruby classes from
22
+ specific directories within the installed third-party repos:
23
+
24
+ * `exploits/` - may contain additional exploits for [ronin-exploits].
25
+ * `payloads/` - may contain additional payloads for [ronin-payloads].
26
+
27
+ **tl;dr** ronin-repos is essentially a decentralized plugin system for Ronin
28
+ using git repos.
19
29
 
20
30
  ronin-repos is part of the [ronin-rb] project, a toolkit for security research
21
31
  and development.
@@ -40,12 +50,14 @@ Arguments:
40
50
  [ARGS ...] Additional arguments for the command
41
51
 
42
52
  Commands:
53
+ completion
43
54
  help
44
55
  install
45
56
  list, ls
46
57
  new
47
58
  purge
48
59
  remove, rm
60
+ show, info
49
61
  update, up
50
62
  ```
51
63
 
@@ -111,7 +123,7 @@ Rnnin::Repos.glob("wordlists/*.txt")
111
123
  ## Requirements
112
124
 
113
125
  * [Ruby] >= 3.0.0
114
- * [ronin-core] ~> 0.1
126
+ * [ronin-core] ~> 0.2
115
127
 
116
128
  ## Install
117
129
 
@@ -130,7 +142,7 @@ gem 'ronin-repos', '~> 0.1'
130
142
  1. [Fork It!](https://github.com/ronin-rb/ronin-repos/fork)
131
143
  2. Clone It!
132
144
  3. `cd ronin-repos`
133
- 4. `bundle install`
145
+ 4. `./scripts/server`
134
146
  5. `git checkout -b my_feature`
135
147
  6. Code It!
136
148
  7. `bundle exec rake spec`
@@ -138,7 +150,7 @@ gem 'ronin-repos', '~> 0.1'
138
150
 
139
151
  ## License
140
152
 
141
- Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
153
+ Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
142
154
 
143
155
  ronin-repos is free software: you can redistribute it and/or modify
144
156
  it under the terms of the GNU Lesser General Public License as published
@@ -158,3 +170,5 @@ along with ronin-repos. If not, see <https://www.gnu.org/licenses/>.
158
170
  [Ruby]: https://www.ruby-lang.org
159
171
  [git]: https://git-scm.com/
160
172
  [ronin-core]: https://github.com/ronin-rb/ronin-core#readme
173
+ [ronin-exploits]: https://github.com/ronin-rb/ronin-exploits#readme
174
+ [ronin-payloads]: https://github.com/ronin-rb/ronin-payloads#readme
data/Rakefile CHANGED
@@ -32,3 +32,13 @@ 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/repos/cli',
39
+ class_name: 'Ronin::Repos::CLI',
40
+ input_file: 'data/completions/ronin-repos.yml',
41
+ output_file: 'data/completions/ronin-repos'
42
+ )
43
+
44
+ task :setup => %w[man command_kit:completion]
@@ -0,0 +1,139 @@
1
+ # ronin-repos 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-repos_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-repos_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
+ 'install'*'--cache-dir')
32
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
33
+ ;;
34
+
35
+ 'remove'*'--cache-dir')
36
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
37
+ ;;
38
+
39
+ 'update'*'--cache-dir')
40
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
41
+ ;;
42
+
43
+ 'purge'*'--cache-dir')
44
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
45
+ ;;
46
+
47
+ 'list'*'--cache-dir')
48
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
49
+ ;;
50
+
51
+ 'show'*'--cache-dir')
52
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
53
+ ;;
54
+
55
+ 'new'*'--cache-dir')
56
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
57
+ ;;
58
+
59
+ 'completion'*)
60
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--print --install --uninstall")" -- "$cur" )
61
+ ;;
62
+
63
+ 'install'*'-C')
64
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
65
+ ;;
66
+
67
+ 'remove'*'-C')
68
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
69
+ ;;
70
+
71
+ 'update'*'-C')
72
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
73
+ ;;
74
+
75
+ 'purge'*'-C')
76
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
77
+ ;;
78
+
79
+ 'install'*)
80
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--cache-dir -C")" -- "$cur" )
81
+ ;;
82
+
83
+ 'list'*'-C')
84
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
85
+ ;;
86
+
87
+ 'show'*'-C')
88
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
89
+ ;;
90
+
91
+ 'new'*'-C')
92
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
93
+ ;;
94
+
95
+ 'remove'*)
96
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--cache-dir -C $(ronin-repos list)")" -- "$cur" )
97
+ ;;
98
+
99
+ 'update'*)
100
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--cache-dir -C $(ronin-repos list)")" -- "$cur" )
101
+ ;;
102
+
103
+ 'purge'*)
104
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--cache-dir -C")" -- "$cur" )
105
+ ;;
106
+
107
+ 'list'*)
108
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--cache-dir -C")" -- "$cur" )
109
+ ;;
110
+
111
+ 'show'*)
112
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--cache-dir -C $(ronin-repos list)")" -- "$cur" )
113
+ ;;
114
+
115
+ 'info'*)
116
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "$(ronin-repos list)")" -- "$cur" )
117
+ ;;
118
+
119
+ 'new'*)
120
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--cache-dir -C")" -- "$cur" )
121
+ ;;
122
+
123
+ 'rm'*)
124
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "$(ronin-repos list)")" -- "$cur" )
125
+ ;;
126
+
127
+ 'up'*)
128
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "$(ronin-repos list)")" -- "$cur" )
129
+ ;;
130
+
131
+ *)
132
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-repos_completions_filter "--version -V help completion install list new purge remove show update ls up rm info")" -- "$cur" )
133
+ ;;
134
+
135
+ esac
136
+ } &&
137
+ complete -F _ronin-repos_completions ronin-repos
138
+
139
+ # ex: filetype=sh
@@ -0,0 +1,10 @@
1
+ ---
2
+ ronin-repos remove: &remove
3
+ - $(ronin-repos list)
4
+ ronin-repos rm: *remove
5
+ ronin-repos show: &show
6
+ - $(ronin-repos list)
7
+ ronin-repos info: *show
8
+ ronin-repos update: &update
9
+ - $(ronin-repos list)
10
+ ronin-repos up: *update
data/gemspec.yml CHANGED
@@ -2,7 +2,13 @@ name: ronin-repos
2
2
  summary: Third-party git repository support for ronin.
3
3
  description:
4
4
  ronin-repos provides a repository system for installing, managing, and
5
- accessing third-party git repositories, which can contain code or other data.
5
+ accessing third-party git repositories, that can contain additional Ruby code
6
+ or other data. Other Ronin libraries, such as ronin-exploits or
7
+ ronin-payloads, can then list and load additional third-party Ruby classes
8
+ from specific directories within the installed third-party reposs.
9
+
10
+ ronin-repos is essentially a decentralized plugin system for Ronin using git
11
+ repos.
6
12
 
7
13
  license: LGPL-3.0
8
14
  authors: Postmodern
@@ -18,11 +24,14 @@ metadata:
18
24
  rubygems_mfa_required: 'true'
19
25
 
20
26
  generated_files:
27
+ - data/completions/ronin-repos
21
28
  - man/ronin-repos.1
29
+ - man/ronin-repos-completion.1
22
30
  - man/ronin-repos-install.1
23
31
  - man/ronin-repos-list.1
24
32
  - man/ronin-repos-new.1
25
33
  - man/ronin-repos-remove.1
34
+ - man/ronin-repos-show.1
26
35
  - man/ronin-repos-update.1
27
36
  - man/ronin-repos-purge.1
28
37
 
@@ -30,7 +39,7 @@ required_ruby_version: ">= 3.0.0"
30
39
 
31
40
  dependencies:
32
41
  # Library dependencies:
33
- ronin-core: ~> 0.1
42
+ ronin-core: ~> 0.2.0.rc1
34
43
 
35
44
  development_dependencies:
36
45
  bundler: ~> 2.0
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -122,17 +122,18 @@ module Ronin
122
122
  # @return [Array<String>]
123
123
  #
124
124
  def list_files
125
- modules = Set.new(super)
125
+ paths = Set.new(super)
126
126
  pattern = File.join(repo_class_dir,"{**/}*.rb")
127
127
 
128
128
  # the String#slice range to remove the repo_class_dir/ and .rb ext
129
129
  slice_range = (repo_class_dir.length + 1)...-3
130
130
 
131
131
  Repos.list_files(pattern).each do |path|
132
- modules << path.slice(slice_range)
132
+ # NOTE: String#slice is faster than .delete_prefix + delete.suffix
133
+ paths << path.slice(slice_range)
133
134
  end
134
135
 
135
- return modules.to_a
136
+ return paths.to_a
136
137
  end
137
138
 
138
139
  #
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
+ #
5
+ # ronin-repos is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU Lesser General Public License as published
7
+ # by the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # ronin-repos is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License
16
+ # along with ronin-repos. If not, see <https://www.gnu.org/licenses/>.
17
+ #
18
+
19
+ require 'ronin/repos/root'
20
+ require 'ronin/core/cli/completion_command'
21
+
22
+ module Ronin
23
+ module Repos
24
+ class CLI
25
+ module Commands
26
+ #
27
+ # Manages the shell completion rules for `ronin-repos`.
28
+ #
29
+ # ## Usage
30
+ #
31
+ # ronin-repos completion [options]
32
+ #
33
+ # ## Options
34
+ #
35
+ # --print Prints the shell completion file
36
+ # --install Installs the shell completion file
37
+ # --uninstall Uninstalls the shell completion file
38
+ # -h, --help Print help information
39
+ #
40
+ # ## Examples
41
+ #
42
+ # ronin-repos completion --print
43
+ # ronin-repos completion --install
44
+ # ronin-repos completion --uninstall
45
+ #
46
+ # @since 0.2.0
47
+ #
48
+ class Completion < Core::CLI::CompletionCommand
49
+
50
+ completion_file File.join(ROOT,'data','completions','ronin-repos')
51
+
52
+ man_dir File.join(ROOT,'man')
53
+ man_page 'ronin-repos-completion.1'
54
+
55
+ description 'Manages the shell completion rules for ronin-repos'
56
+
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -63,7 +63,7 @@ module Ronin
63
63
  def run(uri)
64
64
  log_info "Installing repository from #{uri} ..."
65
65
  cache_dir.install(uri)
66
- rescue CommandFailed => error
66
+ rescue CommandNotInstalled, CommandFailed => error
67
67
  print_error(error.message)
68
68
  exit(-1)
69
69
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -27,7 +27,7 @@ module Ronin
27
27
  #
28
28
  # ## Usage
29
29
  #
30
- # ronin-repos list [options] [REPO]
30
+ # ronin-repos list [options] [NAME]
31
31
  #
32
32
  # ## Options
33
33
  #
@@ -36,15 +36,15 @@ module Ronin
36
36
  #
37
37
  # ## Arguments
38
38
  #
39
- # [REPO] Optional repository name to list
39
+ # [NAME] Optional repository name(s) to list
40
40
  #
41
41
  class List < Command
42
42
 
43
- usage '[options] [REPO]'
43
+ usage '[options] [NAME]'
44
44
 
45
45
  argument :name, required: false,
46
- usage: 'REPO',
47
- desc: 'Optional repository name to list'
46
+ usage: 'NAME',
47
+ desc: 'Optional repository name(s) to list'
48
48
 
49
49
  description 'Lists all repositories in the cache directory'
50
50
 
@@ -57,19 +57,16 @@ module Ronin
57
57
  # The optional repo name to list.
58
58
  #
59
59
  def run(name=nil)
60
- if name
61
- begin
62
- repo = cache_dir[name]
60
+ repos = if name
61
+ cache_dir.select do |repo|
62
+ repo.name.include?(name)
63
+ end
64
+ else
65
+ cache_dir.each
66
+ end
63
67
 
64
- puts " #{repo}"
65
- rescue RepositoryNotFound => error
66
- print_error(error.message)
67
- exit(-1)
68
- end
69
- else
70
- cache_dir.each do |repo|
71
- puts " #{repo}"
72
- end
68
+ repos.each do |repo|
69
+ puts " #{repo}"
73
70
  end
74
71
  end
75
72
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -54,7 +54,7 @@ module Ronin
54
54
 
55
55
  description 'Creates a new git repository'
56
56
 
57
- man_page 'ronin-repos.1'
57
+ man_page 'ronin-repos-new.1'
58
58
 
59
59
  #
60
60
  # Runs the `ronin-repos new` command.
@@ -67,6 +67,10 @@ module Ronin
67
67
  @github_user = Core::Git.github_user || ENV['USER']
68
68
 
69
69
  mkdir path
70
+ mkdir File.join(path,'exploits')
71
+ mkdir File.join(path,'payloads')
72
+ mkdir File.join(path,'recon')
73
+ mkdir File.join(path,'brute')
70
74
  erb 'README.md.erb', File.join(path,'README.md')
71
75
 
72
76
  Dir.chdir(path) do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published
@@ -38,7 +38,7 @@ module Ronin
38
38
 
39
39
  description 'Removes all git repository from the cache directory'
40
40
 
41
- man_page 'ronin-repos-download.1'
41
+ man_page 'ronin-repos-purge.1'
42
42
 
43
43
  #
44
44
  # Runs the `ronin-repos purge` command.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
- # Copyright (c) 2021-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
3
+ # Copyright (c) 2021-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
4
4
  #
5
5
  # ronin-repos is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published