add param fuzzer

main
David 2022-04-09 04:10:41 +02:00
parent d693f7ee5c
commit 682d487586
3 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,44 @@
import params_pb2
import base64
import urllib.parse
import requests
import json
for i in range(0, 100):
g = params_pb2.params()
g.p1 = i
g.p2 = i
g.p3 = i
b64 = base64.b64encode(g.SerializeToString())
b64_url = urllib.parse.quote(b64)
post_data = {
"context": {
"client": {
"hl": "en",
"clientName": "WEB",
"clientVersion": "2.20220331.06.00"
}
},
"videoId": "8PNJCjXkrps",
"params": b64_url
}
try:
res = requests.post("https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", data=json.dumps(post_data), headers={
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36 Edg/100.0.1185.29",
"Content-Type": "text/plain;charset=UTF-8"
})
print(b64_url, res.status_code)
if res.status_code == 200:
f = open("results/" + str(i) + ".json", "w", encoding="utf-8")
f.write(res.text)
f.close()
except Exception as ex:
print(ex)

View File

@ -0,0 +1,9 @@
syntax = "proto3";
package youtube;
message params {
int32 p1 = 30;
int32 p2 = 57;
int32 p3 = 71;
}

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: params.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cparams.proto\x12\x07youtube\",\n\x06params\x12\n\n\x02p1\x18\x1e \x01(\x05\x12\n\n\x02p2\x18\x39 \x01(\x05\x12\n\n\x02p3\x18G \x01(\x05\x62\x06proto3')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'params_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_PARAMS._serialized_start=25
_PARAMS._serialized_end=69
# @@protoc_insertion_point(module_scope)