Download libpcap source from www.tcpdump.org
here Download libpcap for win32 fromwww.winpcap.orgCheck out a better pcap tutorial
hereFront matter: This is a slightly modified and extended version
of my older pcap tutorial. Revisiting this work five years later, I am
necessarily dumber (age and beer) yet hopefully somewhat more
knowledgeable. Contact information has changed, please send your
hate-mail to casado at cs.stanford.edu.ContentsIntro (You are already here)Capturing our First PacketWriting a Basic Packet Capturing EngineAnalyzing packets….. (in progress)Who this is for: This tutorial assumes a cursory
knowledge in networks; what a packet is, Ethernet vs. IP vs.
TCP vs. UDP etc. If these concepts are foreign I highly suggest
you invest in a good (e.g. probably can’t find at Best Buy)
networking book. My favorites are:
Computer Networking : A Top-Down Approach Featuring the Internet
(3rd Edition) by James F. Kurose, Keith W. Ross
UNIX Network Programming by W. Richard StevensThe Protocols (TCP/IP Illustrated, Volume 1) by W. Richard StevensThis tutorial does not assume any previous knowledge in network
programming, just免费云主机域名 a basic familiarity with c. If you already are a
c/c++ master, then you might as well just man 3 pcap. You should
have a working c compiler on your system and libpcap installed. All
source in this section was written and tested on linux, kernel 2.2.14,
while it should be mostly portable (hehe) I can’t guarantee that it will
compile or run on other operating systems. You are going to want to run
as root so be careful and be sure not to break your box in the meantime.
Oh, and though I have tested and run all the code presented in this
tutorial with no problems, I am NOT responsible if your shit breaks and
has to be quarantined by the health department… aka play at your own
risk….
hcn# gcc ldev.c -lpcap
加入编译和执行正确,控制台将显示如下信息:DEV: eth0
NET: 192.168.12.0
MASK: 255.255.255.0
The value for DEV is your default interface name (likely eth0 on linux,
could be eri0 on solaris). The NET and MASK values are your primary interface’s
subnet and subnet mask. Don’t know what those are? Might want to read
this.”So what did we just do?”, you ask. Well, we just asked libpcap
to give us some specs on an interface to listen on.
“Whats an interface?”
Just think of an interface as your computers hardware connection to
whatever network your computer is connected to. On Linux, eth0 denotes
the first Ethernet card in your computer. (btw you can list all of your
interfaces using the ifconfig command).OK at this point we can compile a pcap program that essentially does
nothing. On to grabbing our first packet …
本篇内容主要讲解“linux df缩写指的是什么”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“linux df缩写指的是什么”吧! df是“disk free”的缩写,用于显示Linux系统中各文件系统的硬盘使用情…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。