Metasploit mailing list archives

Re: windows/exec payload


From: Robert Larsen <robert () the-playground dk>
Date: Tue, 07 Aug 2012 23:18:13 +0200

On 08/07/2012 04:00 PM, HD Moore wrote:
Typically these match (length vs max length) and even if they don't, the
null byte wouldn't affect the hashing. At least, that is my vague
understanding of it. You may want to read through the source code under
external/source/shellcode/windows/x86/src/

Thanks for your reply.

On my machine "ntdll.dll" has length 0x12 and max length 0x14,
"kernel32.dll" has length 0x18 and max length 0x1a. Maybe max length
just adds room for the null terminator?

The hashing algorithm does this for each byte in the string (max length
bytes):

  ror edi, 13            ; Rotate right our hash value
  add edi, eax           ; Add the next byte of the name

...so the 'ror edi, 13' modifies the hash even for null bytes.

However, I have never seen the code fail, so maybe these numbers are in
fact stable...but would it not be more safe to use the length?

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


Current thread: