From 462f2811b98013e8b4ae8b0a887b5ba29bcc1269 Mon Sep 17 00:00:00 2001 From: Tim Blume Date: Sun, 21 Mar 2021 02:35:40 +0100 Subject: [PATCH] foo --- CMakeLists.txt | 2 -- httpflow.cpp | 2 -- httpflow.h | 3 --- include/httpsender.h | 8 ++++---- mainwindow.h | 1 - mitmaddon/bigsnitch.py | 2 ++ plugins/mitmproxy/mitmproxy_network.cpp | 2 ++ session.h | 1 - test.sh | 2 +- 9 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 httpflow.cpp delete mode 100644 httpflow.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c22052..4caa655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/httpflow.cpp b/httpflow.cpp deleted file mode 100644 index 949b557..0000000 --- a/httpflow.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "httpflow.h" - diff --git a/httpflow.h b/httpflow.h deleted file mode 100644 index b768556..0000000 --- a/httpflow.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include diff --git a/include/httpsender.h b/include/httpsender.h index a4906b1..a3c80e0 100644 --- a/include/httpsender.h +++ b/include/httpsender.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 receive(int id); @@ -18,4 +18,4 @@ public: } -Q_DECLARE_INTERFACE(http::SenderInterface, HTTPSenderInterfaceIID) +Q_DECLARE_INTERFACE(http::InterceptorInterface, HTTPInterceptorInterfaceIID) diff --git a/mainwindow.h b/mainwindow.h index 4460ccc..fbeb178 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/mitmaddon/bigsnitch.py b/mitmaddon/bigsnitch.py index d5d33ba..905b997 100644 --- a/mitmaddon/bigsnitch.py +++ b/mitmaddon/bigsnitch.py @@ -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()}) diff --git a/plugins/mitmproxy/mitmproxy_network.cpp b/plugins/mitmproxy/mitmproxy_network.cpp index 232ceed..f21e3a4 100644 --- a/plugins/mitmproxy/mitmproxy_network.cpp +++ b/plugins/mitmproxy/mitmproxy_network.cpp @@ -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") { diff --git a/session.h b/session.h index 2d9cdb3..2261640 100644 --- a/session.h +++ b/session.h @@ -2,7 +2,6 @@ #include #include -#include #include #include diff --git a/test.sh b/test.sh index fd444c9..295b552 100755 --- a/test.sh +++ b/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