LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-11-2015, 04:59 AM   #16
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600

Quote:
Originally Posted by A Gallina View Post
Code:
Apr 10 20:58:50 zina-desktop named[1280]: error

Apr 10 20:58:51 zina-desktop kernel: [   77.766479] init: plymouth-stop pre-start process (3085) terminated with status 1
These log lines are not related to Snort or Barnyard2.


Quote:
Originally Posted by A Gallina View Post
/etc/init.d/barnyard2 looks like this.
Code:
#!/bin/sh
The characters before "#!/bin/sh" must be removed.


Quote:
Originally Posted by A Gallina View Post
Code:
Apr 10 20:58:49 zina-desktop barnyard2[2812]: Parsing config file "/etc/snort/barnyard2.conf"

Apr 10 20:58:51 zina-desktop barnyard2[3062]: Parsing config file "/etc/snort/barnyard.conf"
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.
 
1 members found this post helpful.
Old 04-16-2015, 01:56 AM   #17
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
Thank you again unSpawn

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.
 
Old 04-19-2015, 04:04 AM   #18
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by A Gallina View Post
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 View Post
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.
 
1 members found this post helpful.
Old 04-19-2015, 12:30 PM   #19
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
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.
 
Old 04-25-2015, 05:53 AM   #20
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
1 members found this post helpful.
Old 04-26-2015, 01:50 PM   #21
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
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
 
Old 04-29-2015, 11:55 AM   #22
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
Red face

Ok figured it out here is that post you asked for.

Code:
zina@zina-desktop:~$ ps --no-headers -C barnyard2 -o cmd;
barnyard2 -D -c /etc/snort/barnyard2.conf -d /var/log/snort -f snort.log -n

zina@zina-desktop:~$ sudo su
root@zina-desktop:/home/zina# /etc/init.d/runbarnyard2 stop
Stopping Barnyard2
Barnyard2 stopped.
root@zina-desktop:/home/zina# barnyard2 -c /etc/snort/barnyard2.conf /var/log/snort -f snort.log -n
Running in Continuous mode

        --== Initializing Barnyard2 ==--
Initializing Input Plugins!
Initializing Output Plugins!
Parsing config file "/etc/snort/barnyard2.conf"
What do we do next?
 
Old 04-30-2015, 02:32 PM   #23
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by A Gallina View Post
Code:
root@zina-desktop:/home/zina# barnyard2 -c /etc/snort/barnyard2.conf /var/log/snort -f snort.log -n
Running in Continuous mode

        --== Initializing Barnyard2 ==--
Initializing Input Plugins!
Initializing Output Plugins!
Parsing config file "/etc/snort/barnyard2.conf"
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).
 
Old 04-30-2015, 10:03 PM   #24
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
Yes it really showed only those 5 lines. Commented out line 85 in barnyard2.conf #config daemon
 
Old 05-01-2015, 01:15 AM   #25
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
OK. So be it. Send me an email please so we can discuss you dropping off your snort.conf, barnyard2.conf and my.conf.
 
Old 05-01-2015, 01:49 AM   #26
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
Thank you unSpawn. Tried to PM you. The board said I did'nt have access rights.
 
Old 05-01-2015, 05:26 AM   #27
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
How can I get your e-mail address?
 
Old 05-02-2015, 05:36 AM   #28
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Ask Jeremy to forward email to me?
 
Old 05-03-2015, 12:32 PM   #29
A Gallina
LQ Newbie
 
Registered: Apr 2004
Posts: 25

Original Poster
Rep: Reputation: 0
That's very interesting. But who is Jeremy?
 
Old 05-03-2015, 01:25 PM   #30
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with snort, error when starting barnyard2 l33y Linux - Newbie 1 07-16-2014 09:06 PM
Using barnyard2 with newer versions of Snort (no mysql) Scottish_Jason Linux - Server 2 01-30-2014 06:39 PM
adding Barnyard2 to Snort w/MySQL - no MySQL error when it was working before estars100 Linux - Software 0 04-10-2013 11:44 PM
Snort with barnyard2 pra838 Linux - Server 3 08-16-2012 04:18 AM
LXer: Intrusion Detection: Snort, Base, MySQL, and Apache2 On Ubuntu 7.10 (Gutsy Gibb LXer Syndicated Linux News 0 11-21-2007 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration