Ticket #167 (new defect)

Opened 1 year ago

Last modified 10 months ago

Payload encoders fall-through behavior unexpected.

Reported by: druid@caughq.org Assigned to: hdm
Priority: minor Milestone: Metasploit 3.2
Component: framework3 Version:
Keywords: encoder Cc:

Description

When enabling a payload encoder, if a specific encoder is specified as the desired encoder for the payload, if that encoder fails to encode the payload metasploit silently attempts other encoders until one of them is successful. The only way to know that this is happening is to watch the log output for encoder failures. If a specific encoder is specified, it seems more reasonable to attempt only the encoder specified and bail out of the exploit attempt if the desired encoder fails. The fall-through behavior is useful, however I don't believe it should be the default. I would suggest semantics such as are described in the following use cases:

1: set ENCODER my_encoder == only my_encoder is attempted, if it fails, the exploit fails.

2: set ENCODER pref(erred) == the preferred encoder list is traversed, attempting all preferred encoders until one succeeds. This is currently the default behavior.

3: set ENCODER any == any and all encoders are attempted until one succeeds

This is directly relative to my recent modifications of encoders to optionally support the use of context-keys. If a user selects an encoder and indicates that they want to use context keying, encoders which do not support context-keys should not be attempted. Currently, it is desired that this be achievable by explicitly defining the encoder to use, ala use-case #1 above. In use-case #2 and #3, it would be expected that if a encoder is attempted that does not support context-keys, context-keying is ignored for that encoder (current behavior).

Change History

12/27/07 11:37:55 changed by hdm

  • milestone set to Metasploit 3.2 Release.

This is expected behavior (since 2.7 did this as well). We should change and document this better for 3.2