Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing dumped file then client-replay #63

Closed
virindh opened this issue Sep 18, 2012 · 5 comments
Closed

Editing dumped file then client-replay #63

virindh opened this issue Sep 18, 2012 · 5 comments

Comments

@virindh
Copy link

virindh commented Sep 18, 2012

I am using mitmdump to dump some network activity. Then I use textedit on osx to edit then (literally changing one line), but when I try client replay it gives Could not load file: Invalid data format. How do I fix this???? I also tried simple replay w/o editing it and it gives the issue

@cortesi
Copy link
Member

cortesi commented Sep 21, 2012

Sorry, you can't just edit the mitmdump files by hand. The data segment headers encode the length of the following data chunk. If you change a portion of it, and change the length, you've corrupted the file. So please treat the data dumps as binary data, just like a pcap dump. If you need to, you can edit the dump using mitmproxy, by reading the dump in, changing it in the interface, and then writing it to disk again.

@cortesi cortesi closed this as completed Sep 21, 2012
@virindh
Copy link
Author

virindh commented Sep 21, 2012

I tried that too. Same thing. Invalid data format.

On Sep 20, 2012, at 9:55 PM, Aldo Cortesi notifications@github.com wrote:

Sorry, you can't just edit the mitmdump files by hand. The data segment
headers encode the length of the following data chunk. If you change a
portion of it, and change the length, you've corrupted the file. So please
treat the data dumps as binary data, just like a pcap dump. If you need to,
you can edit the dump using mitmproxy, by reading the dump in, changing it
in the interface, and then writing it to disk again.


Reply to this email directly or view it on
GitHubhttps://github.com/cortesi/mitmproxy/issues/63#issuecomment-8751545.

@cortesi
Copy link
Member

cortesi commented Sep 26, 2012

OK. You'll have to give me a lot more information though. First, a step-by-step on how to reproduce the issue. Second, what platform you're running on, what version of mitmproxy you're using, etc.

@wimbledon
Copy link

I know how to modify the flow in mitmproxy, however, how do I read in the flow file, edit it and save it using libmproxy?

@mhils
Copy link
Member

mhils commented Jun 30, 2014

Hi @wimbledon,

you can read an existing dump file using mitmproxy -r dumpfile (optionall with -n). Having modified the flows, you can save them to a new file by pressing w -> a in the flow list.

Cheers,
Max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants