From 8ab3b6c1784306f82d07e3203cd632a20967a50d Mon Sep 17 00:00:00 2001 From: cgranleese-r7 Date: Fri, 30 Aug 2024 11:10:40 +0100 Subject: [PATCH] Address PR feedback --- spec/acceptance/command_shell_spec.rb | 2 +- spec/support/acceptance/command_shell/linux.rb | 4 ++-- test/modules/post/test/cmd_exec.rb | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/command_shell_spec.rb b/spec/acceptance/command_shell_spec.rb index 6fe6b1e1057d..46436afd5d74 100644 --- a/spec/acceptance/command_shell_spec.rb +++ b/spec/acceptance/command_shell_spec.rb @@ -411,7 +411,7 @@ def get_file_attachment_contents(path) validated_lines.each do |test_line| test_line = Acceptance::CommandShell.uncolorize(test_line) - expect(test_line).to_not include('FAILED', '[-] FAILED', '[-] Exception', '[-] '), "Unexpected error: #{test_line}" + expect(test_line).to_not include('FAILED', '[-] '), "Unexpected error: #{test_line}" end # Assert all expected lines are present diff --git a/spec/support/acceptance/command_shell/linux.rb b/spec/support/acceptance/command_shell/linux.rb index cd80bd4e20c3..98c6924b5945 100644 --- a/spec/support/acceptance/command_shell/linux.rb +++ b/spec/support/acceptance/command_shell/linux.rb @@ -3,10 +3,10 @@ module Acceptance::CommandShell payloads: [ { name: "cmd/unix/reverse_bash", - extension: "", + extension: ".sh", platforms: [:linux], executable: true, - execute_cmd: ["${payload_path}"], + execute_cmd: ["sh ${payload_path}"], generate_options: { '-f': "raw" }, diff --git a/test/modules/post/test/cmd_exec.rb b/test/modules/post/test/cmd_exec.rb index 0d339310634c..bf0dcd7a60e7 100644 --- a/test/modules/post/test/cmd_exec.rb +++ b/test/modules/post/test/cmd_exec.rb @@ -38,6 +38,8 @@ def show_args_binary { path: 'show_args.exe', cmd: "#{pwd}\\show_args.exe" } elsif session.platform == 'windows' && session.type == 'shell' { path: 'show_args.exe', cmd: 'show_args.exe' } + elsif session.platform == 'windows' && session.arch == 'php' + { path: 'show_args.exe', cmd: '.\\show_args.exe' } elsif session.platform == 'windows' { path: 'show_args.exe', cmd: './show_args.exe' } elsif session.type == 'meterpreter' && session.arch == 'java'