Results 1 to 3 of 3
Hi, all.
please help me with this problem.
I want to run snort through a web application with exec("snort -v -i eth0 ") php function.
for example when start button ...
- 02-14-2009 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 10
connect to network adapter through a web application
Hi, all.
please help me with this problem.
I want to run snort through a web application with exec("snort -v -i eth0 ") php function.
for example when start button was pressed snort should be run,
but the execution failed with this error:
Running in packet dump mode
--== Initializing Snort ==--
Initializing Output Plugins!
Verifying Preprocessor Configurations!
Initializing Network Interface eth0
ERROR: OpenPcap() device eth0 open:
socket: Operation not permitted
Fatal Error, Quitting..
but when I run snort command via command line as root it will execute successfully.
I think this problem is for that apache user haven't access to network adapter, is my guess correct? I have no experience with apache, should I change apache configuration? what is the configuration for this problem.
thanks a lot for your attention.
- 02-14-2009 #2Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
see if this [ Shadows of epiphany Blog Archive How to run snort as a non-root user ] helps.
you should substitute user snort with your apache user and group snort with the group that runs apache (for example, in OpenSUSE, user=wwwrun, group=www)
- 02-15-2009 #3Just Joined!
- Join Date
- Aug 2008
- Posts
- 10
Hello,
I apply below command:
chown -R wwwrun:www /srv/www/htdocs/myprogram/snort
and changed my snort run command like this:
<?php
exec(/srv/www/htdocs/myprogram/snort/bin/snort -u wwwrun -g www -v -i eth0)
?>
but my problem didn't solve,I also test this:
chown -R root:www /srv/www/htdocs/myprogram/snort
but no difference,
I think I should find a way to allow apache to access but I don't know how?


Reply With Quote