然后在 ftp://ftp.ee.lbl.gov/libpcap.tar.Z下载libpcap 我们使用的是 0.40版。
把文件放在临时文件夹里并解包,
tar xvzf libpcap.tar.Z
然后进行编译
cd libpcap-0.4; ./configure; make; make install; make install-incl
假如您遇到了困难,可以参见在libpcap-0.4目录里的README或INSTALL文件。根据我们实验的经验,如果/usr/local/include 和/usr/local/include/net目录在linux系统中不存在的话,安装会失败。加入您在安装时遇到了pcap.h 或 bpf.h的错误时你可以运行
mkdir /usr/local/include; mkdir /usr/local/include/net然后重新运行'make install-incl'。然后我们需要编译ngrep (使用我们修改过的版本)。首先解包
tar xvzf ngrep-1.35.tar.gz
然后进行配置
cd ngrep; ./configure
然后把ngrep.c复制到ngrep目录里。你可以覆盖也可以备份原始的ngrep.c文件。在这里,您应当回顾在修改过的ngrep.c里的配置,至少您应当把DNS_SERVER_IP更改为您所使用的DNS的地址。更改完毕后你就可以运行'make',这样就建立了ngrep应用程序。
Modified ngrep.c source code
/* this code is available for download from http://www.wiretrip.net/na/ngrep.c */
/*
* $Id: ngrep.c,v 1.35 1999/10/13 16:44:16 jpr5 Exp $
*
*/
/* TFN detection code added by Rain Forest Puppy / rfp@wiretrip.net
and Night Axis / na@wiretrip.net */
/********* TFN detection defines *******************************/
/* how many DNS and ICMP requests to track */
#define DNS_REQUEST_MAX 5000
#define ICMP_REQUEST_MAX 1000
/* flood threshold is matches per 10 seconds */
#define FLOOD_THRESHOLD 20
/* IP of your DNS server */
#define DNS_SERVER_IP "10.9.100.8"
/* TFN syn uses ttl between 200-255. Assuming less than 50 hops,
flag stuff with ttl > TTL_THRESHOLD (other critera are used
as well) */
#define TTL_THRESHOLD 150
/**************************************************************/
#include
#include
#include
#ifdef LINUX
#include
#endif
#if defined(BSD)
共4页: 上一页 [1] [2] [3] 4 下一页 |