This patch adds new behaviour to CMD option.
Now if CMD is empty or unset, a 21 byte not null-free execve payload is built.
The arbitrary command option continues the same when CMD is set.
It also adds the OptBool NullFreeVersion advanced option.
Its default value is false. When set as true, generate will output a
self included null-free version of the payload without need of encoding.
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
This patch converts shellcode to metasm and make it more efficient, resulting
in its size being reduced to 37 bytes + CMD length.
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Calling .new on payload modules does not perform parameter validation, leading
to a number cached sizes based on invalid parameters. Most notably,
normalization does not occur either, which makes all OptBool params default to
true.
See the complaint on #4039. This doesn't fix that particular
issue (it's somewhat unrelated), but does solve around
a file parsing problem reported by @void-in