All Projects → nccgroup → Blackboxprotobuf

nccgroup / Blackboxprotobuf

Licence: mit
Blackbox protobuf is a Burp Suite extension for decoding and modifying arbitrary protobuf messages without the protobuf type definition.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Blackboxprotobuf

Cmakeprotosgrpc
gRPC + protobuf using CMake example
Stars: ✭ 137 (-11.61%)
Mutual labels:  protobuf
Practical Dapr
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 140 (-9.68%)
Mutual labels:  protobuf
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (-5.16%)
Mutual labels:  protobuf
Rq
Record Query - A tool for doing record analysis and transformation
Stars: ✭ 1,808 (+1066.45%)
Mutual labels:  protobuf
Flutter hand tracking plugin
这是一个 Flutter Packge 以实现摄像头精确追踪并识别十指的运动路径/轨迹和手势动作, 且输出22个手部关键点以支持更多手势自定义. 基于这个包可以编写业务逻辑将手势信息实时转化为指令信息: 一二三四五, rock, spiderman...还可以对不同手势编写不同特效. 可用于短视频直播特效, 智能硬件等领域, 为人机互动带来更自然丰富的体验
Stars: ✭ 142 (-8.39%)
Mutual labels:  protobuf
Tgtv
用swift3.1编写的直播APP,运用protobuf
Stars: ✭ 145 (-6.45%)
Mutual labels:  protobuf
Libprotobuf Mutator fuzzing learning
Learn how to combine libprotobuf-mutator with libfuzzer & AFL++
Stars: ✭ 134 (-13.55%)
Mutual labels:  protobuf
Go Grpc Example
An example of gRPC
Stars: ✭ 153 (-1.29%)
Mutual labels:  protobuf
Gf Cli
GoFrame Command Line Interface, which is your helpmate for building GoFrame application with convenience.
Stars: ✭ 143 (-7.74%)
Mutual labels:  protobuf
Goprotowrap
A package-at-a-time wrapper for protoc, for generating Go protobuf code.
Stars: ✭ 147 (-5.16%)
Mutual labels:  protobuf
Raptor
拍拍贷微服务rpc框架
Stars: ✭ 139 (-10.32%)
Mutual labels:  protobuf
Him Vue
开源的H5即时聊天系统 spring-boot + netty + protobuf + vue ~
Stars: ✭ 142 (-8.39%)
Mutual labels:  protobuf
Grpc Cmake Example
gRPC C++ example with CMake
Stars: ✭ 142 (-8.39%)
Mutual labels:  protobuf
Pb And K
Kotlin Code Generator and Runtime for Protocol Buffers
Stars: ✭ 137 (-11.61%)
Mutual labels:  protobuf
Netty Learning Example
🥚 Netty实践学习案例,见微知著!带着你的心,跟着教程。我相信你行欧。
Stars: ✭ 2,146 (+1284.52%)
Mutual labels:  protobuf
Protobuf Java Format
Provide serialization and de-serialization of different formats based on Google’s protobuf Message. Enables overriding the default (byte array) output to text based formats such as XML, JSON and HTML.
Stars: ✭ 134 (-13.55%)
Mutual labels:  protobuf
Protolint
A pluggable linter and fixer to enforce Protocol Buffer style and conventions.
Stars: ✭ 142 (-8.39%)
Mutual labels:  protobuf
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+1176.77%)
Mutual labels:  protobuf
Berkanansdk
Bluetooth mesh messaging SDK for apps
Stars: ✭ 150 (-3.23%)
Mutual labels:  protobuf
Steamkit
SteamKit2 is a .NET library designed to interoperate with Valve's Steam network. It aims to provide a simple, yet extensible, interface to perform various actions on the network.
Stars: ✭ 1,926 (+1142.58%)
Mutual labels:  protobuf

BlackBox Protobuf Burp Extension

Description

