This commit is contained in:
fishwaldo 2003-05-14 14:21:44 +00:00
parent 7232234b09
commit 3eee5660bf
4 changed files with 78 additions and 8 deletions

View file

@ -13,6 +13,9 @@ OBJECTS= opsb.o proxy.o opsb_help.o
TARGET= opsb.so
DOCS=README.opsb
DATA=
DISTFILES = $(SOURCES) $(DOCS) modconfig.h.in configure install-sh ChangeLog Makefile.in opsb.h
distdir = @PACKAGE@-@VERSION@
all: module
@ -29,6 +32,20 @@ clean:
install: module
$(INSTALL) -m 644 $(TARGET) $(DIRECTORY)
$(INSTALL) -m 644 $(DOCS) $(DIRECTORY)../doc/
dist:
@echo -n "Creating Directories"
@-rm -rf $(distdir)
@mkdir $(distdir)
@echo "Done"
@echo -n "Coping Core Distribution Files"
@for file in $(DISTFILES); do \
echo -n "."; \
cp -pr $$file $(distdir)/$$file; \
done
@echo "Done"
@tar -czf $(distdir).tar.gz $(distdir)/*
@rm -rf $(distdir)
@echo "Tar file $(distdir).tar.gz created, Freshmeat Time"
$(OBJECTS): Makefile

8
configure vendored
View file

@ -272,7 +272,7 @@ PACKAGE_BUGREPORT=
ac_unique_file="opsb.c"
ac_default_prefix=~/NeoStats/
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DIRINST LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DIRINST PACKAGE VERSION LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -1222,7 +1222,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers modconfig.h"
PACKAGE=opsb
PACKAGE=OPSB
VERSION=1.0
DIRINST=~/NeoStats/
@ -2330,6 +2330,8 @@ fi;
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -2952,6 +2954,8 @@ s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
s,@DIRINST@,$DIRINST,;t t
s,@PACKAGE@,$PACKAGE,;t t
s,@VERSION@,$VERSION,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF

View file

@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(opsb.c)
AC_CONFIG_HEADER(modconfig.h)
PACKAGE=opsb
PACKAGE=OPSB
VERSION=1.0
DIRINST=~/NeoStats/
AC_PREFIX_DEFAULT(~/NeoStats/)
@ -71,6 +71,8 @@ AC_MSG_RESULT(no)
AC_SUBST(DIRINST)
AC_SUBST(CFLAGS)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_OUTPUT(Makefile)
echo "(*----------------------------------------------------------*)"
echo "(| Important Instructions |)"

57
opsb.c
View file

@ -18,7 +18,7 @@
** USA
**
** NeoStats CVS Identification
** $Id: opsb.c,v 1.15 2003/04/17 15:55:46 fishwaldo Exp $
** $Id: opsb.c,v 1.16 2003/05/14 14:21:44 fishwaldo Exp $
*/
@ -63,7 +63,7 @@ int online;
Module_Info my_info[] = { {
"OPSB",
"A Open Proxy Scanning Bot",
"1.0RC3"
"1.0"
} };
@ -363,6 +363,10 @@ int do_set(User *u, char **av, int ac) {
}
if (!strcasecmp(av[2], "DISABLESCAN")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!strcasecmp(av[3], "0")) {
opsb.doscan = 1;
prefmsg(u->nick, s_opsb, "Scanning is now Enabled");
@ -378,6 +382,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 1;
} else if (!strcasecmp(av[2], "TARGETIP")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!inet_addr(av[3])) {
prefmsg(u->nick, s_opsb, "Invalid IP address (Can not be hostname) in TARGETIP");
return 0;
@ -388,6 +396,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 1;
} else if (!strcasecmp(av[2], "TARGETPORT")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!atoi(av[3])) {
prefmsg(u->nick, s_opsb, "Invalid Port (Must be numeric) in TARGETPORT");
return 0;
@ -398,6 +410,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 1;
} else if (!strcasecmp(av[2], "OPMDOMAIN")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!index(av[3], '.')) {
prefmsg(u->nick, s_opsb, "Invalid Domain name in OPMDOMAIN");
return 0;
@ -408,6 +424,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 1;
} else if (!strcasecmp(av[2], "MAXBYTES")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!atoi(av[3])) {
prefmsg(u->nick, s_opsb, "Invalid setting (Must be numeric)");
return 0;
@ -418,6 +438,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 1;
} else if (!strcasecmp(av[2], "TIMEOUT")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!atoi(av[3]) || (atoi(av[3]) > 120)) {
prefmsg(u->nick, s_opsb, "Setting must be numeric, and below 120");
return 0;
@ -428,6 +452,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 1;
} else if (!strcasecmp(av[2], "OPENSTRING")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
buf = joinbuf(av, ac, 3);
snprintf(opsb.lookforstring, 512, "%s", buf);
free(buf);
@ -436,6 +464,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 0;
} else if (!strcasecmp(av[2], "SPLITTIME")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!atoi(av[3])) {
prefmsg(u->nick, s_opsb, "Error, Setting must be numeric");
return 0;
@ -446,6 +478,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 0;
} else if (!strcasecmp(av[2], "SCANMSG")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
buf = joinbuf(av, ac, 3);
snprintf(opsb.scanmsg, 512, "%s", buf);
free(buf);
@ -454,6 +490,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 0;
} else if (!strcasecmp(av[2], "BANTIME")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!atoi(av[3])) {
prefmsg(u->nick, s_opsb, "Error, Bantime must be numeric (in Seconds)");
return 0;
@ -464,6 +504,10 @@ int do_set(User *u, char **av, int ac) {
opsb.confed = 1;
return 0;
} else if (!strcasecmp(av[2], "CACHETIME")) {
if (ac < 4) {
prefmsg(u->nick, s_opsb, "Invalid Option. Try /msg %s help set", s_opsb);
return 0;
}
if (!atoi(av[3])) {
prefmsg(u->nick, s_opsb, "Error, CacheTime must be numeric (in Seconds)");
return 0;
@ -487,6 +531,9 @@ int do_set(User *u, char **av, int ac) {
prefmsg(u->nick, s_opsb, "Cache Time: %d", opsb.cachetime);
prefmsg(u->nick, s_opsb, "Configured: %s", (opsb.confed ? "Yes" : "No"));
return 0;
} else {
prefmsg(u->nick, s_opsb, "Unknown Command %s, try /msg %s help set", av[2], s_opsb);
return 0;
}
return 0;
}
@ -497,10 +544,10 @@ int Online(char **av, int ac) {
strcpy(segv_location, "OPSB:Online");
if (init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", "+xd", my_info[0].module_name) == -1 ) {
if (init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", "+S", my_info[0].module_name) == -1 ) {
/* Nick was in use!!!! */
s_opsb = strcat(s_opsb, "_");
init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", "+xd", my_info[0].module_name);
init_bot(s_opsb,"opsb",me.name,"Proxy Scanning Bot", "+S", my_info[0].module_name);
}
loadcache();
if (opsb.confed == 0) add_mod_timer("unconf", "Un_configured_warn", "opsb", 60);
@ -1098,7 +1145,7 @@ void _init() {
opsb.targetport = me.port;
opsb.maxbytes = 500;
opsb.timeout = 30;
opsb.timedif = 30;
opsb.timedif = 600;
opsb.open = 0;
opsb.scanned = 0;
opsb.confed = 0;