m1# grep domain /etc/services
m1# nslookup www.google.fr 192.168.1.2
No. Time Source Destination Protocol Info 1 0.000000 192.168.1.1 192.168.1.2 DNS Standard query A www.google.fr 2 0.000552 192.168.1.2 192.168.1.1 ICMP Destination unreachable (Port unreachable)
No. Time Source Destination Protocol Info 1 0.000000 192.168.1.1 192.168.1.2 DNS Standard query A www.google.fr Frame 1 (73 bytes on wire, 73 bytes captured) Ethernet II, Src: 02:04:06:00:00:01, Dst: 02:04:06:00:00:02 ... Type: IP (0x0800) Internet Protocol, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.2 (192.168.1.2) Version: 4 Header length: 20 bytes ... Total Length: 59 ... Time to live: 64 Protocol: UDP (0x11) Header checksum: 0xb75e [correct] Source: 192.168.1.1 (192.168.1.1) Destination: 192.168.1.2 (192.168.1.2) User Datagram Protocol, Src Port: m1 (2049), Dst Port: domain (53) Source port: m1 (2049) Destination port: domain (53) Length: 39 Checksum: 0x084b [correct] Domain Name System (query) Transaction ID: 0x4524 Flags: 0x0100 (Standard query) ... Questions: 1 ... Queries www.google.fr: type A, class IN Name: www.google.fr Type: A (Host address) Class: IN (0x0001) No. Time Source Destination Protocol Info 2 0.000552 192.168.1.2 192.168.1.1 ICMP Destination unreachable (Port unreachable) ...
m1# grep http /etc/services m1# grep www /etc/services
m2# /etc/init.d/apache2 start
m1# lynx http://192.168.1.2
No. Time Source Destination Protocol Info 1 0.000000 192.168.1.1 192.168.1.2 TCP m1 > http [SYN] Seq=0 ... 2 0.000476 192.168.1.2 192.168.1.1 TCP http > m1 [SYN, ACK] Seq=0 Ack=1 ... 3 0.000534 192.168.1.1 192.168.1.2 TCP m1 > http [ACK] Seq=1 Ack=1 ... 4 0.021186 192.168.1.1 192.168.1.2 HTTP GET / HTTP/1.0 5 0.022686 192.168.1.2 192.168.1.1 TCP http > m1 [ACK] Seq=1 Ack=216 ... 6 0.023423 192.168.1.2 192.168.1.1 HTTP HTTP/1.1 200 OK (text/html) 7 0.023440 192.168.1.1 192.168.1.2 TCP m1 > http [ACK] Seq=216 Ack=297 ... 8 0.023425 192.168.1.2 192.168.1.1 TCP http > m1 [FIN, ACK] Seq=297 Ack=216 ... 9 0.065447 192.168.1.1 192.168.1.2 TCP m1 > http [ACK] Seq=216 Ack=298 ... 10 0.087474 192.168.1.1 192.168.1.2 TCP m1 > http [FIN, ACK] Seq=216 Ack=298 ... 11 0.087886 192.168.1.2 192.168.1.1 TCP http > m1 [ACK] Seq=298 Ack=217 ...
No. Time Source Destination Protocol Info 1 0.000000 192.168.1.1 192.168.1.2 TCP m1 > http [SYN] Seq=0 ... Frame 1 (74 bytes on wire, 74 bytes captured) Ethernet II, Src: 02:04:06:00:00:01, Dst: 02:04:06:00:00:02 Internet Protocol, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.2 (192.168.1.2) Transmission Control Protocol, Src Port: m1 (2657), Dst Port: http (80), Seq: 0, Len: 0 Source port: m1 (2657) Destination port: http (80) Sequence number: 0 (relative sequence number) Header length: 40 bytes Flags: 0x02 (SYN) Window size: 5840 Checksum: 0x42c8 [correct] Options: (20 bytes)
No. Time Source Destination Protocol Info 2 0.000476 192.168.1.2 192.168.1.1 TCP http > m1 [SYN, ACK] Seq=0 Ack=1 ... Frame 2 (74 bytes on wire, 74 bytes captured) Ethernet II, Src: 02:04:06:00:00:02, Dst: 02:04:06:00:00:01 Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 192.168.1.1 (192.168.1.1) Transmission Control Protocol, Src Port: http (80), Dst Port: m1 (2657), Seq: 0, Ack: 1, Len: 0 Source port: http (80) Destination port: m1 (2657) Sequence number: 0 (relative sequence number) Acknowledgement number: 1 (relative ack number) Header length: 40 bytes Flags: 0x12 (SYN, ACK) Window size: 5792 Checksum: 0xe453 [correct] Options: (20 bytes) [SEQ/ACK analysis]
No. Time Source Destination Protocol Info 3 0.000534 192.168.1.1 192.168.1.2 TCP m1 > http [ACK] Seq=1 Ack=1 ... Frame 3 (66 bytes on wire, 66 bytes captured) Ethernet II, Src: 02:04:06:00:00:01, Dst: 02:04:06:00:00:02 Internet Protocol, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.2 (192.168.1.2) Transmission Control Protocol, Src Port: m1 (2657), Dst Port: http (80), Seq: 1, Ack: 1, Len: 0 Source port: m1 (2657) Destination port: http (80) Sequence number: 1 (relative sequence number) Acknowledgement number: 1 (relative ack number) Header length: 32 bytes Flags: 0x10 (ACK) Window size: 5840 (scaled) Checksum: 0x1e52 [correct] Options: (12 bytes) [SEQ/ACK analysis]
No. Time Source Destination Protocol Info 4 0.021186 192.168.1.1 192.168.1.2 HTTP GET / HTTP/1.0 Frame 4 (281 bytes on wire, 281 bytes captured) Ethernet II, Src: 02:04:06:00:00:01, Dst: 02:04:06:00:00:02 Internet Protocol, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.2 (192.168.1.2) Transmission Control Protocol, Src Port: m1 (2657), Dst Port: http (80), Seq: 1, Ack: 1, Len: 215 Source port: m1 (2657) Destination port: http (80) Sequence number: 1 (relative sequence number) [Next sequence number: 216 (relative sequence number)] Acknowledgement number: 1 (relative ack number) Header length: 32 bytes Flags: 0x18 (PSH, ACK) Window size: 5840 (scaled) Checksum: 0xd82e [correct] Options: (12 bytes) Hypertext Transfer Protocol
No. Time Source Destination Protocol Info 5 0.022686 192.168.1.2 192.168.1.1 TCP http > m1 [ACK] Seq=1 Ack=216 ... Frame 5 (66 bytes on wire, 66 bytes captured) Ethernet II, Src: 02:04:06:00:00:02, Dst: 02:04:06:00:00:01 Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 192.168.1.1 (192.168.1.1) Transmission Control Protocol, Src Port: http (80), Dst Port: m1 (2657), Seq: 1, Ack: 216, Len: 0 Source port: http (80) Destination port: m1 (2657) Sequence number: 1 (relative sequence number) Acknowledgement number: 216 (relative ack number) Header length: 32 bytes Flags: 0x10 (ACK) Window size: 6864 (scaled) Checksum: 0x1b77 [correct] Options: (12 bytes) [SEQ/ACK analysis]
No. Time Source Destination Protocol Info 6 0.023423 192.168.1.2 192.168.1.1 HTTP HTTP/1.1 200 OK (text/html) Frame 6 (362 bytes on wire, 362 bytes captured) Ethernet II, Src: 02:04:06:00:00:02, Dst: 02:04:06:00:00:01 Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 192.168.1.1 (192.168.1.1) Transmission Control Protocol, Src Port: http (80), Dst Port: m1 (2657), Seq: 1, Ack: 216, Len: 296 Source port: http (80) Destination port: m1 (2657) Sequence number: 1 (relative sequence number) [Next sequence number: 297 (relative sequence number)] Acknowledgement number: 216 (relative ack number) Header length: 32 bytes Flags: 0x18 (PSH, ACK) Window size: 6864 (scaled) Checksum: 0x0f1e [correct] Options: (12 bytes) Hypertext Transfer Protocol Line-based text data: text/html
No. Time Source Destination Protocol Info 7 0.023440 192.168.1.1 192.168.1.2 TCP m1 > http [ACK] Seq=216 Ack=297 ... Frame 7 (66 bytes on wire, 66 bytes captured) Ethernet II, Src: 02:04:06:00:00:01, Dst: 02:04:06:00:00:02 Internet Protocol, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.2 (192.168.1.2) Transmission Control Protocol, Src Port: m1 (2657), Dst Port: http (80), Seq: 216, Ack: 297, Len: 0 Source port: m1 (2657) Destination port: http (80) Sequence number: 216 (relative sequence number) Acknowledgement number: 297 (relative ack number) Header length: 32 bytes Flags: 0x10 (ACK) Window size: 6912 (scaled) Checksum: 0x1a37 [correct] Options: (12 bytes) [SEQ/ACK analysis]
No. Time Source Destination Protocol Info 8 0.023425 192.168.1.2 192.168.1.1 TCP http > m1 [FIN, ACK] Seq=297 Ack=216 ... Frame 8 (66 bytes on wire, 66 bytes captured) Ethernet II, Src: 02:04:06:00:00:02, Dst: 02:04:06:00:00:01 Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 192.168.1.1 (192.168.1.1) Transmission Control Protocol, Src Port: http (80), Dst Port: m1 (2657), Seq: 297, Ack: 216, Len: 0 Source port: http (80) Destination port: m1 (2657) Sequence number: 297 (relative sequence number) Acknowledgement number: 216 (relative ack number) Header length: 32 bytes Flags: 0x11 (FIN, ACK) Window size: 6864 (scaled) Checksum: 0x1a4e [correct] Options: (12 bytes) [SEQ/ACK analysis]
No. Time Source Destination Protocol Info 9 0.065447 192.168.1.1 192.168.1.2 TCP m1 > http [ACK] Seq=216 Ack=298 ... Frame 9 (66 bytes on wire, 66 bytes captured) Ethernet II, Src: 02:04:06:00:00:01, Dst: 02:04:06:00:00:02 Internet Protocol, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.2 (192.168.1.2) Transmission Control Protocol, Src Port: m1 (2657), Dst Port: http (80), Seq: 216, Ack: 298, Len: 0 Source port: m1 (2657) Destination port: http (80) Sequence number: 216 (relative sequence number) Acknowledgement number: 298 (relative ack number) Header length: 32 bytes Flags: 0x10 (ACK) Window size: 6912 (scaled) Checksum: 0x1a32 [correct] Options: (12 bytes) [SEQ/ACK analysis]
No. Time Source Destination Protocol Info 10 0.087474 192.168.1.1 192.168.1.2 TCP m1 > http [FIN, ACK] Seq=216 Ack=298 ... Frame 10 (66 bytes on wire, 66 bytes captured) Ethernet II, Src: 02:04:06:00:00:01, Dst: 02:04:06:00:00:02 Internet Protocol, Src: 192.168.1.1 (192.168.1.1), Dst: 192.168.1.2 (192.168.1.2) Transmission Control Protocol, Src Port: m1 (2657), Dst Port: http (80), Seq: 216, Ack: 298, Len: 0 Source port: m1 (2657) Destination port: http (80) Sequence number: 216 (relative sequence number) Acknowledgement number: 298 (relative ack number) Header length: 32 bytes Flags: 0x11 (FIN, ACK) Window size: 6912 (scaled) Checksum: 0x1a2e [correct] Options: (12 bytes)
No. Time Source Destination Protocol Info 11 0.087886 192.168.1.2 192.168.1.1 TCP http > m1 [ACK] Seq=298 Ack=217 ... Frame 11 (66 bytes on wire, 66 bytes captured) Ethernet II, Src: 02:04:06:00:00:02, Dst: 02:04:06:00:00:01 Internet Protocol, Src: 192.168.1.2 (192.168.1.2), Dst: 192.168.1.1 (192.168.1.1) Transmission Control Protocol, Src Port: http (80), Dst Port: m1 (2657), Seq: 298, Ack: 217, Len: 0 Source port: http (80) Destination port: m1 (2657) Sequence number: 298 (relative sequence number) Acknowledgement number: 217 (relative ack number) Header length: 32 bytes Flags: 0x10 (ACK) Window size: 6864 (scaled) Checksum: 0x1a3e [correct] Options: (12 bytes) [SEQ/ACK analysis]
m2# netcat -l -p 80 m1# lynx http://192.168.1.2
m1# netcat 192.168.1.2 80