static void Main2() { //Initialise ScutaConfig.load(); HelperFunctions.configure(3, 1, false, true, "", "Application", "Scuta"); HelperFunctions.debugMessage(0, ("Scuta v" + Assembly.GetExecutingAssembly().GetName().Version + " is starting..."), 0, 100, HelperFunctions.MessageType.Information); FWCtrl.Setup(); if (ScutaConfig.enableIOT) { IOTCtrl.Initialise(ScutaConfig.iotHubConnectionString, ScutaConfig.iotHubDeviceName, ScutaConfig.iotHubUri); } if (ScutaConfig.enableMessageForwarding) { MsgForwarding.Setup(ScutaConfig.messageForwardingIP, ScutaConfig.messageForwardingPort); } if (ScutaConfig.watchEventLog) { EventLogWorker newWorker = new EventLogWorker(); ThreadManager.LaunchWorker(newWorker); } if (ScutaConfig.watchLogFile) { LogFileWorker logFileWorker = new LogFileWorker(ScutaConfig.watchLogFilePath, ScutaConfig.watchLogFileName); ThreadManager.LaunchWorker(logFileWorker); } }
public async Task recordToIOT(string ip, string username) { HelperFunctions.debugMessage(0, "Begin post to IOT", 0); HelperFunctions.debugMessage(0, "Begin post to IOT.", 2, 103, HelperFunctions.MessageType.Information, TAG); string sourceCountry = ResolveCountry(ip); IOTAttackInstance attackInstance = new IOTAttackInstance { userName = username, ip = ip, sourceCountry = sourceCountry, attemptId = Guid.NewGuid(), timestamp = DateTime.Now }; await IOTCtrl.Send(attackInstance); }
protected override void OnStart(string[] args) { base.OnStart(args); //Initialise ScutaConfig.load(); HelperFunctions.configure(3, 3, false, true, "", "Scuta", "Scuta Service"); HelperFunctions.debugMessage(0, ("Scuta v" + Assembly.GetExecutingAssembly().GetName().Version + " is starting..."), 0, 100, HelperFunctions.MessageType.Information); FWCtrl.Setup(); httpClient = new HttpClient(); if (ScutaConfig.enableIOT) { IOTCtrl.Initialise(ScutaConfig.iotHubConnectionString, ScutaConfig.iotHubDeviceName, ScutaConfig.iotHubUri); } if (ScutaConfig.enablePBI) { PowerBICtrl.serviceURI = ScutaConfig.pbiServiceUri; PowerBICtrl.enableDebugToLog = true; } ; if (ScutaConfig.enableMessageForwarding) { MsgForwarding.Setup(ScutaConfig.messageForwardingIP, ScutaConfig.messageForwardingPort); } if (ScutaConfig.watchEventLog) { EventLogWorker newWorker = new EventLogWorker(); rootThread = ThreadManager.LaunchWorker(newWorker); } if (ScutaConfig.watchLogFile) { LogFileWorker logFileWorker = new LogFileWorker(ScutaConfig.watchLogFilePath, ScutaConfig.watchLogFileName); ThreadManager.LaunchWorker(logFileWorker); } }