If we don't include a value when setting a variable in a .cap file, the entire caplet is ignored, and no errors are shown (only with -debug).
Please provide:
v2.2Linux ghxst 4.14.0-kali3-amd64 #1 SMP Debian 4.14.17-1kali1 (2018-02-16) x86_64 GNU/Linuxgo1.10rc2 linux/amd64sudo bettercap -caplet caplets/issue187.cap# test if the code prior is included or ignored
http.server on
# set an empty value
set http.proxy.port
# try starting a module
http.proxy on
bettercap -debug ... ).Command:
sudo bettercap -caplet caplets/issue187.cap -debug
Output:
[12:51:24] [mod.started] net.recon
[12:51:24] [mod.started] update
[12:51:24] [sys.log] [err] Error while runnig caplet /root/caplets/issue187.cap: Unknown or invalid syntax "set http.proxy.port", type help for the help menu.
192.168.1.0/24 > 192.168.1.19 » [12:51:25] [sys.log] [inf] You are running 2.2 which is the latest stable version.
192.168.1.0/24 > 192.168.1.19 » [12:51:25] [mod.stopped] update
# test if the code prior is included or ignored
http.server on
# set an empty value
set http.proxy.port
# try starting a module
http.proxy on
sudo bettercap -caplet caplets/issue187.capExpected behavior: It throws a warning and sticks to the default value (and also warns the user that this has happened).
Actual behavior: WIthout using -debug, no errors are shown, and no caplet code is executed.
--
♥ ANY INCOMPLETE REPORT WILL BE CLOSED RIGHT AWAY ♥
stupid autocomment hotkeys...
updated :+1:
So, this is not -exactly- what it seems (not realted to -debug at all :D), what it happens is that the events.stream is started but, if an error occurs just after it started, the log event will not be printed (and -this- is the bug).
This commit just fixes the events.stream so that the logs are correctly buffered and then printed :)