sirdarckcat / sirdarckcat.github.io

31 stars 11 forks source link

Request Payload #1

Closed steveops closed 7 years ago

steveops commented 7 years ago

Is there a way to modify the request payload?

sirdarckcat commented 7 years ago

Hi

Where? In the service worker script?

Yes, just in info param put a data property with the string you would like to send.

steveops commented 7 years ago

When a request is intercepted, I am able to redirect it to a new url. Is there a way to modify its payload also before rerouting?

sirdarckcat commented 7 years ago

Yes, for example, here: https://sirdarckcat.github.io/#/service-worker

Select "fetch", then on URL put: /sw/fetch?url=https://httpbin.org/post&init={"method":"POST","body":"bar"}

Then put in the options, configure method:POST and body:foo

You will see that the request was made with "bar" rather than "foo"

image

steveops commented 7 years ago

Hello, am finding it hard to understand whats going on there. Is that another tool altogether or is is part of tamper? Could you please explain in simple terms how to proceed from this menu: capture

sirdarckcat commented 7 years ago

Ah, you want to ask that here: https://groups.google.com/forum/#!forum/tamper-chrome-help =)

I didn't know what you were talking about.

To answer your question - Chrome doesn't expose any APIs to do that, but I'm trying to make it work anyway.

What you can do instead is to:

  1. Enable "Replay Requests (Experimental)"
  2. Enable "Block / Reroute Requests"
  3. BLOCK the request you want to modify.
  4. Edit the request you blocked.

This is very similar to what you asked for.

steveops commented 7 years ago

Ok thanks, I'll try that.

sirdarckcat commented 7 years ago

let me know how it goes!

steveops commented 7 years ago

Sure, I will.