Home > Articles

Dissecting Snort

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Output Plugins

Snort's output plugins are the means Snort has to get intrusion data to you. The purpose of the output plugins is to dump alerting data to another resource or file. Multiple outputting plugins can be activated to perform different functions. Loads of external applications—some even built exclusively for Snort—are designed to read Snort's output and manage intrusion data. Chapters 6 and 11 examine some of these applications.

Output plugins can be a major bottleneck for Snort. Snort can read and process packets quickly, but bogs down when trying to write to a slow database or over a network. Database output plugins are not used in high-bandwidth environments. It is recommended to configure Snort to spool to unified format and let Snort's unified log application, Barnyard, take over. Snort has 12 output plugins that push out data in different formats.

Alert_fast

Alert_fast is the quick and dirty outputting mechanism for Snort. It spits out alerts in a one-line file as fast as the detection engine can spawn them. With Alert_fast Snort does not write packet headers, making it a fast but brief method of logging. Alert_fast takes one configuration option.

[filename] is simply the name of the file for Alert_fast to log to. The log is created in the default logging directory (/var/log/snort) or the directory specified.

Alert_full

This is a somewhat antiquated logging facility for Snort, but still useful for low- bandwidth networks. Alert_full creates a directory for each IP that generates an alert and fills it with decoded packet dumps. It includes the packet headers in the dumps, unlike Alert_fast. It has one configuration option.

[filename] is simply the name of the file for Alert_full to log to. The log is created in the default logging directory (/var/log/snort) or the directory specified.

Alert_smb

Alert_smb is another antiquated output plugin. It sends windows SMB requests to Windows machines. If you take perverse pleasure in clearing message boxes hour after hour, this plugin is for you. Alert_smb sends alerting information in the clear, and executes an external binary with root privileges, making it a security risk in and of itself. Alert_smb has one configuration option.

[alertworkstationlist] is a file listing workstation to be notified. The format of the workstation file is a list of the NETBIOS names of the hosts, one per line.

Alert_unixsock

This plugin sets up a Unix domain socket and sends alerts to it. External programs/processes can listen in on this socket and receive Snort alert and packet data in real time. This plugin does not work with Windows installations, for obvious reasons. Alert_unixsock has no configuration options.

Log_tcpdump

Log_tcpdump logs packets to the famous tcpdump file format. There exists a wide assortment of applications and tools designed to read tcpdump output. This module enables you to use them in conjunction with Snort. Log_tcpdump has one configuration option.

[filename] is the name of the output file. The [filename] will have the <month><date>@<time> prepended to it. This is to keep data from separate Snort runs distinct.

CSV

The CSV plugin outputs to a comma delimited file. CSV files are easily imported into other databases and spreadsheets. The data separated by commas can be organized in any manner required. You can use CSV to write as few as one field or all 24. CSV takes two configuration options.

[filename]

This is the name of the output file.

[default | field list]

Here you can list out the fields in your desired order. The possible fields are:

timestamp
msg
proto
src
srcport
dst
dstport
ethsrc
ethdst
ethlen
tcpflags
tcpseq
tcpack
tcplen
tcpwindow
ttl
tos
id
dgmlen
iplen
icmptype
icmpcode
icmpid
icmpseq

You can modify this list to output the fields you want in the order you desire. If you specify default, CSV outputs a comma-separated file in the preceding order.

XML

