diff --git a/ChangeLog b/ChangeLog index b4624ee..fc45166 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Open Proxy Scanning Bot Module for NeoStats Changelog. - Fix a coredump when not enough paramaters supplied to the set command - OPSB checks the excluded server list when a nick joins on straight away, instead of waiting for the DNS lookups to finish :) - Changed some of the levels to 40 (localoper) so localops can use opsb to check sites/users +- Bah, really fixed set to not work at all! +- Added some stats on cachehits and opm hits * Version 1.0RC3 * 5/11/2002 * Fish - Fixed a problem when we delete a scanned user out of the active list when the tcp connect had finished, but not the dns bl lookup... diff --git a/opsb.c b/opsb.c index 880ff19..d2a0281 100644 --- a/opsb.c +++ b/opsb.c @@ -18,7 +18,7 @@ ** USA ** ** NeoStats CVS Identification -** $Id: opsb.c,v 1.12 2003/01/18 04:19:12 fishwaldo Exp $ +** $Id: opsb.c,v 1.13 2003/01/30 11:29:25 fishwaldo Exp $ */ @@ -322,7 +322,7 @@ int __Bot_Message(char *origin, char **argv, int argc) return 0; } } else if (!strcasecmp(argv[1], "SET")) { - if (argc <= 4) { + if (argc < 3) { prefmsg(u->nick, s_opsb, "Syntax Error. /msg %s help set", s_opsb); return 0; } @@ -472,7 +472,7 @@ int do_set(User *u, char **av, int ac) { prefmsg(u->nick, s_opsb, "Configured: %s", (opsb.confed ? "Yes" : "No")); return 0; } - + return 0; } int Online(char **av, int ac) { @@ -615,6 +615,7 @@ int checkcache(scaninfo *scandata) { #ifdef DEBUG log("OPSB: user %s is already in Cache", scandata->who); #endif + opsb.cachehits++; if (scandata->u) prefmsg(scandata->u->nick, s_opsb, "User %s is already in Cache", scandata->who); return 3; } @@ -1013,6 +1014,7 @@ void dnsblscan(char *data, adns_answer *a) { log("Got Positive OPM lookup for %s (%s)", scandata->who, scandata->lookup); #endif scandata->dnsstate = OPMLIST; + opsb.opmhits++; do_ban(scandata); checkqueue(); } else @@ -1121,6 +1123,8 @@ void _init() { opsb.cachetime = 3600; opsb.bantime = 86400; opsb.doscan = 1; + opsb.cachehits = 1; + opsb.opmhits = 1; snprintf(opsb.lookforstring, 512, "*** Looking up your hostname..."); snprintf(opsb.scanmsg, 512, "Your Host is being Scanned for Open Proxies"); } diff --git a/opsb.h b/opsb.h index 2b38a37..a78c4ca 100644 --- a/opsb.h +++ b/opsb.h @@ -4,7 +4,7 @@ ** Based from GeoStats 1.1.0 by Johnathan George net@lite.net * ** NetStats CVS Identification -** $Id: opsb.h,v 1.7 2002/11/18 13:45:32 fishwaldo Exp $ +** $Id: opsb.h,v 1.8 2003/01/30 11:29:25 fishwaldo Exp $ */ @@ -68,6 +68,8 @@ struct opsb { int confed; int cachetime; int doscan; + int cachehits; + int opmhits; } opsb; struct sockinfo { diff --git a/proxy.c b/proxy.c index 9c3ec37..ff3b29e 100644 --- a/proxy.c +++ b/proxy.c @@ -20,7 +20,7 @@ ** USA ** ** NeoStats CVS Identification -** $Id: proxy.c,v 1.11 2002/11/18 13:45:32 fishwaldo Exp $ +** $Id: proxy.c,v 1.12 2003/01/30 11:29:25 fishwaldo Exp $ */ @@ -231,6 +231,8 @@ void send_status(User *u) { prefmsg(u->nick, s_opsb, "Proxy Results:"); prefmsg(u->nick, s_opsb, "Hosts Scanned: %d Hosts found Open: %d Exceptions %d", opsb.scanned, opsb.open, list_count(exempt)); prefmsg(u->nick, s_opsb, "Cache Entries: %d", list_count(cache)); + prefmsg(u->nick, s_opsb, "Cache Hits: %d", opsb.cachehits); + prefmsg(u->nick, s_opsb, "Blacklist Hits: %d", opsb.opmhits); for (i = 0; i < NUM_PROXIES; i++) { prefmsg(u->nick, s_opsb, "Proxy %s (%d) Found %d Open %d", proxy_list[i].type, proxy_list[i].port, proxy_list[i].nofound, proxy_list[i].noopen); } @@ -241,7 +243,7 @@ void send_status(User *u) { if (scandata->u) prefmsg(u->nick, s_opsb, "Scanning %s by request of %s", scandata->lookup, scandata->u->nick); else - prefmsg(u->nick, s_opsb, "Scanning %s (%s)", scandata->lookup, inet_ntoa(scandata->ipaddr)); + prefmsg(u->nick, s_opsb, "Scanning %s (%s) - %s", scandata->lookup, inet_ntoa(scandata->ipaddr), scandata->who); switch(scandata->dnsstate) { case REPORT_DNS: