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 main.cpp
mainwindow.cpp mainwindow.cpp
session.cpp session.cpp
httpflow.cpp
pluginhandler.cpp pluginhandler.cpp
proxyhandler.cpp proxyhandler.cpp
historymodel.cpp historymodel.cpp
@ -35,7 +34,6 @@ add_executable(bigsnitch
settings.cpp settings.cpp
mainwindow.h mainwindow.h
httpflow.h
session.h session.h
includes.h includes.h
proxyhandler.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 { namespace http {
#define HTTPSenderInterfaceIID "bigsnitch.api.HTTPSenderInterface/100" #define HTTPSenderInterfaceIID "bigsnitch.api.HTTPInterceptorInterface/100"
class SenderInterface { class InterceptorInterface {
public: public:
virtual ~SenderInterface() = default; virtual ~InterceptorInterface() = default;
virtual int send(http::Request request); virtual int send(http::Request request);
virtual bool received(int id); virtual bool received(int id);
virtual std::optional<http::Response> receive(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 <string>
#include <session.h> #include <session.h>
#include <includes.h> #include <includes.h>
#include <httpflow.h>
#include <editandresend.h> #include <editandresend.h>
#include <pluginhandler.h> #include <pluginhandler.h>

View file

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

View file

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

View file

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

View file

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