ronin-payloads 0.1.0 → 0.1.1

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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +15 -1
  3. data/.rubocop.yml +37 -0
  4. data/ChangeLog.md +13 -1
  5. data/Gemfile +5 -2
  6. data/Rakefile +3 -1
  7. data/bin/ronin-payloads +6 -7
  8. data/examples/bin_sh.rb +4 -0
  9. data/lib/ronin/payloads/asm_payload.rb +1 -1
  10. data/lib/ronin/payloads/builtin/php/cmd_exec.rb +4 -3
  11. data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/bind_shell.rb +1 -1
  12. data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/exec_shell.rb +1 -1
  13. data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/reverse_shell.rb +1 -1
  14. data/lib/ronin/payloads/builtin/shellcode/freebsd/x86_64/exec_shell.rb +1 -1
  15. data/lib/ronin/payloads/builtin/shellcode/linux/arm/bind_shell.rb +1 -1
  16. data/lib/ronin/payloads/builtin/shellcode/linux/arm/exec_shell.rb +1 -1
  17. data/lib/ronin/payloads/builtin/shellcode/linux/arm/reverse_shell.rb +1 -1
  18. data/lib/ronin/payloads/builtin/shellcode/linux/mips/bind_shell.rb +1 -1
  19. data/lib/ronin/payloads/builtin/shellcode/linux/mips/exec_shell.rb +1 -1
  20. data/lib/ronin/payloads/builtin/shellcode/linux/mips/reverse_shell.rb +1 -1
  21. data/lib/ronin/payloads/builtin/shellcode/linux/ppc/exec_shell.rb +1 -1
  22. data/lib/ronin/payloads/builtin/shellcode/linux/ppc/reverse_shell.rb +2 -2
  23. data/lib/ronin/payloads/builtin/shellcode/linux/x86/bind_shell.rb +1 -1
  24. data/lib/ronin/payloads/builtin/shellcode/linux/x86/exec_shell.rb +1 -1
  25. data/lib/ronin/payloads/builtin/shellcode/linux/x86/reverse_shell.rb +1 -1
  26. data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/bind_shell.rb +1 -1
  27. data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/exec_shell.rb +1 -1
  28. data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/reverse_shell.rb +1 -1
  29. data/lib/ronin/payloads/builtin/shellcode/macos/x86_64/exec_shell.rb +1 -1
  30. data/lib/ronin/payloads/builtin/shellcode/macos/x86_64/reverse_shell.rb +1 -1
  31. data/lib/ronin/payloads/builtin/shellcode/netbsd/x86/exec_shell.rb +1 -1
  32. data/lib/ronin/payloads/builtin/shellcode/netbsd/x86/reverse_shell.rb +1 -1
  33. data/lib/ronin/payloads/builtin/shellcode/openbsd/x86/bind_shell.rb +1 -1
  34. data/lib/ronin/payloads/builtin/shellcode/openbsd/x86/exec_shell.rb +1 -1
  35. data/lib/ronin/payloads/builtin/shellcode/windows/x86_64/cmd.rb +2 -2
  36. data/lib/ronin/payloads/builtin/test/open_redirect.rb +3 -3
  37. data/lib/ronin/payloads/builtin/test/xss.rb +3 -3
  38. data/lib/ronin/payloads/c_payload.rb +1 -1
  39. data/lib/ronin/payloads/cli/commands/build.rb +10 -12
  40. data/lib/ronin/payloads/cli/commands/encode.rb +16 -20
  41. data/lib/ronin/payloads/cli/commands/launch.rb +2 -2
  42. data/lib/ronin/payloads/cli/commands/new.rb +1 -1
  43. data/lib/ronin/payloads/cli/commands/show.rb +1 -0
  44. data/lib/ronin/payloads/cli/encoder_methods.rb +1 -0
  45. data/lib/ronin/payloads/cli/generator/payload_types.rb +1 -0
  46. data/lib/ronin/payloads/encoders/builtin/html/encode.rb +1 -0
  47. data/lib/ronin/payloads/encoders/builtin/js/encode.rb +1 -0
  48. data/lib/ronin/payloads/encoders/builtin/powershell/encode.rb +1 -0
  49. data/lib/ronin/payloads/encoders/builtin/shell/encode.rb +1 -0
  50. data/lib/ronin/payloads/encoders/builtin/sql/encode.rb +1 -0
  51. data/lib/ronin/payloads/encoders/builtin/xml/encode.rb +1 -0
  52. data/lib/ronin/payloads/encoders/encoder.rb +2 -1
  53. data/lib/ronin/payloads/encoders/exceptions.rb +1 -0
  54. data/lib/ronin/payloads/encoders/html_encoder.rb +1 -0
  55. data/lib/ronin/payloads/encoders/javascript_encoder.rb +1 -0
  56. data/lib/ronin/payloads/encoders/pipeline.rb +1 -0
  57. data/lib/ronin/payloads/encoders/powershell_encoder.rb +1 -0
  58. data/lib/ronin/payloads/encoders/registry.rb +4 -0
  59. data/lib/ronin/payloads/encoders/shell_encoder.rb +1 -0
  60. data/lib/ronin/payloads/encoders/sql_encoder.rb +1 -0
  61. data/lib/ronin/payloads/encoders/xml_encoder.rb +1 -0
  62. data/lib/ronin/payloads/exceptions.rb +1 -0
  63. data/lib/ronin/payloads/go_payload.rb +1 -1
  64. data/lib/ronin/payloads/java_payload.rb +1 -1
  65. data/lib/ronin/payloads/metadata/arch.rb +1 -0
  66. data/lib/ronin/payloads/metadata/os.rb +1 -0
  67. data/lib/ronin/payloads/mixins/bind_shell.rb +2 -2
  68. data/lib/ronin/payloads/mixins/post_ex.rb +0 -1
  69. data/lib/ronin/payloads/mixins/reverse_shell.rb +0 -1
  70. data/lib/ronin/payloads/mixins/typescript.rb +1 -2
  71. data/lib/ronin/payloads/payload.rb +7 -7
  72. data/lib/ronin/payloads/registry.rb +3 -0
  73. data/lib/ronin/payloads/rust_payload.rb +1 -1
  74. data/lib/ronin/payloads/shellcode_payload.rb +8 -8
  75. data/lib/ronin/payloads/url_payload.rb +1 -1
  76. data/lib/ronin/payloads/version.rb +1 -1
  77. data/lib/ronin/payloads.rb +1 -0
  78. data/man/ronin-payloads-build.1 +1 -1
  79. data/man/ronin-payloads-build.1.md +1 -1
  80. data/man/ronin-payloads-encode.1 +1 -1
  81. data/man/ronin-payloads-encode.1.md +1 -1
  82. data/man/ronin-payloads-encoder.1 +1 -1
  83. data/man/ronin-payloads-encoder.1.md +1 -1
  84. data/man/ronin-payloads-encoders.1 +1 -1
  85. data/man/ronin-payloads-encoders.1.md +1 -1
  86. data/man/ronin-payloads-irb.1 +1 -1
  87. data/man/ronin-payloads-irb.1.md +1 -1
  88. data/man/ronin-payloads-launch.1 +1 -1
  89. data/man/ronin-payloads-launch.1.md +1 -1
  90. data/man/ronin-payloads-list.1 +1 -1
  91. data/man/ronin-payloads-list.1.md +1 -1
  92. data/man/ronin-payloads.1 +1 -1
  93. data/man/ronin-payloads.1.md +1 -1
  94. data/ronin-payloads.gemspec +3 -4
  95. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07561b5d1c24b065edf8f865ebfe2c68f0646ca7bdb64815f0208792a75cf930
