botmaster
05-04-2007, 07:55 PM
THE INTERNET
You use it daily to check your e-mail and to access SRL forums, to gather information, to authenticate your scripts, to hack people, and to torrent files. Simple enough, you call it "the internet". This tutorial will basically teach you a little bit about how HTTP/1.1, Protocols, and TCP/IP. Probably all techie stuff you've heard about before, but never really figured out what it REALLY means.
If you have a short attention span or can't stand text longer than a few lines, please exit this tutorial NOW (thanks to Boreas for that line :D ).
Feel free to skip certain parts when you feel you already know about stuff, but if you don't get something later because you didn't read earlier stuff, don't complain. Feel free to ask questions.
1. THE BASICS
So, what exactly is the internet? Is it the web you use to access SRL and google.com? I betcha 90% of the people on this world believe this to be the case - and they're WRONG! The internet is just that - a network of computers connected together by wires. Anything that transfers data in this network is the internet. This means bittorrent, e-mail, and MSN are part of the internet!
A computer in the internet can do two things: send and receive. Usually, it does both. Think of it as a telephone: You can send (speak into the mike) and receive (listen at the receiver). The receiving end is called a server because it constanly "Listens" to the connection, and the sender is usually called a client.
So, how is stuff sent through the internet? Answer: there's two ways to send data. One is called UDP, but I won't go into detail for that one, because it is complicated and used less often (like, almost never :p ). Basically, it sends data as a single stream through the wire (or fiber optics cable).
The more commonly used method for transferring data is to break down the data you want to send into small things called "packets", which are then individually sent into the internet. Packets are just that: like a packet you bring to the postoffice, except that this one contains data.
Like a packet at the postoffice, the packet has a receiving and a destination adress. Also, like at a mail office, the packets doesn't get sent directly to the destination computer but are instead passed over various servers that serve as "post offices". You can try tracing the servers your packets go through before arriving by using the followging command in ms-dos (or linux bash shell):
tracert hostname
where you replace hostname with the web address/IP you want to trace to. Speaking of IP's - I think I haven't talked about them yet.
2. ADDRESSING COMPUTERS HOOKED ONTO THE INTERNET
Every packet is adressed, as already said. Now, there are two types of adresses: IP's and Web adresses. There's a third kind called a mac adress, but it's rarely used and kind of complex so I won't explain it.
An IP is four number code, ranging from 0.0.0.0 to 255.255.255.255 . Basically, it specifies the adress of a computer. You can simply type in http://72.14.207.99 into your browser window, and you will land at... google.com!
Now, since four-code numbers are very hard to remember, a second type of adress has been developed: a web-address. This is the familiar address you type into the browser. But how does the internet know that if you type in www.google.com you actually mean 72.14.207.99? The answer is kind of complex: DNS servers. DNS stands for "Domain name server". Basically, it is a kind of server that serves as a sort of telephone book, where your computer looks up which IP corresponds to the domain name you typed in. Maintaining these servers costs money, so you usually have to pay to register a domain name in these servers.
3. PORTS AND SOCKETS
You occasionally hear techies talk about "ports" and "sockets". So here I'm going to explain to you what they are.
Imagine your computer as a call center, with thousands of incoming and outgoing connections to the internet. If that were the case, each connection would be a port. A port is simply said, a gateway into your computer. Ports are usually assigned a number between 0 and 65535.
If you continue with the call-center analogy, each person would be a socket. A socket is something that either listens for, or sends data. This data can be anything (usually stored in packets).
4. WTF ARE PROTOCOLS?
Okay, so now that we've covered the basic stuff, ports, IP's sockets and well, DNS, you know how computers are able to communicate to each other physically. However, there is still the matter of organizing the data into packets and telling the server/client what you're sending. You could be sending a textfile, and for all you know the server you're uploading it to could interpret it as a picture. In order to prevent this stuff from happening, computers use protocols.
Protocols are simply a way of organizing the data that gets sent. For example, to send an instant message, you need to tell your buddy that the data your sending is an instant message, not a file transfer or an invitation into direct-connection.
This is usually done by giving each packet a "header" which tells the client what the packet contains. A header could say "I'm part of a textfile called sometextfile.txt, part #3" and the client gathers up all parts separated into packets and puts them back together into textfile sometextfile.txt
5. HTTP/1.1 PROTOCOL: EXAMPLE
So, how does the www work? How does your computer manage to access SRL-forums.com? The web works by using a protocol called http. This is the stuff you don't see, the "behind the scenes". Even when looking at the html code of your page, you just see half of the story. The "behind the scenes" exchange of data from the server is also called "header data", and contains information about the version the server is running, the local time/UTC of the server, type of data transferred, and lots more.
The transaction starts at the client. Let's say, the user wanted to access google.com. You type it in, and press the enter button. Here's the sequence of events that happen when you wait for the page to load:
User sends GET request to google.com (get me the resource!), including information on the browser you use (user agent), the operating system, and loads more. You wouldn't believe how much info you reveal just based on your header data! :eek:
Server sends status report (usually 200, if it's ok, 404 if it doesn't find the page)
Server sends it's own header data (server version, date, time, cookies to be set, other stuff that can be quite revealing)
Server sends the resource
Client repeats this until all resources associated with the site are loaded (pictures, .swf's, scripts, etc.)
So, let's say you wanted to make a post on SRL forums. How do you send data to the server with http? Well, you use the POST request :) . Then there's also the HEADER request and some other more complex and less used ones, but I won't discuss these. Basically, the POST and GET request are the ones most commonly used.
You can find out more about the http/1.1 specification at http://www.w3.org/Protocols/rfc2616/rfc2616.html. WARNING: this site may give you a heart attack if you're easily overwhelmed by lots of technical details. Not for the faint of heart!
6. WHY SHOULD I CARE ABOUT THIS BORING STUFF?
Well... basically, you can use it to build auths using SCAR, to make programs that automatically retrieve information from websites, and lots of other useful stuff like protecting your privacy by controlling what your browser sends as header data. You can also craft custom packets and send them to other people or change the return address of the packet (i.e. your IP on the packet). Basically, lots of fun stuff.
I'm not to be held responsible for any incidents that result because of you reading this tutorial. Use your brain and don't do anything stupid - you'll regret it and you WILL get caught.
Have fun programming the web :f: !!!
You use it daily to check your e-mail and to access SRL forums, to gather information, to authenticate your scripts, to hack people, and to torrent files. Simple enough, you call it "the internet". This tutorial will basically teach you a little bit about how HTTP/1.1, Protocols, and TCP/IP. Probably all techie stuff you've heard about before, but never really figured out what it REALLY means.
If you have a short attention span or can't stand text longer than a few lines, please exit this tutorial NOW (thanks to Boreas for that line :D ).
Feel free to skip certain parts when you feel you already know about stuff, but if you don't get something later because you didn't read earlier stuff, don't complain. Feel free to ask questions.
1. THE BASICS
So, what exactly is the internet? Is it the web you use to access SRL and google.com? I betcha 90% of the people on this world believe this to be the case - and they're WRONG! The internet is just that - a network of computers connected together by wires. Anything that transfers data in this network is the internet. This means bittorrent, e-mail, and MSN are part of the internet!
A computer in the internet can do two things: send and receive. Usually, it does both. Think of it as a telephone: You can send (speak into the mike) and receive (listen at the receiver). The receiving end is called a server because it constanly "Listens" to the connection, and the sender is usually called a client.
So, how is stuff sent through the internet? Answer: there's two ways to send data. One is called UDP, but I won't go into detail for that one, because it is complicated and used less often (like, almost never :p ). Basically, it sends data as a single stream through the wire (or fiber optics cable).
The more commonly used method for transferring data is to break down the data you want to send into small things called "packets", which are then individually sent into the internet. Packets are just that: like a packet you bring to the postoffice, except that this one contains data.
Like a packet at the postoffice, the packet has a receiving and a destination adress. Also, like at a mail office, the packets doesn't get sent directly to the destination computer but are instead passed over various servers that serve as "post offices". You can try tracing the servers your packets go through before arriving by using the followging command in ms-dos (or linux bash shell):
tracert hostname
where you replace hostname with the web address/IP you want to trace to. Speaking of IP's - I think I haven't talked about them yet.
2. ADDRESSING COMPUTERS HOOKED ONTO THE INTERNET
Every packet is adressed, as already said. Now, there are two types of adresses: IP's and Web adresses. There's a third kind called a mac adress, but it's rarely used and kind of complex so I won't explain it.
An IP is four number code, ranging from 0.0.0.0 to 255.255.255.255 . Basically, it specifies the adress of a computer. You can simply type in http://72.14.207.99 into your browser window, and you will land at... google.com!
Now, since four-code numbers are very hard to remember, a second type of adress has been developed: a web-address. This is the familiar address you type into the browser. But how does the internet know that if you type in www.google.com you actually mean 72.14.207.99? The answer is kind of complex: DNS servers. DNS stands for "Domain name server". Basically, it is a kind of server that serves as a sort of telephone book, where your computer looks up which IP corresponds to the domain name you typed in. Maintaining these servers costs money, so you usually have to pay to register a domain name in these servers.
3. PORTS AND SOCKETS
You occasionally hear techies talk about "ports" and "sockets". So here I'm going to explain to you what they are.
Imagine your computer as a call center, with thousands of incoming and outgoing connections to the internet. If that were the case, each connection would be a port. A port is simply said, a gateway into your computer. Ports are usually assigned a number between 0 and 65535.
If you continue with the call-center analogy, each person would be a socket. A socket is something that either listens for, or sends data. This data can be anything (usually stored in packets).
4. WTF ARE PROTOCOLS?
Okay, so now that we've covered the basic stuff, ports, IP's sockets and well, DNS, you know how computers are able to communicate to each other physically. However, there is still the matter of organizing the data into packets and telling the server/client what you're sending. You could be sending a textfile, and for all you know the server you're uploading it to could interpret it as a picture. In order to prevent this stuff from happening, computers use protocols.
Protocols are simply a way of organizing the data that gets sent. For example, to send an instant message, you need to tell your buddy that the data your sending is an instant message, not a file transfer or an invitation into direct-connection.
This is usually done by giving each packet a "header" which tells the client what the packet contains. A header could say "I'm part of a textfile called sometextfile.txt, part #3" and the client gathers up all parts separated into packets and puts them back together into textfile sometextfile.txt
5. HTTP/1.1 PROTOCOL: EXAMPLE
So, how does the www work? How does your computer manage to access SRL-forums.com? The web works by using a protocol called http. This is the stuff you don't see, the "behind the scenes". Even when looking at the html code of your page, you just see half of the story. The "behind the scenes" exchange of data from the server is also called "header data", and contains information about the version the server is running, the local time/UTC of the server, type of data transferred, and lots more.
The transaction starts at the client. Let's say, the user wanted to access google.com. You type it in, and press the enter button. Here's the sequence of events that happen when you wait for the page to load:
User sends GET request to google.com (get me the resource!), including information on the browser you use (user agent), the operating system, and loads more. You wouldn't believe how much info you reveal just based on your header data! :eek:
Server sends status report (usually 200, if it's ok, 404 if it doesn't find the page)
Server sends it's own header data (server version, date, time, cookies to be set, other stuff that can be quite revealing)
Server sends the resource
Client repeats this until all resources associated with the site are loaded (pictures, .swf's, scripts, etc.)
So, let's say you wanted to make a post on SRL forums. How do you send data to the server with http? Well, you use the POST request :) . Then there's also the HEADER request and some other more complex and less used ones, but I won't discuss these. Basically, the POST and GET request are the ones most commonly used.
You can find out more about the http/1.1 specification at http://www.w3.org/Protocols/rfc2616/rfc2616.html. WARNING: this site may give you a heart attack if you're easily overwhelmed by lots of technical details. Not for the faint of heart!
6. WHY SHOULD I CARE ABOUT THIS BORING STUFF?
Well... basically, you can use it to build auths using SCAR, to make programs that automatically retrieve information from websites, and lots of other useful stuff like protecting your privacy by controlling what your browser sends as header data. You can also craft custom packets and send them to other people or change the return address of the packet (i.e. your IP on the packet). Basically, lots of fun stuff.
I'm not to be held responsible for any incidents that result because of you reading this tutorial. Use your brain and don't do anything stupid - you'll regret it and you WILL get caught.
Have fun programming the web :f: !!!