Need help testing Snort, Barnyard2,PulledPork,BASE IDS is not loging to mysql
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Here it shows you run 2 Barnyard2 processes and worse: each using their own configuration file! From the information you provided you seem to have 2 init scripts: /etc/init.d/barnyard2 and /etc/init.d/runbarnyard2. You must only use one. Stop them both. Now open up a separate terminal (or screen) window in which you run 'tail -f /var/log/messages' and then start /etc/init.d/barnyard2. If the output looks good then remove /etc/init.d/runbarnyard2.
I ran this from a terminal to unlock the files for editing.
Code:
zina@zina-desktop:~$ sudo service snort stop
[sudo] password for zina:
* Stopping Network Intrusion Detection System snort [ OK ]
zina@zina-desktop:~$ sudo service barnyard2 stop
/etc/init.d/barnyard2: 1: /etc/init.d/barnyard2: #!/bin/sh: not found
$Shutting down Snort Output Processor (barnyard2):
Then looked at the property's of the /etc/init.d/barnyard2 and /etc/init.d/runbarnyard2 files by right clicking on them and noticed that they were set to run as program. Cool simple matter of elimination. Deselected the run as program check box on the /etc/init.d/barnyard2 file.
Hey I got lucky it now starts barnyard2 without trying to start it twice and crashing. I checked this through syslog.
Now I guess the next thing to do would be to figure out why baryard2 wont log to the MySQL data base.
It is getting better! Any tips on trouble shooting will be appreciated thank you.
Then looked at the property's of the /etc/init.d/barnyard2 and /etc/init.d/runbarnyard2 files by right clicking on them and noticed that they were set to run as program. Cool simple matter of elimination. Deselected the run as program check box on the /etc/init.d/barnyard2 file.
I said you should delete one of the SysV ini scripts but of course it's your choice to ignore advice : - )
Quote:
Originally Posted by A Gallina
Now I guess the next thing to do would be to figure out why baryard2 wont log to the MySQL data base.
Please first confirm rules actually fire during your setup phase either by configuring Barnyard2 to log to binary log file or syslog. Also use your MySQL client to connect to the database the way Barnyard2 does and see if you can add a log entry manually.
Thanks again I just deleted the other barnyard2 init was not my intention to ignore good advice.
Barnyard2 is set to log to syslog.
Connected to the mysql data base snort is using.
Code:
mysql Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (i686) using readline 6.3
Connection id: 52
Current database: snort
Current user: snort@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.41-0ubuntu0.14.04.1 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 56 min 45 sec
Threads: 2 Questions: 253 Slow queries: 0 Opens: 407 Flush tables: 1 Open tables: 100 Queries per second avg: 0.074
Please explain more about how to add a log entry manually. Like what would that command look like in the terminal? And should I then check to see if it was entered? How would I do that? Thank you unspawn.
Lets try something more basic first. As root:
- Find out how Barnyard2 is started by running '\ps --no-headers -C barnyard2 -o cmd;'
- Stop Barnyard2.
- Start Barnyard2 from the command line using all arguments but remove any "-D" and any "-q".
- Post all output here.
Hello when ran from a terminal on my Ubuntu system I am getting nothing from this.
Find out how Barnyard2 is started by running '\ps --no-headers -C barnyard2 -o cmd;'
So I am not sure how to Start Barnyard2 from the command line using all arguments but remove any "-D" and any "-q".
As that command for some reason didnt give me any out put. Thanks
Did it REALLY only show those 5 lines on stdout (or syslog)???
Should be a line or 50 at least depending on your configuration...
Also note your /etc/snort/barnyard2.conf should not have a line "config daemon" (or temporarily comment it out).
You've been a member for over a decade and you don't know Jeremy owns LQ?..
Never mind. Do prepare your configuration files as per post #5 then attach them to your reply as plain text files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.