2

I'm evaluating ZAP and followed the guide: https://zaproxy.blogspot.ru/2017/04/exploring-apis-with-zap.html

But cannot find a way how to set header parameters in the UI, for example api key.

1 Answer 1

3

You could use the Replacer addon: https://www.zaproxy.org/docs/desktop/addons/replacer/

Or a script. Here's a python scripting example:

headers = dict({"X-MIP-ACCESS-TOKEN": "XXXXXxXX-xxXX-XXXx-xxxX-XXxxXxXXxXxX",
                "X-MIP-CHANNEL": "ANDROID",
                "X-MIP-Device-Id": "1",
                "X-MIP-APP-VERSION": "1.0.1",
                "X-MIP-APP-VERSION-ID": "1"});

def sendingRequest(msg, initiator, helper): 
    for x in list(headers):
      msg.getRequestHeader().setHeader(x, headers[x]);


def responseReceived(msg, initiator, helper): 
    pass;    

You can find other examples in the community-scripts repo: https://github.com/zaproxy/community-scripts

You can get the Replacer add-on or python scripting add-on via the ZAP Marketplace: enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

@alexander-kjäll thanks for the updated link :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.