|
|
|
|
|
|
||
|
|
||
|
|
HTTP Protocol
The web is run on port 80. You are probably wondering what "port 80" is, right (whether you actually are or not is irrelevant)? Well, the answer is easy (not really). See, the Internet and the web are different. The Internet is the infrastructure (ie the physical wires, the server hardware, etc) and the web is the ideas and the software. I say ideas because before the web the Internet was a mess of wires and powerful computers using POP3 and SMTP for communication, FTP for file transfer, and TELNET for remote shell access, among others. Then the web came along, and Internet use spread to the home and all across the world. See, in plain terms, a web server broadcasts HTML to all connected clients on port 80, so port 80 is the "HTTP port." HTTP is the protocol, or set of standards for port 80 and its software. The client software is your browser, (ie probably Internet Explorer but hopefully Firefox), and the server is something like Apache or IIS(uug). This relates to hacking, as you will see later, but first you need to know more about HTTP. (the spaces before the < & > are put in so this isnt thought of as HTML)
< html >
< body >
< img src="image.png" >< br >
< div align="center" >text< /div >
< /body >
< /html >
If Apache is serving that, and Firefox picks it up, It will replace the < img src... etc with the image found at image.png relative to the working directory of the page requested, (ie ./, current dir), and the < div... is turned into text printed in the middle of the page. Since the code is processed from top to bottom, the br means that the browser should skip down one line and start the rest from there. The top two and bottom two lines tell the browser what part of the page it is reading. You migh have noticed the < /div >, the < /body >, etc. They "close" the tag. Tag is a term for anything in s, and they must be opened (ie introduced) and closed (ie < /tag >). If you want to learn HTML tagging, just head over to our close friend Google and do a search.
Since you haven't gotten to the programming section, and currently I have not even wrote it, I will show you a web server example in the simplest form I can think of that will work on any OS you are currently using. So the obvious choice is JAVA:
import java.net.*; import java.io.*; import java.util.*;
public class jhttp extends Thread {
Socket theConnection;
static File docroot;
static String indexfile = "index.html";
public jhttp(Socket s) {
theConnection = s;
}
public static void main(String[] args) {
int thePort;
ServerSocket ss;
// get the Document root
try {
docroot = new File(args[0]);
}
catch (Exception e) {
docroot = new File(".");
}
// set the port to listen on
try {
thePort = Integer.parseInt(args[1]);
if (thePort < 0 || thePort > 65535) thePort = 80;
}
catch (Exception e) {
thePort = 80;
}
try {
ss = new ServerSocket(thePort);
System.out.println("Accepting connections on port "
+ ss.getLocalPort());
System.out.println("Document Root:" + docroot);
while (true) {
jhttp j = new jhttp(ss.accept());
j.start();
}
}
catch (IOException e) {
System.err.println("Server aborted prematurely");
}
}
public void run() {
String method;
String ct;
String version = "";
File theFile;
try {
PrintStream os = new PrintStream(theConnection.getOutputStream());
DataInputStream is = new DataInputStream(theConnection.getInputStream());
String get = is.readLine();
StringTokenizer st = new StringTokenizer(get);
method = st.nextToken();
if (method.equals("GET")) {
String file = st.nextToken();
if (file.endsWith("/")) file += indexfile;
ct = guessContentTypeFromName(file);
if (st.hasMoreTokens()) {
version = st.nextToken();
}
// loop through the rest of the input li
// nes
while ((get = is.readLine()) != null) {
if (get.trim().equals("")) break;
}
try {
theFile = new File(docroot, file.substring(1,file.length()));
FileInputStream fis = new FileInputStream(theFile);
byte[] theData = new byte[(int) theFile.length()];
// need to check the number of bytes rea
// d here
fis.read(theData);
fis.close();
if (version.startsWith("HTTP/")) { // send a MIME header
os.print("HTTP/1.0 200 OKrn");
Date now = new Date();
os.print("Date: " + now + "rn");
os.print("Server: jhttp 1.0rn");
os.print("Content-length: " + theData.length + "rn");
os.print("Content-type: " + ct + "rnrn");
} // end try
// send the file
os.write(theData);
os.close();
} // end try
catch (IOException e) { // can't find the file
if (version.startsWith("HTTP/")) { // send a MIME header
os.print("HTTP/1.0 404 File Not Foundrn");
Date now = new Date();
os.print("Date: " + now + "rn");
os.print("Server: jhttp 1.0rn");
os.print("Content-type: text/html" + "rnrn");
}
os.println("< HTML >< HEAD >< TITLE >File Not Found< /TITLE >< /HEAD >");
os.println("< BODY >< H1 >HTTP Error 404: File Not Found< /H1 >< /BODY >< /HTML >");
os.close();
}
}
else { // method does not equal "GET" if (version.startsWith("HTTP/")) { // send a MIME header os.print("HTTP/1.0 501 Not Implementedrn"); Date now = new Date(); os.print("Date: " + now + "rn"); os.print("Server: jhttp 1.0rn"); os.print("Content-type: text/html" + "rnrn"); }
os.println("< HTML >< HEAD >< TITLE >Not Implemented< /TITLE >"); os.println("< BODY >< H1 >HTTP Error 501: Not Implemented< /H1 >< /BODY >< /HTML >"); os.close(); }
}
catch (IOException e) {
}
try { theConnection.close(); }
catch (IOException e) { }
}
public String guessContentTypeFromName(String name) { if (name.endsWith(".html") || name.endsWith(".htm")) return "text/html"; else if (name.endsWith(".txt") || name.endsWith(".java")) return "text/plain"; else if (name.endsWith(".gif") ) return "image/gif"; else if (name.endsWith(".class") ) return "application/octet-stream"; else if (name.endsWith(".jpg") || name.endsWith(".jpeg")) return "image/jpeg"; else return "text/plain"; }
}
I learned the basics of JAVA web server programming from "JAVA Network Programming" by Elliotte Rusty Harold. Now you don't need to know JAVA to be able to understand that, even though it might not seem like that at first. The important thing to look for when examining the code it the os.print("") commands. There is nothing fancy being used to get the data to the browser, you don't have to mutate the data, its sending plain HTML via a simple command. The plain and simple truth is that the browser is doing the majority of the difficult stuff, when speaking about this simple server. But in complicated servers there is server-side scripting, etc. Webs are much more complicated than just a simple server and Internet Explorer, such as Flash and JAVA Applets (run on clients machine in browser) and server-side stuff like PHP and PEARL (displayed on clients browser as plain HTML but executed as scripting on the server). T
he code above is a good way to learn the HTTP standards, even though the program itself ignores most of the regulations. The web browser not only understands HTML but also knows that incoming connection starting with 404 means that the page is missing, etc. It also knows that when "image/gif" is returned the file is an image of type gif. These are not terms the stupid server made up. They are web standards. Generally speaking, there are two standards. There is the w3 standard (ie the real standard based on the first web servers and browsers) and the Microsoft standard (ie the Internet Explorer, IIS and NT standards). The standards are there so anyone can make a server or client and have it be compatible with (nearly) everything else.
Hiding your Connection
If you have a copy of Visual Basic 6, making a web browser is easy, thanks to Winsock and the code templates included, so I will not put in an example of that. Instead I will explain cool and potentially dangerous things you can do to keep yourself safe. I know those words put together doesn't make sense (ie potentially dangerous and safe), but you will see in a moment. I'm talking about PROXIES. (anonymous proxy servers, to be exact). You connect to the internet on port 80 through the proxy server, thus hiding your real IP. There are many obvious applications for this, but it is also the only really potentially dangerous thing so far, so I will restate what I have written at the top: Whatever you do with this info is your responsibility. I provide information and nothing more. With that said, there is nothing illegal about using an anonymous proxy server as long as it is free and you are harming no one by using it. But if you think you are completely safe using one, you are deadly wrong. They can simply ask the owners of the proxy what your IP is if they really want to find you. If you join a high anonymous server, the chance of them releasing your IP is pretty low for something like stealing music, but if you do something that would actually warrant jail time, they probably will be able to find you. www.publicproxyservers.com is a good site for finding these servers.
The last trick related to web servers and port 80 is a simple one. First, find a free website host that supports PHP and use the following code:
If the address of this file is http://file.com/script.php, to download the latest Fedora DVD you would go to the following address: http://file.com/script.php?destfile=linuxiso.org/download.php/611/FC3-i386-DVD.iso &password=passwd
You can change "passwd" to whatever password you want. This will make any onlookers think you are connected to http://file.com. You are still limited to the speed of your connection, but you are using the bandwidth of the web host
Whatever you do with the above information is solely your responsibility.
Mike Vollmer --- eblivion
http://eblivion.sitesled.com




