# Про сниффинг трафика HTTP2/gRPC

## GRPC

Бинарный протокол поверх HTTP/2. Данные передаются в формате protobuf.

## Сниффинг: Особенности

Burp, Fiddler & Mitmdump (?) не поддерживают HTTP/2 -> запросы не увидим\
Через [bettercap](https://www.bettercap.org/modules/ethernet/net.sniff/) факт запросов видно, но это кусок говна: непонятно как получить доступ к телу запроса (даже прокидывая серты, вообще плагин https там хуево работает).\
Другой вариант: использовать [nghttpx](https://nghttp2.org/documentation/nghttpx-howto.html) ([пример](https://security.stackexchange.com/questions/205388/how-to-mitm-http-2-traffic)) для перевода HTTP/2 в HTTP/1.1, перенаправлять на бурп, а затем переводить обратно в HTTP/2. Это так и не тестировалось.\
Не тестировался mitm-relay.\
Через Wireshark не получилось расшифровать трафик: хз почему.

## Безопасное соединение через GRPC

Безопасно (своего рода полу ssl pinnning / tls) поднимать соединение использовая сертификаты.

## Статьи по теме

* [Practical guide to securing gRPC connections with Go and TLS](https://itnext.io/practical-guide-to-securing-grpc-connections-with-go-and-tls-part-1-f63058e9d6d1)
* [Secure gRPC with TLS/SSL](https://bbengfort.github.io/programmer/2017/03/03/secure-grpc.html)
* [How to Pin Mobile gRPC Connections](https://hackernoon.com/how-to-pin-mobile-grpc-connections-fd3ff1143dda)
*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://appsecurity.gitbook.io/offensive/pentest/keisy/obshie/pro-sniffing-trafika-http2-grpc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
