This commit is contained in:
Tim Blume 2021-03-21 02:35:40 +01:00
parent 600d7146d3
commit 462f2811b9
9 changed files with 9 additions and 14 deletions

View file

@ -27,7 +27,6 @@ add_executable(bigsnitch
main.cpp
mainwindow.cpp
session.cpp
httpflow.cpp
pluginhandler.cpp
proxyhandler.cpp
historymodel.cpp
@ -35,7 +34,6 @@ add_executable(bigsnitch
settings.cpp
mainwindow.h
httpflow.h
session.h
includes.h
proxyhandler.h

View file

@ -1,2 +0,0 @@
#include "httpflow.h"

View file

@ -1,3 +0,0 @@
#pragma once
#include <includes.h>

View file

@ -5,12 +5,12 @@
namespace http {
#define HTTPSenderInterfaceIID "bigsnitch.api.HTTPSenderInterface/100"
#define HTTPSenderInterfaceIID "bigsnitch.api.HTTPInterceptorInterface/100"
class SenderInterface {
class InterceptorInterface {
public:
virtual ~SenderInterface() = default;
virtual ~InterceptorInterface() = default;
virtual int send(http::Request request);
virtual bool received(int id);
virtual std::optional<http::Response> receive(int id);
@ -18,4 +18,4 @@ public:
}
Q_DECLARE_INTERFACE(http::SenderInterface, HTTPSenderInterfaceIID)
Q_DECLARE_INTERFACE(http::InterceptorInterface, HTTPInterceptorInterfaceIID)

View file

@ -4,7 +4,6 @@
#include <string>
#include <session.h>
#include <includes.h>
#include <httpflow.h>
#include <editandresend.h>
#include <pluginhandler.h>

View file

@ -94,6 +94,8 @@ class BigSnitchBridge:
def request(self, flow):
self.q.put({'msg': 'request', 'flow': flow.get_state()})
# intercept until ACK received
flow.intercept()
def requestheaders(self, flow):
self.q.put({'msg': 'requestheaders', 'flow': flow.get_state()})

View file

@ -51,11 +51,13 @@ void mitmproxyPlugin::process()
qDebug() << "received " << msg_type.c_str();
} else if(msg_type == "response") {
qDebug() << "received " << msg_type.c_str();
//qDebug() << "message: " << QString(response.to_string().c_str());
emit message(j);
} else if(msg_type == "requestheaders") {
qDebug() << "received " << msg_type.c_str();
} else if(msg_type == "request") {
qDebug() << "received " << msg_type.c_str();
qDebug() << "message: " << QString(response.to_string().c_str());
} else if(msg_type == "ping") {
qDebug() << "received " << msg_type.c_str();
} else if(msg_type == "error") {

View file

@ -2,7 +2,6 @@
#include <QObject>
#include <includes.h>
#include <httpflow.h>
#include <historymodel.h>
#include <optional>

View file

@ -2,7 +2,7 @@
mitmdump -k -p 1878 -s ./mitmaddon/bigsnitch.py &
export mitmpid=$!
./build/bin/bigsnitch &
#./build/bin/bigsnitch &
sleep 5
curl -s -x http://localhost:1878 -k https://yolo.jetzt > /dev/null