|URL,Certificate Validity|||||||||||
|addressvalidation-viewbill.my-service-space.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m321 >= 60 days[m (2024-01-23 00:00 --> 2025-02-12 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|admin.my-security-desk.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m335 >= 60 days[m (2024-02-08 00:00 --> 2025-02-26 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|ai.supervision-watch.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m337 >= 60 days[m (2024-02-29 00:00 --> 2025-02-28 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|alert-notification.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m145 >= 60 days[m (2023-08-18 00:00 --> 2024-08-20 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|api.operations-status.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m78 >= 60 days[m (2023-05-17 00:00 --> 2024-06-14 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|applications-performance.monitoring.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m253 >= 60 days[m (2023-11-10 00:00 --> 2024-12-06 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|assistant.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m89 >= 60 days[m (2023-06-23 00:00 --> 2024-06-25 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|backend.learning-journey.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m365 >= 60 days[m (2024-02-28 00:00 --> 2025-03-28 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|customer-links.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m140 >= 60 days[m (2023-08-11 00:00 --> 2024-08-15 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|customerjourney-request.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m99 >= 60 days[m (2023-07-06 00:00 --> 2024-07-05 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|dbu.orange.com,"[1m Certificate Validity (UTC) [m[0|32m317 >= 60 days[m (2024-01-15 00:00 --> 2025-02-08 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|easymail.orange.com,"[1m Certificate Validity (UTC) [m[0|32m146 >= 60 days[m (2023-07-27 00:00 --> 2024-08-21 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|easymail.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m232 >= 60 days[m (2023-11-02 00:00 --> 2024-11-15 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|equant.absence-management.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m197 >= 60 days[m (2023-09-15 00:00 --> 2024-10-11 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|germany-emergency.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m104 >= 60 days[m (2023-06-14 00:00 --> 2024-07-10 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|it.djingo.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m225 >= 60 days[m (2023-10-30 00:00 --> 2024-11-08 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|justcommunicate.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m169 >= 60 days[m (2023-09-14 00:00 --> 2024-09-13 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|kpi.service-desk-management.orange-business.com,"[1m Certificate Validity (UTC) [m[0|33mexpires < 60 days (35)[m (2023-05-03 00:00 --> 2024-05-02 23:59)| | | | | |||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|learning-journey.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m358 >= 60 days[m (2024-02-28 00:00 --> 2025-03-21 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|learning-tools.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m337 >= 60 days[m (2024-02-14 00:00 --> 2025-02-28 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|monitoring-insert.orange-business.com,"[1m Certificate Validity (UTC) [m[0|33mexpires < 60 days (49)[m (2023-04-18 00:00 --> 2024-05-16 23:59)| | | | | |||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|my-files.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m99 >= 60 days[m (2023-06-08 00:00 --> 2024-07-05 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|my-security-desk.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m336 >= 60 days[m (2024-01-29 00:00 --> 2025-02-27 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|myworkingway.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m357 >= 60 days[m (2024-02-21 00:00 --> 2025-03-20 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|nprod.my-files.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m182 >= 60 days[m (2023-09-27 00:00 --> 2024-09-26 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|nue.oper-tlc-f-or-01.sgut.local,"Certificate information not found"|||||||||||
|pp-status.factory.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m229 >= 60 days[m (2023-11-10 00:00 --> 2024-11-12 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|qualif.auth.trusted-administration.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m581 >= 60 days[m (2023-10-31 08:21 --> 2025-10-31 08:21)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2036-05-03 13:20). [3mOrange Internal G2 Server CA[m <-- [3mOrange Internal G2 Root CA[m"| | | | | | | | ||
|quotation-tracking.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m139 >= 60 days[m (2023-07-18 00:00 --> 2024-08-14 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|scan-antivirus.factory.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m435 >= 60 days[m (2023-06-07 09:41 --> 2025-06-07 09:41)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2036-05-03 13:20). [3mOrange Internal G2 Server CA[m <-- [3mOrange Internal G2 Root CA[m"| | | | | | | | ||
|sites-management.orange-business.com,"[1m Certificate Validity (UTC) [m[0|33mexpires < 60 days (33)[m (2023-04-28 00:00 --> 2024-04-30 23:59)| | | | | |||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|skills-drive.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m155 >= 60 days[m (2023-08-31 00:00 --> 2024-08-30 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|staging-backend.learning-journey.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m369 >= 60 days[m (2024-03-06 00:00 --> 2025-04-01 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|staging.learning-journey.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m358 >= 60 days[m (2024-03-06 00:00 --> 2025-03-21 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|staging.learning-tools.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m337 >= 60 days[m (2024-02-14 00:00 --> 2025-02-28 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|supervision-watch.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m231 >= 60 days[m (2023-11-15 00:00 --> 2024-11-14 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|tt-gateway-s.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m100 >= 60 days[m (2023-06-06 00:00 --> 2024-07-06 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|tt-gateway.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m100 >= 60 days[m (2023-06-06 00:00 --> 2024-07-06 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|tt-gateway5.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m174 >= 60 days[m (2023-08-22 00:00 --> 2024-09-18 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|uat.admin.my-security-desk.orange-business.com,"Certificate information not found"|||||||||||
|uat.equant.absence-management.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m197 >= 60 days[m (2023-09-15 00:00 --> 2024-10-11 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|uat.my-security-desk.orange-business.com,"Certificate information not found"|||||||||||
|uat.quotation-tracking.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m118 >= 60 days[m (2023-06-26 00:00 --> 2024-07-24 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|uat.skills-drive.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m155 >= 60 days[m (2023-08-31 00:00 --> 2024-08-30 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|uat.easymail.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m232 >= 60 days[m (2023-11-02 00:00 --> 2024-11-15 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|uat.justcommunicate.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m169 >= 60 days[m (2023-09-14 00:00 --> 2024-09-13 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|uat.myworkingway.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m358 >= 60 days[m (2024-02-21 00:00 --> 2025-03-21 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|whois-data-reminder-policy.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m97 >= 60 days[m (2023-07-04 00:00 --> 2024-07-03 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2030-09-23 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|workforceintervention.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m125 >= 60 days[m (2023-07-03 00:00 --> 2024-07-31 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-03-29 23:59). [3mDigiCert Global G2 TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root G2[m"| | | | | | | | | |
|www.enx.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m107 >= 60 days[m (2023-06-13 00:00 --> 2024-07-13 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-04-13 23:59). [3mDigiCert Global G3 TLS ECC SHA384 2020 CA1[m <-- [3mDigiCert Global Root G3[m"| | | | | | | | | |
|www.int-cisco-po.mnc.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m225 >= 60 days[m (2023-10-24 00:00 --> 2024-11-08 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-04-13 23:59). [3mDigiCert TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root CA[m"| | | | | | | | ||
|www.int-cisco-po.staging.mnc.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m218 >= 60 days[m (2023-10-16 00:00 --> 2024-11-01 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-04-13 23:59). [3mDigiCert TLS RSA SHA256 2020 CA1[m <-- [3mDigiCert Global Root CA[m"| | | | | | | | ||
|www.ncr.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m385 >= 60 days[m (2024-03-20 00:00 --> 2025-04-17 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-04-13 23:59). [3mDigiCert Global G3 TLS ECC SHA384 2020 CA1[m <-- [3mDigiCert Global Root G3[m"| | | | | | | | | |
|www.nuar.fr.orange-business.com,"[1m Certificate Validity (UTC) [m[0|32m377 >= 60 days[m (2024-03-11 00:00 --> 2025-04-09 23:59)| | | | ||||||
|[1m Intermediate cert validity [m#1: [0|32mok > 40 days[m (2031-04-13 23:59). [3mDigiCert Global G3 TLS ECC SHA384 2020 CA1[m <-- [3mDigiCert Global Root G3[m"| | | | | | | | | |
Pour obtenir un fichier CSV avec une colonne pour l'URL et une autre pour la validité du certificat proprement formatée, en supprimant les caractères étranges et en simplifiant les informations affichées, vous pouvez suivre les étapes suivantes dans votre script bash.
Voici comment vous pouvez modifier le bloc de script qui traite chaque URL pour atteindre cet objectif :
bash Copy code
#!/bin/bash
# Nom du fichier d'entrée et de sortie
input_file="urls.txt"
output_file="results.csv"
# En-têtes du fichier CSV
echo "URL,Certificate Validity (UTC)" > "$output_file"
# Boucle à travers chaque URL du fichier d'entrée
while IFS= read -r url; do
# Supprimer les espaces en début et fin d'URL
url=$(echo "$url" | tr -d '[:space:]')
# Vérifier si l'URL est vide
if [ -z "$url" ]; then
continue
fi
# Exécuter testssl et extraire le "Validity" du certificat
# Utilisation de sed pour nettoyer la sortie
validity=$(testssl --quiet "$url" 2>/dev/null | grep -i "Validity" | awk -F"(" '{print $2 $3}' | sed 's/)//g' | tr -d '\033[0m\033[1m\033[32m\033[31m')
# Vérifier si une information de validité a été trouvée
if [ -z "$validity" ]; then
validity="Certificate information not found"
else
# Nettoyage supplémentaire si désiré, par exemple extraire des dates ou simplifier encore plus le texte
validity=$(echo "$validity" | grep -oE "[0-9]+ >= [0-9]+ days.*" )
fi
# Ajouter les résultats au fichier CSV, en enlevant les caractères de contrôle et couleurs
echo "$url,\"$validity\"" >> "$output_file"
done < "$input_file"
echo "Le fichier CSV a été créé avec succès : $output_file"
Ce script bash effectue les modifications nécessaires pour :
Extraire seulement la partie pertinente des informations de "Validity" du certificat (ignorant le préambule coloré et les termes non nécessaires).
Nettoyer encore plus la sortie en supprimant les caractères de contrôle ANSI qui causent l'affichage de caractères étranges (comme "[1m").
Simplifier ou ajuster l'affichage des informations sur la validité selon les besoins, ici illustré par une extraction basique des informations essentielles avec grep -oE.
Assurez-vous que testssl est configuré correctement et capable de retourner les informations de validité attendues pour chaque URL dans votre fichier d'entrée. Cette solution suppose que testssl est capable de fournir la validité en un format cohérent et prévisible qui peut être traité de cette manière.