示例#1
0
        public virtual void Init()
        {
            // generate browser info
            useragent = BdaGen.get_userbrowser(os_type);
            lang      = BdaGen.gen_lang();
            bda       = Funcs.GenerateBda(useragent, os_type);

            client.AddDefaultHeader("Accept", "*/*");
            client.AddDefaultHeader("Accept-Encoding", "gzip, deflate");
            client.AddDefaultHeader("Accept-Language", lang[1]);

            alt_client.AddDefaultHeader("Accept-Language", lang[1]);
            alt_client.AddDefaultHeader("Accept-Encoding", "gzip, deflate");

            client.AddDefaultHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
            client.AddDefaultHeader("Host", host_url);
            client.AddDefaultHeader("Origin", site_url);

            client.AddDefaultHeader("Sec-Fetch-Dest", "empty");
            client.AddDefaultHeader("Sec-Fetch-Mode", "cors");
            client.AddDefaultHeader("Sec-Fetch-Site", "cross-site");

            client.ConnectionGroupName = "keep-alive";

            client.UserAgent     = useragent;
            alt_client.UserAgent = useragent;
        }
示例#2
0
        public static string get_bda(string os_type)
        {
            var    rnd = new Random();
            JArray bda = new JArray();

            JObject api_type = new JObject();

            api_type.Add(new JProperty("key", "api_type"));
            api_type.Add(new JProperty("value", "js"));

            JObject p = new JObject();

            p.Add(new JProperty("key", "p"));
            p.Add(new JProperty("value", 1));

            object[] fp = BdaGen.fp();

            JObject f = new JObject();

            f.Add(new JProperty("key", "f"));
            f.Add(new JProperty("value", fp[0]));

            JObject n = new JObject();

            n.Add(new JProperty("key", "n"));
            n.Add(new JProperty("value", "B64TIME"));

            JObject wh = new JObject();

            wh.Add(new JProperty("key", "wh"));

            // chrome
            // wh.Add(new JProperty("value", BdaGen.fp()[0] + "|" + "5d76839801bc5904a4f12f1731a7b6d1"));

            // firefox
            // wh.Add(new JProperty("value", BdaGen.fp()[0] + "|" + "5d76839801bc5904a4f12f1731a7b6d1"));

            // chrome dev (android)
            wh.Add(new JProperty("value", $"{BdaGen.fp()[0]}|{(os_type == "Android" ? "5d76839801bc5904a4f12f1731a7b6d1" : "72627afbfd19a741c7da1732218301ac")}"));


            string fonts =
                "Arial,Arial Black,Arial Narrow,Calibri,Cambria,Cambria Math,Comic Sans MS,Consolas,Courier,Courier New,Georgia,Helvetica,Impact,Lucida Console,Lucida Sans Unicode,Microsoft Sans Serif,MS Gothic,MS PGothic,MS Sans Serif,MS Serif,Palatino Linotype,Segoe Print,Segoe Script,Segoe UI,Segoe UI Light,Segoe UI Semibold,Segoe UI Symbol,Tahoma,Times,Times New Roman,Trebuchet MS,Verdana,Wingdings";

            string mobileFonts =
                "Arial,Courier,Courier New,Georgia,Helvetica,Monaco,Palatino,Tahoma,Times,Times New Roman,Verdana";

            string plugins       = "Chrome PDF Plugin,Chrome PDF Viewer,Native Client";
            string mobilePlugins = "";

            JArray fe_data = new JArray();

            fe_data.Add("DNT:unknown");
            fe_data.Add("L:en-US");
            fe_data.Add("D:24");
            fe_data.Add(os_type == "Android" ? "PR:1.2000000476837158" : "PR:1");
            fe_data.Add(os_type == "Android" ? "S:1067,600" : "S:1920,1080");
            fe_data.Add(os_type == "Android" ? "AS:1067,600" : "AS:1920,1040");
            fe_data.Add("TO:-60");
            fe_data.Add("SS:true");
            fe_data.Add("LS:true");
            fe_data.Add($"IDB:{(os_type == "Android" ? "false" : "true")}");
            fe_data.Add("B:false");
            fe_data.Add($"ODB:{(os_type == "Android" ? "false" : "true")}");
            fe_data.Add("CPUC:unknown");
            fe_data.Add(os_type == "Android" ? "PK:Linux armv7l" : "PK:Win32");

            // todo change this
            fe_data.Add("CFP:" + fp[1]);

            fe_data.Add("FR:false");
            fe_data.Add("FOS:false");
            fe_data.Add("FB:false");
            fe_data.Add($"JSF:{(os_type == "Android" ? mobileFonts : fonts)}");
            fe_data.Add(os_type == "Android" ? ("P:" + mobilePlugins) : ("P:" + plugins));
            fe_data.Add(os_type == "Android" ? "T:5,true,true" : "T:0,false,false");
            //fe_data.Add("H:" + rnd.Next(2, 7));
            fe_data.Add("H:4");
            fe_data.Add("SWF:false");

            JObject fe = new JObject();

            fe.Add(new JProperty("key", "fe"));
            fe.Add(new JProperty("value", fe_data));

            string pure_fe = String.Empty;

            foreach (var fvalue in fe_data)
            {
                pure_fe = pure_fe + fvalue + ", ";
            }

            pure_fe = pure_fe.Substring(0, pure_fe.Length - 2);
            var hash = engine.CallGlobalFunction <string>("x64hash128", pure_fe, 38);

            JObject ife = new JObject();

            ife.Add(new JProperty("key", "ife_hash"));
            ife.Add(new JProperty("value", hash));

            JObject cs = new JObject();

            cs.Add(new JProperty("value", 1));
            cs.Add(new JProperty("key", "cs"));

            JObject jsbd_data = new JObject();

            jsbd_data.Add(new JProperty("HL", rnd.Next(2, 14)));
            jsbd_data.Add(new JProperty("NCE", true));
            jsbd_data.Add(new JProperty("DT", "Roblox"));
            jsbd_data.Add(new JProperty("NWD", "undefined"));

            if (os_type == "Android")
            {
                jsbd_data.Add(new JProperty("DMTO", 1));
                jsbd_data.Add(new JProperty("DOTO", 1));
            }
            else
            {
                jsbd_data.Add(new JProperty("DA", null));
                jsbd_data.Add(new JProperty("DR", null));
                jsbd_data.Add(new JProperty("DMT", rnd.Next(28, 38)));
                jsbd_data.Add(new JProperty("DO", null));
                jsbd_data.Add(new JProperty("DOT", rnd.Next(31, 45)));
            }


            JObject jsbd = new JObject();

            jsbd.Add(new JProperty("key", "jsbd"));
            jsbd.Add(new JProperty("value", jsbd_data.ToString(Formatting.None)));

            bda.Add(api_type);
            bda.Add(p);
            bda.Add(f);
            bda.Add(n);
            bda.Add(wh);
            bda.Add(fe);
            bda.Add(ife);
            bda.Add(cs);
            bda.Add(jsbd);

            return(bda.ToString(Formatting.None));
        }