亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sniffers.txt

?? 500 C execises document
?? TXT
?? 第 1 頁 / 共 2 頁
字號:

   This is the most important line in the entire program. Socket() takes three arguments in
   this form:

sockfd = socket(int family, int type, int protocol);




    The first argument is the family. This could be either AF_UNIX which is used so a process
   can communicate with another process on the same host or AF_INET which is used for
   internet communication between remote hosts. In this case it will be  AF_INET . Next  
   is the type, the type is usually between 1 of 4 choices (there are others that we will not
   discuss here) the main four are :

   1. SOCK_DRAM      : used for udp datagrams
   2. SOCK_STREAM    : used for tcp packets
   3. SOCK_RAW       : used to bypass the transport layer
                 and directly access the IP layer

   4. SOCK_PACKET    : this is linux specific, it is similuar to
                         SOCK_RAW except it accesses the DATA LINK Layer

      For our needs we will use the SOCK_RAW type. You must have root acces to open a
    raw socket. The last parameter  is the protocol,the protocol value specifies what type of
    traffic the socket should receive , for normal sockets this value is usally set to "0"
    because the socket can figure out if for instance the "type" of SOCK_DGRAM is
    specified then the protocol should be UDP.In our case we just want to look at tcp 
    traffic so we will specify IPPROTO_TCP.


line 15 :
   while (1)

  The while (1) puts the program into an infinite loop this is necessary so that after the
 first packet is processed we will loop around and grab the next. 


Line 18:
   bytes_recieved = recvfrom(sock, buffer, sizeof buffer, 0,
 (struct sockaddr *)&from, &fromlen);

   Now here is where we are actually reading data from the open socket "sock".The from
   struct is also filled in but notice that we are casting "from" from a "sockaddr_in" struct
   to a "sockaddr" struct. We do this because the recvfrom() requires a sockaddr type but
   to access the separate fields we will continue to use the sockaddr_in structure. The 
   length of the "from" struct must also be present and passed by address. The recvfrom()
   call will return the number of bytes on success and a -1 on error and fill the global var
   errno.

   This is what we call "blocking-I/O" the recvfrom() will wait here forever until a
   datagram on the open socket is ready to be processed. This is opposed to 
   Non-blocking I/O which is like running a process in the background and move on to
   other tasks.


Line 20:
   printf("Source address ::: %s\n",inet_ntoa(from.sin_addr));

   This printf uses the special function inet_ntoa() to take the value of "from.sin_addr"
   which is stored in Network-byte order and outputs a value in a readable ip form such
   as 192.168.1.XXX.

Line 21:
   ip = (struct ip *)buffer;

   This is where we will overlay a predefined structure that will help us to individually
   identify the fields in the packet that we pick up from the open socket.


Line 22:
   printf("IP header length ::: %d\n",ip->ip_length);

   The thing to notice on this line is the "ip->ip_length" this will access a pointer in
   memory to the ip header length the important thing to remember is that the length 
   will be represented in 4-byte words this will be more important later when trying to
   access items past the ip header such as the tcp header or the data portion of the packet.



Line 23:
   printf("Protocol ::: %d\n",ip->ip_protocol);

   This gives access to the type of protocol such as 6 for tcp or 17 for udp.

Line 24:
   tcp = (struct tcp *)(buffer + (4*ip->ip_length));

       Remember earlier it was mentioned that the ip header length is stored in 4 byte words,
   this is where that bit of information becomes important. Here we are trying to get access
   to the tcp header fields, to do this we must overlay a structure that has the fields
   predefined just as we did with ip. There is one key difference here the ip header fields
   were easy to access due to the fact that the beginning of the buffer was also the beginning
   of the ip header as so :


|----------------- buffer ----------------|
 _________________________________________
| ip header          |                    |
        |____________________|____________________|
                             ^
                             *ip
                             ^
                             *buffer

      So to get access to the ip header we just set a pointer casted as an ip structure to the
   beginning of the buffer like "ip = (struct ip *)buffer;". To get access to the tcp header 
   is a little more difficult due to the fact that we must set a pointer and cast it as a tcp
   structure at the beginning of the tcp header which follows the ip header in the buffer 
   as so :


 |----------------- buffer ---------------|
          ________________________________________
         | ip header | tcp header |               |
         |___________|____________|_______________|
                     ^
                     *tcp
                     
This is why we use 4*ip->ip_length to find the start of the tcp header.

