From 7818e36244826f465af60d9ddf9077c13ed0424a Mon Sep 17 00:00:00 2001 From: unKn0wnUser453 <61127067+unKn0wnUser453@users.noreply.github.com> Date: Fri, 26 Feb 2021 11:20:44 -0500 Subject: [PATCH 1/2] Update evil-winrm.rb ANSI was not being interpreted using Readline (not sure why) --- evil-winrm.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evil-winrm.rb b/evil-winrm.rb index d0e96c0..b6753f1 100755 --- a/evil-winrm.rb +++ b/evil-winrm.rb @@ -456,7 +456,8 @@ def main until command == "exit" do pwd = shell.run("(get-location).path").output.strip if $colors_enabled then - command = Readline.readline(self.colorize("*Evil-WinRM*", "red") + self.colorize(" PS ", "yellow") + pwd + "> ", true) + print(self.colorize("*Evil-WinRM*", "red") + self.colorize(" PS ", "yellow") + pwd + "> ") + command = Readline.readline('', true) else command = Readline.readline("*Evil-WinRM* PS " + pwd + "> ", true) end From d055a678ae8369ff127dfc08d0b08fd6875b4132 Mon Sep 17 00:00:00 2001 From: unKn0wnUser453 <61127067+unKn0wnUser453@users.noreply.github.com> Date: Sat, 6 Mar 2021 08:56:07 -0500 Subject: [PATCH 2/2] Fix ANSI --- evil-winrm.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/evil-winrm.rb b/evil-winrm.rb index b6753f1..2270768 100755 --- a/evil-winrm.rb +++ b/evil-winrm.rb @@ -234,7 +234,7 @@ def docker_detection() def colorize(text, color = "default") colors = {"default" => "38", "blue" => "34", "red" => "31", "yellow" => "1;33", "magenta" => "35"} color_code = colors[color] - return "\033[0;#{color_code}m#{text}\033[0m" + return "\001\033[0;#{color_code}m\002#{text}\001\033[0m\002" end # Messsage printing @@ -456,8 +456,7 @@ def main until command == "exit" do pwd = shell.run("(get-location).path").output.strip if $colors_enabled then - print(self.colorize("*Evil-WinRM*", "red") + self.colorize(" PS ", "yellow") + pwd + "> ") - command = Readline.readline('', true) + command = Readline.readline(self.colorize("*Evil-WinRM*", "red") + self.colorize(" PS ", "yellow") + pwd + "> ", true) else command = Readline.readline("*Evil-WinRM* PS " + pwd + "> ", true) end