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

Function insert_result

python3_cron_scripts/zgrab_http_ip.py:186–217  ·  view source on GitHub ↗

Insert the matched domain into the collection of positive results.

(entry, port, ip_context, zones, results_collection)

Source from the content-addressed store, hash-verified

184
185
186def insert_result(entry, port, ip_context, zones, results_collection):
187 """
188 Insert the matched domain into the collection of positive results.
189 """
190 if "zgrab2" in global_zgrab_path:
191 temp_date = entry["data"]["http"]["timestamp"]
192 new_date = parse(temp_date)
193 entry["timestamp"] = new_date
194 entry["data"]["http"]["timestamp"] = new_date
195 else:
196 temp_date = entry["timestamp"]
197 new_date = parse(temp_date)
198 entry["timestamp"] = new_date
199
200 entry["domain"] = "<nil>"
201
202 matches = check_ip_context(entry["ip"], ip_context)
203
204 zones = []
205 if len(matches) > 0:
206 for match in matches:
207 if match["zone"] not in zones:
208 zones.append(match["zone"])
209 if port == "443":
210 cert_zones = check_in_zone(entry, zones)
211 for zone in cert_zones:
212 if zone not in zones:
213 zones.append(zone)
214
215 entry["zones"] = zones
216
217 results_collection.replace_one({"ip": entry["ip"]}, entry, upsert=True)
218
219
220def run_port_80_command(target_list, tnum):

Callers 1

process_threadFunction · 0.70

Calls 2

check_ip_contextFunction · 0.70
check_in_zoneFunction · 0.70

Tested by

no test coverage detected