Slashdot Mirror


TinyDisk, A File System on Someone Else's Web App

Psy writes "I attended Phreaknic this weekend where Acidus released TinyDisk, a shared file system that runs on top of TinyURL or his own implementation NanoURL. TinyDisk compresses a file, encrypts it, and dices it into clusters. Each cluster is submitted to TinyURL as if it were a url. This clusters can be read back out of the database, making TinyDisk a global file system anyone can use. There are safeguards in the default config to prevent people from dumping gigs of MP3s into TinyURL. While file-system-on-web-applications are nothing new (GMail file system anyone?) this hack shows how easy it is to accidentally design a web application insecurely despite the default PHP protections. See his presentation for more info"

44 of 188 comments (clear)

  1. Nifty hack by FidelCatsro · · Score: 4, Interesting
    This does seem to be a bit of an abuse of the service. whilst it does not contravene the TinyURL terms of use in any real way
    Terms of use:
    TinyURL was created as a free service to make posting long URLs easier. Using it for spamming or illegal purposes is forbidden and any such use will result in the TinyURL being disabled and you will be reported to all ISPs involved and to the proper governmental agencies. This service is provided without warranty of any kind.
    , it just seems rather untoward .

    Nifty little program all the same and a nice hack ,
    Having it running on his NanoURL implementation locally , could allow for a cool little service . Though there are better ways to offer web based file systems in the real world .

    He does state in the FAQ that its not intended to pollute TinURL in any way .. but this is what some people will use it for (and I doubt the restrictions will be hard to remove).

    Perhaps it will give TinyURL a nudge to tighten up their security though .
    --
    The only things certain in war are Propaganda and Death. You can never be sure which is which though
  2. Problems ahead? ;) by sznupi · · Score: 4, Funny

    TinyURL might become not so tiny anymore...

    --
    One that hath name thou can not otter
  3. From what I understand by FST · · Score: 4, Informative

    I saw this a few hours ago, and from what I understand the process goes as follows:

    1- Open a meta file
    2- Retrieve and concatenate all the clusters from TinyURL in the order
    specified in the meta file.
    2- Base64 decode the file
    3- Decrypt the file with the algorithm and key in the meta file
    4- Decompress the file with the algorithm in the meta file.
    5 - Verify the file size given in the meta file is correct for the
    decoded/decrypted/decompressed file
    6- Verify the checksum with the algorithm and value in the meta file matches
    for the decoded/decrypted/decompressed file
    7- Set the filename of the decoded/decrypted/decompressed file to the
    filename specified in the meta file.

    Hope that helps somebody :)

    --
    46487 466780 252994 376409 96920 39622 205366 244315 622115 512361 668040 63608 259203 955314 811176 652718 166330 23922
  4. Insecure? Really? by Afty0r · · Score: 5, Insightful
    this hack shows how easy it is to accidentally design a web application insecurely despite the default PHP protections.
    The design of these TinyURL style applications is insecure in the same way as a concrete wall is insecure because someone could spray paint on it.

    Insecure? Rancid tabloid hyperbole more like.
    1. Re:Insecure? Really? by julesh · · Score: 3, Insightful

      URLs could be checked on the serverside on availability for example; if your URL is phony, then it's rejected. I suppose that would make massive DOS-attacks possible

      It would also prevent tinyurl being useful for private URLs (e.g. those behind firewalls which only allow connections from known IP addresses). You can also use currently use tinyurl with protocols that the tinyurl server knows nothing about, e.g. ed2k: or magnet:.

      The better solution is just to disallow any single IP from creating more than, say, 10 URLs in an hour. This would make such a filesystem implementation useless without overly restricting legitimate users.

    2. Re:Insecure? Really? by xappax · · Score: 4, Funny

      Is it hyperbole day on Slashdot and no one told me?

      Hyperbole day? That's the most ridiculous thing I've ever heard in my entire life!

  5. NanoURL review by Anonymous Coward · · Score: 5, Funny

    I like NanoURL but it scratches real easily.

  6. I'm sure this won't be abused by Dekortage · · Score: 3, Interesting

    Pretty soon you'll see someone trying to use this as their backup system for 30gb of pr0n. Will large files kill TinyURL? What kind of latency is this going to introduce? If nothing else, this might constitute a DoS attack on TinyURL.com (which would be illegal.

    It's still interesting work.

    --
    $nice = $webHosting + $domainNames + $sslCerts
    1. Re:I'm sure this won't be abused by MichaelSmith · · Score: 2, Insightful
      It's still interesting work.

      Even more interesting would be something which encrypts your files and spreads them around in various free storage media (slashdot trolls?) in such a way that they can not be easily correlated with each other.

      Cramming all this stuff into tinyurl is bound to be noticed, but if it is a couple of dozen bytes here and there it might be possible to store lots of stuff with a reasonable degree of safety.

  7. Default PHP protections? by Egregius · · Score: 4, Funny

    Bwahahahahaha.

    1. Re:Default PHP protections? by digidave · · Score: 2, Informative

      "PHP as little to none default protection so much so that they make it insecure by default. You would have to go through a considerable amount of work to make any script secure."

      Really? So in what way is 'echo "hello world";' insecure? The only PHP scripts that are insecure are the ones where programmers made stupid decisions or wasn't thinking the design through, just like in any other language. 99% of these PHP problems are using external data without checking it. 99% of those cases are where the programmer didn't use the readily available tools such as prepared SQL statements.

      In fact, with PHP in its default configuration, a script that does not accept user data has zero chance for exploitation. You do get cases where programmers do exceedingly stupid things such as get data in such a way as so internal data can be injected, but programming that way is actually much more difficult than doing it the right way. Programs ported from very old versions of PHP may suffer from this if they weren't ported properly.

      Anyway, this is all aside from the fact that the TinyURL issue isn't a vulnerability caused by PHP. The program is working exactly as intended, but the programmers didn't think about it being used in this way. They could have easily written a couple lines of code to check to make sure the URL is valid before accepting it.

      --
      The global economy is a great thing until you feel it locally.
  8. Is it by manojar · · Score: 2, Funny

    is it another way to backup more porn/mp3s online?

  9. TinyDisk's inspiration by Anonymous Coward · · Score: 3, Interesting
  10. Solution for which problem? by 't+is+DjiM · · Score: 4, Interesting

    That's pretty much what I understood.

    I adore the ingenuity (correct spelling?) of the hack but... I can't really find a problem this hack is a solution for.

    As a way to distribute files, it's probably too slow. The pro's I see here: the file is not stored as one single file but it's stored as a distributed file (a set of Base-64 encoded clusters), making removal of the file hard. On the other hand, if one single segment drops out, the file will be destroyed (except if some redundancy exists, of which I did not find evidence).

    If you want to send attachments in an e-mail, this is a very complicated way to do it. Every receiver must have the decoder program to re-assemble the file.

    Moreover, if tinyURL builds in a check to see whether the submitted URL exists (not just some 404 page), the whole concept would probably break.

    Anyways, very clever hack!

    --
    --Use ant to make .war
    1. Re:Solution for which problem? by acariquara · · Score: 2, Interesting

      Simple, guerrilla distribution of files that would be illegal but not immoral - DeCSS, anyone?

      Also, it could be used for distributing small text files containing reports from warzones and other heavy-censored countries. EFF should have a blast on this one.

      --
      Dear aunt, let's set so double the killer delete select all
  11. You could do this with blogs or any CMS by tezza · · Score: 4, Insightful
    You could put this in an unapproved pending queue for Wikipedia, comments on Joel Spolsky's blog or wherever.

    But overall 'WHY?' must be the question? Al Quaeda or The Real IRA? They still have their old working communication channels. Also who needs space like this? Space of this amount could be made redundant and available by using GoogleMail, Yahoo and Hotmail in synchrony. If none of those are available, presumably you'd have it on USB key as well.

    --
    [% slash_sig_val.text %]
    1. Re:You could do this with blogs or any CMS by Bogtha · · Score: 2, Informative

      But overall 'WHY?' must be the question?

      I've used something similar myself, and there are a few obscure reasons for hiding data in somebody else's web application.

      For instance, Opera's UserJS (the inspiration for Greasemonkey) doesn't have a restriction-free XMLHttpRequest object, so the only information you can retrieve with it is from the original host. Stuffing data onto that host is sometimes the only way of making some features work.

      --
      Bogtha Bogtha Bogtha
  12. Furthur Compression by hoshino · · Score: 5, Interesting

    I noticed that the whole of Alice in Wonderland is compressed to just 20 clusters and each cluster is represented by the five-letter keys used by TinyURL. So is it not possible, using the same method, to reduce the entire metafile (which is merely a textfile of less than 1kB) into a single-line URL? Then you can have the program retrieve the metafile from the URL and the actual file from the metafile. So instead of sending people a metafile, you can just copy and paste them one line of URL.

    1. Re:Furthur Compression by grimJester · · Score: 2, Insightful

      Which makes it more like what it really is, hosting your file on someone else's web server. "Compression" my ass.

  13. It's simple. by TheSpoom · · Score: 2, Insightful

    If you want your online app to not be used by scripts such as this, implement a CAPTCHA. Sure, people could still use it if they wanted to input a bunch of letters for every single chunk of their file...

    --
    It's better to vote for what you want and not get it than to vote for what you don't want and get it.
    - E. Debs
    1. Re:It's simple. by Smidge204 · · Score: 4, Insightful

      Or better yet, validate all entered URLs by attempting to establish a connection to the server. If the URL is invalid then kick it back.

      You wouldn't even need to do this with every URL added to the system. Spot-checking every 1 in 10 URLs or so will go a long way to preventing any sort of abuse.
      =Smidge=

    2. Re:It's simple. by FidelCatsro · · Score: 2, Informative

      That is a great idea . It would also double as a feature , incase anyone accidentally mistypes a URL or misses a chunk at the end during a copy/paste

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    3. Re:It's simple. by Chi-RAV · · Score: 3, Interesting

      not really. as the author of the hack already proposed, you can add hosts of sites that have base64 encoded urls which means that you can get http://www.bleh.org/topic.php?= and then the prog will filter out the part for use in the decrypting... surely if you use big enough sites (amazon, google, again as the author proposed) you can circumvent this. The point of this "hack" isnt really to show how to break tinyurl but to create a different way of approaching networked file systems, using only HTTP POST/GET. I for one see great potential in this for the likes of Al Qaida (you know, where better to hide your building hitlist than on tinyurl).

    4. Re:It's simple. by orangesquid · · Score: 3, Interesting

      Interesting idea:
      (1) create one tinyurl which contains encrypted data
      (2) create another tinyurl which contains the decryption key

      Never access them from the same IP nor around the same time, and nobody will ever know what you're hiding.

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    5. Re:It's simple. by nahdude812 · · Score: 3, Informative

      Visual captchas present a significant usability problem for blind users, and audio captchas have proven much easier to defeat in general than visual captchas (some of which are actually quite easily defeated).

      Further, even the best visual captchas are easily overridden if the attacker is motivated enough; a common means to perform this action is to get other humans to voluntarily solve the captchas as they are encountered by offering, eg, free porn.

      Basically, captchas aren't really the solution to preventing bots (there are no good solutions for this), they only deter casual botters.

    6. Re:It's simple. by Syberghost · · Score: 2, Funny

      I for one see great potential in this for the likes of Al Qaida (you know, where better to hide your building hitlist than on tinyurl).

      Oh, great; now we're all gonna have to remember "http://tinyurl.nsa.gov" instead of "http://tinyurl.com".

  14. What does PHP have to do with it? by miknight · · Score: 5, Informative

    Sure, well all know PHP is far from synonymous with security, but this seems to be a case of exploiting a web app using only the mechanics intentionally made available, just in a novel way. Seems like some unfounded (though not necessarily undeserved) PHP bashing.

  15. Re:Nifty hack, or antisocial behavior? by Anonymous Coward · · Score: 5, Insightful

    It is a nifty hack, but let's not kid ourselves and pretend this is anything new, or that it's even a good thing.

    At its core, Tinyurl is just a write-once database. You add data and get back a key/pointer to said data. As with typical databases, the size of the pointer is logarithmic in the size of the input (* number of keys stored, not bytes; however, the number of bytes/key is bounded under some constant, so it's effectively the number of bytes).

    This gives us a logarithmic compression scheme, where our compression ratio (N-logN)/N approaches 100% as N gets large. This kind of "infinite compression" is what makes the method attractive: you put in say a kilobyte of data and get out a (currently) 5 byte key. All you have to do is keep an index of the keys.

    TinyDisk doesn't seem to do this, but you could then turn around and store the index as a key. Take 1000/5 = 200 keys and get back one key. Lather. Rinse. Repeat. In the end, you have a single key that points to the backup of your mp3 collection, all in one TinyUrl! Not too shabby. After all, it's free storage, right? Wrong. Someone ends up paying for the infinite compression. In this case, it's Tinyurl. If this kid had stopped to think for a few minutes before publishing his hack, he would have realized that he's actually doing a malicious, antisocial thing. I suspect there will be a dozen copycats in the wild before the end of the day.

    Farewell TinyUrl, we knew ye well.

  16. The end of TinyURL. by tmroyster · · Score: 2, Insightful

    The end of TinyURL is in sight. Yes, this is (probably) a clever hack.
    But this is a misuse of a really useful service.

    When TinyURL's administrator has to either go out and buy his
    second 2Terabyte disk array in a week or shutdown, which do
    you think he will pick?

  17. Video/Overview of Acidus's presentation by Anonymous Coward · · Score: 4, Informative

    Here is a video of Acidus's presentation. If you haven't seen him present before (At Hope, O'Reilly's E-Tech, Toorcon, Phreaknic, Interz0ne, etc, etc) he puts on a good show.

    The presentation was called: Layer 7 Fun: Extending web applications in interesting ways. He discusses how traditional web applications work -vs- "new" web ppas that use AJAX. He talks about writing extensions to web apps using an API supplied (ala Housingmaps.com, or chicagocrime.org). Finally he talks about writing an extension to a web app where you don't have access to an API. TinyDisk was a case study for writes these so-called "non-sanctioned" extensions. He has a funny little slide he goes back to about how to properly implement a web app (which TinyRUL fails to do). Things like "don't wallow users to uploaded arbitrary amounts of data directly into your database."

    Funny Stuff. His upcoming talk at Shmoocon seems pretty cool too.

  18. Book names - Recommended Reading by eltoyoboyo · · Score: 3, Informative

    In the Recommended reading section this is stated:

    There are definitive works in certain fields that online guides and HOWTOs cannot even approach in terms of detail or quality. It's a class of books that are so familiar people refer to them by nicknames instead of by full title.

    Well maybe so, but I did not know them all, and in the interest of helping people along the path here they are:

    Books like:
    K&R,
    The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie
    The Dinosaur Book, Operating System Concepts by Abraham Silberschatz
    Knuth's never-ending story, The Art of Computer Programming, but Donald Knuth
    The White Book, Introduction To Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Cliff Stein
    P&H, Computer Organization and Design The Hardware/Software Interface David Patterson John Hennessy
    The Illustrated's. TCP/IP Illustrated Series (The Illustrated's) - W. Richard Stevens
    The Rainbow series. U.S. DOD Computer Security Series

    --
    Have you Meta Moderated t
  19. Security isn't the issue; resource exploitation is by rjamestaylor · · Score: 4, Insightful

    Sorry to be Mr. Obvious this morning, but I take issue with submitter's conclusion that TinyDisk illustrates a security issue on the part of tinyurl.com. It rather illustrates the ease of creating a leachable web app that resource pirates can abuse. Yes, I have a negative opinion of those using such a creative hack against others who provide services to the general public in good faith.

    --
    -- @rjamestaylor on Ello
  20. Why not go further? by SamSim · · Score: 3, Interesting

    Take the list of cluster URLs. Concatenate them into a single URL. Submit it again. Thus compressing literally ANY file to five characters.

    At least, as long as the possibility space of five-character URLs isn't exhausted. It's very much first come, first served.

    1. Re:Why not go further? by guitaristx · · Score: 2, Informative

      Let us not forget, we are NOT COMPRESSING ANYTHING.

      We are simply addressing it. By your definition, a filesystem path (e.g. /usr/home/SamSim/foo.txt) is compressing the contents of foo.txt to the length of the path.

      --
      I pity the foo that isn't metasyntactic
    2. Re:Why not go further? by John+Nowak · · Score: 2, Funny

      I have no idea what you're talking about. Get a clue.

      Okay, back to working on my perpetual motion machine!

  21. Great Idea! by Se7enLC · · Score: 3, Insightful
    I was looking for another way to store files online in such a way as to make them:
    • Difficult to access
    • Unreliable
    • Split into many different pieces
    • Under somebody else's control that has motivation to delete them

    I guess once this goes down, I'll have to go back to posting UUencoded files in peoples blogs.
  22. Re:Google and banks (MODS ON CRACK!) by julesh · · Score: 2, Interesting

    PayPal UK used to use the same technique to validate you were the owner of a credit card: make a small reverse payment and ask you how much it was. Then they got proper integration with the banks and stopped doing it like that.

    And WTF is this modded 'offtopic'?

  23. Juggling With Packets by pizza_milkshake · · Score: 3, Insightful

    looks like an implementation of Michael Zalewski's Juggling With Packets concept, the storing of data in buffers of publicly available services for use as a filesystem.

  24. What does PHP have to do with it by PktLoss · · Score: 2, Interesting

    Yes, I RTFA, and looked at how things work, the fact that PHP is being used is immaterial.

    The basic functionality of TinyURL, NanoURL or any other service is to accept a string (presumably a URI) and return a shorter string that will serve as a pointer to it. If you want your application to accomplish that it doesn't matter what it was written in, people can store things other than URLs in your database. The protections against this sort of use/abuse suggested in the article are also language independent.

  25. Greatest FAQ answer ever. by jdludlow · · Score: 5, Funny

    From the TinyDisk FAQ:

    Q: This damn thing doesn't work on large files! #@%& You!
    A: Did you not read the manual? Man I wish I could punch you in the face over TCP/IP! Change the config file's MaxSize line. By default the limit is 2 megs.

  26. Re:Nifty hack, or antisocial behavior? by ezzzD55J · · Score: 2, Insightful
    In the end, you have a single key that points to the backup of your mp3 collection, all in one TinyUrl! Not too shabby.

    Sure, but I think it's a pretty dumb idea because of the large overhead (in time and data) of actually retrieving that data.. http request and response, encoding, etc. And the fact that tinyurl will (rightly) kick your ass off the service once he's on to you.

  27. google fuck by cjsteele · · Score: 2, Interesting

    I had a similar idea a number of years back basically masquerading uuencoded files inside of bogus html files that get crawled by Google's caching bot... the idea being that if you knew the names of the files you could query the cache and retrieve the UUEncoded bits.

    At the time, no one else had written about such things. I just never got around to automating the process, so it never really materialized. Maybe some brave and time-rich soul would like to give it a go?

    --
    "This above all, to thine own self be true" :x!
  28. Re:It's not a file system by milgr · · Score: 2, Informative

    Why isn't it a filesystem? Filesystems have been around since long before Posix.

    A filesystem stores and retrieves files.

    Here are some exmaples of filesystems that undoubtably violate posix:
        FAT as shipped in DOS 1.0
            Had no subdirectories
            Had no notion of users
            Had no permissions
            Limited filenames to 8.3

        CD-R
            Doesn't allow data to be modified (or meta-data to be changed).

    In addition, some filesystems allow remote access:
        NFS
        andrewfs
        Coda

    In addition, some OS'es allow some things to be treated as filesystems:
        Linux has /proc filesystem - accessing in-memory data
        Hurd allows filesystem access to tar files, and ftp servers

    So, why isn't it a filesystem?

    --
    Where law ends, tyranny begins -- William Pitt
  29. Re:TinyDisk? by hobbit · · Score: 2, Funny
    2005-10-25 04:54:53 - Attempting to contact external host
    2005-10-25 04:54:56 - Connection refused
    2005-10-25 04:55:34 - Attempting to contact external host
    2005-10-25 04:55:36 - Connection refused
    2005-10-25 04:55:38 - All hosts unreachable except localhost
    2005-10-25 04:55:40 - Connecting to loopback interface
    --
    "Wise men talk because they have something to say; fools, because they have to say something" - Plato