/** * os_pingspam.C: ping spammer thingy * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005 William Pitcock, et al. * Rights to this code are as documented in doc/pod/license.pod. * * $Id: os_pingspam.C,v 1.6 2007/09/22 14:27:27 pippijn Exp $ */ #include "atheme.h" #include #include "servers.h" #include #include static char const rcsid[] = "$Id: os_pingspam.C,v 1.6 2007/09/22 14:27:27 pippijn Exp $"; REGISTER_MODULE ("operserv/pingspam", false, "The Ermyth Team "); char const * const notices[] = { "Scanning for proxies.", "Killing off bottlers.", "LOL ok so like we are teh SKANZ0RZING j00 becuz well like OMG deze bots r h3r3 an liek they are FL00DING!!#@! ignore plz", "gaben", "Please ignore this notice.", "Scanning for warez.", "All your pr0n are belong to us!", "Move over! This is the police!", "This notice brought to you by Burma-Shave.", "They're coming...", ":)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(::)(:", "lolz!", " your a pagan", "* Ads needs to shower soon", " Don't make me get Yakuza on you", "beu fails it", "BAN KAI~!$" }; char phrases[][15] = { "", " please-ignore", " proxy scan", " ignore me", " <3 neostats", }; void pingspam (user_t *u); static void os_cmd_pingspam (sourceinfo_t *si, int parc, char *parv[]); static void os_cmd_autopingspam (sourceinfo_t *si, int parc, char *parv[]); command_t const os_pingspam = { "PINGSPAM", "Spam a user with pings from every service, plus some bonus notices.", PRIV_OMODE, 1, os_cmd_pingspam }; command_t const os_autopingspam = { "AUTOPINGSPAM", "Spam connecting users with pings from every service, plus some bonus notices (setting).", PRIV_ADMIN, 1, os_cmd_autopingspam }; int spamming; E cmdvec os_cmdtree; static void user_add_hook (user_t *u) { if (spamming) pingspam (u); } static void os_cmd_pingspam (sourceinfo_t *si, int parc, char *parv[]) { char *target = parv[0]; user_t *u; if (!target) { notice (opersvs.nick, si->su->nick, "Usage: \2PINGSPAM\2 "); return; } if (!(u = user_find_named (target))) { notice (opersvs.nick, si->su->nick, "\2%s\2 is not on the network", target); return; } pingspam (u); notice (opersvs.nick, si->su->nick, "\2%s\2 has been pwned.", target); snoop ("PINGSPAM: \2%s\2 -> \2%s\2", get_oper_name (si), target); } static void os_cmd_autopingspam (sourceinfo_t *si, int parc, char *parv[]) { char *mode = parv[0]; if (!mode) { notice (opersvs.nick, si->su->nick, "Auto-pingspam is currently \2%s\2", spamming ? "ON" : "OFF"); return; } if (strcasecmp (mode, "on") == 0 || atoi (mode)) { spamming = 1; notice (opersvs.nick, si->su->nick, "Auto-pingspam is now \2ON\2"); } else { spamming = 0; notice (opersvs.nick, si->su->nick, "Auto-pingspam is now \2OFF\2"); } } void pingspam (user_t *u) { user_t *sptr; node_t *n; int i; if (*globsvs.nick) for (i = 0; i < 6; i++) notice (globsvs.nick, u->nick, notices[gen_rand32 () % sizeof (notices) / sizeof (char *)]); LIST_FOREACH (n, me.me->userlist.head) { sptr = static_cast (n->data); phandler->privmsg (sptr->nick, u->nick, "\001PING %d%s\001", NOW, phrases[gen_rand32 () % sizeof (phrases) / sizeof (char *)]); } } bool _modinit (module *m) { spamming = 0; os_cmdtree << os_pingspam; os_cmdtree << os_autopingspam; user_t::callback.add.attach (user_add_hook); return true; } void _moddeinit () { os_cmdtree >> os_pingspam; os_cmdtree >> os_autopingspam; user_t::callback.add.detach (user_add_hook); }