How long do you think DVDs have around? 20 years? 10 years? Actually, they have only been around for about seven years, but it seems like they have been around much longer. Many... Read More
What is a Refurbished Computer?Refurbished Computers. Remanufactured Computers. Reconditioned Computers. Essentially, all of these terms refer to the same thing. But what does refurbished really mean? A refurbished computer is one that is... Read More
Computers are supposed to speed up our productivity?to help us do more in less time. What do you do when your computer is running so slow that it's keeping you from getting your... Read More
Up until the recent past, those who wanted to take advantage of a mobile phone, data organizer, wireless e-mail with text messaging, web browsing and a digital camera had to have separate units... Read More
Tip #1 -- Rebates: A rebate is not always a bargain. Computers with rebates are often close to being discontinued. You may pick up a good deal or purchase technology that's about to... Read More
Flow Text Around a GraphicQuestion: I have inserted a photo in my Word document but when I try to make my text go around the photo, it will only go above and below... Read More
Freezing is also known as crashing or hanging. It's frustrating. The computer locks up and the mouse and keyboard do not respond. You may lose data and you certainly lose time and patience.... Read More
I do a holiday letter every year and send them to friends so they know what's happening with my family and I ask them about theirs. Though addressing the envelopes and such is... Read More
MP3 players are Hot! Playing music has come a long way since the transistor radio, portable tape and CD player days. Most players are no larger than a deck of cards. Eliminating the... Read More
With renting methods such as online DVD rental and pay-per-view, it seems almost old-fashioned to go to the rental store. But with all the different ways to get the latest movies, which way... Read More
One of the most confusing parts of beginning your Cisco studies is keeping all the cable types separate in your mind, and then remembering what they're used for. This often occurs when a... Read More
That desk in front of you and everything else around you is made up of atoms. An atom consists of electrons orbiting around a nucleus. An atom is increadibly tiny. You could line... Read More
Your first step in removing dangerous infections from your computer should be downloading a free program called Hijack This. Make sure you download the file and extract it to a directory on your... Read More
As the web has evolved, so have the methods of collecting personal information. A large number of websites require visitors to register to gain access or participate. While the need for registration is... Read More
Stop Getting LostOne of the greatest uses for a pocket pc is for gps navigation. Now all those people who continually get lost can find their way anywhere with the various types of... Read More
Buying Your PCBuying a PC that's right for you and your family is not all that simple task. More so if you're going to buy an unbranded or an assembled one. But branded... Read More
Do you remember the old saw about how computers would change our lives for the better? We'd have more time to ourselves and lead healthier, happier lives. The truth is computers do make... Read More
A computer needs a certain amount of information to operate; for example, the date and time, the amount of memory installed, the number of drives and their configuration, and so on. In the... Read More
Most of the web applications have a lot of images used in it. These images are usually stored in a web server folder and they are accessed by giving the relative path to... Read More
The best way to get the gaming computer that you want, that will provide optimum performance is to build your own computer. If you think you do not have the technical knowledge or... Read More
This is not your typical lost data story. I was a good girl and I kept my files on the network drive just like the company recommended. The only thing I put on... Read More
Most people think that all you have to do to purchase a new plasma television set is to walk into a shop, look around, and purchase the first set that catches your attention.... Read More
Are you thinking of buying an Apple iPod? Or have you bought one?Almost everyone and anyone that I know seems to have bought an iPod or at least is thinking of getting an... Read More
Yes, it's true. You may have inadvertently invited a spy into your computer. This spy is known as "spyware, adware, or trojans", and once it is in your computer it starts taking statistical... Read More
While most small businesses really do need to find a good local computer consulting business to take care of their computer problems, there are some computer problems that are simple enough for even... Read More
I've worked my way from the CCNA to the CCIE, and along the way I've conducted job interviews and casual conversations with dozens of CCNAs and CCNA candidates. Believe me, people who "sneak... Read More
The Cisco Certified Network Associate (CCNA) Certification is meant for career enhancement as well as gaining knowledge of the LAN/WAN technologies currently available for implementation. Hence, CCNA Certification can be obtained by IT... Read More
If you use a computer, you need to know more than just how to use your email and surf the web. You need to know that you are protected. If there isn't someone... Read More
I am going to assume that you are running windows xp on your machine, and you are the only user on this machine. That is right, no one else uses your computer except... Read More
If you have a computer for home use or for your business and don't take comprehensive backup for full protection then you are in the danger-zone. Maybe you do not take any backup... Read More
Are you looking for an MP3 player but am not sure which type and model to buy? There is a wide variety of MP3 players out there, from flash memory based players to... Read More
Get started creating web pages using text files and HTML code! This article is a continuation of HTML Explained: Part 1, which gives a general overview of HTML. Here, we're going to get... Read More
Do you use Windows standard uninstall feature? How do you migrate data from your old PC to the new one? Get some tips on amazing software you never knew existed and find out... Read More
MMC and SDFlash memory is available in so many formats that it can be difficult to know what will work with any particular device. Devices such as MP3 players, PDAs, mobile phones, digital... Read More
As the Web grows more crowded and just plain "noisy" with information bombarding us from every angle, most people welcome any tool, trick or shortcut to help them wade through the mountains of... Read More
Wouldn't you be shocked to find that your personal sensitive information, like files, credit card information, operating system / software and other non-disclosed data to be penetrated by unscrupulous prying eyes? Even worse..."Is... Read More
Lost & Found for the 21st CenturyIn today's hectic world more and more people are turning to those handy gadgets and mobile products that can be taken with them anywhere they go. The... Read More
World War II - Germany decided to attack Poland. Poland had many great warriors. They all prepared to fight the Germans. They were all ready with the best armor, the best and well... Read More
Understanding digital camera prices makes finding the best camera value much easier. Uncovering digital cameras best buys is easier if we know what's available within various price ranges. With that in mind let's... Read More
You use Ctrl+Alt+Del to see what's running on your PC, to close crashed programs and processes, and to check performance. You probably avoid a few processes whose names mean nothing to you, but... Read More
Time is money. And when you constantly have to divide your time between your mouse and your keyboard, your workflow rate really slows down.That's particularly true when you're working on a laptop, where... Read More
With the bewildering number of digital cameras on the market, it's increasing difficult to know where to start for your first purchase. One of the major determining factors of the price of a... Read More
Below you will find some useful information and comments about a few of the most popular MP3 players by Rio, including the Nitrus, Carbon, Cali, and Forge. None of these MP3 players are... Read More
The United States Of America citizen feels that games is a part of their life while developed countries such as the United Kingdom and Japan would feels that Games is high prospects to... Read More
"Aaaaaahhhhhh! I've been invaded by a virus!" Getting a virus means getting sick and no one in their right mind wants to be ill. Well, now that computers have become our close friends,... Read More
For six years, my Samsung PC 13.8 inch SyncMaster conventional monitor has served me well.Since the appearance of the flat screen LCD monitor, it has become obsolete. Perhaps, the flat screen's image of... Read More
Freezing is also known as crashing or hanging. It's frustrating. The computer locks up and the mouse and keyboard do not respond. You may lose data and you certainly lose time and patience.... Read More
Maybe you always wanted a feature that hasn't been available in the latest release of Wordpress. What you can do is either install a 3rd party plugin or write your own custom code... Read More
The Internet is an awesome tool, but be careful and aware that the cloud of over stimulation doesn't invade your mind.It seems we have to become aware of a new problem that is... Read More
Maintaining your computer is extremely important ? especially if you are an Internet Marketer. As you know, without your computer, your business can come to a screeching halt. There are 4 important steps... Read More
Heading off on vacation soon?Then perhaps you're tempted to take your trusty laptop along for the trip.After all, you bought it for its mobility, and it's nice to stay in touch via email... Read More
The Internet can be a dangerous place.While you're enjoying the convenience of online shopping, Internet banking and subscription websites, nasty people lurk around every corner.Hackers, fraudsters, identity thieves and many others would love... Read More
You don't have to fork out $250 for a super-diggy-whizbang mp3 player, do you? There are cheap mp3 players to be had, with a host of features perfectly suitable for everyday use. Here... Read More
I met an entrepreneur who hole heartedly disagree with an article in Advertising Age by Bradley Johnson that Palm Pilot can keep their market share through brand name. We discussed RIMM Research in... Read More
Occupational Therapy Made EasierMedical downloads for the pda have improved the life of both patients and doctors of all kinds. These freeware software downloads make many types of medical conditions much easier to... Read More
Here are some tips on how to use screensavers:First of all you should be careful when you use a screensaver on a LCD. A pixel it's on when it's dark on a LCD.... Read More
Not so many years ago, homes across the country watched their favorite TV shows on a bulky floor model that took awhile to warm up before you could see the picture, didn't offer... Read More
For many people the computer industry is a seeming unsolvable jungle filled with mysterious words. Here is a guide to help you understand the personal computer and to give you the information needed... Read More
| GOOGLE AD |
Personal Technology Personal Technology |