Пример #1
0
        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);
        }
Пример #2
0
        public async Task recordToPBI(string ip, string username)
        {
            HelperFunctions.debugMessage(0, "Begin POST to PBI.", 0, 500, HelperFunctions.MessageType.Information, TAG);
            string            sourceCountry  = ResolveCountry(ip);
            IOTAttackInstance attackInstance = new IOTAttackInstance {
                userName = username, ip = ip, sourceCountry = sourceCountry, attemptId = Guid.NewGuid(), timestamp = DateTime.Now, date = (DateTime.Now.ToShortDateString())
            };

            try
            {
                await PowerBICtrl.post(attackInstance);
            }
            catch (Exception ex)
            {
                HelperFunctions.debugMessage(0, "An error occurred POSTing to PBI.", 0, 590, HelperFunctions.MessageType.Error, TAG);
            }
        }