t3l3machus / Villain

Villain is a high level stage 0/1 C2 framework that can handle multiple TCP socket & HoaxShell-based reverse shells, enhance their functionality with additional features (commands, utilities) and share them among connected sibling servers (Villain instances running on different machines).
Other
3.72k stars 598 forks source link

Catch EOFError at prompt #54

Closed bcoles closed 1 year ago

bcoles commented 1 year ago

Prior to this PR, pressing ctrl+d at the main Villain prompt resulted in termination of the Villain process. This is unexpected. I would expect this to behave identically to ctrl+c - that is, if sessions are open, prompt the user to confirm exit.

Prior to this PR, pressing ctrl+d from within shell <session id> would terminate both the shell and the Villain process. This is unexpected. I would expect this to behave identically to ctrl+c - that is, terminate only the shell and return to the Villain prompt.

After this PR, pressing ctrl+d in both scenarios described above will result in identical behavior to pressing ctrl+c.

Tested with Python 3.10.8 on Linux.