simplify dronebl_check_tickets, force all ips to be rechecked
This commit is contained in:
parent
0298f3e0db
commit
907d36766d
|
@ -93,29 +93,30 @@ with pgconn:
|
||||||
already_sent = False
|
already_sent = False
|
||||||
for entry in results:
|
for entry in results:
|
||||||
debug_log.debug(results)
|
debug_log.debug(results)
|
||||||
if entry[4] != "inactive":
|
if not entry[7]:
|
||||||
|
curs.execute("update proxies set status='unscanned', recheck=true where id=%s", (entry[0],))
|
||||||
|
debug_log.debug(f"rechecking {ip}")
|
||||||
should_remove = False
|
should_remove = False
|
||||||
if entry[4] == "active":
|
else if entry[4] in ["scanning", "unscanned"]:
|
||||||
if entry[7]:
|
debug_log.debug(f"IP: {ip} is {entry[4]}, skipping")
|
||||||
if entry[1] == entry[3] or entry[1] == ip:
|
should_remove = False
|
||||||
if entry[5] in ["http", "socks5", "socks4", "httpsocks", "https"]:
|
else if entry[4] == "active":
|
||||||
details = f"{entry[1]} has an open {entry[5]} proxy on port {entry[2]}, confirmed active at {entry[6]}"
|
should_remove = False
|
||||||
if entry[5] == "vpngate":
|
if entry[1] == entry[3] or entry[1] == ip:
|
||||||
details = f"{entry[1]} is running an open VPNGate proxy on port {entry[2]}, confirmed active at {entry[6]}. These are heavily abused by spammers, therefore they are blocked."
|
if entry[5] in ["http", "socks5", "socks4", "httpsocks", "https"]:
|
||||||
else:
|
details = f"{entry[1]} has an open {entry[5]} proxy on port {entry[2]}, confirmed active at {entry[6]}"
|
||||||
details = f"Confirmed open {entry[5]} proxy with an entry IP of {entry[1]}, port {entry[2]} and exit IP of {entry[3]}, confirmed active at {entry[6]}"
|
if entry[5] == "vpngate":
|
||||||
debug_log.debug(details)
|
details = f"{entry[1]} is running an open VPNGate proxy on port {entry[2]}, confirmed active at {entry[6]}. These are heavily abused by spammers, therefore they are blocked."
|
||||||
s.post("https://mirror1.dronebl.org/admin/tickets", headers=headers, data={"ajax": "delete", "id": ticket["ticket_id"]})
|
else:
|
||||||
if not already_sent:
|
details = f"Confirmed open {entry[5]} proxy with an entry IP of {entry[1]}, port {entry[2]} and exit IP of {entry[3]}, confirmed active at {entry[6]}"
|
||||||
send_active_email(ticket, details, comment.text)
|
debug_log.debug(details)
|
||||||
debug_log.debug(f"Sent email: {details}")
|
s.post("https://mirror1.dronebl.org/admin/tickets", headers=headers, data={"ajax": "delete", "id": ticket["ticket_id"]})
|
||||||
already_sent = True
|
if not already_sent:
|
||||||
curs.execute("update proxies set recheck=false where id=%s", (entry[0],))
|
send_active_email(ticket, details, comment.text)
|
||||||
else:
|
debug_log.debug(f"Sent email: {details}")
|
||||||
curs.execute("update proxies set status='unscanned', recheck=true where id=%s", (entry[0],))
|
already_sent = True
|
||||||
debug_log.debug(f"IP: {ip} is active, rechecking")
|
curs.execute("update proxies set recheck=false where id=%s", (entry[0],))
|
||||||
if entry[4] in ["scanning", "unscanned"]:
|
|
||||||
debug_log.debug(f"IP: {ip} is {entry[4]}, skipping")
|
|
||||||
if should_remove:
|
if should_remove:
|
||||||
if not results:
|
if not results:
|
||||||
debug_log.debug(f"IP: {ip} is not in database")
|
debug_log.debug(f"IP: {ip} is not in database")
|
||||||
|
|
Loading…
Reference in New Issue