Metasploit mailing list archives

Re: Escape characters


From: Patrick Webster <patrick () aushack com>
Date: Sat, 2 Apr 2011 02:18:14 +1100

I'm not aware of any specific requirements. It is essentially the
console (i.e. /bin/[?]sh or cmd.exe) which acts on the special
chars... so anything non a-z, 0-9, space & period. Everything else is
potentially special and must be escaped.

In real world tests, I tend to subconsciously escape everything and
have never had any issues... \& vs &, whether special or not, should
still be & at execution. (I've also used msf host-based escaping where
code on victim needs escaping too, so \\& = \& = '&' at runtime :)

-Patrick

On Fri, Apr 1, 2011 at 6:22 PM, Eric <dkn4a1 () gmail com> wrote:
No. I'm not trying to encode the shellcode.

Suppose, I want to generate a payload executable with msfpayload for
windows/exec payload with parameter CMD=cmd /c start calc & start
notepad
In this case, obviously I need to escape spaces, \ and & characters, like
msfpayload windows/exec CMD=cmd\ \/c\ start\ calc\ \&\ start\ notepad

Likewise, which all character I need to escape to make it work perfectly fine?

On Fri, Apr 1, 2011 at 12:36 PM, Jose Selvi <jselvi () pentester es> wrote:
MSFEncode is who encode the payload without badchars.
Badchars depends on wich vulnerability are you exploiting. Each
vulnerability has their own badchars so there isn't a single list of
universal badchars. Some of them are quite common like 0x00 (end of string),
but I think there isn't any universal list.

What vulnerability are you exploiting?

Regards.

El 01/04/11 08:53, Eric escribió:

Hello all,

What all special characters should be escaped with msfpayload?
I believe<  >  ; : ' " / ( ) %&

Could I find documentation regarding this somewhere?

Thanks in advance.

--
Jose Selvi.
Security Technical Consultant
CISA, CISSP, CNAP, GCIH, GPEN

http://www.pentester.es

SANS Mentor in Madrid (Spain). September 23 - November 25
SEC560: Network Penetration Testing and Ethical Hacking
http://www.sans.org/mentor/details.php?nid=24133
http://www.pentester.es/2010/12/nuevo-grupo-y-descuento-para-network.html
_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework

_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework

_______________________________________________
https://mail.metasploit.com/mailman/listinfo/framework


Current thread: