November 25, 2008

Windows Space Monitoring

Every time I boot into my windows partition, it alerts me with: "You are running out of space on Local Disk (C:)." In my mind, I picture an xkcd comic with a caption reading:

"And I ran. I ran forever... Without space. In only time."

November 22, 2008

Javascript Injection Party Trick

I know its old and I know its silly, but harmless javascript injections still amuse me. So of course I must share this fun with the world at large, right? :^)

A javascript injection by itself is fairly harmless. This is because the 'exploit' is client-side. When a javascript injection occurs, nothing changes on the server. The real workings of it are that the user is telling their browser to change how the web page is displayed; For instance, if we used a javascript injection to change the google logo at www.google.com to the goatse.cz image, nothing on the google servers will be altered. No one else accessing google.com will have the goatse man on their browser.

Its fairly simple to do. Open a web browser pointed to www.google.com, clear the address bar, and enter
javascript:void(document.images[0].src="//google.com/intl/en//images/sitesearch/linux.gif");

Now to break it down. The prefix "javascript:" tells the browser that the following is a javascript command, much like the prefix "http:" says to display the page html. The "void():" function carries out what is passes as an argument, in this case, to assign a variable to a new value. Now it gets a bit harder... The data we are changing is stored in the variable "document.images[0].src". The main object here is "document", which is the current web page. Images are stored in an array called "images[ ]", which is simply an indexed list of images from top to bottom. The top-most image will be "images[0]", the next will be "images[1]", and so on. The google logo happens to be the first image, so we use "images[0]" to reference it. The variable "src" contains the URL of the image to be displayed. When we change this, the browser will display whatever we change it to. Of course the "=" sign assigns whatever is next to the "document.images[0].src" variable, and then comes the new source value itself.

So in essence, this javascript injection is saying: "Hey, browser, change the source(src) of the first image(images[0]) on this web page(document) to "http://www.google.com/intl/en//images/sitesearch/linux.gif". Pretty neat eh?

This is a pretty fun way to silence those "1337 Hax0rs!!1!1!" by showing them up. :-D And extra points if you convert the command string into hex characters to throw them off.

Here is some additional material, mainly for my personal reference:

Appearance Related:
  • document.bgColor - The background color.
  • document.fgColor - The foreground text color.
  • document.defaultCharset - The default charset.
  • document.title - The name of the current document.
  • document.write() - Writes the argument passed to write() onto the document.

Non-Visible:
  • document.cookie - The cookie associated with the web page.
  • document.security
  • document.location - What the web browser is pointing to. Change this to change pages.
  • document.referrer - The URL of the document that we got the link to the present document from.
  • document.URL - The path to the current document.

Document Arrays:
  • document.embeds[ ] - An array containing all the plugins in a document.
  • document.anchors[ ] - An array of all the anchors in the document.
  • document.forms[ ] - An array of all the forms in the document.
  • document.frames[ ] - An array that consists of all the frame objects in the document.
  • document.layers[ ] - An array containing all the layers in a document.
  • document.images[ ] - An array of the images in the document.
  • document.links[ ] - An array of links in the document.

Image Objects:
document.image - An image in a document.
  • image.border - The width of the border around the image in pixels.
  • image.complete - A Boolean value which identifies whether an image is completely loaded yet.
  • image.height - The read only height of the image in pixels.
  • image.hspace - The read only amount of horizontal space to the left and right sides of the image.
  • image.lowsrc - The URL of an alternate image for low-res screens.
  • image.name - The image name.
  • prototype - Used for adding user-specified properties to the image.
  • image.src - The URL of the image to be displayed. It is a read/write string.
  • image.vspace - The read only vertical space above and below the image.
  • image.width - The width of the image in pixels.

Link Objects:
document.link - A link within the document.
  • link.hash - The URL anchor part including the leading hash mark if one exists.
  • link.host - The URL host name and port.
  • link.hostname - The URL host name section.
  • link.href - The URL.
  • link.pathname - The URL path name section.
  • link.port - The URL port section.
  • link.protocol - The URL protocol section including the colon after the protocol name.
  • link.search - The URL query string. This is the section after and including the question mark.
  • link.target - The URL link’s target name.

Document Object Methods:
  • clear() - This is depreciated.
  • close() - Closes an output stream that was used to create a document object.
  • contextual() - Used to specify specific attributes. To change things in block quotes to the color blue: document.contextual(document.tags.blockquote).color = "blue";

November 17, 2008

Mineral Oil Coolant Rig 2.0

I have come across many interesting hardware hacks on the internet, but this coolant rig places well within the top 10. The mineral oil cooling system ranks so high on my personal scale due to being relatively simple to construct. Simple, cheap, and freakin' cool. What reason do I have not to build it?

Needed for the hack:
  • Mobo, processor, ram and all that basic stuff. (I'll probably use parts from local dumpsters first, so that I don't accidentally sogg-ify my current system if this fails...)
  • A mobo sled ripped from a computer case.
  • A clear, non-conductive liquid. Enough to fill the case-tank. Mineral oil is the usual liquid, but I'll have to look into others such as mineral oil or ethylene glycol. Ideally I would rather use ethylene glycol because of its lower viscosity at sub-zero temps.
  • A glass tank. An aquarium is most likely my best bet here. I better make sure my mobo is comfy inside of it first.
  • Large piece of clear acrylic or other such material. This goes on top to keep dust bunnies and computer bugs out. :^)
Needed to Hack the Hack:
  • Cheap LED lighting. I want both neon blue and neon green.
  • Fish tank "bubbler" thingy. This should add cool little bubbles. :-)
  • Fish tank gravel, preferably blue or black. Cover the bottom of the case-tank with this for more eye-candy.
  • 100% biologically efficient fish that thrive in mineral oil. Ok, this may be a long shot, but you never know with Ebay...
  • Cooling coil, to replace the fan; Fans are for air... I imagine the coil mounted inside the oil itself. My only concern is that water would condense if the coil brought the temprature low enough...
In my head the setup seems fairly simple. The hard drive would have to be outside the liquid because of its little "breather hole"; maybe I could mount it over the oil, covered by the tank's top piece. Solid-state hard drives shouldn't have those little holes, so they could work. Its moot either way because I won't find a nice solid-state drive in the garbage and I'm not buying one.

So far so good. I'll post pics and such when I get around to building it. (By that I mean when I have the money to build it :-D )

November 12, 2008

This is Your Code on Drugs

This is your code:
Prints "Hello World."

This is your code smoking Cigarettes:
Smoker's gunk blows out fan motors. CPU is fried.

This is your code drinking Alcohol:
Prints "Hel;i wOr;d!!! ROfLOLOloLOLoLOlz!!!!!"

This is your code smoking Marijuana:
Prints nothing. Code never compiled.

This is your code on Hard Stimulants:
Prints "Hello World!" 512 times, without loops.

This is your code on Hard Depressants:
Prints "Goodbye World..."

This is your code on Hallucinogens:
Prints "Hello World!" cycling through 1024 colors.