ronin-exploits 1.0.4 → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +1 -0
  3. data/.gitignore +1 -0
  4. data/ChangeLog.md +37 -0
  5. data/Gemfile +6 -4
  6. data/README.md +32 -6
  7. data/Rakefile +10 -0
  8. data/data/completions/ronin-exploits +111 -0
  9. data/data/completions/ronin-exploits.yml +12 -0
  10. data/data/new/exploit.rb.erb +5 -3
  11. data/gemspec.yml +3 -1
  12. data/lib/ronin/exploits/advisory.rb +1 -1
  13. data/lib/ronin/exploits/cli/command.rb +1 -1
  14. data/lib/ronin/exploits/cli/commands/completion.rb +64 -0
  15. data/lib/ronin/exploits/cli/commands/irb.rb +1 -1
  16. data/lib/ronin/exploits/cli/commands/list.rb +1 -1
  17. data/lib/ronin/exploits/cli/commands/new.rb +25 -16
  18. data/lib/ronin/exploits/cli/commands/run.rb +30 -4
  19. data/lib/ronin/exploits/cli/commands/show.rb +44 -1
  20. data/lib/ronin/exploits/cli/exploit_command.rb +1 -1
  21. data/lib/ronin/exploits/cli/exploit_methods.rb +1 -1
  22. data/lib/ronin/exploits/cli/ruby_shell.rb +1 -1
  23. data/lib/ronin/exploits/cli.rb +1 -1
  24. data/lib/ronin/exploits/client_side_web_vuln.rb +1 -1
  25. data/lib/ronin/exploits/command_injection.rb +78 -0
  26. data/lib/ronin/exploits/exceptions.rb +1 -1
  27. data/lib/ronin/exploits/exploit.rb +4 -3
  28. data/lib/ronin/exploits/heap_overflow.rb +1 -1
  29. data/lib/ronin/exploits/lfi.rb +1 -1
  30. data/lib/ronin/exploits/loot/file.rb +1 -1
  31. data/lib/ronin/exploits/loot.rb +1 -1
  32. data/lib/ronin/exploits/memory_corruption.rb +1 -1
  33. data/lib/ronin/exploits/metadata/arch.rb +1 -1
  34. data/lib/ronin/exploits/metadata/cookie_param.rb +1 -1
  35. data/lib/ronin/exploits/metadata/default_filename.rb +1 -1
  36. data/lib/ronin/exploits/metadata/default_port.rb +1 -1
  37. data/lib/ronin/exploits/metadata/header_name.rb +1 -1
  38. data/lib/ronin/exploits/metadata/os.rb +1 -1
  39. data/lib/ronin/exploits/metadata/shouts.rb +1 -1
  40. data/lib/ronin/exploits/metadata/url_path.rb +1 -1
  41. data/lib/ronin/exploits/metadata/url_query_param.rb +1 -1
  42. data/lib/ronin/exploits/mixins/binary.rb +1 -1
  43. data/lib/ronin/exploits/mixins/build_dir.rb +1 -1
  44. data/lib/ronin/exploits/mixins/file_builder.rb +1 -1
  45. data/lib/ronin/exploits/mixins/format_string.rb +1 -1
  46. data/lib/ronin/exploits/mixins/has_payload.rb +1 -1
  47. data/lib/ronin/exploits/mixins/has_targets.rb +1 -1
  48. data/lib/ronin/exploits/mixins/html.rb +1 -1
  49. data/lib/ronin/exploits/mixins/http.rb +3 -3
  50. data/lib/ronin/exploits/mixins/loot.rb +1 -1
  51. data/lib/ronin/exploits/mixins/nops.rb +1 -1
  52. data/lib/ronin/exploits/mixins/remote_tcp.rb +1 -1
  53. data/lib/ronin/exploits/mixins/remote_udp.rb +2 -2
  54. data/lib/ronin/exploits/mixins/seh.rb +1 -1
  55. data/lib/ronin/exploits/mixins/stack_overflow.rb +1 -1
  56. data/lib/ronin/exploits/mixins/text.rb +1 -1
  57. data/lib/ronin/exploits/mixins.rb +1 -1
  58. data/lib/ronin/exploits/open_redirect.rb +1 -1
  59. data/lib/ronin/exploits/params/base_url.rb +1 -1
  60. data/lib/ronin/exploits/params/bind_host.rb +1 -1
  61. data/lib/ronin/exploits/params/bind_port.rb +1 -1
  62. data/lib/ronin/exploits/params/filename.rb +1 -1
  63. data/lib/ronin/exploits/params/host.rb +1 -1
  64. data/lib/ronin/exploits/params/port.rb +1 -1
  65. data/lib/ronin/exploits/registry.rb +1 -1
  66. data/lib/ronin/exploits/rfi.rb +1 -1
  67. data/lib/ronin/exploits/root.rb +1 -1
  68. data/lib/ronin/exploits/seh_overflow.rb +1 -1
  69. data/lib/ronin/exploits/sqli.rb +1 -1
  70. data/lib/ronin/exploits/ssti.rb +1 -1
  71. data/lib/ronin/exploits/stack_overflow.rb +1 -1
  72. data/lib/ronin/exploits/target.rb +1 -1
  73. data/lib/ronin/exploits/test_result.rb +1 -1
  74. data/lib/ronin/exploits/use_after_free.rb +1 -1
  75. data/lib/ronin/exploits/version.rb +2 -2
  76. data/lib/ronin/exploits/web.rb +1 -1
  77. data/lib/ronin/exploits/web_vuln.rb +1 -1
  78. data/lib/ronin/exploits/xss.rb +1 -1
  79. data/lib/ronin/exploits.rb +2 -1
  80. data/man/ronin-exploits-completion.1 +76 -0
  81. data/man/ronin-exploits-completion.1.md +78 -0
  82. data/man/ronin-exploits-irb.1 +10 -15
  83. data/man/ronin-exploits-irb.1.md +6 -2
  84. data/man/ronin-exploits-list.1 +8 -16
  85. data/man/ronin-exploits-list.1.md +7 -3
  86. data/man/ronin-exploits-new.1 +23 -46
  87. data/man/ronin-exploits-new.1.md +24 -20
  88. data/man/ronin-exploits-run.1 +32 -56
  89. data/man/ronin-exploits-run.1.md +31 -24
  90. data/man/ronin-exploits-show.1 +10 -20
  91. data/man/ronin-exploits-show.1.md +9 -5
  92. data/man/ronin-exploits.1 +11 -23
  93. data/man/ronin-exploits.1.md +11 -7
  94. data/scripts/setup +58 -0
  95. metadata +12 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cfd3c025753ca4049f2ec1f5a61aa9442e6fb39dab803aed575cfddcfadd0e8