4
- data.tar.gz: 9168b42d9147d245dcc08d3125f7e84037c7d0cf306024e69e5c8cdd65ca3215
3
+ metadata.gz: 6fddb2f659bbde5b22104a0199430583326dd28ff4183121da3e25e88a94fe8a
4
+ data.tar.gz: 5e2f20bca62fcd8d43f4bc82eb33c1098cac1e20269d49b847e793dcd186a978
5
5
  SHA512:
6
- metadata.gz: 50b73eaed5e5a285d369d330a7301979c715665c5e68a1fb7d0d6ad67adbc154922bbbb609fb3bc9583f643fd26293a9c21ce36bcc5071313029cfe47d808dbc
7
- data.tar.gz: a9112a634a9de0c0adb4cd117ed63f2d2ee848ae7ea043cf91cb449824d932ba07e14c8a7f893d3b416de14923731db540ea61f58e069e1c614e66fc82a6a332
6
+ metadata.gz: 0d75e548fc4782f995dbba42e62f4a1a485d3fc2fbdf005c479fe6beda75b2006d9f8132fe98125586d5b4877604c251ad1fe284ea13dccb04476b4edecfc4e4
7
+ data.tar.gz: 36384af31fb5ba8e407c1b7ebe5777974b966a005c42ebe57a499fea46e450b82987ce3e117c07def7c515fe7f099caa1e760db1ca06ca077ccd2590a3cef8df
@@ -12,7 +12,7 @@ jobs:
12
12
  - '3.0'
