X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/9b78b212f659e935d4656c3cc885e93763afa15e..8855bb48b449ed06cfd3ce528b3c0a77c37cb24b:/proxyscan/proxyscan.c diff --git a/proxyscan/proxyscan.c b/proxyscan/proxyscan.c index 4f0ce921..37a2fcf2 100644 --- a/proxyscan/proxyscan.c +++ b/proxyscan/proxyscan.c @@ -27,6 +27,7 @@ #include "../localuser/localuserchannel.h" #include "../core/nsmalloc.h" #include "../lib/irc_ipv6.h" +#include "../glines/glines.h" MODULE_VERSION("") @@ -525,6 +526,7 @@ void killsock(scan *sp, int outcome) { cachehost *chp; foundproxy *fpp; time_t now; + char reason[200]; scansdone++; scansbyclass[sp->class]++; @@ -574,18 +576,18 @@ void killsock(scan *sp, int outcome) { /* the purpose of this lastgline stuff is to stop gline spam from one scan */ if (!chp->glineid || (now>=chp->lastgline+SCANTIMEOUT)) { char buf[512]; - const char *ip; + struct irc_in_addr *ip; chp->lastgline=now; glinedhosts++; loggline(chp, sp->node); - ip = IPtostr(((patricia_node_t *)sp->node)->prefix->sin); - irc_send("%s GL * +*@%s 1800 %jd :Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d", - mynumeric->content,ip,(intmax_t)getnettime(), chp->glineid); - Error("proxyscan",ERR_DEBUG,"Found open proxy on host %s",ip); + ip = &(((patricia_node_t *)sp->node)->prefix->sin); + snprintf(reason, sizeof(reason), "Open Proxy, see http://www.quakenet.org/openproxies.html - ID: %d", chp->glineid); + glinebyip("*", ip, 128, 1800, reason, GLINE_IGNORE_TRUST, "proxyscan"); + Error("proxyscan",ERR_DEBUG,"Found open proxy on host %s",IPtostr(*ip)); - snprintf(buf, sizeof(buf), "proxy-gline %lu %s %s %hu %s", time(NULL), ip, scantostr(sp->type), sp->port, "irc.quakenet.org"); + snprintf(buf, sizeof(buf), "proxy-gline %lu %s %s %hu %s", time(NULL), IPtostr(*ip), scantostr(sp->type), sp->port, "irc.quakenet.org"); triggerhook(HOOK_SHADOW_SERVER, (void *)buf); } else { loggline(chp, sp->node); /* Update log only */ @@ -1114,6 +1116,8 @@ int proxyscandoscanfile(void *sender, int cargc, char **cargv) { } } + fclose(fp); + sendnoticetouser(proxyscannick,np,"Started %d scans...", count); return CMD_OK; }