4
- data.tar.gz: 48651dbef77525c74e9fbcdea6a7688f4048e2be5ce696a1301b408fb8d30e2f
3
+ metadata.gz: f1903994a4e01a78bb334adf97253e14d28c9aa3b0a96b1f20b396b3aace75a0
4
+ data.tar.gz: c7b6722919a752899b73dac910bbae6f5562e6e0f533c3911a5ffe531e673bde
5
5
  SHA512:
6
- metadata.gz: 3c048f3293d44ec2c8615d56ee8c3ab363aa0393fa3fe50dc35b83875ab289b86f55fa28501a127138ee8eca3bc5bce077debee6b0992154294bcfbe825da840
7
- data.tar.gz: 76486d06cf34785a94b867ca79cde13fe79da7a26e71896388fc5cd8c46ff0968e4484e8da854d99a7c02c084cd7e3edcae67f7dffec5fb014023e8e593d2f4a
6
+ metadata.gz: 81747617a07cc5cd43618afed1f1e3f80526214f9630ebd8baf7063667e4323c02f25e9f24e2332060f7c6fd3ce1330258ccedb95a17fbdb2633d5d020441e36
7
+ data.tar.gz: 1e2144a69c774293648426c2e7b9bbfab62df5d43cd36b25564e9d972bb2dbd138845216814d19bd73360744ca66a0c6bcaddad4ae1d111af14b92c3070894d5
@@ -12,6 +12,7 @@ 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 }}
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /coverage
2
+ /data/completions/ronin-exploits
2
3
  /doc
