I'm trying to use the REST API from google safebrowsing v5 in python.
I try to get all hashLists using the following code snippet
URL = "/?key=" + GSB_API_KEY
r = requests.get(URL)
print(r.content)
This returns some binary data that is partially in HEX.
b'\n`\n\x02gcBZ\x12\x01\x01"QThis list contains popular sites that are unlikely to pose any threats to a user.*\x02\x05\x04\n\xec\x01\n\x03uwsB\xe4\x01\n\x01\x03"\xdb\x01This list contains desktop Unwanted Software threats. Unwanted Software refers to software that are not malware but do not adhere to Google\'s Software Principles at .html.*\x01\x02\n\x0c\n\x03srfB\x05\n\x00*\x01\x02\n\xa7\x02\n\x02seB\xa0\x02\n\x01\x02"\x97\x02This list contains general Social Engineering threats (Phishing threats are a subcategory of Social Engineering and are also included).\n\nMore information about social engineering can be found at .*\x01\x02\n\x0c\n\x03mwbB\x05\n\x00*\x01\x02\n\xf6\x01\n\x04uwsaB\xed\x01\n\x01\x03"\xe4\x01This list contains Android-specific Unwanted Software threats. Unwanted Software refers to software that are not malware but do not adhere to Google\'s Software Principles at .html.*\x01\x02\n\xb4\x01\n\x02mwB\xad\x01\n\x01\x01"\xa4\x01This list contains desktop Malware threats. More information about malware can be found at .*\x01\x02\n\xe5\x01\n\x03phaB\xdd\x01\n\x01\x04"\xd4\x01This list contains Android-specific Potentially Harmful Application (PHA) threats. More information about PHAs can be found at .*\x01\x02'
The provided Google documentation is ambiguous as it mentions both JSON as protocol-buffer output. Decoding as a json yields a JSONDecodeError, as such I assume it should be a protocol-buffer. Yet to which prototype should it be decoded? As far as I understand protobuf needs a proto to compile it too.