对于http 防盗链mp3文件下载

dreferdrefer

很多网站设置了防盗链比如图片,mp3和视频
其中最多的是.mp3的下载;
今天就来破解一例如何从别人网站设置了防盗链的地址上下载文件
http请求码是206
downdown

https://cdn.gohudong.com/Public/Hudong/Games/GameShake2019/assets/audio/game_running.mp3

//目标地址:一个年会互动类web界面
https://show.gohudong.com/Hudong/Demo/index/type/1
//经过查看发现有背景音乐是一个mp3文件
https://cdn.gohudong.com/Public/Hudong/Games/GameShake2019/assets/audio/game_running.mp3
//直接打开是403错误
//分析应该是头内容设置了防盗链的措施

downdown

解决方法有两种:

1.将base64的文件转化成文件,让同时帮我写了一个c#程序

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string file = "F:\\aa.txt";
            string txt = System.IO.File.ReadAllText(file);
            byte[] buffer = Convert.FromBase64String(txt);
            string filesave = "F:\\aa.mp3";
            System.IO.File.WriteAllBytes(filesave, buffer);
            Console.ReadLine();
        }
    }    
}
//aa.txt是从网上复制下来的base64源,aa.mp3是另存为的mp3文件,注意看路径

downdown

2.直接从操作dom,再页面上创建一个a元素下载
downdown

最后修改于:2019年12月27日 17:48