Stegosploit: Owned By A JPG

We’re primarily hardware hackers, but every once in a while we see a software hack that really tickles our fancy. One such hack is Stegosploit, by [Saumil Shah]. Stegosploit isn’t really an exploit, so much as it’s a means of delivering exploits to browsers by hiding them in pictures. Why? Because nobody expects a picture to contain executable code.

stegosploit_diagram[Saumil] starts off by packing the real exploit code into an image. He demonstrates that you can do this directly, by encoding characters of the code in the color values of the pixels. But that would look strange, so instead the code is delivered steganographically by spreading the bits of the characters that represent the code among the least-significant bits in either a JPG or PNG image.

OK, so the exploit code is hidden in the picture. Reading it out is actually simple: the HTML canvas element has a built-in getImageData() method that reads the (numeric) value of a given pixel. A little bit of JavaScript later, and you’ve reconstructed your code from the image. This is sneaky because there’s exploit code that’s now runnable in your browser, but your anti-virus software won’t see it because it wasn’t ever written out — it was in the image and reconstructed on the fly by innocuous-looking “normal” JavaScript.

232115_1366x1792_scrotAnd here’s the coup de grâce. By packing HTML and JavaScript into the header data of the image file, you can end up with a valid image (JPG or PNG) file that will nonetheless be interpreted as HTML by a browser. The simplest way to do this is send your file myPic.JPG from the webserver with a Content-Type: text/html HTTP header. Even though it’s a totally valid image file, with an image file extension, a browser will treat it as HTML, render the page and run the script it finds within.

The end result of this is a single image that the browser thinks is HTML with JavaScript inside it, which displays the image in question and at the same time unpacks the exploit code that’s hidden in the shadows of the image and runs that as well. You’re owned by a single image file! And everything looks normal.

We like this because it combines two sweet tricks in one hack: steganography to deliver the exploit code, and “polyglot” files that can be read two ways, depending on which application is doing the reading. A quick tag-search of Hackaday will dig up a lot on steganography here, but polyglot files are a relatively new hack.

[Ange Ablertini] is the undisputed master of packing one file type inside another, so if you want to get into the nitty-gritty of [Ange]’s style of “polyglot” file types, watch his talk on “Funky File Formats” (YouTube). You’ll never look at a ZIP file the same again.

Sweet hack, right? Who says the hardware guys get to have all the fun?

Dealing With Fallout

In just a few short days, Fallout 4 will be released and a substantial portion of the Hackaday staff will be taking the day off. As you would expect, a lot of people with 3D printers, soldering irons, and far too much time on their hands are getting pumped for the Fallout release. Here’s a few Fallout builds we’ve found over the past few weeks:

Pip-Boys

919501417186321280The most iconic thing you’ll find in a Fallout game is the Pip-Boy, the UI for the player and a neat wrist-mounted computer (that somehow has a CRT in it, I guess) for the player’s character. Hackaday’s own [Will Sweatman] built his own Pip-Boy 3000 that’s completely functional. The build uses a 4.3 inch touch display, a 10 position rotary switch, and a bunch of 3D printed parts.

Elsewhere on Hackaday.io, [Karl] is working on a functional Pip-Boy controller for Fallout, and [cody] built one with a Raspberry Pi. Of course, if you’re super special and have two thousand dollars to blow, Bethesda released a limited-edition Pip-Boy edition of Fallout 4 that’s compatible with most cell phones.

The Not Pip-Boys

door

There’s more to Fallout than just wrist-mounted computers, and for the true aficionados, there are gigantic gear-shaped doors. [TreyHill] has a partially finished basement with a gaming room tucked behind his very own vault door. The door itself is built out of plywood and rolls along a gear rack mounted to the floor. Will it hold up to a nuclear blast? Probably not. Is it up to code? It looks cool, at least.

[Lilykill] on Thingiverse is extremely capable with a copy of solidworks and produced a bunch of 3D models from the Fallout universe that includes power armorray guns, more Pip-Boys, plasma grenades, and a Nuka-Cola truck.

Fallout 4 for the Apple II

Fallout 4 will be available for the PS4, Xbox One, and PC, leaving out a large contingent of retro gamers. Fear not, lovers of the 6502: there’s’ a version for the Apple II:

This tribute to both the Apple II and Fallout was made with the Outlaw Editor, an SDK for pseudo-3D game development on exceedingly old hardware. There’s actual ray casting happening in this tribute, and it works just the same as Wolfenstein 3D or the like.

The Eloquence Of The Barcode

Beep. You hear it every time you buy a product in a retail store. The checkout person slides your purchase over a scanner embedded in their checkout stand, or shoots it with a handheld scanner. The familiar series of bars and spaces on the label is digitized, decoded to digits, and then used as a query to a database of every product that particular store sells. It happens so often that we take it for granted. Modern barcodes have been around for 41 years now. The first product purchased with a barcode was a 10 pack of Juicy Fruit gum, scanned on June 26, 1974 at Marsh supermarket in Troy, Ohio. The code scanned that day was UPC-A, the same barcode used today on just about every retail product you can buy.

The history of the barcode is not as cut and dry as one would think. More than one group has been credited with inventing the technology. How does one encode data on a machine, store it on a physical media, then read it at some later date? Punch cards and paper tape have been doing that for centuries. The problem was storing that data without cutting holes in the carrier. The overall issue was common enough that efforts were launched in several different industries.

