MCPcopy Create free account
hub / github.com/adobe/Marinus / get_scan_count

Function get_scan_count

python3_cron_scripts/create_cert_graphs.py:160–190  ·  view source on GitHub ↗

Get the count of matching certificates for the provided hash

(zgrab_collection, sha256_hash, version)

Source from the content-addressed store, hash-verified

158
159
160def get_scan_count(zgrab_collection, sha256_hash, version):
161 """
162 Get the count of matching certificates for the provided hash
163 """
164 if version == 1:
165 result_count = zgrab_collection.count_documents(
166 {
167 "$or": [
168 {
169 "data.http.response.request.tls_handshake.server_certificates.certificate.parsed.fingerprint_sha256": sha256_hash
170 },
171 {
172 "data.http.response.redirect_response_chain.0.request.tls_handshake.server_certificates.certificate.parsed.fingerprint_sha256": sha256_hash
173 },
174 ]
175 }
176 )
177 else:
178 result_count = zgrab_collection.count_documents(
179 {
180 "$or": [
181 {
182 "data.http.result.response.request.tls_log.handshake_log.server_certificates.certificate.parsed.fingerprint_sha256": sha256_hash
183 },
184 {
185 "data.http.result.redirect_response_chain.0.request.tls_log.handshake_log.server_certificates.certificate.parsed.fingerprint_sha256": sha256_hash
186 },
187 ]
188 }
189 )
190 return result_count
191
192
193def add_terminal_zgrab_certificates(

Calls

no outgoing calls

Tested by

no test coverage detected