LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 04-18-2024, 10:27 AM   #1
lvelazquez
LQ Newbie
 
Registered: Apr 2024
Posts: 4

Rep: Reputation: 0
Smile Send snort alerts to web page


In order to understand what I'm trying to do I explain it more detailed:

I have 2 VMs with CentOS 7, I installed and set up snort-2.9.16 in one and I configured rules for detect HTTP, ICMP, FTP and SSH traffic.

Let's see how it works:

I wrote in my VM client:
[root@localhost gvelazquez]# curl 172.20.0.2
<html>
<title> Snort Logs </title>
<body> <h1> These are the snort logs </h1>
</body>
</html>

And in my VM Server (Where snort it's installed) I can see these messages:

[root@srvcentos etc]# snort -A console -q -u snort -u snort -c /home/lvelazquez/Downloads/snort-2.9.16/etc/snort.conf -i enp0s8
04/16-10:41:17.188144 [**] [1:10000040:1] HTTP Traffic Detected [**] [Priority: 0] {TCP} 172.20.130.254:36830 -> 172.20.0.2:80
04/16-10:41:17.189102 [**] [1:10000040:1] HTTP Traffic Detected [**] [Priority: 0] {TCP} 172.20.130.254:36830 -> 172.20.0.2:80
04/16-10:41:17.189116 [**] [1:10000040:1] HTTP Traffic Detected [**] [Priority: 0] {TCP} 172.20.130.254:36830 -> 172.20.0.2:80
04/16-10:41:17.191968 [**] [1:10000040:1] HTTP Traffic Detected [**] [Priority: 0] {TCP} 172.20.130.254:36830 -> 172.20.0.2:80
04/16-10:41:17.192491 [**] [1:10000040:1] HTTP Traffic Detected [**] [Priority: 0] {TCP} 172.20.130.254:36830 -> 172.20.0.2:80
04/16-10:41:17.193620 [**] [1:10000040:1] HTTP Traffic Detected [**] [Priority: 0] {TCP} 172.20.130.254:36830 -> 172.20.0.2:80


172.20.0.2 is the Ip address of my web server, I want to see these messages in my web server, but I don't know how to do it. I know that the logs of snort are in /var/log/snort so first I thought in just forwarded these logs like this:

cat /var/log/snort > /var/www/html/index.html

(/var/www/html/index.html is the path of where my web server is)

it didn't work, the web server was just filled with symbols, and nothing could be read, and the most appropriate thing would be for snort to write in index.html but I don't know how.

Can you help me?
 
Old 04-18-2024, 10:44 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,313
Blog Entries: 3

Rep: Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723Reputation: 3723
There are several ways to do that. One way would be to make a symbolic link from your web server's DocumentRoot to the file /var/log/snort and then assign the original file a group (or ACL) which allows the group www-data to read from it, but not write to it. Then fix the logrotate utility's configuration so that those settings are preserved. Then turn on Server-Side Include noexec for that directory on your Apache2 instance. After that you can point to your log file's symbolic link with your index.shtml file:

Code:
<html>
<title> Snort Logs </title>
<body> 
 <h1> These are the snort logs </h1>
 <pre>
  <!--#include virtual="/snort"-->
 </pre>
</body>
</html>
You might want to use Basic Auth to put a password on that file if there are multiple people using the LAN or, especially, if you plan to serve it via the open net. See also the HTML tidy utility with its -indent option.
 
1 members found this post helpful.
  


Reply

Tags
centos 7, snort



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Snort alerts on Web Server lvelazquez Linux - Newbie 5 04-18-2024 07:48 PM
Snort - no portscan and tcp alerts in snort av.dubey Linux - Software 6 07-11-2008 09:56 PM
Snort Alerts knight_ridda Linux - Security 13 06-21-2003 04:32 PM
Interpreting Snort log files and alerts epeus Linux - Security 6 10-21-2002 09:47 AM
I need a way to automate emailing of snort alerts Olusegun Linux - Software 1 10-19-2002 12:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 09:54 AM.

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