epinna / weevely3

Weaponized web shell
GNU General Public License v3.0
3.21k stars 605 forks source link

onecmd doesn't work without full session #160

Closed theguly closed 7 months ago

theguly commented 1 year ago

running weevely in the "onecmd" mode as per https://github.com/epinna/weevely3/blob/master/weevely.py#L59 doesn't run anything if the session has not been established beforehands.

i guess the self.default() called at https://github.com/epinna/weevely3/blob/0bae932d5cb0e96370e1b76fbdb6ca84bd42c0ed/core/terminal.py#L106 after no do_ or doalias commands are found doesn't support an session with empty default_shell

to reproduce:

now force a shell_sh:

open a session and run a single command:

ZanyMonk commented 7 months ago

Fixed by 3fe896a.