Open Chiggins opened 7 years ago
yes hello
I think I can help
@Chiggins as to why str and words aren't being used, even tho they are passed in, I can't say, but I'm guessing the original intent was to use them, but that intent got lost and it was easier to just return the full paths because they are already available just my enumerating the modules loaded into the framework object. I think we can "remedy" this tho
That method definition is cargo-culted everywhere, so it wouldn't surprise me if those values were never even intended to be used. We can definitely fix this.
@Chiggins and I worked on it, and the problem at the moment is when you return any tab completion, something automatically adds a space to the end, which make it really painful to try to tab complete further... for example, w/our mods in place, you try use[tab][tab]
you get a list of module types, life is good, you do use expl[tab][tab]
you get back a prompt which has msf> use exploit_
where the '_' is actually a space, so you can't further tab complete w/o back spacing to get rid of the trailing space. I think it may come down to the Readline gem as there is a completion.append.character which is defined as the character that is automatically appended after the Readline.completion_proc is called, and AFAICT, I think that proc is the default tab_completion_proc in dispatcher_shell
Currently tab completion with module selection is kind of... lacking. Tab completion will work well for the module type, such as exploit, payload, etc, but then it will want to show all the possibilities for that module type, instead of recursing to the next "directory" under it.
What would be ideal is that from this point, it will tab complete for the payload platform..
Onward, you can tab complete the service type (http, smb, ftp, etc), and then module name.
From what I'm gathering, the beginning of this fix would start in the method at modules.rb:867. (also, why are neither
str
orwords
being used at all in that method?)I'm reporting this here for visibility. I've started poking into this issue, but framework is kind of confusing and it's taking me some time. @kernelsmith, any good helping hand ideas?
CC: @wvu-r7 @egypt