13
13
  - '3.1'
14
14
  - '3.2'
15
- # - jruby
15
+ - jruby
16
16
  - truffleruby
17
17
  name: Ruby ${{ matrix.ruby }}
18
18
  steps:
@@ -30,3 +30,17 @@ jobs:
30
30
  run: bundle install --jobs 4 --retry 3
31
31
  - name: Run tests
32
32
  run: bundle exec rake test
33
+
34
+ # rubocop linting
35
+ rubocop:
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v2
39
+ - name: Set up Ruby
40
+ uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: 3.0
43
+ - name: Install dependencies
44
+ run: bundle install --jobs 4 --retry 3
45
+ - name: Run rubocop
46
+ run: bundle exec rubocop --parallel
data/.rubocop.yml ADDED
@@ -0,0 +1,37 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ TargetRubyVersion: 3.1
5
+
6
+ inherit_gem:
7
+ rubocop-ronin: rubocop.yml
8
+
9
+ #
10
+ # ronin-payload specific exceptions:
11
+ #
12
+ Layout/ArgumentAlignment: { Exclude: ['spec/rust_payload_spec.rb'] }
13
+
14
+ # the placeholder API methods are meant to be empty
15
+ Style/EmptyMethod:
16
+ Exclude:
17
+ - 'lib/ronin/payloads/payload.rb'
18
+ - 'spec/**/*'
19
+
20
+ # rubocop does not support constants that contain multiple numbers
21
+ Naming/ClassAndModuleCamelCase:
22
+ AllowedNames:
23
+ - X86_64
24
+
25
+ # robucop mistakes :x86_64 for a "symbol number"
26
+ Naming/VariableNumber:
27
+ AllowedIdentifiers:
28
+ - x86_64
29
+
30
+ # this is a bug in rubocop
31
+ Style/FormatStringToken:
32
+ Exclude:
33
+ - 'lib/ronin/payloads/builtin/cmd/powershell/reverse_shell.rb'
34
+ - 'spec/builtin/cmd/powershell/reverse_shell_spec.rb'
35
+
36
+ # rubocop does not recognize empty-line continuations
37
+ Layout/LineContinuationSpacing: { Exclude: ['lib/ronin/payloads/builtin/shellcode/**/*.rb'] }
data/ChangeLog.md CHANGED
@@ -1,4 +1,16 @@
1
- ### 0.1.0 / 2023-XX-XX
1
+ ### 0.1.1 / 2023-03-01
2
+
3
+ * Default the `host` param defined by {Ronin::Payloads::Mixins::BindShell} to
4
+ `0.0.0.0`.
5
+
6
+ #### CLI
7
+
8
+ * Fixed multiple bugs in the `--param` option of the `ronin-payloads encode`
9
+ comand.
10
+ * Fixed multiple bugs in the `--encoder-param` option of
11
+ the `ronin-payloads build` command.
12
+
13
+ ### 0.1.0 / 2023-02-01
2
14
 
3
15
  * Initial release:
4
16
  * Require `ruby` >= 3.0.0.
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
 
3
4
  gemspec
@@ -41,6 +42,8 @@ group :development do
41
42
  gem 'yard-spellcheck', require: false
42
43
 
43
44
  gem 'dead_end', require: false
44
- gem 'sord', require: false
45
- gem 'stackprof', require: false
45
+ gem 'sord', require: false, platform: :mri
46
+ gem 'stackprof', require: false, platform: :mri
47
+ gem 'rubocop', require: false, platform: :mri
48
+ gem 'rubocop-ronin', require: false, platform: :mri
46
49
  end
