This is for research and fun purpose only. Don't contaminate the web using this technique. Use the tool at your own risk.
I just finished a POC implementation of what I call as Web2Torrent. It is not exactly a torrent as you will know after reading this post. It is just a funny way of storing your files on blogs, message forums, mailing lists etc. (Note: This is no rocket science)
- A binary file is converted to a base64 representation.
- It is then divided into suitable number of segments.
- Each of these segments is hosted on a different web page. Appropriate delimiters are used to identify the file contents correctly.
- Each page also contains the link(s) of the next segment. If one link is down for example, others could be used.
- Since each page could come from a domain that you may not control, a bookmarklet needs to be manually loaded after the page is loaded. This bookmarklet (which uses fetch.js) reads the page content and submits it to uploader.php
- Uploader then stores the contents in a file and redirects the browser to the next url to be loaded.
- Again you manually click the bookmarklet and the process repeats until all segments are downloaded.
- After all of them are downloaded, uploader.php creates the output file and redirects the browser to that file.
Note: Now there is a greasemonkey script included that takes care of clicking this bookmarklet for you! Just install the script, edit the URL to point to uploader.php, and just load the address of the first segment. You will have the file downloaded automatically! The code has to undergo lots of improvements though.
Each segment looks like following,
One or more hrefs to the next segment with id linkid (Actually this could be anywhere on the page) ->
_begin_wt_ (The beginning delimiter)
base64 data possibly with tags and whitespaces
Link on the last segment points to 'http://final/' and thats how the segment chain ends.
Rest of it is probably self explanatory.
- You don't need a hosting service anymore, web pages start hosting files for you.
- The upload/download process can be automated.
- Spamming is first time being used for a good cause (Depends on what you share)
- Web pages start to look ugly ;) (Soln: use divs and display:none)
- base64 expands the data (Who cares, its not stored on your hard disk anyway :) )
- Legal issues may be involved (No solution)
You can grab the files here.
Usage (Also includes a sample example):
- Extract the files so that they are accessible from http://localhost:8080/web2torrent/ (Otherwise change first url lines in bookmarklet and fetch.js)
- Allow php scripts to create files in the directory
- Load http://localhost:8080/web2torrent/uploader.php in the browser
- Enter the url http://webtorrenttestdata.blogspot.com/2008/03/segment-1.html in the text box and submit the form
- The page containing segment will load, then press the bookmarklet you just saved (copy it from bookmarklet.js)
- Now new segment will load automatically, use bookmarklet after every page load.
- After the third segment is processed, you will be redirected to a wav file (Borrowed from http://www.partnersinrhyme.com)
- The zip file also contains filesplit.php which lets you split files in specified number of segments. Before posting it, you will need to properly format it by adding delimiters etc described above. Its good to start from the last segment.
Other variants are possible, e.g. saving data in the images.
Let's see if I can get a research topic for my thesis from this idea... Maybe- distinguishing between good and bad spam? How to protect applications from web2torrent? ...