博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Not using PCAP_FRAMES 解释(snort中)
阅读量:2149 次
发布时间:2019-04-30

本文共 6248 字,大约阅读时间需要 20 分钟。

启动snort的时候会提示:Not using PCAP_FRAMES

上网查了一些资料,其中最经典的是下面的一个帖子,来自

中文也有翻译过来的,我就不解释了,直接cp过来:

中文的:

*********************************************************************************************

snort错误Not Using PCAP_FRAMES

1,最近在做snort和base的测试安装,在安装完成base以后总是会出现运行
./snort -c /etc/snort/snort.conf
总是会出现:Not Using PCAP_FRAMES 对于snort的正常运行好像是没有影响,但是为什么会出现这个问题
http://leonward.wordpress.com/2008/07/18/not-using-pcap_frames-aka-when-good-verbosity-goes-bad/ 在这篇文章中较详细的说明
简单的说出现上述错误是因为在编译snort的时候没有加上libpcap的lib库的位置,而PCAP_FRAME是一个环境变量还设置libpacp的lib库,从代码角度来看,如果没有设置PCAP_FRAME并不影响snort的运行因为在不加载PCAP_FRAMES的时候,只是会给出默认的LOGMessage 
代码在这里体现的:
1163     if( getenv(“PCAP_FRAMES”) )
1164     {
1165         LogMessage(“Using PCAP_FRAMES = %s/n”, getenv(“PCAP_FRAMES”) );
1166     }
1167     else
1168     {
1169         LogMessage(“Not Using PCAP_FRAMES/n” );
1170     }
所以,总的来说出现Not Using PCAP_FRAMES对snort是没有影响的但是这里我们可以通过设置变量还改变:
命令是 export PCAP_FRAMES=max 这样就不会出现上面的问题了
Build 1>
           Preprocessor Object: SF_FTPTELNET  Version 1.2  <Build 12>
           Preprocessor Object: SF_SSLPP  Version 1.1  <Build 3>
           Preprocessor Object: SF_DCERPC  Version 1.1  <Build 5>
           Preprocessor Object: SF_SMTP  Version 1.1  <Build 8>
           Preprocessor Object: SF_DCERPC2  Version 1.0  <Build 2>
           Preprocessor Object: SF_DNS  Version 1.1  <Build 3>
           Preprocessor Object: SF_SSH  Version 1.1  <Build 2>
Using PCAP_FRAMES = max
*** Caught Usr-Signal: 'Rotate Stats' 
其实,设置或者不设置没太大的关系。不影响snort的正常工作。

 

***********************************************************************************

英文的:

***********************************************************************************

 

 

The same questions get posted again and again to the Snort forums, at the moment this is the most frequently misunderstood, and asked question that catches my eye.

Help !!!!!!!!

Snort doesn’t work !
It dies with a “Not Using PCAP_FRAMES” error message”.
Quick, quick help me now!

I’m ranting about this here so hopefully when people google the “Not using PCAP_FRAMES” message before blindly posting to the forums or mail lists for help (I know, I can dream), maybe this post will appear in their search results solving their non-issue.

What is an error message?

Lets look a real error messages first, unlike the above.

--== Initializing Snort ==--Initializing Output Plugins!Initializing Preprocessors!Initializing Plug-ins!Parsing Rules file /this/rules/file/does/not/existERROR: Unable to open rules file: /this/rules/file/does/not/exist or /this/rules/file/does/not//this/rules/file/does/not/existFatal Error, Quitting..

The error condition above is clearly identified, other messages not prefixed with “ERROR” are supporting messages to help a user understand what the system is doing. This rule holds true with most software and not Snort alone.

What is a PCAP_FRAME?

PCAP_FRAMES is an environment variable that is used to pass a configuration setting to a custom pcap library, specifically the code by Phil Woods (Nice job by the way Phil). If you have not built snort against Phil’s libpcap that supports pcap ring buffers in shared memory, PCAP_FRAMES means absolutely NOTHING to you, zip, nout, fsck all, nada.

If you are unsure if you have built Snort against Phil’s libpcap or a stock distribution, then trust me you’re using a stock libpcap.

For those who are interested, PCAP_FRAMES defines a size (in frames) of a pcap ring-buffer in shared memory.

Are you sure? It looks like Snort stops with this as an error.

Yes I’m sure, and I find your lack of faith disturbing. Lets look at the code in snort.c to check.

1163     if( getenv(“PCAP_FRAMES”) )

