Hacking - The Art of Exploitation, 2nd Edition
Networking 207 When compiled and run, the program binds to port 7890 of the host and waits for incoming connections: reader@hack ...
208 0x400 From /etc/services finger 79/tcp # Finger finger 79/udp http 80/tcp www www-http # World Wide Web HTTP HTTP exists in ...
Networking 209 This reveals that the webserver is Apache version 2.0.52 and even that the host runs CentOS. This can be useful f ...
210 0x400 bytes_to_send -= sent_bytes; buffer += sent_bytes; } return 1; // Return 1 on success. } /* This function accepts a so ...
Networking 211 From /usr/include/netdb.h / Description of database entry for a single host. / struct hostent { char h_name; / Of ...
212 0x400 reader@hacking:~/booksrc $ gcc -o host_lookup host_lookup.c reader@hacking:~/booksrc $ ./host_lookup http://www.intern ...
Networking 213 while(recv_line(sockfd, buffer)) { if(strncasecmp(buffer, "Server:", 7) == 0) { printf("The web server for %s is ...
214 0x400 tinyweb.c include <stdio.h> include <fcntl.h> include <stdlib.h> include <string.h> include &l ...
Networking 215 } /* This function handles the connection on the passed socket from the passed client address. The connection is ...
216 0x400 free(ptr); // Free file memory. } close(fd); // Close the file. } // End if block for file found/not found. } // End i ...
Networking 217 Accepting web requests on port 80 Got request from 127.0.0.1:52996 "GET / HTTP/1.1" Opening './webroot/index.html ...
218 0x400 communications. At the bottom, the physical layer (1) is simply the wire and the protocol used to send bits from one d ...
Networking 219 the two addressing schemes. In the office, post office mail sent to an employee at the office’s address goes to t ...
220 0x400 0x432 Network Layer The network layer is like a worldwide postal service providing an addressing and delivery method u ...
Networking 221 also exist on this layer. ICMP packets are used for messaging and diagnostics. IP is less reliable than the post ...
222 0x400 The two major protocols at this layer are the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). TC ...
Networking 223 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ...
224 0x400 Sequence numbers allow TCP to put unordered packets back into order, to determine whether packets are missing, and to ...
Networking 225 Interrupt:16 Base address:0x2024 reader@hacking:~/booksrc $ The act of capturing packets that aren’t necessarily ...
226 0x400 0x0020 8018 438a 4c8c 0000 0101 080a 0007 1feb ..C.L........... 0x0030 000e 10d1 3233 3020 5573 6572 206c 6565 ....230 ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf