feat: setup spoofer
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "spoofer.h"
|
||||||
#include "log-sink.h"
|
#include "log-sink.h"
|
||||||
#include "proxy-configurator.h"
|
#include "proxy-configurator.h"
|
||||||
#include "cache-cleaner.h"
|
#include "cache-cleaner.h"
|
||||||
@@ -81,11 +82,16 @@ bool run()
|
|||||||
mitmConfig.threadCount = 255;
|
mitmConfig.threadCount = 255;
|
||||||
mitmConfig.caName = utils::randomizeString(32);
|
mitmConfig.caName = utils::randomizeString(32);
|
||||||
proxy = new TinyMITMProxy(mitmConfig);
|
proxy = new TinyMITMProxy(mitmConfig);
|
||||||
|
proxy->addLogSink(std::make_shared<ConOutSink>());
|
||||||
|
|
||||||
mainLog.info("Creating configurator and setting proxy addr");
|
mainLog.info("Creating configurator and setting proxy addr");
|
||||||
conf = new ProxyConfigurator();
|
conf = new ProxyConfigurator();
|
||||||
conf->setProxy("127.0.0.1", 44444);
|
conf->setProxy("127.0.0.1", 44444);
|
||||||
|
|
||||||
|
mainLog.info("Instantiating spoofer and registering proxy listeners");
|
||||||
|
Spoofer* spoofer = new Spoofer();
|
||||||
|
spoofer->registerListeners(proxy);
|
||||||
|
|
||||||
mainLog.info("Starting proxy");
|
mainLog.info("Starting proxy");
|
||||||
if (!proxy->init())
|
if (!proxy->init())
|
||||||
{
|
{
|
||||||
@@ -117,7 +123,6 @@ int main()
|
|||||||
/*
|
/*
|
||||||
handlers for cleaning proxy conf on exit / crash / taskkill / whatever
|
handlers for cleaning proxy conf on exit / crash / taskkill / whatever
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SetConsoleCtrlHandler(consoleHandler, TRUE);
|
SetConsoleCtrlHandler(consoleHandler, TRUE);
|
||||||
StartWatchdog();
|
StartWatchdog();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user