private void CheckRDPSession() { RemoteConnectionDetection rce = new RemoteConnectionDetection(); bool isRemoteConnection = rce.IsRemoteConnectionActive(); if (isRemoteConnection) { riskAssessor.addRemoteConnectionRisk(); } else { Debug.Print("No RDP session detected."); } }
public void FakeCMDScanTest() { RiskAssessor riskAssessor = NewRiskAssessor(); bool reachedThreshold = false; int riskScore = 0; reachedThreshold = riskAssessor.addRemoteConnectionRisk(); riskScore = riskAssessor.calculateRiskScore(); Assert.IsFalse(reachedThreshold); Assert.AreEqual(riskScore, 50); reachedThreshold = riskAssessor.addAndAssessRisks(RiskAssessor.EventRisk.COMMAND_PROMPT); riskScore = riskAssessor.calculateRiskScore(); Assert.IsFalse(reachedThreshold); Assert.AreEqual(riskScore, 70); reachedThreshold = riskAssessor.addAndAssessRisks(RiskAssessor.EventRisk.CMD_SCAN); riskScore = riskAssessor.calculateRiskScore(); Assert.IsFalse(reachedThreshold); Assert.AreEqual(riskScore, 90); reachedThreshold = riskAssessor.addAndAssessRisks(RiskAssessor.EventRisk.SUSPICIOUS_KEYBOARD_INPUT); riskScore = riskAssessor.calculateRiskScore(); Assert.IsTrue(reachedThreshold); Assert.AreEqual(riskScore, 130); }
public void AddRemoteConnectionRiskTest() { RiskAssessor riskAssessor = NewRiskAssessor(); riskAssessor.addRemoteConnectionRisk(); int riskScore = riskAssessor.calculateRiskScore(); Assert.AreEqual(riskScore, 50); }