mitmproxy / mitmproxy/mitmproxy

Console: Make it easier to edit binary contents

Open
#5,231 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted kind/feature kind/ux
Dominant language
Python
Stars
45.1k
Forks
4.7k
Avg merge
21h 12m
Merged PRs (30d)
16

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ConsoleMaster.spawn_editor in mitmproxy/tools/console/master.py and the binary-content detection function in mitmproxy/utils/strutils.py. Review the proposed console-based hex-editor choices and verify the behavior with the binary favicon response described in the issue, while ensuring ordinary text contents still use the default editor.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.