mitmproxy icon indicating copy to clipboard operation
mitmproxy copied to clipboard

Console: Make it easier to edit binary contents

Open mhils opened this issue 2 years ago • 3 comments

Problem Description

Right now, editing a request or response body opens the default text editor. This is a bad choice for binary formats, which should much rather be opened in a hex editor.

Steps to reproduce the behavior:

  1. Make an HTTP request to a binary file, e.g. https://www.google.com/favicon.ico
  2. Edit the response body in mitmproxy.

Proposed Fix

  1. Assemble a list of console-based hex editors and order them by usefulness.
  2. Adjust ConsoleMaster.spawn_editor to detect binary contents and then spawn a hex editor instead.

We already have a function to detect if contents are binary in mitmproxy.utils.strutils.

mhils avatar Mar 30 '22 12:03 mhils