3
4
  /man/*.[0-9]
4
5
  /pkg
data/ChangeLog.md CHANGED
@@ -1,3 +1,40 @@
1
+ ### 1.1.0 / 2024-XX-XX
2
+
3
+ * Added {Ronin::Exploits::CommandInjection}.
4
+ * Allow `:untested` as a value for {Ronin::Exploits::Exploit.quality}.
5
+ * Renamed the `raw_user_agent` param to `user_agent_string` in
6
+ {Ronin::Exploits::Mixins::HTTP}.
7
+
8
+ #### CLI
9
+
10
+ * Added the `-T,--test` option to `ronin-exploits run` which will only run the
11
+ exploits {Ronin::Exploits::Exploit#test test} method to determine if the
12
+ target is vulnerable or not.
13
+ * Added the `ronin-exploits completion` command to install shell completion
14
+ files for all `ronin-exploits` commands for Bash and Zsh shells.
15
+ * The `ronin-exploits show` command can now print an example
16
+ `ronin-exploits run` command for the given exploit.
17
+ * Use hyphenated values for `ronin-exploits new` options.
18
+
19
+ ### 1.0.5 / 2024-06-19
20
+
21
+ #### CLI
22
+
23
+ * Correctly assign the `-d` short flag to `--debug` and the `-D` short flag to
24
+ `--dry-run` for the `ronin-exploits run` command.
25
+ * Multiple bug fixes to the `ronin-exploits new` command:
26
+ * Create the parent directory of the new exploit file, if it already doesn't
27
+ exist, when running `ronin-exploits new path/to/new_exploit.rb`.
28
+ * Fixed a bug where `ronin-exploits new -t open_redirect` was not being
29
+ accepted as a valid exploit type.
30
+ * Fixed a bug in `ronin-explotis new` where `-t xss` and `-t ssti` were not
31
+ adding placeholder `base_path` and `query_param` metadata attributes to the
32
+ newly generated exploit file.
33
+ * Fixed a typo in the example `escape_expr` metadata attribute added by
34
+ `ronin-exploits new -t ssti`.
35
+ * Fixed a spelling mistake in the new exploit template used by the
36
+ `ronin-exploits new` command.
37
+
1
38
  ### 1.0.4 / 2023-12-23
2
39
 
3
40
  * Documentation fixes.
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ end
11
11
  # gem 'fake_io', '~> 0.1', github: 'postmodern/fake_io.rb',
12
12
  # branch: 'main'
13
13
 
14
- # gem 'command_kit', '~> 0.4', github: 'postmodern/command_kit.rb',
14
+ # gem 'command_kit', '~> 0.5', github: 'postmodern/command_kit.rb',
15
15
  # branch: 'main'
16
16
 
17
17
  # Ronin dependencies
@@ -23,8 +23,8 @@ end
23
23
  # branch: 'main'
24
24
  # gem 'ronin-post_ex', '~> 0.1', github: 'ronin-rb/ronin-post_ex',
25
25
  # branch: 'main'
26
- # gem 'ronin-core', '~> 0.1', github: 'ronin-rb/ronin-core',
27
- # branch: 'main'
26
+ # gem 'ronin-core', '~> 0.2', github: 'ronin-rb/ronin-core',
27
+ # branch: 'main'
28
28
  # gem 'ronin-repos', '~> 0.1', github: 'ronin-rb/ronin-repos',
29
29
  # branch: 'main'
30
30
  # gem 'ronin-code-asm', '~> 1.0', github: 'ronin-rb/ronin-code-asm',
@@ -40,7 +40,7 @@ group :development do
40
40
  gem 'simplecov', '~> 0.20'
41
41
 
42
42
  gem 'kramdown', '~> 2.0'
43
- gem 'kramdown-man', '~> 0.1'
43
+ gem 'kramdown-man', '~> 1.0'
44
44
 
45
45
  gem 'redcarpet', platform: :mri
46
46
  gem 'yard', '~> 0.9'
@@ -51,4 +51,6 @@ group :development do
51
51
  gem 'stackprof', require: false, platform: :mri
52
52
  gem 'rubocop', require: false, platform: :mri
53
53
  gem 'rubocop-ronin', '~> 0.2', require: false, platform: :mri
54
+
55
+ gem 'command_kit-completion', '~> 0.2', require: false
54
56
  end
data/README.md CHANGED
@@ -35,6 +35,7 @@ research and development.
35
35
  * [SEH Overflows][docs-seh-overflow]
36
36
  * [Heap Overflows][docs-heap-overflow]
37
37
  * [Use After Free (UAF)][docs-use-after-free]
38
+ * [Command Injection][docs-command-injection]
38
39
  * [Open Redirect][docs-open-redirect]
39
40
  * [Local File Inclusions (LFI)][docs-lfi]
40
41
  * [Remote File Inclusions (RFI)][docs-rfi]
@@ -54,6 +55,7 @@ research and development.
54
55
  [docs-seh-overflow]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/SEHOverflow.html
55
56
  [docs-heap-overflow]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/HeapOverflow.html
56
57
  [docs-use-after-free]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/UseAfterFree.html
58
+ [docs-command-injection]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/CommandInjection.html
57
59
  [docs-open-redirect]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/OpenRedirect.html
58
60
  [docs-lfi]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/LFI.html
59
61
  [docs-rfi]: https://ronin-rb.dev/docs/ronin-exploits/Ronin/Exploits/RFI.html
@@ -84,6 +86,7 @@ Arguments:
84
86
  [ARGS ...] Additional arguments for the command
85
87
 
86
88
  Commands:
89
+ completion
87
90
  help
88
91
  irb
89
92
  list, ls
@@ -95,7 +98,7 @@ Commands:
95
98
  Generate a new exploit file:
96
99
 
97
100
  ```shell
98
- $ ronin-exploits new example_exploit.rb --type stack_overflow \
101
+ $ ronin-exploits new example_exploit.rb --type stack-overflow \
99
102
  --arch x86 --os linux --software ExampleWare --software-version 1.2.3 \
100
103
  --author Postmodern --author-email "postmodern.mod3@gmail.com" \
101
104
  --summary "Example exploit" --description "This is an example."
@@ -157,7 +160,7 @@ Generate a ronin repository of your own exploits (and/or payloads):
157
160
  $ ronin-repos new my-repo
158
161
  $ cd my-repo/
159
162
  $ mkdir exploits
160
- $ ronin-exploits new exploits/my_exploit.rb --type stack_overflow \
163
+ $ ronin-exploits new exploits/my_exploit.rb --type stack-overflow \
161
164
  --arch x86 --os linux --software ExampleWare --software-version 1.2.3 \
162
165
  --author You --author-email "you@example.com" \
163
166
  --summary "My exploit" --description "This is my example."
@@ -283,6 +286,29 @@ module Ronin
283
286
  end
284
287
  ```
285
288
 
289
+ Define a Command Injection exploit:
290
+
291
+ ```ruby
292
+ require 'ronin/exploits/command_injection'
293
+ require 'ronin/exploits/mixins/http'
294
+
295
+ module Ronin
296
+ module Exploits
297
+ class MyExploit < CommandInjection
298
+
299
+ register 'my_exploit'
300
+
301
+ include Mixins::HTTP
302
+
303
+ def launch
304
+ http_post '/form.php', post_data: {var: "';#{payload}#"}
305
+ end
306
+
307
+ end
308
+ end
309
+ end
310
+ ```
311
+
286
312
  Define an Open Redirect exploit:
287
313
 
288
314
  ```ruby
@@ -410,7 +436,7 @@ For real-world example ronin exploits, see the [example-exploits] repository.
410
436
  * [uri-query_params] ~> 0.6
411
437
  * [ronin-support] ~> 1.0
412
438
  * [ronin-code-sql] ~> 2.0
413
- * [ronin-core] ~> 0.1
439
+ * [ronin-core] ~> 0.2
414
440
  * [ronin-repos] ~> 0.1
415
441
  * [ronin-payloads] ~> 0.1
416
442
  * [ronin-vulns] ~> 0.1
@@ -427,7 +453,7 @@ $ gem install ronin-exploits
427
453
  1. [Fork It!](https://github.com/ronin-rb/ronin-exploits/fork)
428
454
  2. Clone It!
429
455
  3. `cd ronin-exploits`
430
- 4. `bundle install`
456
+ 4. `./scripts/setup`
431
457
  5. `git checkout -b my_feature`
432
458
  6. Code It!
433
459
  7. `bundle exec rake spec`
@@ -445,7 +471,7 @@ to be malicious software (malware) or malicious in nature.
445
471
  ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
446
472
  payload crafting functionality.
447
473
 
448
- Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
474
+ Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
449
475
 
450
476
  ronin-exploits is free software: you can redistribute it and/or modify
451
477
  it under the terms of the GNU Lesser General Public License as published
@@ -470,4 +496,4 @@ along with ronin-exploits. If not, see <https://www.gnu.org/licenses/>.
470
496
  [ronin-repos]: https://github.com/ronin-rb/ronin-repos#readme
471
497
  [ronin-payloads]: https://github.com/ronin-rb/ronin-payloads#readme
472
498
  [ronin-post_ex]: https://github.com/ronin-rb/ronin-post_ex#readme
473
- [ronin-vulns]: https://github.com/ronin-rb/ronin-vulns#readme
499
+ [ronin-vulns]: https://github.com/ronin-rb/ronin-vulns#readm
data/Rakefile CHANGED
@@ -40,3 +40,13 @@ YARD::Rake::YardocTask.new
40
40
 
41
41
  require 'kramdown/man/task'
42
42
  Kramdown::Man::Task.new
43
+
44
+ require 'command_kit/completion/task'
45
+ CommandKit::Completion::Task.new(
46
+ class_file: 'ronin/exploits/cli',
47
+ class_name: 'Ronin::Exploits::CLI',
48
+ input_file: 'data/completions/ronin-exploits.yml',
49
+ output_file: 'data/completions/ronin-exploits'
50
+ )
51
+
52
+ task :setup => %w[man command_kit:completion]
@@ -0,0 +1,111 @@
1
+ # ronin-exploits 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-exploits_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-exploits_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
+ 'run'*'--payload-file')
32
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
33
+ ;;
34
+
35
+ 'run'*'--read-payload')
36
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
37
+ ;;
38
+
39
+ 'run'*'--encoder-file')
40
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
41
+ ;;
42
+
43
+ 'run'*'--save-loot')
44
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
45
+ ;;
46
+
47
+ 'run'*'--encoder')
48
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "$(ronin-payloads encoders)")" -- "$cur" )
49
+ ;;
50
+
51
+ 'run'*'--payload')
52
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "$(ronin-payloads list)")" -- "$cur" )
53
+ ;;
54
+
55
+ 'show'*'--file')
56
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
57
+ ;;
58
+
59
+ 'completion'*)
60
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "--print --install --uninstall")" -- "$cur" )
61
+ ;;
62
+
63
+ 'run'*'--file')
64
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
65
+ ;;
66
+
67
+ 'show'*'-f')
68
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
69
+ ;;
70
+
71
+ 'run'*'-f')
72
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
73
+ ;;
74
+
75
+ 'run'*'-L')
76
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -- "$cur" )
77
+ ;;
78
+
79
+ 'run'*'-E')
80
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "$(ronin-payloads encoders)")" -- "$cur" )
81
+ ;;
82
+
83
+ 'run'*'-P')
84
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "$(ronin-payloads list)")" -- "$cur" )
85
+ ;;
86
+
87
+ 'show'*)
88
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "--file -f --verbose -v $(ronin-exploits list)")" -- "$cur" )
89
+ ;;
90
+
91
+ 'info'*)
92
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "$(ronin-exploits list)")" -- "$cur" )
93
+ ;;
94
+
95
+ 'new'*)
96
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "$(_ronin-exploits_completions_filter "--type -t --author -a --author-email -e --summary -S --description -D --advisory-id -I --reference -R --has-payload -P --networking -N --arch -A --os -O --os-version --software -S --software-version -V --loot -L")" -- "$cur" )
97
+ ;;
98
+
99
+ 'run'*)
100
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "--file -f --param -p --dry-run -D --test -T --payload-file --read-payload --payload-string --payload -P --payload-param --encoder-file --encoder -E --encoder-param --target -t --target-arch -A --target-os -O --target-os-version --target-software -S --target-version -V --save-loot -L --debug -d --irb $(ronin-exploits list)")" -- "$cur" )
101
+ ;;
102
+
103
+ *)
104
+ while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_ronin-exploits_completions_filter "--version -V help completion irb list new run show ls info")" -- "$cur" )
105
+ ;;
106
+
107
+ esac
108
+ } &&
109
+ complete -F _ronin-exploits_completions ronin-exploits
110
+
111
+ # ex: filetype=sh
@@ -0,0 +1,12 @@
1
+ ---
2
+ ronin-exploits show: &show
3
+ - $(ronin-exploits list)
4
+ ronin-exploits info: *show
5
+ ronin-exploits run:
6
+ - $(ronin-exploits list)
7
+ ronin-exploits run*--encoder: &run_encoder
8
+ - $(ronin-payloads encoders)
9
+ ronin-exploits run*-E: *run_encoder
10
+ ronin-exploits run*--payload: &run_payload
11
+ - $(ronin-payloads list)
12
+ ronin-exploits run*-P: *run_payload
@@ -44,7 +44,7 @@ module Ronin
44
44
  advisory <%= advisory.inspect -%>
45
45
  <%- end -%>
46
46
  <%- else -%>
47
- # advisory 'CVE-YYYY-NNNN'
47
+ # advisory 'CVE-YYYY-XXXX'
48
48
  # advisory 'GHSA-XXXXXX'
49
49
  <%- end -%>
50
50
 
@@ -81,6 +81,8 @@ module Ronin
81
81
  <%- end -%>
82
82
  <%- if web_vuln_exploit? -%>
83
83
 
84
+ base_path '/FIXME'
85
+ query_param 'FIXME'
84
86
  <%- if @exploit_type[:class] == 'LFI' -%>
85
87
  # depth 7
86
88
  <%- elsif @exploit_type[:class] == 'SQLI' -%>
@@ -88,7 +90,7 @@ module Ronin
88
90
  # escape_parens true
89
91
  # terminate true
90
92
  <%- elsif @exploit_type[:class] == 'SSTI' -%>
91
- # escape_expr ->(expr) { "{{${expr}}}" }
93
+ # escape_expr ->(expr) { "{{#{expr}}}" }
92
94
  <%- end -%>
93
95
  <%- else -%>
94
96
  <%- if @has_payload -%>
@@ -106,7 +108,7 @@ module Ronin
106
108
  <%- end -%>
107
109
 
108
110
  # #
109
- # # Test whether the target systme is vulnerable.
111
+ # # Test whether the target system is vulnerable.
110
112
  # #
111
113
  # def test
112
114
  # # return Vulnerable('host is vulnerable')
data/gemspec.yml CHANGED
@@ -24,7 +24,9 @@ metadata:
24
24
  rubygems_mfa_required: 'true'
25
25
 
26
26
  generated_files:
27
+ - data/completions/ronin-exploits
27
28
  - man/ronin-exploits.1
29
+ - man/ronin-exploits-completion.1
28
30
  - man/ronin-exploits-irb.1
29
31
  - man/ronin-exploits-list.1
30
32
  - man/ronin-exploits-new.1
@@ -39,7 +41,7 @@ dependencies:
39
41
  ronin-payloads: ~> 0.1, >= 0.1.1
40
42
  ronin-vulns: ~> 0.1, >= 0.1.1
41
43
  ronin-post_ex: ~> 0.1
42
- ronin-core: ~> 0.1
44
+ ronin-core: ~> 0.2.0.rc1
43
45
  ronin-repos: ~> 0.1
44
46
 
45
47
  development_dependencies:
@@ -3,7 +3,7 @@
3
3
  # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
4
4
  # payload crafting functionality.
5
5
  #
6
- # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # ronin-exploits is free software: you can redistribute it and/or modify
9
9
  # it under the terms of the GNU Lesser General Public License as published
@@ -3,7 +3,7 @@
3
3
  # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
4
4
  # payload crafting functionality.
5
5
  #
6
- # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # ronin-exploits is free software: you can redistribute it and/or modify
9
9
  # it under the terms of the GNU Lesser General Public License as published
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
4
+ # payload crafting functionality.
5
+ #
6
+ # Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
7
+ #
8
+ # ronin-exploits 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-exploits 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-exploits. If not, see <https://www.gnu.org/licenses/>.
20
+ #
21
+
22
+ require 'ronin/exploits/root'
23
+ require 'ronin/core/cli/completion_command'
24
+
25
+ module Ronin
26
+ module Exploits
27
+ class CLI
28
+ module Commands
29
+ #
30
+ # Manages the shell completion rules for `ronin-exploits`.
31
+ #
32
+ # ## Usage
33
+ #
34
+ # ronin-exploits 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-exploits completion --print
46
+ # ronin-exploits completion --install
47
+ # ronin-exploits completion --uninstall
48
+ #
49
+ # @since 1.1.0
50
+ #
51
+ class Completion < Core::CLI::CompletionCommand
52
+
53
+ completion_file File.join(ROOT,'data','completions','ronin-exploits')
54
+
55
+ man_dir File.join(ROOT,'man')
56
+ man_page 'ronin-exploits-completion.1'
57
+
58
+ description 'Manages the shell completion rules for ronin-exploits'
59
+
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -3,7 +3,7 @@
3
3
  # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
4
4
  # payload crafting functionality.
5
5
  #
6
- # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # ronin-exploits is free software: you can redistribute it and/or modify
9
9
  # it under the terms of the GNU Lesser General Public License as published
@@ -3,7 +3,7 @@
3
3
  # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
4
4
  # payload crafting functionality.
5
5
  #
6
- # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # ronin-exploits is free software: you can redistribute it and/or modify
9
9
  # it under the terms of the GNU Lesser General Public License as published
@@ -3,7 +3,7 @@
3
3
  # ronin-exploits - A Ruby library for ronin-rb that provides exploitation and
4
4
  # payload crafting functionality.
5
5
  #
6
- # Copyright (c) 2007-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
6
+ # Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
7
7
  #
8
8
  # ronin-exploits is free software: you can redistribute it and/or modify
9
9
  # it under the terms of the GNU Lesser General Public License as published
@@ -45,7 +45,7 @@ module Ronin
45
45
  #
46
46
  # ## Options
47
47
  #
48
- # -t exploit|heap_overflow|stack_overflow|web|open_redirect|lfi|rfi|sqli|ssti|xss,
48
+ # -t exploit|heap-overflow|stack-overflow|command-injection|web|open-redirect|lfi|rfi|sqli|ssti|xss,
49
49
  # --type The type for the new exploit
50
50
  # -a, --author NAME The name of the author
51
51
  # -e, --author-email EMAIL The email address of the author
@@ -84,31 +84,41 @@ module Ronin
84
84
  class: 'Exploit'
85
85
  },
86
86
 
87
- heap_overflow: {
87
+ "heap-overflow": {
88
88
  file: 'heap_overflow',
89
89
  class: 'HeapOverflow'
90
90
  },
91
91
 
92
- stack_overflow: {
92
+ "stack-overflow": {
93
93
  file: 'stack_overflow',
94
94
  class: 'StackOverflow'
95
95
  },
96
96
 
97
- seh_overflow: {
97
+ "seh-overflow": {
98
98
  file: 'seh_overflow',
99
99
  class: 'SEHOverflow'
100
100
  },
101
101
 
102
- user_after_free: {
102
+ "user-after-free": {
103
103
  file: 'use_after_free',
104
104
  class: 'UseAfterFree'
105
105
  },
106
106
 
107
+ "command-injection": {
108
+ file: 'command_injection',
109
+ class: 'CommandInjection'
110
+ },
111
+
107
112
  web: {
108
113
  file: 'web',
109
114
  class: 'Web'
110
115
  },
111
116
 
117
+ "open-redirect": {
118
+ file: 'open_redirect',
119
+ class: 'OpenRedirect'
120
+ },
121
+
112
122
  lfi: {
113
123
  file: 'lfi',
114
124
  class: 'LFI'
@@ -137,12 +147,12 @@ module Ronin
137
147
 
138
148
  # Mapping of network mixins and their file/module names.
139
149
  NETWORKING_TYPES = {
140
- remote_tcp: {
150
+ "remote-tcp": {
141
151
  file: 'remote_tcp',
142
152
  module: 'RemoteTCP'
143
153
  },
144
154
 
145
- remote_udp: {
155
+ "remote-udp": {
146
156
  file: 'remote_udp',
147
157
  module: 'RemoteUDP'
148
158
  },
@@ -283,9 +293,12 @@ module Ronin
283
293
  # The path to the new exploit file.
284
294
  #
285
295
  def run(file)
296
+ @directory = File.dirname(file)
286
297
  @file_name = File.basename(file,File.extname(file))
287
298
  @class_name = CommandKit::Inflector.camelize(@file_name)
288
299
 
300
+ mkdir @directory unless @directory == '.'
301
+
289
302
  erb "exploit.rb.erb", file
290
303
  chmod '+x', file
291
304
  end
@@ -298,17 +311,13 @@ module Ronin
298
311
  # @return [String]
299
312
  #
300
313
  def format_kwargs(kwargs)
301
- args = []
302
-
303
- kwargs.each do |key,value|
304
- args << "#{key}: #{value.inspect}"
305
- end
306
-
307
- return args.join(', ')
314
+ kwargs.map { |key,value|
315
+ "#{key}: #{value.inspect}"
316
+ }.join(', ')
308
317
  end
309
318
 
310
319
  # Web exploit class names.
311
- WEB_VULN_EXPLOITS = %w[LFI RFI SQLI]
320
+ WEB_VULN_EXPLOITS = %w[OpenRedirect LFI RFI SQLI SSTI XSS]
312
321
 
313
322
  #
314
323
  # Determines if the exploit type is `stack_overflow`.