firnsy / barnyard2

Barnyard2 is a dedicated spooler for Snort's unified2 binary output format.
GNU General Public License v2.0
343 stars 189 forks source link

Barnyard2 config won't escape symbols in passwords #194

Open wilesproof opened 7 years ago

wilesproof commented 7 years ago

I was setting up barnyard2 as per the ubuntu snort guide, and ran into a problem with the following line:

output database: log, mysql, user=snort password=MySqlSNORTpassword dbname=snort host=localhost

Using a complex password with non-shell-friendly symbols (eg 1234567!@#$%^&aBcDeFg) without escaping predictably caused a parse error. But using single-quotes to escape the password didn't work, and double quotes cause some sort of misread of the password, so authentication would fail.

EG:

mysql -e CREATE USER snort@localhost IDENTIFIED BY '1234567!@#$%^&aBcDeFg';

barnyard2.conf: output database: log, mysql, user=snort password=1234567!@#$%^&aBcDeFg dbname=snort host=localhost => Parse error output database: log, mysql, user=snort password='1234567!@#$%^&aBcDeFg' dbname=snort host=localhost => Parse error output database: log, mysql, user=snort password="1234567!@#$%^&aBcDeFg" dbname=snort host=localhost => MySQL authentication error

Is there another method of escaping variables in this config I should be using instead? Thanks!