Line 25-26:
    printf("Source port ::: %d\n",ntohs(tcp->tcp_source_port);
    printf("Dest port  ::: %d\n",ntohs(tcp->tcp_dest_port));

   We can now access the source and dest ports which are located in the tcp header via 
   the structure as defined above.

This will conclude our  first very simple tcp sniffer. This was a very basic application
that should help define how  to access packets passing on the network and how  to use
sockets to access the packets. Hopefully this will be the first of many papers to come,
which each proceeding paper we will add a new or more complex feature to the sniffer. I
should also mention that there a number of great resources on the net that should aid you
   in further research in this area :
1. Beej's Guide to Network Programming
This is an awesome paper that really helps  clear up any misconceptions about network programming.
[http://www.ecst.csuchico.edu/~beej/guide/net]

        2. TCP/IP Illustrated Vol 1,2,3
           W.Richard Stevens

To use the above program, cut out the above code and strip off all 
of the line numbers. Save the edited file as sniff.c. Next cut 
out the header file headers.h (below) and save it to a file headers.h
in the same directory. Now just compile: gcc -o sniff sniff.c
You should now have the executable "sniff", to run it type
#./sniff

/*************************headers.h**************************/
/*structure of an ip header             */
struct ip {
unsigned int        ip_length:4;    /*little-endian*/
unsigned int        ip_version:4;
unsigned char       ip_tos;
unsigned short      ip_total_length;
unsigned short      ip_id;
unsigned short      ip_flags;
unsigned char       ip_ttl;
unsigned char       ip_protocol;
unsigned short      ip_cksum;
unsigned int        ip_source;
unsigned int        ip_dest;
};

/* Structure of a TCP header */
struct tcp {
unsigned short      tcp_source_port;
unsigned short      tcp_dest_port;
unsigned int        tcp_seqno;
unsigned int        tcp_ackno;
unsigned int        tcp_res1:4,     /*little-endian*/
tcp_hlen:4,
tcp_fin:1,
  tcp_syn:1,
tcp_rst:1,
tcp_psh:1,
tcp_ack:1,
tcp_urg:1,
tcp_res2:2;
unsigned short      tcp_winsize;
unsigned short      tcp_cksum;
unsigned short      tcp_urgent;
};
/*********************EOF***********************************/    

About
Contact
Services
Hosting
Mission
Ethics
FAQ
CD Archive
Unix (A-N)
Unix (O-Z)
Windows 95/98
Windows NT
Novell
Home Brew
Take Out
Text Files
Online Books
Auditing Tools
CGI Attacks
Detection Tools
Log Tools
Log Cleaners
IMAPD Exploits
IMAPD Scanners
FTP Exploits
General Unix Tools
Network Sniffers
Operating Systems
Password Crackers
Rootkits
Security Analysis Tools
Sendmail Exploits
TCP Tools
Trojans
UDP Tools
Word Lists
Attack (A-M)
Attack (N-Z)
Defence
Other
Advanced
AOL Programs
BIOS Crackers
Cheat Engines
Encryption
Hex Editors
Java Attack
Keystroke Loggers
Mail Programs
Misc Programs
MSN Programs
Multiple Attack
Needed Files
Nukers
Ping and ICMP
Port Scanners
Trojans
Wardialers
Windows Password Crackers
Wingate
Anti Spam
File Wipers
IP Spoofers
Trojan Cleaners
Anarchy
Credit Card
Cell Phone Programs
Cell Phone Text Files
Pager Programs
Virii
Auditing Tools
Intrusion Detection
Administrative Tools
Password Crackers
Scanners
Code Hackers
Dark Fool
Grenadier
Lord Somer
Rhino9
SIN
Stormer
Wiltered Fire
Hacking
Cracking
Phreaking
Newbie
PC Optimization
ICQ Server List
Privacy Quotient
United States Congress Email Addresses

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产品国语在线app| 男女男精品视频| 青青草97国产精品免费观看无弹窗版| 国产精品99久久久久久久vr| 欧美亚洲一区二区三区四区| 国产精品狼人久久影院观看方式| 美女爽到高潮91| 欧美日韩中文字幕精品| 亚洲丝袜精品丝袜在线| 国产乱人伦偷精品视频免下载| 在线观看不卡视频| 日韩理论在线观看| 成人app网站| 国产蜜臀av在线一区二区三区| 蜜臀va亚洲va欧美va天堂| 色偷偷成人一区二区三区91| 国产精品久久久久久久久搜平片| 国产一本一道久久香蕉| 日韩一卡二卡三卡四卡| 偷偷要91色婷婷| 日本道在线观看一区二区| 中文字幕一区二区三区色视频 | 五月天婷婷综合| 色一情一伦一子一伦一区| 亚洲美腿欧美偷拍| av不卡免费电影| 日韩毛片精品高清免费| 色综合色狠狠综合色| 亚洲免费观看高清在线观看| 色就色 综合激情| 亚洲成人免费影院| 欧美日韩高清在线播放| 欧美bbbbb| 精品区一区二区| 激情文学综合插| 国产欧美一区二区三区鸳鸯浴| 国产激情偷乱视频一区二区三区| 国产欧美日韩激情| 99在线精品观看| 亚洲精品中文字幕乱码三区| 91丝袜美腿高跟国产极品老师| 一区二区三区日本| 欧美三级午夜理伦三级中视频| 三级影片在线观看欧美日韩一区二区 | 欧美激情在线免费观看| 成人黄色免费短视频| 成人免费在线视频| 在线观看av一区二区| 日韩精品每日更新| 国产视频一区二区三区在线观看| 成人av在线资源网| 一级日本不卡的影视| 7777精品伊人久久久大香线蕉经典版下载 | 国产69精品久久99不卡| 国产精品乱码妇女bbbb| 91成人在线观看喷潮| 蜜臀av在线播放一区二区三区| 欧美精品一区二区三区在线 | 欧美高清www午色夜在线视频| 日韩国产精品91| 日本一区二区三区四区在线视频| 成人动漫一区二区| 日韩福利视频网| 亚洲欧洲美洲综合色网| 欧美日韩国产色站一区二区三区| 精品一区二区三区不卡| 亚洲精品国产a| 2017欧美狠狠色| 欧美在线观看一区二区| 国产在线视视频有精品| 依依成人综合视频| 久久午夜电影网| 欧美美女一区二区三区| 国产成人av一区二区三区在线 | 成人夜色视频网站在线观看| 一区二区三区日韩精品视频| 欧美精品一区二区三区一线天视频| 成人福利电影精品一区二区在线观看| 三级精品在线观看| 亚洲免费三区一区二区| 久久精品免费在线观看| 欧美日韩性生活| 色诱视频网站一区| 国产成人综合自拍| 免费观看日韩av| 亚洲一区二区三区爽爽爽爽爽| 国产农村妇女精品| 精品福利av导航| 欧美日韩激情在线| 91福利视频网站| 99久久婷婷国产综合精品电影 | 欧美一区二区精品在线| 99久久99久久久精品齐齐| 精品一二线国产| 欧美aaa在线| 亚洲bdsm女犯bdsm网站| 亚洲一区免费在线观看| 亚洲欧美电影院| 亚洲人一二三区| 国产精品蜜臀av| 国产精品美女久久久久久久网站| 日韩一区二区中文字幕| 91精品蜜臀在线一区尤物| 欧美性生活一区| 欧美女孩性生活视频| 欧美日韩一区高清| 欧美午夜宅男影院| 欧美日韩一区二区不卡| 欧美亚洲一区三区| 7777精品伊人久久久大香线蕉超级流畅 | a4yy欧美一区二区三区| 国产精品资源网| 国产精品亚洲第一区在线暖暖韩国| 麻豆精品在线观看| 麻豆精品一区二区综合av| 另类专区欧美蜜桃臀第一页| 另类欧美日韩国产在线| 久久99精品国产麻豆婷婷洗澡| 另类小说综合欧美亚洲| 亚洲欧美怡红院| 欧美精品一二三| 国产精品久久精品日日| 亚洲免费伊人电影| 91精品国产综合久久福利软件| 欧美性大战久久久久久久蜜臀| 日本精品免费观看高清观看| 欧美色电影在线| 91精品国产美女浴室洗澡无遮挡| 91精品国产综合久久婷婷香蕉 | 亚洲国产精品欧美一二99| 亚洲理论在线观看| 亚洲福利视频一区二区| 免费av成人在线| 成人高清视频免费观看| 日本高清不卡视频| 日韩一区二区精品| 国产精品网友自拍| 亚洲一区二区成人在线观看| 奇米四色…亚洲| 成人开心网精品视频| 欧美性做爰猛烈叫床潮| 欧美va亚洲va国产综合| 国产精品成人网| 视频一区免费在线观看| 国产成a人亚洲精品| 欧洲中文字幕精品| 久久久久久久久久久久久久久99 | 麻豆精品久久精品色综合| 国产综合久久久久久久久久久久| 成人av电影在线网| 欧美高清精品3d| 1000部国产精品成人观看| 偷拍一区二区三区四区| 成人一区在线观看| 欧美久久久久久久久中文字幕| 久久亚洲一级片| 亚洲成人午夜电影| 丁香婷婷综合色啪| 欧美精品黑人性xxxx| 最新国产の精品合集bt伙计| 免费久久精品视频| 在线观看免费亚洲| 国产午夜精品久久久久久免费视| 亚洲第一在线综合网站| 成人综合在线网站| 日韩一区二区电影在线| 一区二区三国产精华液| 成人avav影音| 久久久久久久久久久久久夜| 午夜亚洲国产au精品一区二区| 成人午夜视频在线| 日韩精品一区二| 日韩电影在线观看一区| 91在线小视频| 国产欧美精品一区| 另类人妖一区二区av| 欧美丰满一区二区免费视频| 亚洲美女视频一区| 成人黄色软件下载| 久久午夜羞羞影院免费观看| 日韩av一二三| 欧美日韩国产高清一区| 亚洲综合色丁香婷婷六月图片| av中文一区二区三区| 亚洲国产精品成人综合色在线婷婷| 美国欧美日韩国产在线播放| 欧美日韩精品福利| 丝袜亚洲另类欧美综合| 欧美日韩亚洲高清一区二区| 一区二区三区四区亚洲| 99精品视频在线免费观看| 国产精品第五页| 色综合久久66| 亚洲综合视频在线观看| 色哟哟一区二区在线观看| ...xxx性欧美| 色综合久久久网| 亚洲精品美国一| 欧美日韩日日摸| 美女精品一区二区|