Continue reading “The Eloquence Of The Barcode”

The Flying Man

No, that’s not a typo for Burning Man. What do you get when you take a hundred feet of plastic sheet, weld up a big ramp, modify a car into your own personal high speed winch, and put it all near a lake? You get some serious air time.

A group of French water sports enthusiasts decided to build this fantastically ill-advised super slip and slide. They built a giant ramp alongside an old farm house heading towards the lake. At the bottom is a large ramp they welded together out of steel. Now you can just slide down this slip and slide.

But they weren’t content with just that.

Continue reading “The Flying Man”

A Peek Under The Hood Of The 741 Op-Amp

First introduced as an IC back in 1968, but with roots that go back to 1941, the 741 has been tweaked and optimized over the years and is arguably the canonical op-amp. [Ken Shirriff] decided to take a look inside everybody’s favorite op-amp, and ended up with some good-looking photomicrographs and a lot of background on the chip.

canRather than risk the boiling acid method commonly used to decap epoxy-potted ICs, [Ken] wisely chose a TO-99 can format to attack with a hacksaw. With the die laid bare for his microscope, he was able to locate all the major components and show how each is implemented in silicon. Particularly fascinating is the difference between the construction of NPN and PNP transistors, and the concept of “current mirrors” as constant current sources. And he even whipped up a handy interactive chip viewer – click on something in the die image and find out which component it is on the 741 schematic. Very nice.

We’ve seen lots of chip decappings before, including this reveal of TTL and CMOS logic chips. It’s nice to see the guts of the venerable 741 on display, though, and [Ken]’s tour is both a great primer for the newbie and a solid review for the older hands. Don’t miss the little slice of history he included at the end of the post.

Flashed The Wrong Firmware? Swap Out The LCD To Match!

We always joke about the hardware guys saying that they’ll fix it in firmware, and vice-versa, but this is ridiculous. When [Igor] tried to update his oscilloscope and flashed the wrong firmware version in by mistake, he didn’t fix it in firmware. Instead, he upgraded the LCD display to match the firmware.

See, Siglent doesn’t make [Igor]’s DSO any more; they stopped using the 4:3 aspect ratio screens and replaced them with wider versions. Of course, this is an improvement for anyone buying a new scope, but not if you’ve got the small screen in yours and can’t see anything anymore. After playing around with flashing other company’s firmware (for a similar scope) and failing to get it done over the JTAG, he gave up on the firmware and started looking for a hardware solution.

It turns out that a few SMT resistors set the output screen resolution. After desoldering the appropriate resistors, [Igor] bought a new 7″ LCD screen online only to find out that it has a high-voltage backlight and that he’d need to build an inverter (and hide the noisy circuit inside his oscilloscope). Not daunted, he went digging through his junk box until he found a backlight panel of the right size from another display.

Yet more small soldering, and he had frankensteined a new backlight into place. Of course, the larger LCD won’t fit the case without some cutting, double-sided tape, and a healthy dose of black tape all around insulates the loose electricals. Et voilá!

We have to hand it to [Igor], he’s got moxie. It’s an ugly hack, but it’s a definite screen upgrade, and a lesser hacker would have stopped after flashing the wrong firmware and thrown the thing in the trash. We’d be proud to have that scope sitting on our desk; it’s a definite conversation starter, and a badge of courage to boot.

Applications For The Bitcoin Blockchain

Bitcoin, the libertarian’s dream currency, is far past the heady days of late 2013. When one Bitcoin was worth $1000 USD, there was no end to what could be done; new, gigantic mining rigs were being created, every online store jumped onto the bandwagon, and the price of Bitcoin inevitably crashed. Right now, the exchange rate sits at about $280 USD per coin, valuing all the Bitcoins ever mined somewhere around $4 Billion USD. That’s a lot of coins out there, and a lot of miners constantly verifying the integrity of the greatest thing to come from the Bitcoin community: the blockchain.

The bitcoin is just a record, or the ledger, of every transaction that has ever occurred on the Bitcoin network. It’s distributed, and the act of mining coins creates new blocks, or another set of data committed to the blockchain for eternity. While magical Internet money™ is by far the most visible product of the blockchain, developers, investors, and other people in the know are gushing about the possibilities of what can be done with a distributed record that can’t practically be altered and can’t be deleted.

[Jon Matonis], a figurehead for the entire cryptocurrency movement, recently said Bitcoin has become the strongest computer in the world, and stronger than all of the top 500 supercomputers combined. All of this computational power is effectively funneled in to verifying the integrity of the blockchain.

Bitcoin and other cryptocurrencies are not just a completely anonymous payment system; that’s only a side effect of the blockchain. The blockchain is the only inherently valuable part of a bitcoin; each transaction is logged in the blockchain, providing incredible security over how every coin is spent. No currency in the history of mankind has ever had a record of how every dollar or denarius is spent, and at the very least makes for very interesting economics research. Now, thousands of researchers across the globe are wondering what else the blockchain can do; tapping the power of the most powerful computer on the planet must have some interesting applications, and in the last few months, a few ideas have popped up.

Continue reading “Applications For The Bitcoin Blockchain”