понедельник, 19 марта 2012 г.

libpcap, продолжение

Дополнил хэлло экстракцией http пакета, теперь вывод выглядит так:
Packet captured
IP header lengh:  20
Packet size:  60
Source IP:        192.168.10.108
Destination IP:   178.21.10.7
Source port:      52987
Destination port: 80
Flags:            SYN


Packet captured
IP header lengh:  20
Packet size:  60
Source IP:        178.21.10.7
Destination IP:   192.168.10.108
Source port:      80
Destination port: 52987
Flags:            SYN ACK


Packet captured
IP header lengh:  20
Packet size:  52
Source IP:        192.168.10.108
Destination IP:   178.21.10.7
Source port:      52987
Destination port: 80
Flags:            ACK


Packet captured
IP header lengh:  20
Packet size:  372
Source IP:        192.168.10.108
Destination IP:   178.21.10.7
Source port:      52987
Destination port: 80
Flags:            ACK
GET / HTTP/1.1
Host: speedcorezombie.net
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101 Firefox/10.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive



Packet captured
IP header lengh:  20
Packet size:  52
Source IP:        178.21.10.7
Destination IP:   192.168.10.108
Source port:      80
Destination port: 52987
Flags:            ACK


Packet captured
IP header lengh:  20
Packet size:  323
Source IP:        178.21.10.7
Destination IP:   192.168.10.108
Source port:      80
Destination port: 52987
Flags:            ACK
HTTP/1.1 200 OK
Date: Mon, 19 Mar 2012 19:26:14 GMT
Server: Apache/2.2.15 (CentOS)
Last-Modified: Sun, 18 Mar 2012 20:52:54 GMT
ETag: "6e653-6-4bb8aa02c9580"
Accept-Ranges: bytes
Content-Length: 6
Connection: close
Content-Type: text/html; charset=UTF-8

hello


Packet captured
IP header lengh:  20
Packet size:  52
Source IP:        192.168.10.108
Destination IP:   178.21.10.7
Source port:      52987
Destination port: 80
Flags:            ACK


Packet captured
IP header lengh:  20
Packet size:  52
Source IP:        192.168.10.108
Destination IP:   178.21.10.7
Source port:      52987
Destination port: 80
Flags:            ACK FYN


Packet captured
IP header lengh:  20
Packet size:  52
Source IP:        178.21.10.7
Destination IP:   192.168.10.108
Source port:      80
Destination port: 52987
Flags:            ACK FYN


Packet captured
IP header lengh:  20
Packet size:  52
Source IP:        192.168.10.108
Destination IP:   178.21.10.7
Source port:      52987
Destination port: 80
Flags:            ACK


Packet captured
IP header lengh:  20
Packet size:  52
Source IP:        178.21.10.7
Destination IP:   192.168.10.108
Source port:      80
Destination port: 52987
Flags:            ACK
Теперь осталось решить, какие поля http заголовка заграббить в базу )

Комментариев нет: