cachehost *chp;
foundproxy *fpp;
time_t now;
+ char reason[200];
scansdone++;
scansbyclass[sp->class]++;
/* the purpose of this lastgline stuff is to stop gline spam from one scan */
if (!chp->glineid || (now>=chp->lastgline+SCANTIMEOUT)) {
char buf[512];
- char reason[200];
- 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);
+ 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);
- glinesetbynode( (patricia_node_t *)sp->node, 1800, reason, "proxyscan" );
- Error("proxyscan",ERR_DEBUG,"Found open proxy on host %s",ip);
+ glinebyip("*", ip, 128, 43200, 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 */
}
}
+ fclose(fp);
+
sendnoticetouser(proxyscannick,np,"Started %d scans...", count);
return CMD_OK;
}