📜 ⬆️ ⬇️

How to make Yandex.Disk unlimited file storage system

This article is the final in a series of my posts about Yandex.Disk and file uploading: bypassing captcha , downloading a part of a file with a RANGE request from a remote source, and automatically uploading Yandex.Disk . All these posts are united by one desire, to figure out exactly how the Yandex.Disk protection system works and what are its drawbacks. In no way do I want to say that non-professionals work in Yandex, on the contrary, while studying the code, I came to the opposite conclusion. The sole purpose of this article, using the example of Yandex.Disk, is to show how to create free storage for your project from a free file hosting service, just an idea. And of course, give some food for thought to the developers of such services.

So, I present to your attention an example of using Yandex.Disk file hosting is not quite as intended.

Downloading the file is the easiest part of this system, you can read how it is done in my previous post . Next, Yandex.Disk provides a link and the next part enters into action, a captcha bypass .

When the captcha is successfully completed, the system gives you a temporary link, of the form 18.dl19sd-narod.yandex.ru/disk/number/time_hash/file_name, this link is valid only until you download the file completely or at least 24 hours Yandex.Disk determines this in the simplest way, HTTP Status Code 200. As soon as the server gives you this answer, it will not give you anything more on this link. There is also a limit on the number of generated links without captcha, according to the latest data for the last 5 minutes, which prevents you from downloading many files at once. Everything seems logical? How can you get around such a "stupid counter", who simply considers how many links he has issued, 1-2-3-4-5 and Captcha. Yes? But this is the problem, and it is here that the basis of the bypass of this system is laid. We do not need to store 5 GB files? We need to keep our files 5, 10, 100 megabytes? And what do we have this counter when there is an archive? By archive, in this particular case, I mean simple file splicing.
')
You prepare your files in 5-gigabyte archives, and using the file download script in parts get access to them. Even if you have 1 big file, just add 1 byte to it and everything will work. Since the link is valid for about 24 hours, during this time you can download your files back indefinitely. Yandex.Disk will think that you simply download the file in parts, displaying HTTP Status Code 206 and the link will be valid even after you download the file! It is for this reason that the limit of 10 requests without captcha with Yandex. Bar in 5 minutes (experts will correct how many exactly) is more than enough. And not because the developer was wrong, but because the developer thought that the captcha protects the file, but in reality it turns out that the captcha protects several files in one file.

The strangest thing is that the blocking of connections occurs within the reference, and not within the IP address, i.e You can generate a couple of dozen links and regenerate them as they are turned off (about every 24 hours at the moment) and download the same file from several IP in several streams (at least I did). So you will always have enough threads to download files. Periodically you will have to download the file completely, so as not to prolong his life in manual mode.

In fact, even if Yandex turns off the ability to download files without captcha, it will not solve the problem, since you need to enter a captcha only once a day (for example, include a captcha of the Yandex.disk in the registration on your project) to download from the archive how many whatever If you introduce a limit on the size of the downloaded file by reference, you can run into problems with some download managers, which, in case of errors, can reload part of the file, especially if the file size is large and the channel is not very good.

How can all this be used? Well, for example, you are creating the next file garbage dump a la rapidshare.com or photo hosting, but you do not want to rest on the limitations of Yandex. Photos, what is the main problem of all such projects? Right where to keep files cheap. In the case of Yandex.Disk, you can simply buy shared / VPS hosting in Moscow and for 300 rubles, get access to the unlimited 100 megabit channel to Yandex. Those. with a minimum investment you will receive a garbage bin of unlimited capacity. If you work a little, you can really make a competent project, with caching data on shared hosting and with permanent storage on Yandex.Disk.

Of course, for large projects, such things are not done, but I think that at the initial stages of development of your startup, the cost of server and storage system maintenance comes to the fore and in this case you can use this idea.

PS This article is the result of my research and in no way encourages the use of information for personal gain. My goal is to help developers improve the security of web applications, to make them think that their application can be used not only in the way they originally intended, but, for example, in such a “tricky” way. That is why I will not give you any source code for a complete system.

PPS According to the results of comments in my previous post, it turned out that Yandex is loyal to this problem. Well, I think we will soon realize that if the scripts presented in my articles continue their work :)

PPPS This article ends this series, as well as my vacation, and it’s time for me to go back to work, so we shouldn’t wait for new posts soon. Hope you enjoyed my articles.

Source: https://habr.com/ru/post/67234/


All Articles