www.1001TopWords.com |
Web Standards
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 probablyInternet 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. Sincethe 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 headeros.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
|
RELATED ARTICLES
Basic Diagnosis Guidelines for Your PC Simone is exasperated. She has to work on her university assignment but her PC is not working properly. For example: She would like to open a single Internet Explorer window but a whole series of windows are opening up. Simone is not alone when it comes to this sort of problem. As a matter of fact, most of us will come across these kinds of problems in our life. When you fall sick you go to a doctor and he/she asks you a couple of questions as well as taking a look at your case history before giving any medication to you. In a similar way you have to find out what's wrong with your PC before treating it, if it's working in an aberrant manner. This article will help you in finding out what's troubling your PC. Image Conversion In Computers JPEG, GIFF/JIFF, BMP, and TIFF are the most commonly used formats for storing still image files such as photographs, graphics, and drawings.JPEG stands for Joint Photographic Experts Group and is a standard for image compression. Windows PDA Medical Software Benefits PDA Medical Benefits Email Management If you utilize a computer at home or work it is likely that you use email. Email is an electronic message that is sent from one computer to another following a specific protocol (Simple Mail Transfer Protocol or SMTP). As email's popularity has grown so too have the inherent problems with email. Connect Your IPAQ to Linux Choose Not To Conform How To Become A True CCNA 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 by" the CCNA exam by braindumps, memorization, and never touching a router or switch are QUICKLY found out in job interviews and on the job. Basic Computer Maintenance One of the most common questions computer users ask is, "How do I maintain my computer and keep it running great?" A computer is a lot like a car?it costs more than you think it should, it starts going down in value as soon as you bring it home and it requires regular maintenance to keep it running smoothly. Here are a few basic guidelines required to help keep your PC out of the shop: The Best MP3 Players Under $100 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 is a small sampling of some of the highest-rated cheap mp3 players. Looking at their features and failings can give you an idea of what can be attained for under $100. Tips For Finding Great Deals On Computer Accessories & Supplies Tip #1. Do a Google search. Don't be to general in your search, typein exactly what your looking for. Try putting the words youtype in quotes to narrow the search. Cisco Certification: Building Your Own Home Lab, Part I CCNAs and CCNA candidates hear it all the time: â??Get some hands-on experienceâ??. From my personal experience climbing the Cisco certification ladder, I can tell you firsthand that there is no learning like hands-on learning. No simulator in the world is going to give you the experience you will get cabling and configuring your own routers. Virtual Memory - What is It? I recently got an e-mail asking about virtual memory. The person who sent me the question was getting an error on random occasions from their Windows operating system stating "Your computer is low on virtual memory". They wanted to know what is virtual memory, and if this error does occur, what can I do to fix it? Here is the answer that I sent out: Seven Things to Consider When Choosing a PDA In the early days, Personal Digital Assistants (PDAs) were not much more than glorified calculators with the ability to store contact information and brief notes. Now, the line between personal computer and personal digital assistant is blurred thanks to the advanced capabilities of these useful little devices. Buying a Home Theater Receiver Buying a receiver is one of the most important decisions you're going to have to make when building your home theater. The receiver has a number of functions including; connecting and switching audio sources; connecting and switching video sources; decoding surround sound formats; amplifying an audio signal and sending it to your speakers; tuning in to radio stations; and acting as the interface between you and your home theater. Make Windows XP Run Faster! A friend told me: "My computer startup seems to be taking a long time. And when the hard disk finally stops churning, everything just seems slower than when it was new. Can you suggest any maintenance tips to reduce the startup time and make Windows run faster?" PDA Bible Free Download Your Bible At Your Fingertips Review of Rio MP3 Players 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 perfect, but each offers a unique set of strengths and weaknesses that should be taken into consideration before you purchase any one of them. Be sure to compare price, usability, and the overall performance of each. 4 Easy Ways to Speed Up A Sluggish PC 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 work done? Before you kick it to the curb, try these easy, do-it-yourself suggestions to help your system run & perform better. Bluetooth Technology: Tips for Buying Headsets or Headphones The technological horizon has always got something new to offer, and among the most recent of these offerings is Bluetooth enhanced hardware. For those of you who are unfamiliar with this latest-and-greatest technology, headsets and headphones in the Bluetooth line offer the ability to use your cell phone without the need for hands or dangling wires. In other words, when you have one of these, you've got yourself a wireless piece of hardware that attaches to the ear which allows cell phone communications to take place without the inconvenience or hassle of holding the phone to your ear or trailing long wires from the headset to the body of the phone. How Does a Palm Pilot Work? Just The Facts, Ma'm Be Your Own IT Department 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 responsible for the computers in your home or office, then pick someone, quick. Their job is to assure you that everything I've listed below is getting done on a regular basis so you can relax a little. |
© Athifea Distribution LLC - 2013 |