LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-28-2009, 05:02 AM   #1
AJones
Member
 
Registered: Feb 2005
Posts: 95

Rep: Reputation: 16
SNORT IDS not starting at Boot


Hi:

I installed Snort on my home computer. It does not start a boot. I have a home DSL connection. I have to manually enter

sudo snort to get it started. I tried dpkg-reconfigure snort and chose Boot option. Still it does not start at boot. How do I make it start at boot.

Thanks,

AJ
 
Old 11-28-2009, 05:25 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

What's showing up in your log files? messages, syslog, snort log file, ....

Furthermore what distro are you using?

Kind regards,

Eric
 
Old 11-28-2009, 05:40 AM   #3
AJones
Member
 
Registered: Feb 2005
Posts: 95

Original Poster
Rep: Reputation: 16
Hi:

I am using Kanotix Thorhammer upgraded to Debian Lenny. This is what I get in messages and syslog

Nov 28 10:31:34 Hilbert kernel: [ 1103.536277] snort uses obsolete (PF_INET,SOCK_PACKET)

I am using Snort currently manually. I did not see any snoprt PID upon boot.

Thanks,

AJ
 
Old 11-28-2009, 05:55 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

I found this through Google. Look into it and check what they are mentioning.

Quote:
* Linux:
--------
With kernels 2.2.x and higher you may get `snort [pid] uses obsolete
(PF_INET, SOCK_PACKET)' warnings. This is because you use some older
implementation of libpcap library and you need an upgrade. The recent
version of libpcap could be found at www.tcpdump.org page. On linux
with kernels 2.2.x and higher you may also get feature to monitor
several interfaces down to network level (session + TCP + IP) if you
link your snort with the lattest version of libpcap which incorporates
Sebastian Krahmer's patch for interface 'any'.
from http://read.pudn.com/downloads111/so.../INSTALL__.htm

Kind regards,

Eric
 
Old 11-28-2009, 06:18 AM   #5
AJones
Member
 
Registered: Feb 2005
Posts: 95

Original Poster
Rep: Reputation: 16
Hi:

I installed the latest version of libpcap program, I still dont get snort started up at boot.

Thanks,
AJ
 
Old 11-28-2009, 06:30 AM   #6
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

What arguments did you give to snort when starting manually? And can you check if you have a startup script present in your /etc/rcX.d directory (where X is your runlevel).

Kind regards,

Eric
 
Old 11-28-2009, 06:41 AM   #7
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 EricTRA View Post
What arguments did you give to snort when starting manually? And can you check if you have a startup script present in your /etc/rcX.d directory (where X is your runlevel).
...and if that doesn't show clues check your syslog for snort-related startup messages and see 'man snort' for "-T".
 
Old 11-28-2009, 06:45 AM   #8
AJones
Member
 
Registered: Feb 2005
Posts: 95

Original Poster
Rep: Reputation: 16
Hi:

I give sudo snort in Konsole. There was no link to snort at any levels rcX.d. I created a link to /etc/init.d/snort in /etc/rc5.d. I will see it snort runs at startup now.

Thanks,
AJ
 
Old 11-28-2009, 06:48 AM   #9
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Great!

Be sure to check your logs when you have rebooted and check that snort is really running.

Kind regards,

Eric
 
Old 11-28-2009, 07:09 AM   #10
AJones
Member
 
Registered: Feb 2005
Posts: 95

Original Poster
Rep: Reputation: 16
Hi:

At boot I get a message stating IDS Snort starting. I get these error messages in /var/log/syslog

Nov 28 12:56:43 Hilbert snort[4965]: Initializing daemon mode
Nov 28 12:56:43 Hilbert snort[4987]: OpenPcap() device eth0 network lookup: eth0: no IPv4 address assigned
Nov 28 12:56:43 Hilbert snort[4987]: PID path stat checked out ok, PID path set to /var/run/
Nov 28 12:56:43 Mantra snort[4987]: Writing PID "4987" to file "/var/run//snort_eth0.pid"
Nov 28 12:56:43 Hilbert snort[4987]: Daemon initialized, signaled parent pid: 4965
Nov 28 12:56:43 Hilbert snort[4987]: FATAL ERROR: OpenAlertFile() => fopen() alert file /var/log/snort/alert: Permission denied
Nov 28 12:56:43 Hilbert snort[4965]: Daemon parent exiting

I see that it is unable to open alert file. I get this when I do ls -al in /var/log

drwxr-s--- 2 snort adm 312 2009-11-28 13:02 snort/


It is exiting becoz it is unable to write to snort directory. Should I change permissions on this directory?

Thanks

AJ
 
Old 11-28-2009, 07:32 AM   #11
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

What's the user snort runs at? Check with
Code:
ps -aux | grep snort
then change permissions on the snort log directory accordingly.

Kind regards,

Eric
 
Old 11-28-2009, 07:44 AM   #12
AJones
Member
 
Registered: Feb 2005
Posts: 95

Original Poster
Rep: Reputation: 16
Hi:

I get this message with ps -aux | grep snort


root 7161 51.4 57.9 173976 147860 pts/5 S+ 13:40 0:09 snort
alan 7228 0.0 0.2 5848 724 pts/4 S+ 13:41 0:00 grep --color=auto snort

It runs as root.

ls -al in /var/log gives me this

drwxr-x--- 2 snort adm 312 2009-11-28 13:41 snort/

Should chown it to root or alan.

Thanks

AJ
 
Old 11-28-2009, 07:59 AM   #13
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Just checked mine and they're set to root:root for the /var/log/snort directory.

So I'd say yes, change them to root and try again.

Kind regards,

Eric
 
Old 11-28-2009, 08:11 AM   #14
AJones
Member
 
Registered: Feb 2005
Posts: 95

Original Poster
Rep: Reputation: 16
Hi:

I changed it to root, I got an error stating /var/log/snort should be owned by snort. I changed the ownership to snort:root instead of snort:adm. The initial messages at boot are that Snort has started. But I get nothing when I enter ps -A . I just dont understand why it does not start. The messages that flash in the beginning are they stored in /var/log/messages or /var/log/dmesg. I continue to get this error

from /var/log/syslog

Nov 28 14:01:58 Hilbert snort[4986]: Daemon initialized, signaled parent pid: 4966
Nov 28 14:01:58 Hilbert snort[4966]: Daemon parent exiting
Nov 28 14:01:58 Hilebert snort[4986]: FATAL ERROR: OpenAlertFile() => fopen() alert file /var/log/snort/alert: Permission denied


This is such a silly problem. I am unable to fix it.

Thanks,
Alan
 
Old 11-28-2009, 08:14 AM   #15
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Maybe the alert log doesn't get created. Do the following:
Code:
cd /var/log/snort
touch alert
chown snort:adm alert
chmod 664 alert
and then try again.

Kind regards,

Eric
 
  


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
[HELP]SNORT PROBLEMS(IDS)-service snort start JayCool Linux - Software 5 03-15-2009 12:34 PM
How to setup snort IDS saini_mw Linux - Security 2 05-15-2006 07:46 AM
developing an ids using snort chax Linux - Networking 1 01-10-2006 11:51 AM
Snort/ACID as an IDS WeNdeL Linux - Security 4 09-10-2004 12:14 PM
snort (ids) not working please help!!! crealkillerI75 Slackware 5 07-18-2002 03:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:50 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