data/Rakefile CHANGED
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler'
3
5
  rescue LoadError => e
4
6
  warn e.message
5
7
  warn "Run `gem install bundler` to install Bundler"
6
- exit -1
8
+ exit(-1)
7
9
  end
8
10
 
9
11
  begin
data/bin/ronin-payloads CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # ronin-payloads - A Ruby micro-framework for writing and running exploit
4
5
  # payloads.
@@ -22,13 +23,11 @@
22
23
  root = File.expand_path(File.join(File.dirname(__FILE__),'..'))
23
24
  if File.file?(File.join(root,'Gemfile.lock'))
24
25
  Dir.chdir(root) do
25
- begin
26
- require 'bundler/setup'
27
- rescue LoadError => e
28
- warn e.message
29
- warn "Run `gem install bundler` to install Bundler"
30
- exit -1
31
- end
26
+ require 'bundler/setup'
27
+ rescue LoadError => e
28
+ warn e.message
29
+ warn "Run `gem install bundler` to install Bundler"
30
+ exit(-1)
32
31
  end
33
32
  end
34
33
 
data/examples/bin_sh.rb CHANGED
@@ -1,9 +1,13 @@
1
1
  #!/usr/bin/env -S ronin-payloads build -f
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'ronin/payloads/shellcode_payload'
4
5
 
5
6
  module Ronin
6
7
  module Payloads
8
+ #
9
+ # An example `execve()` `/bin/sh` shellcode payload.
10
+ #
7
11
  class BinSh < ShellcodePayload
8
12
 
9
13
  register 'examples/bin_sh'
@@ -61,7 +61,7 @@ module Ronin
61
61
  end
62
62
 
63
63
  param :assembler, required: true,
64
- default: ->{ assembler },
64
+ default: -> { assembler },
65
65
  desc: 'The assmebler command to use'
66
66
 
67
67
  #
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # ronin-payloads - A Ruby micro-framework for writing and running exploit
3
4
  # payloads.
@@ -32,9 +33,9 @@ module Ronin
32
33
 
33
34
  summary 'PHP command exec payload'
34
35
  description <<~DESC
35
- A basic injectable PHP payload which executes a command passed in via a
36
- URL query parameter. The output of the commend will be returned in the
37
- response body wrapped in `<exec>...</exec>` tags.
36
+ A basic injectable PHP payload which executes a command passed in via a
37
+ URL query parameter. The output of the commend will be returned in the
38
+ response body wrapped in `<exec>...</exec>` tags.
38
39
  DESC
39
40
 
40
41
  param :query_param, String, default: 'cmd',
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'FreeBSD x86 bind shell shellcode'
42
42
  description <<~DESC
43
- FreeBSD x86 shellcode that binds a shell to a port.
43
+ FreeBSD x86 shellcode that binds a shell to a port.
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'FreeBSD x86 execve() shellcode'
42
42
  description <<~DESC
43
- FreeBSD x86 shellcode that calls execve() with "/bin/sh".
43
+ FreeBSD x86 shellcode that calls execve() with "/bin/sh".
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'FreeBSD x86 reverse shell shellcode'
42
42
  description <<~DESC
43
- FreeBSD x86 shellcode that spawns a connect back reverse shell.
43
+ FreeBSD x86 shellcode that spawns a connect back reverse shell.
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'FreeBSD x86-64 execve() shellcode'
42
42
  description <<~DESC
43
- FreeBSD x86-64 shellcode that calls execve() with "/bin/sh".
43
+ FreeBSD x86-64 shellcode that calls execve() with "/bin/sh".
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux ARM bind shell shellcode'
42
42
  description <<~DESC
43
- Linux ARM shellcode that binds a shell to a port.
43
+ Linux ARM shellcode that binds a shell to a port.
44
44
  DESC
45
45
 