The XML plugin allows you to log to Simple Network Markup Language (SNML). SNML can be used to collect data from many different sensors in a single management database. The XML plugin logs via encrypted or plain text HTTP sessions. XML has a unique sanitization feature. With the santization feature enabled, all IP addresses will be outputted with the mask, XXX.XXX.XXX.XXX. You can then anonymously submit your intrusion data for review by other entities, such as the CERT/CC (check http://www.cert.org for more information). CERT/CC can use this data to predict trends and monitor malicious activity on a global scale. The XML plugin has a good number of configuration options.

log or alert

This is used to specify whether to attach the XML output plugin to the log or alert facility. Certain rules are set to "alert" while others are set to "log"; this option outputs the chosen rule type.

parameter list

This option is a monster list of possible parameters for configuring XML to function in the way you want it to. Parameters are set in the familiar name=value pair. A list of names and descriptions follows:

  • file—Filename for XML output. If this is the only parameter entered, it writes to disk, to a local file.

  • protocol—Used to specify the protocol for logging to a remote host. Possible values are

  • n http—Send output via HTTP posts; requires file parameter

  • n -https—Send via encrypted HTTPS posts; requires file, cert, and key parameters

  • n -tcp—Send via a TCP port; requires an external application to listen to the TCP port

  • host—The remote host to send logs to.

  • cert—The client certificate to be used for HTTPS communication.

  • sanitize—An IP address range with netmask combination. The range specified will be sanitized. You can use this option several times to sanitize multiple ranges. With any alerts that are sanitized, packet payloads are not logged.

  • hex—Include this name with no value to store binary data in hex.

  • base64—Include this name with no value to store binary data in base64 encoding.

  • ascii—Include this name with no value to store binary data in human-readable ASCII encoding.

  • detail—Can be either full or fast. With full you log all details of the packet that Snort has available. Fast logs only timestamp, signature, source and destination IPs, source and destination ports, TCP flags, and protocol.

Alert_syslog

Alert_syslog writes to the syslog facility. A syslog server can be used to collect logging information from a variety of different devices not related to Snort, such as routers, firewalls, Web servers, and so on. Inputting Snort intrusion data into a syslog server can vastly aid in event correlation and problem identification. Writing alerting data to syslog can be used in conjunction with other tools to perform real-time alerting and notification. Alert_syslog is one of the most popular outputting plugins.

This plugin cannot be used to log to a remote syslog server if the sensor is installed on a Windows machine. You must use the command-line option for syslog (-s) to write to a remote syslog server. Alert_syslog supports the standard three syslog configuration options.

facility

This is the facility parameter that will be assigned to Alert_syslog output in the syslog server. The default is LOG_AUTH. You may want to use LOG_AUTHPRIV if others will be working with the syslog server but should not have access to intrusion data.

priority

This is the priority parameter that will be assigned to Alert_syslog output in the syslog server. The default is LOG_ALERT. This setting is a good fit for alerts; it is included with other critical events.

options

This is the option parameter that will be assigned to Alert_syslog output in the syslog server. The default is not assigned. You can use options to write directly to the console, or to log Snort's process ID with each alert. The options parameter can be used to identify multiple Snort processes on a single machine.

Database

The database output plugin logs directly to a relational database of your choice. It supports MySQL, PostgreSQL, Oracle, and UnixODBC-compliant databases such as SAPdb. Outputting to a relational database makes large amounts of intrusion data accessible. When the database plugin is placed into a database, alerts can be sorted, searched for, and prioritized in an organized manner. There are several applications that use the intrusion data in a relational database to create a management GUI. Snort data is written to the database in the table structure shown in Figure 3.3.

Figure 3.3Figure 3.3 Snort database structure.

The database plugin can serve as a bottleneck in even moderately saturated networks. The plugin itself is not a bottleneck; rather, the database being written to is. When the database plugin writes to the chosen database, it must wait until the database is ready for another write. Writing to a remote database over a network can exacerbate the problem.

The database plugin has three options.

log or alert

This option lets you write alert or log data to the selected database. Remember, you can enable as many output plugins as you wish. To write both alert and log data to the same database, activate the database plugin twice, once with alert and once with log.

mysql or postgresql or unixodbc or mssql

This is the type of database you are going to write to. You can write to MySQL, PostgreSQL, Oracle, Microsoft's SQL Server, and UnixODBC-compliant databases.

parameter list

This list contains the name=value pairs required to successfully write to a database. The names and descriptions are as follows:

  • host—This is the host where the database resides. Set to localhost if connecting to a database local to Snort.

  • port—The port number to connect at the remote database host.

  • dbname—The database username required to log in to the database.

  • password—The password required to authenticate to the database.

  • sensor_name—The name you want given to this sensor or Snort process in the database.

  • hex—Include this name with no value to store binary data in hex. This is the default.

  • base64—Include this name with no value to store binary data in base64 encoding.

  • ascii—Include this name with no value to store binary data in human-readable ASCII encoding.

  • detail—Can be either full or fast. With full you log all details of the packet that Snort has available. Fast logs only timestamp, signature, source and destination IPs, source and destination ports, TCP flags, and protocol.

Unified

The unified output plugin is designed specifically for speed. It is the fastest possible method of outputting Snort intrusion data. Unified writes intrusion data to its own binary format. It outputs two files: an alert file and a packet log file. The alert file contains a summary of the alert, including only the source and destination IP addresses, the protocol, the source and destination ports, and the alert message id. The log file contains the full packet information.

The purpose of the unified plugin is to allow data to be pushed out of Snort as fast as possible and to outsource plugins to a dedicated application. The application, Barnyard, reads unified output and sends data to other plugins, namely database output plugins. This gives Snort the luxury of not having to wait for a slower database to be ready to accept more input.

Unlike other plugins, the unified plugin is enabled with two different commands. The alert_unified command outputs alert data and the log_unified command outputs log data. Each produces a file that has a time signature (monthday@hourminute-) prepended to it. They both have one configuration option.

limit [maximum size]

The maximum size to which a file is allowed to grow. Default is 128MB.

  • + Share This
  • 🔖 Save To Your Account

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020