Metasploit mailing list archives

Locale in non-English exploit shell


From: jeweller20 at mail.ru (Vlad)
Date: Mon, 17 Nov 2008 00:48:30 +0300

Hello.

I've noticed another problem: if Metasploit itself is running on windows (tested on XP SP3 + russian MUI) and exploited 
workstation is also windows XP, all remote file and directory names written in CYRILLIC are not displayed correctly in 
any shell (meterpreter too). Your patch doesn't help in the case.

As I can see, the names are returned in unicode, but part of the unicode symbols which indicate language is replaced 
with 0x00.

Sorry for poor english.

When you explit non-English Windows, some text appear in wrong charset.
On russain Windows cmd.exe runs in cp866, meterpeter in cp1251. My Linux 
box run on UTF-8. So i needed recode cp866->UTF-8 in bindshell, and cp1251->UTF-8 in meterpeter.
To cd/download/... non-english dirs all commands must be transcoded back.
So whai is my patch. Charsets are hardcoded. Good idea is place charsets in
config, or autodetect from windows version.
svn diff

Index: lib/rex/ui/interactive.rb
===================================================================
--- lib/rex/ui/interactive.rb    (revision 5886)
+++ lib/rex/ui/interactive.rb    (working copy)
@@ -147,7 +147,7 @@
    #




Current thread: