From 7e4a666e1b433916cef5c8fa650510226955e918 Mon Sep 17 00:00:00 2001 From: Wang Yihang Date: Sun, 12 Aug 2018 04:54:08 +0800 Subject: [PATCH] [+] Modify script arguments, change LOG_FILE to /dev/null --- lib/msf/base/sessions/command_shell.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/msf/base/sessions/command_shell.rb b/lib/msf/base/sessions/command_shell.rb index 357c32556e..96150a4373 100644 --- a/lib/msf/base/sessions/command_shell.rb +++ b/lib/msf/base/sessions/command_shell.rb @@ -243,7 +243,10 @@ class CommandShell script_path = binary_exists("script") if script_path != nil print_status("Using `script` to pop up an interactive shell") - shell_command(script_path) + # Payload: script /dev/null + # Using /dev/null to make sure there is no log file on the target machine + # Prevent being detected by the admin or antivirus softwares + shell_command("#{script_path} /dev/null") return end