46
46
  references [
@@ -41,7 +41,7 @@ module Ronin
41
41
 
42
42
  summary 'Linux ARM execve() shellcode'
43
43
  description <<~DESC
44
- Linux ARM shellcode that calls execve() with "/bin/sh".
44
+ Linux ARM shellcode that calls execve() with "/bin/sh".
45
45
  DESC
46
46
 
47
47
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux ARM reverse shell shellcode'
42
42
  description <<~DESC
43
- Linux ARM shellcode that spawns a connect back reverse shell.
43
+ Linux ARM shellcode that spawns a connect back reverse shell.
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux ARM bind shell shellcode'
42
42
  description <<~DESC
43
- Linux ARM shellcode that binds a shell to a port.
43
+ Linux ARM shellcode that binds a shell to a port.
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux MIPS execve() shellcode'
42
42
  description <<~DESC
43
- Linux MIPS shellcode that calls execve() with "/bin/sh".
43
+ Linux MIPS shellcode that calls execve() with "/bin/sh".
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux MIPS reverse shell shellcode'
42
42
  description <<~DESC
43
- Linux MIPS shellcode that spawns a connect back reverse shell.
43
+ Linux MIPS shellcode that spawns a connect back reverse shell.
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux PPC execve() shellcode'
42
42
  description <<~DESC
43
- Linux PPC shellcode that calls execve() with "/bin/sh".
43
+ Linux PPC shellcode that calls execve() with "/bin/sh".
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,9 +40,9 @@ module Ronin
40
40
 
41
41
  summary 'Linux PPC reverse shell shellcode'
42
42
  description <<~DESC
43
- Linux PPC shellcode that spawns a connect back reverse shell.
43
+ Linux PPC shellcode that spawns a connect back reverse shell.
44
44
 
45
- Note: disabling with_stderr will save 16 bytes, but lose stderr.
45
+ Note: disabling with_stderr will save 16 bytes, but lose stderr.
46
46
  DESC
47
47
 
48
48
  references [
@@ -41,7 +41,7 @@ module Ronin
41
41
 
42
42
  summary 'Linux x86 bind shell shellcode'
43
43
  description <<~DESC
44
- Linux x86 shellcode that binds a shell to a port.
44
+ Linux x86 shellcode that binds a shell to a port.
45
45
  DESC
46
46
 
47
47
  references [
@@ -41,7 +41,7 @@ module Ronin
41
41
 
42
42
  summary 'Linux x86 execve() shellcode'
43
43
  description <<~DESC
44
- Linux x86 shellcode that calls execve() with "/bin/sh".
44
+ Linux x86 shellcode that calls execve() with "/bin/sh".
45
45
  DESC
46
46
 
47
47
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux x86 reverse shell shellcode'
42
42
  description <<~DESC
43
- Linux x86 shellcode that spawns a connect back reverse shell.
43
+ Linux x86 shellcode that spawns a connect back reverse shell.
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux x86-64 bind shell shellcode'
42
42
  description <<~DESC
43
- Linux x86-64 shellcode that binds a shell to a port.
43
+ Linux x86-64 shellcode that binds a shell to a port.
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux x86-64 execve() shellcode'
42
42
  description <<~DESC
43
- Linux x86-64 shellcode that calls execve() with "/bin/sh".
43
+ Linux x86-64 shellcode that calls execve() with "/bin/sh".
44
44
  DESC
45
45
 
46
46
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'Linux x86-64 reverse shell shellcode'
42
42
  description <<~DESC
43
- Linux x86-64 shellcode that spawns a connect back reverse shell.
43
+ Linux x86-64 shellcode that spawns a connect back reverse shell.
44
44
  DESC
45
45
 
46
46
  references [
@@ -41,7 +41,7 @@ module Ronin
41
41
 
42
42
  summary 'macOS x86-64 execve() shellcode'
43
43
  description <<~DESC
44
- macOS x86-64 shellcode that calls execve() with "/bin/sh".
44
+ macOS x86-64 shellcode that calls execve() with "/bin/sh".
45
45
  DESC
46
46
 
47
47
  references [
@@ -41,7 +41,7 @@ module Ronin
41
41
 
42
42
  summary 'macOS x86-64 reverse shell shellcode'
43
43
  description <<~DESC
44
- macOS x86-64 shellcode that spawns a connect back reverse shell.
44
+ macOS x86-64 shellcode that spawns a connect back reverse shell.
45
45
  DESC
46
46
 
47
47
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'NetBSD x86 execve() shellcode'
42
42
  description <<~DESC
43
- NetBSD x86 shellcode that calls execve() with "/bin/sh".
43
+ NetBSD x86 shellcode that calls execve() with "/bin/sh".
44
44
  DESC
45
45
 
46
46
  references [
@@ -41,7 +41,7 @@ module Ronin
41
41
 
42
42
  summary 'NetBSD x86 reverse shell shellcode'
43
43
  description <<~DESC
44
- NetBSD x86 shellcode that spawns a connect back reverse shell.
44
+ NetBSD x86 shellcode that spawns a connect back reverse shell.
45
45
  DESC
46
46
 
47
47
  references [
@@ -40,7 +40,7 @@ module Ronin
40
40
 
41
41
  summary 'OpenBSD x86 bind shell shellcode'
42
42
  description <<~DESC
43
- OpenBSD x86 shellcode that binds a shell to a port.
43
+ OpenBSD x86 shellcode that binds a shell to a port.
44
44
  DESC
45
45
 
46
46
  references [
@@ -41,7 +41,7 @@ module Ronin
41
41
 
42
42
  summary 'OpenBSD x86 execve() shellcode'
43
43
  description <<~DESC
44
- OpenBSD x86 shellcode that calls execve() with "/bin/sh".
44
+ OpenBSD x86 shellcode that calls execve() with "/bin/sh".
45
45
  DESC
46
46
 
47
47
  references [
@@ -37,11 +37,11 @@ module Ronin
37
37
  os :windows
38
38
  os_version '7'
39
39
 
40
- author "agix"
40
+ author "agix"
41
41
 
42
42
  summary 'Windows x86-64 cmd shellcode'
43
43
  description <<~DESC
44
- Windows x86-64 shellcode that executes "cmd"
44
+ Windows x86-64 shellcode that executes "cmd"
45
45
  DESC
46
46
 
47
47
  references [
@@ -33,10 +33,10 @@ module Ronin
33
33
 
34
34
  summary 'An Open Redirect test payload'
35
35
  description <<~DESC
36
- A non-malicious test payload for testing Open Redirect vulnerabilities.
37
- Simply redirects to https://google.com/.
36
+ A non-malicious test payload for testing Open Redirect vulnerabilities.
37
+ Simply redirects to https://google.com/.
38
38
  DESC
39
-
39
+
40
40
  #
41
41
  # Builds the Open Redirect test payload.
42
42
  #
@@ -33,10 +33,10 @@ module Ronin
33
33
 
34
34
  summary 'A XSS test payload'
35
35
  description <<~DESC
36
- A non-malicious test payload for testing Cross Site Scripting (XSS).
37
- Simply calls `alert(1)`.
36
+ A non-malicious test payload for testing Cross Site Scripting (XSS).
37
+ Simply calls `alert(1)`.
38
38
  DESC
39
-
39
+
40
40
  #
41
41
  # Builds the XSS test payload.
42
42
  #
@@ -52,7 +52,7 @@ module Ronin
52
52
  end
53
53
 
54
54
  param :cc, required: true,
55
- default: ->{ cc },
55
+ default: -> { cc },
56
56
  desc: 'The C compiler to use'
57
57
 
58
58
  #
@@ -80,9 +80,9 @@ module Ronin
80
80
  },
81
81
  desc: 'Sets a param for one of the encoders' do |str|
82
82
  name, value = str.split('=',2)
83
- ecndoer_name, param_name = name.split('.',2)
83
+ encoder_name, param_name = name.split('.',2)
84
84
 
85
- @encoder_params[encoder_name][param_name] = value
85
+ @encoder_params[encoder_name][param_name.to_sym] = value
86
86
  end
87
87
 
88
88
  option :debug, short: '-D',
@@ -162,16 +162,14 @@ module Ronin
162
162
  # Builds the {#payload}.
163
163
  #
164
164
  def build_payload
165
- begin
166
- @payload.perform_build
167
- rescue PayloadError => error
168
- print_error "failed to build the payload #{@payload_class.id}: #{error.message}"
169
- exit(-1)
170
- rescue => error
171
- print_exception(error)
172
- print_error "an unhandled exception occurred while building the payload #{@payload.class_id}"
173
- exit(-1)
174
- end
165
+ @payload.perform_build
166
+ rescue PayloadError => error
167
+ print_error "failed to build the payload #{@payload_class.id}: #{error.message}"
168
+ exit(-1)
169
+ rescue => error
170
+ print_exception(error)
171
+ print_error "an unhandled exception occurred while building the payload #{@payload.class_id}"
172
+ exit(-1)
175
173
  end
176
174
 
177
175
  #
@@ -71,15 +71,15 @@ module Ronin
71
71
  },
72
72
  desc: 'Sets a param on an encoder' do |str|
73
73
  prefix, value = str.split('=',2)
74
- ecndoer, name = prefix.split('.',2)
74
+ encoder, name = prefix.split('.',2)
75
75
 
76
- @params[encoder][name] = value
76
+ @params[encoder][name.to_sym] = value
77
77
  end
78
78
 
79
79
  option :string, short: '-s',
80
80
  value: {
81
81
  type: String,
82
- usage: 'STRING',
82
+ usage: 'STRING'
83
83
  },
84
84
  desc: 'The string to encode'
85
85
 
@@ -157,16 +157,14 @@ module Ronin
157
157
  # Another encoder validation error occurred.
158
158
  #
159
159
  def validate_encoder(encoder)
160
- begin
161
- encoder.validate
162
- rescue Core::Params::ParamError, ValidationError => error
163
- print_error "failed to validate the encoder #{encoder.class_id}: #{error.message}"
164
- exit(1)
165
- rescue => error
166
- print_error "an unhandled exception occurred while validating the encoder #{encoder.class_id}"
167
- print_exception(error)
168
- exit(-1)
169
- end
160
+ encoder.validate
161
+ rescue Core::Params::ParamError, ValidationError => error
162
+ print_error "failed to validate the encoder #{encoder.class_id}: #{error.message}"
163
+ exit(1)
164
+ rescue => error
165
+ print_error "an unhandled exception occurred while validating the encoder #{encoder.class_id}"
166
+ print_exception(error)
167
+ exit(-1)
170
168
  end
171
169
 
172
170
  #
@@ -197,13 +195,11 @@ module Ronin
197
195
  # @return [String]
198
196
  #
199
197
  def encode_data(data)
200
- begin
201
- @pipeline.encode(data)
202
- rescue => error
203
- print_error "unhandled exception occurred while encoding data"
204
- print_exception(error)
205
- exit(1)
206
- end
198
+ @pipeline.encode(data)
199
+ rescue => error
200
+ print_error "unhandled exception occurred while encoding data"
201
+ print_exception(error)
202
+ exit(1)
207
203
  end
208
204
 
209
205
  end
@@ -36,7 +36,7 @@ module Ronin
36
36
  # ronin-payloads launch [options] {-f FILE | NAME}
37
37
  #
38
38
  # ## Options
39
- #
39
+ #
40
40
  # -f, --file FILE The payload file to load
41
41
  # -p, --param NAME=VALUE Sets a param
42
42
  # -D, --debug Enables debugging messages
@@ -90,7 +90,7 @@ module Ronin
90
90
  begin
91
91
  @payload.perform_prelaunch
92
92
  @payload.perform_postlaunch
93
- rescue PayloadError => error
93
+ rescue PayloadError => error
94
94
  print_error("failed to launch payload #{@payload.class_id}: #{error.message}")
95
95
  exit(1)
96
96
  rescue => error
@@ -41,7 +41,7 @@ module Ronin
41
41
  # ronin-payload new [options] FILE
42
42
  #
43
43
  # ## Options
44
- #
44
+ #
45
45
  # -t asm|shellcode|c|go|rust|shell|powershell|html|javascript|typescript|java|sql|php|python|ruby|nodejs,
46
46
  # --type The type for the new payload
47
47
  # -a, --author NAME The name of the author
@@ -87,6 +87,7 @@ module Ronin
87
87
 
88
88
  indent do
89
89
  fields = {}
90
+
90
91
  fields['Type'] = payload_type(payload)
91
92
  fields['Summary'] = payload.summary if payload.summary
92
93
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  #
2
3
  # ronin-payloads - A Ruby micro-framework for writing and running exploit
3
4
  # payloads.