This is an extension for the intercepting proxy Burp Suite (https://portswigger.net/burp/) that allows encoding and decoding arbitrary protocol buffer (https://developers.google.com/protocol-buffers/) messages which may be contained in an intercepted request. It is designed to work without a protobuf definition file (.proto) which may not be available or may be unusable with existing Burp extensions.

The BlackBox Protobuf library can also be used independently as a Python module to convert protobuf messages to either JSON or a Python dictionary. It can be found under the blackboxprotobuf/lib directory.

Library documentation, background information on Protobuf decoding and a breakdown of the type system and possible type corner cases may be found at https://github.com/nccgroup/blackboxprotobuf/blob/master/README-LIBRARY.md

Usage

Installation

  1. If Burp Suite is not already installed, download it from https://portswigger.net/burp/.
  2. Download/Install Jython 2.7+ and configure Burp with the location. See https://portswigger.net/burp/help/extender.html#options_pythonenv.
  3. Clone this repository and then run git submodule update --init to install dependencies.
  4. Within Burp, navigate to Extender -> Extensions and select "Add".
  5. Set "Extension Type" to Python and select the extender.py file in the git repository.
  6. Click Next and the extension should load.
  7. Note: gRPC is supported, but you'll have to enable Burp's HTTP/2 support (under Project Options->HTTP). Also, currently only uncompressed gRPC payloads are supported. If the first byte of the payload is not 0x00, it's compressed and you'll have to modify the en/decoding code to account for that.

Editing Messages

A new tab will be added to every message window with a content type of "x-protobuf" or "application/protobuf" (this can be modified, see below). The protobuf message will be parsed to a JSON dictionary with numbered fields as the key. The values can be modified as long as the new value is of the same type. At the moment, fields may be removed, but not added. Fields will be reencoded with the same type as it was decoded.

The "Validate" button verifies that the JSON can be reencoded before switching away from the protobuf tab. If you switch away from the tab with an invalid payload, it will raise an error and reset.

The "Save Type"/"Load Type" buttons allow message types to be saved/loaded across editing tabs.

The "Edit Type" brings up a window for editing the current message's type definition in JSON form. The current message will be decoded with the new type upon saving.

The "Reset" button will revert the protobuf message to the original decoded value.

Editing Types

The type definition for a message can be modified to make protobuf messages easier to work with. This allows you to change how a message is decoded (eg. decode a field as an sint instead of the default int) and allows you to assigned names to fields to improve readability.

Field numbers should not be modified and types should only be changed to types within the same wire type. A full list of wiretypes and sub-types can be found below.

Type Reference

  • Varint - Variable length integers (up to 8 bytes)
    • uint - unsigned, represents positive numbers efficiently, can't represent negative numbers
    • int - (default) signed, but represents negative numbers inefficiently
    • sint - Zig-zag encoding to map unsigned space to signed
  • Fixed32 - Always 32 bits
    • fixed32 - (default) unsigned integer
    • sfixed32 - signed integer
    • float - floating point number
  • Fixed64 - Always 64 bits
    • fixed64 - (default) unsigned integer
    • sfixed64 - signed integer
    • double - floating point number
  • Length Delimited - Prefixed by length representing varint
    • bytes - (default) Plain data, used for strings as well
    • message - (detected) Protobuf message. Can contain a nested type definition ('message_typedef') or labeled type name ('message_type_name')
    • string - Similar to bytes, but will return a string python type
    • bytes_hex - Output binary data as a string of hex characters rather than an escaped string
    • packed_* - Repeated fields of the same type packed into a buffer. Can be combined with any Varint, or fixed wiretype (eg. packed_fixed32)
  • Group (Start/End)
    • group - Deprecated way to group fields. Replaced with nested Protobuf Messages

Type Definition Persistence

By default, the extension will remember changes to a type definition and attempt to reuse the type definition for the same requests. This is currently based on the HTTP path and whether it is a request or response. This behavior can be modified with the hash_message function in blackboxprotobuf/burp/user_funcs.py. For example, basing the message type on a URL parameter or header value. These remembered types will be forgotten if they fail to decode a message.

Types can be explicitly saved/named through the "Save Type" button or in the type definition editor tab. Named type definitions can then be applied to any message. These types are not persisted and will disappear when Burp is closed.

Finally, types can be exported to JSON files from the type definition editor tab for longer term backup or storage.

Protobuf Detection/Extraction

The plugin currently attempts to detect a protobuf message using the "Content-Type" header and retrieve the binary from the message body. However, the use of the protobuf format is not standardized and the location/encoding of the protobuf data may change from application to application.

Users can write custom functions for detecting protobufs, retrieving protobuf data from an HTTP message, and setting the re-encoded protobuf data in the HTTP message. These functions, along with several examples, can be found in blackboxprotobuf/burp/user_funcs.py. The extension must be reloaded after modifying the file.

Future Work

  • Persistent message type definitions
    • Save across sessions
    • Import/export to proto files
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].