tomsteele / burpbuddy

burpbuddy exposes Burp Suites's extender API over the network through various mediums, with the goal of enabling development in any language without the restrictions of the JVM
MIT License
156 stars 25 forks source link

method header is disappears in responce when hooked #30

Closed ffredHTTP closed 6 years ago

ffredHTTP commented 7 years ago

When I change the headers, it disappears from the request (SIC!)"GET / HTTP / 1.1". As a result, I can not change anything significant in a query. Also, I noticed that when I change the method or the version of the HTTP protocol - that they do not change

my code for python

from flask import Flask, request, make_response
import json
import collections
from pprint import pprint
import requests

app = Flask(__name__)

@app.route('/<param>', methods=['GET', 'POST'])
def req(param):
    #postdata = json.loads(request.data)
    postdata = json.JSONDecoder(object_pairs_hook=collections.OrderedDict).decode(request.data)

    postdata['comment'] = 'blah-blah' #correct
    postdata['highlight'] = 'red' #correct
    postdata['request']['http_version'] = 'HTTP/1.0' #never apply
    postdata['request']['headers']['User-Agent'] = 'PYTHON-requests/2.13.0' #if apply METHOD dissapear from request
    postdata['request']['headers']['sameHeader'] = 'blah-blah' #if apply METHOD dissapear from request
    postdata['request']['path'] = '/test' #never apply
    postdata['request']['method'] = u'POST' #never apply

    # postdata['request']['raw'] = postdata['request']['raw'].decode('base-64').replace('python', 'PYTHON').encode('base-64')

    response = app.response_class(
        response=json.dumps(postdata),
        status=200,
        mimetype='application/json'
    )

    return response

if __name__ == '__main__':
    app.run(port=3001, debug=True)

request before and after editing via burp buddy burpbuddy_bug

I`m using "Proxy request hook URL" method of burpbuddy

ffredHTTP commented 7 years ago

I`m trying build from source burpbuddy because latest release lags behind master but it has not brought results. So I checked json during shipment between burpbuddy and my application and everything is okay. what's the problem?