示例#1
0
 /// <summary>
 /// Takes the result of the analysis and extracts the information to a new HostEntry.
 /// If the extraction fails, the same HostEntry as passed will be returned.
 /// Otherwise the fresh HostEntry gets returned.
 /// </summary>
 private HostEntry extractInfoFromAnalysis(Analyze a, HostEntry he)
 {
     HostEntry extracted = new HostEntry(he.URL.ToString(), he.Protocol.ToString());
     try
     {
         extracted.SetIP(a.endpoints[0].ipAddress);
         extracted.SetRanking(a.endpoints[0].grade);
         extracted.SetFingerPrintCert(a.endpoints[0].Details.cert.sigAlg);
         extracted.SetExpirationDate(a.endpoints[0].Details.cert.notAfter);
         extracted.SetProtocolVersions(a.endpoints[0].Details.protocols);
         extracted.SetRC4(a.endpoints[0].Details.supportsRc4.ToString());
         extracted.SetBeastVulnerarbility(a.endpoints[0].Details.vulnBeast);
         extracted.SetForwardSecrecy(a.endpoints[0].Details.forwardSecrecy);
         extracted.SetHeartbleedVulnerability(a.endpoints[0].Details.heartbleed);
         extracted.SetSignatureAlgorithm(a.endpoints[0].Details.cert.sigAlg);
         extracted.SetPoodleVulnerability(a.endpoints[0].Details.poodle, a.endpoints[0].Details.poodleTls);
         extracted.SetExtendedValidation(a.endpoints[0].Details.cert.validationType);
         extracted.SetOpenSSLCCSVulnerable(a.endpoints[0].Details.openSslCcs);
         extracted.SetHTTPServerSignature(a.endpoints[0].Details.serverSignature);
         extracted.SetServerHostName(a.endpoints[0].serverName);
         extracted.Set3DESPresence(check3DESCipherPresence(a.endpoints[0].Details.suites));
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
     }
     return extracted;
 }