foo
This commit is contained in:
parent
600d7146d3
commit
462f2811b9
9 changed files with 9 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
#include "httpflow.h"
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <includes.h>
|
|
@ -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)
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <string>
|
||||
#include <session.h>
|
||||
#include <includes.h>
|
||||
#include <httpflow.h>
|
||||
#include <editandresend.h>
|
||||
|
||||
#include <pluginhandler.h>
|
||||
|
|
|
@ -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()})
|
||||
|
|
|
@ -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") {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <includes.h>
|
||||
#include <httpflow.h>
|
||||
#include <historymodel.h>
|
||||
#include <optional>
|
||||
|
||||
|
|
2
test.sh
2
test.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue