summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-15 17:15:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-15 17:15:02 +0000
commit88e7a35027a420f928aea58e89db268d77877724 (patch)
treece6a76259939b74b30cc527ac95b5f53a0e4914d /src
parentc6e941f5c8b01ae80a8d84c5c42cbeee19706bf8 (diff)
Added preliminary m_antibear.cpp, a security module to cripple bear.txt based trojan bots
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3718 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_antibear.cpp86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/modules/m_antibear.cpp b/src/modules/m_antibear.cpp
new file mode 100644
index 000000000..ee595a767
--- /dev/null
+++ b/src/modules/m_antibear.cpp
@@ -0,0 +1,86 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
+ * E-mail:
+ * <brain@chatspike.net>
+ * <Craig@chatspike.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+using namespace std;
+
+#include "users.h"
+#include "channels.h"
+#include "modules.h"
+#include "helperfuncs.h"
+
+/* $ModDesc: Sends a numeric on connect which cripples a common type of trojan/spambot */
+
+class ModuleAntiBear : public Module
+{
+ private:
+
+ Server *Srv;
+ public:
+ ModuleAntiBear(Server* Me)
+ : Module::Module(Me)
+ {
+ Srv = Me;
+ }
+
+ virtual ~ModuleAntiBear()
+ {
+ }
+
+ virtual Version GetVersion()
+ {
+ return Version(1,0,0,0,VF_VENDOR);
+ }
+
+ void Implements(char* List)
+ {
+ List[I_OnUserConnect] = 1;
+ }
+
+ virtual void OnUserConnect(userrec* user)
+ {
+ WriteServ(user,"439 %s :This server has anti-spambot mechanisms enabled.", user->nick);
+ }
+};
+
+class ModuleAntiBearFactory : public ModuleFactory
+{
+ public:
+ ModuleAntiBearFactory()
+ {
+ }
+
+ ~ModuleAntiBearFactory()
+ {
+ }
+
+ virtual Module * CreateModule(Server* Me)
+ {
+ return new ModuleAntiBear(Me);
+ }
+
+};
+
+
+//
+// The "C" linkage factory0() function creates the ModuleAntiBearFactory
+// class for this library
+//
+
+extern "C" void * init_module( void )
+{
+ return new ModuleAntiBearFactory;
+}
+