Personal Technology Information

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
http://eblivion.sitesled.com


MORE RESOURCES:

04/28/2024
The Best Binoculars to Zoom In on Real Life
Whether you’re bird-watching or baseball-spotting, we break down prices and specs to find the best pair for you.


more info


04/28/2024
The Best Sleeping Bags for Every Adventure
Whether you’re climbing peaks or taking the family to the local park, we’ve found the best sleeping bags for every temperature, budget, and camping expedition.


more info


04/28/2024
Our Favorite Digital Notebooks and Smart Pens
These nifty tools combine the ease of jotting notes by hand with the power of saving them digitally.


more info


04/28/2024
The Best Password Managers to Secure Your Digital Life
Keep your logins locked down with our favorite password management apps for PC, Mac, Android, iPhone, and web browsers.


more info


04/28/2024
How to Get Free Kindle Books With Your Library Card
All you need is an internet connection, a library card, and a good ebook reader to dive into your next page-turner.


more info


04/28/2024
I Tried These AI-Based Productivity Tools. Here’s What Happened
Hoping to make life easier, I tested six AI-powered tools meant to help me write better and work smarter.


more info


04/28/2024
The Mysterious ‘Dark’ Energy That Permeates the Universe Is Slowly Eroding
Physicists call the dark energy that drives the universe “the cosmological constant.” Now the largest map of the cosmos to date hints that this mysterious energy has been changing over billions of years.


more info


04/27/2024
The Best Sleeping Pads for Camping, Backpacking, and Travel
Whether you’re snoozing in a campground or schlepping up to an alpine valley, these are the best pads we’ve found for resting your weary bones.


more info


04/27/2024
The Best Robot Vacuums to Keep Your Home Clean
Whether you’re up against pet hair or you want to splurge on a high-end laser-guided robot vacuum, we have the perfect pick for you.


more info


04/27/2024
Get the Most Out of Your iPad With These Accessories
These are some of our favorite stands, cases, keyboards, and styli, no matter which Apple tablet you have.


more info


04/27/2024
7 Spring Albums That You Don’t Need to Fight About Online
New music from Maggie Rogers, Tyla, Brittany Howard, and SchoolBoy Q showcase distinct artistic evolutions.


more info


04/27/2024
Autocomplete Interview
Autocomplete Interview - Is Ice Cube a nice guy? Do astronauts really drink their own pee? Does Gerard Butler still surf? The internet searches for answers and WIRED goes right to the source for the answer.


more info


04/27/2024
Meta’s Ray-Ban Smart Shades Get a Fresh Blast of AI
Plus: Leaked details tell us more about the new Google Pixel 8A, Freitag’s environmentally conscious bag is entirely recyclable, and it’s time to unpack a whole bunch of tech acronyms.


more info


04/27/2024
1 in 3 Americans Live in Areas With Dangerous Air Pollution
Climate change is increasing the number of days people are exposed to hazardous pollution, affecting already disadvantaged communities the most.


more info


04/27/2024
School Employee Allegedly Framed a Principal With Racist Deepfake Rant
This week in cybersecurity news: Google holds off on killing cookies, Samourai Wallet founders get arrested, GM stops its driver surveillance program, and a school principal's racist rant is revealed to be a deepfake.


more info


04/27/2024
Russia Vetoed a UN Resolution to Ban Space Nukes
A ban on weapons of mass destruction in orbit has stood since 1967. Russia apparently has other ideas.


more info


04/26/2024
Roborock’s Robot Vacuums—Including WIRED’s Top Pick—Are on Sale Right Now
More like Robot Rock, am I right? (Sorry.) These are some of the best dust busters around, and they’re cheaper than usual.


more info


04/26/2024
Tesla Autopilot Was Uniquely Risky—and May Still Be
In an investigative report into crashes and deaths associated with Tesla Autopilot, federal regulators concluded that the system lacked standard protections.


more info


04/26/2024
The 17 Best Movies on Amazon Prime Right Now
From "Road House" to "Bottoms," these are the must-watch films on the streamer.


more info


04/26/2024
The 33 Best Shows on Amazon Prime Right Now
From "Mr. and Mrs. Smith" to "Fallout," these are our picks for what you should be watching on the streamer.


more info


04/26/2024
Decades of Garry’s Mod Nintendo Uploads Are Disappearing
Nintendo is once again flexing its copyright muscles by filing takedown requests for user-generated content on the popular game platform.


more info


04/26/2024
The Best Lubes for Every Occasion
For the most sensitive parts of the human body, friction is the enemy. Here’s how to keep it at bay.


more info


04/26/2024
Which Govee Smart Lighting Kit Should You Buy?
Govee makes some of the best affordable smart lights, but its enormous range can be overwhelming and confusing. Here’s how to choose the right fit for your home.


more info


04/26/2024
The Best USB-C Cables for Your Phone, Tablet, or Laptop
Unravel the tangled world of cords and find the ones you need to charge your gadgets and transfer data.


more info


04/26/2024
The Best Car Phone Mounts and Chargers
These mobile accessories will make your smartphone a better—and safer—road trip companion.


more info



home | site map | contact us