1164     {
1165         LogMessage(“Using PCAP_FRAMES = %s/n”, getenv(“PCAP_FRAMES”) );
1166     }
1167     else
1168     {
1169         LogMessage(“Not Using PCAP_FRAMES/n” );
1170     }

If the environment variable PCAP_FRAMES is set, it shows the value to user during Snort initialization. If the environment variable is not set, it tell the user that PCAP_FRAMES are not being used.

For example, ill start up snort as a sniffer on my Mac with a stock libpcap.

[09:12:32]lward@drax~$ sudo snort -vdei en0 > /dev/nullPassword:Running in packet dump mode-snip verbose startup output-
,,_     -*> Snort! <*-o"  )~   Version 2.8.0.2 (Build 75)''''    By Martin Roesch & The Snort Team:http://www.snort.org/team.html(C) Copyright 1998-2007 Sourcefire Inc., et al.Using PCRE version: 7.6 2008-01-28Not Using PCAP_FRAMES^C*** Caught Int-Signal==============================================================Packet Wire Totals:-SNIP-

Here Snort has started up and was sniffing without error (until I hit CRTL+C), now lets set PCAP_FRAMES to some garbage because it will have no effect on Snorts behavior or my stock libpcap.

bash-3.2# export PCAP_FRAMES="Foo Bar This setting has no impact on my libpcap instance"bash-3.2# snort -dvei en0 > /dev/null
Running in packet dump mode
--== Initializing Snort ==--Initializing Output Plugins!Verifying Preprocessor Configurations!Initializing Network Interface en0OpenPcap() device en0 network lookup:en0: no IPv4 address assignedDecoding Ethernet on interface en0--== Initialization Complete ==-- ,,_     -*> Snort! <*-o"  )~   Version 2.8.0.2 (Build 75) ''''    By Martin Roesch & The Snort Team: http://www.snort.org/team.html(C) Copyright 1998-2007 Sourcefire Inc., et al.Using PCRE version: 7.6 2008-01-28Using PCAP_FRAMES = Foo Bar This setting has no impact on my libpcap instance ^C*** Caught Int-Signal ===================================

So in summary, this verbose message has no meaning to most users of Snort. If you are running Snort as an IDS but not in daemon mode, don’t expect to see anything on STDOUT until you stop the processes (hit CRTL+C to send a SIGINT).

As always, happy Snortin’

-Leon

Written by leonward

July 18, 2008 at 6:13 pm

Posted in 

Tagged with 

**********************************************************************************

 

实验结果:

   ,,_     -*> Snort! <*-

  o"  )~   Version 2.8.5.2 (Build 121)  

   ''''    By Martin Roesch & The Snort Team: http://www.snort.org/snort/snort-team

           Copyright (C) 1998-2009 Sourcefire, Inc., et al.

           Using PCRE version: 8.02 2010-03-19

 Using PCAP_FRAMES = max 

04/18-18:26:52.583012 172.26.75.115:34474 -> 211.100.26.77:80

TCP TTL:64 TOS:0x0 ID:2852 IpLen:20 DgmLen:60 DF

******S* Seq: 0x296C94FF  Ack: 0x0  Win: 0x16D0  TcpLen: 40

TCP Options (5) => MSS: 1460 SackOK TS: 8429531 0 NOP WS: 6 

 

 

 

 

转载地址:http://clfwb.baihongyu.com/

你可能感兴趣的文章
【LEETCODE】67-Add Binary
查看>>
【LEETCODE】7-Reverse Integer
查看>>
【LEETCODE】165-Compare Version Numbers
查看>>
【LEETCODE】299-Bulls and Cows
查看>>
【LEETCODE】223-Rectangle Area
查看>>
【LEETCODE】12-Integer to Roman
查看>>
【学习方法】如何分析源代码
查看>>
【LEETCODE】61- Rotate List [Python]
查看>>
【LEETCODE】143- Reorder List [Python]
查看>>
【LEETCODE】82- Remove Duplicates from Sorted List II [Python]
查看>>
【LEETCODE】86- Partition List [Python]
查看>>
【LEETCODE】147- Insertion Sort List [Python]
查看>>
【算法】- 动态规划的编织艺术
查看>>
用 TensorFlow 让你的机器人唱首原创给你听
查看>>
对比学习用 Keras 搭建 CNN RNN 等常用神经网络
查看>>
深度学习的主要应用举例
查看>>
word2vec 模型思想和代码实现
查看>>
怎样做情感分析
查看>>
用深度神经网络处理NER命名实体识别问题
查看>>
用 RNN 训练语言模型生成文本
查看>>