This commit is contained in:
2023-12-22 22:53:54 -05:00
commit 2821b7e9a1
45 changed files with 8425 additions and 0 deletions

57
AGLhosts.file Normal file
View File

@@ -0,0 +1,57 @@
*.zianet.net
*.inu.net
*.iamerica.net
*.spidernet.net
*.southeast.net
*modem*.*
*dialin*.*
*dialup*.*
*port*.*
*.mtl.total.net
*.aol.com
*.ccmaresme.es
*.nettipaja.clinet.fi
*.online.no
*.nitco.com
*.acadia.net
*.erols.com
*istk*.jps.net
*lakeheadu.ca
*tm.net.my
*.jaring.my
*.maltanet.net
*.ibm.net
*.cytanet.com.cy
*.mci.net
*.telia.com
*.tor.iSTAR.ca
*.sb.west.net
*.compuserve.com
*.satlink.com
*.mixcom.net
*.gibnet.gi
*.p3.net
*.internet.com.mx
*.lightspeed.net
*.ihug.co.nz
*.earthlink.net
*.softdisk.com
*.pop.tip.nl
*.quebectel.com
*.pacbell.net
*.att.net
*.videotron.net
*.compuserve.com
*ppp*.advantage.ca
*.telepac.pt
*.ms.uu.net
*.telepost.no
*.ix.netcom.com
*.codetel.net.do
*.pacific.net.sg
*cnc*.concentric.net
*-*.concentric.net
*.ppp.sn.no
*.psi.net
*.MIA.Icanect.Net
*.interlinx.qc.ca

2
Gline.file Normal file
View File

@@ -0,0 +1,2 @@
868971453 *bcoffelt@158.222.1.65 CHANNELBLAST BANNED by Channel Cleanup [1]
869489901 *@*coolio.org ripper_!ripper@grove.ufl.edu Abusive user [1]

1
HELP Symbolic link
View File

@@ -0,0 +1 @@
/usr/local/lib/irc/help

1
KillChan.file Normal file
View File

@@ -0,0 +1 @@
8DffeEddDkeFdckE

0
MMGlog Normal file
View File

14
Makefile Executable file
View File

@@ -0,0 +1,14 @@
LIBS = -ltermcap
#CC = /usr/local/bin/alpha-dec-osf4.0-gcc
CC = gcc
CFLAGS = -O2
OBJECTS = uworld.o socket.o file.o match.o parse.o nickserv.o helpservice.o sevnum.o nicklist.o daemon.o wastedump.o
SOURCES = uworld.c socket.c file.c match.c parse.c nickserv.c helpservice.c sevnum.c nicklist.c daemon.c wastedump.c
.c.o:
${CC} ${CFLAGS} -c $<
uworld: ${OBJECTS}
${CC} ${CFLAGS} -o midway ${OBJECTS} ${LIBS}

196
Mhosts.file Normal file
View File

@@ -0,0 +1,196 @@
*jungle.org
*theguru.com
*spot.aros.net
*.wildstar.net
*.wildstar.com
*irc.crystalball.com
osf1.gmu.edu
mail1.i1.net
net30.nucleus.com
Securit.nsuok.edu
ibm*.ensicaen.ismra.fr
foonix.foonet.net
zart.spiretech.com
jitter.rahul.net
chat.eskimo.com
phish.nether.net
*pipeline.com
gateway.telecom.ksu.edu
falcon.cc.ukans.edu
falcon.lhup.edu
taisun1.tamuk.edu
*.worldone.com
Serve.org
*.YFN.EDU
*.YSU.EDU
SecurIt.nsuok.edu
undernet.org
bbs.*
freenet.*
*.ksu.ksu.edu
irc.crystalball.com
infinity.c2.org
*.teleport.com
*.cns.hp.com
*.ucdavis.edu
karn.wright.edu
*.hp.com
200.20.157.*
bouncer.gnn.com
user1.iswest.com
ra1.randomc.com
*.sorostm.ro
alioth.pi.net
beatrix.btxgate.de
earth-le1.execpc.com
Bayou.UH.EDU
HOSS.EAC.CC.AZ.US
Kestrel.is.und.ac.za
MarLa.enDirect.qc.ca
Mercury.mcs.com
Mill2.MillComm.COM
Panther.UCIS.Dal.Ca
Pegasus.cc.ucf.edu
TURBO.Kean.EDU
UCS.ORST.EDU
academ01.tam.itesm.mx
aix2.uottawa.ca
alcor.Concordia.CA
alpha2-nf.luton.ac.uk
arad.bgu.ac.il
aristotle.algonet.se
ashur.cc.biu.ac.il
athena.compulink.gr
avalon.sul.com.br
*.u.washington.edu
bengt.algonet.se
*.lm.com
bessel.nando.net
bgsuvax.bgsu.edu
bigtca*.3-cities.com
bluestem.prairienet.org
boardwalk.ecst.csuchico.edu
box.degeer.norrkoping.se
carolina-chat.com
cin*.consumerinfonet.com
citicom.ag1.com
cnct.com
comp.uark.edu
connectnet1.connectnet.com
datastug1.ped.lundbygym.educ.goteborg.se
doorway.evansville.net
dunx1.ocs.drexel.edu
eagle.ais.net
email.california.com
eskimo.com
exec.tscnet.com
expert.cc.purdue.edu
firefly.prairienet.org
grove.ufl.edu
gucis.cit.gu.edu.au
gumby.com
gw.cybalink.com
hasle.sn.no
helios.dmu.ac.uk
huk.a.sn.no
hunker.b4futures.net
hyper.shadow.net
iavbbs.com
ieat3.et.Uni-Magdeburg.DE
igs-gate.cng.on.ca
inde.com
infinity.c2.net
infolink.com.br
io.uwinnipeg.ca
is1.hk.super.net
iserv.datasvar.se
jagor.srce.hr
jove.acs.unt.edu
jupiter.neptune.fr
jupiter.telluric.com
kairos.algonet.se
kirk.dnaco.net
landslide.openix.com
learnet.freenet.hut.fi
legba.unsl.edu.ar
leonis.nus.sg
lnxland1.ccd.cccoes.edu
lux.latrobe.edu.au
mackten.asucla.ucla.edu
mail*
mallard2.duc.auburn.edu
manhattan.thirdwave.net
marikit.iphil.net
mercury.gaianet.net
merlin.si.uqam.ca
miso.wwa.com
msuvx1.memphis.edu
mugca.cc.monash.edu.au
mwr.mwr.is
neptune.uqtr.uquebec.ca
maroon.tc.umn.edu
netcom*.netcom.com
nova.dreamscape.com
novell.capecod.net
ns1.maf.mobile.al.us
ods.ods.net
nkuaxp.nku.edu
olci.com
onyx.valunet.com
orion.it.luc.edu
orion.scasd.k12.pa.us
pacx.com
paul.cclu.lv
piglet.cc.utexas.edu
playpen.com
pluto.njcc.com
prostar.com
diac.com
pulua.hcc.Hawaii.Edu
rainbow.descon.com
ramses.centic.utem.cl
rapidnet.com
real.on.ca
redash.qut.edu.au
rimmer.acs.bolton.ac.uk
sassynet.com
serv1.vossnet.co.uk
shell.flinet.com
shellx.best.com
shrike.depaul.edu
simply.ok.is
sodium.Mlink.NET
soleil.acomp.usf.edu
sophocles.algonet.se
spocyberlink.net
step.mother.com
step.polymtl.ca
storm.stud.ntnu.no
sunspot.tiac.net
talos.spark.net.gr
tao.sans.vuw.ac.nz
terranet.terranet.ab.ca
thetics.europa.com
titan.liunet.edu
twinkle.Generation.NET
unix.gsusa.org
verdi.NMSU.Edu
viper.nauticom.net
vr.virt.net
wally.ipa.net
world-f.std.com
zeus.compulink.gr
*.olinter.com
pewter.ing.unlp.edu.ar
206.116.71.230
talk.nacs.net
addman.rapid.co.uk
207.102.122.244
*.cs.vu.nl
199.170.84.240
200.250.252.191200.250.252.192,
*get-on.net
crash.nildram.co.uk
167.144.36.234
timberwolf.snip.net
phish.nether.net

1
NoChan.file Normal file
View File

@@ -0,0 +1 @@
#kill 1200

14
NoGline.file Normal file
View File

@@ -0,0 +1,14 @@
*quicklink.com
*mountain.superlink.net
*.a.sol.no
*tanzit.cetlink.net
*uoknor.edu
*chatsystems.com
*channels*.undernet.org
*ns1.qnet.com
*.ucdavis.edu
*.nssl.uoknor.edu
*gateway.telecom.ksu.edu
*.ksu.ksu.edu
*karn.wright.edu
*seminole*.wildstar.net

2
NoOper.file Normal file
View File

@@ -0,0 +1,2 @@
*.ro 876294105
freeze@pm2s12.newwave.net 864103174

12
OperChan.file Normal file
View File

@@ -0,0 +1,12 @@
valhalla
uworld.floods
nazi
enforcers
warez
vacilon
vacilon
NickServ
<EFBFBD><EFBFBD>f<EFBFBD><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD>f<EFBFBD><EFBFBD><EFBFBD>ꮧ.
syke
bleat

66
README Normal file
View File

@@ -0,0 +1,66 @@
UNDERNET version of Uworld (Protocol 9) THE OLD FAITHFUL
Written by danny@chatsystems.com <wildthang@undernet.org>
UWORLD DISTRIBUTION SITE: www.chatsystems.com/docs/uworld.html
Look at www.chatsystems.com and add a FREE chatroom to your WWW site!!!
VERY IMPORTANT INFORMATION ABOUT UWORLD READ THIS CAREFULLY!!!
#########################################################################
RESTRICTIONS:
This is NOT public domain code. You are not to redistribute this code.
The only approved site to obtain this code from is the site listed above:
www.chatsystems.com/docs/uworld.html ALL code in this distribution is
copyright by Internet Chat Systems, Inc. (even if it is OLD speghetti code)
NOTE: This code was hacked/thrown together over about 7 years of
tossing ideas around, learning more about C, and is quite honestly
NOT something I would dare to consider professional quality code. This
code was mainly never distributed because I consider it somewhat embarassing
to read through. You are welcome to use this code to help learn things,
and you are welcome to use it on your own IRC network, however please give
credit where credit is due, do not redistribute the code. have your friends
obtain the code from the Uworld distribution site listed above.
DISCLAIMER:
I make no promises about anything associated with this code, and do not
plan on supporting this in any way. It has been used previously on
OSF1, IRIX4.5, and BSDI. It also atleast compiles under FreeBSD. Quite
simply, no warranties, no garuntees, no support. This is OLD (extremely
old) code. This code is distributed AS IS, with no support what so ever.
I apologize for the lack of documentation or instructions. I had not intended
to actually ever publicize this code, however numerous people have shown lots
of interest in obtaining it, so after recent events, I decided what the heck,
its not doing me any good sitting there doing nothing, if it helps someone
else on the network, then as long as they read the blurb about chatsystems
on our distribution site, why not give it out.
OFFER:
If you are interested in a more professionally designed version of Uworld
(version 3) which is P10, that has been used on the Undernet IRC network,
please send me a note danny@chatsystems.com and we can discuss licensing a
BINARY version of Uworld.v3
##########################################################################
This is the original P9 Uworld used by Undernet for several years. Undernet
was the first network to allow operators special abilities to help thier users.
The name Uworld actually came from UnderWorld.uoknor.edu which was the first
version of operator services that was later just called Uworld when we became
what is now called Undernet. There have been numerous immitations on the
network and it is very flattering that my ideas and the ideas of Undernet have
been picked up and such by others to the point that having a Uworld on the
network is almost considered a tradition.
Feel free to send me email about this or other chat network related services.
Internet Chat Systems (at the time of this writing) currently maintains the
Undernet Channel Services (X/W), the Undernet P10 Uworld (Uworld.v3), and the
RCSD chatserver (which supports HTML, IRC, and direct Telnet connections). We
are about to release the new version of X/W and soon will be looking at adding
new and exciting modules to the RCSD chatserver to improve chat network add on
services. Internet Chat Systems, Chat Network services are professionally
coded top of the line services (NOT like this uworld source that you have here)
Please let us know if we can be of service to you or your chat network.

85
Shosts.file Normal file
View File

@@ -0,0 +1,85 @@
*dial*
*ppp*
*modem*
antietam.nssl.uoknor.edu
*annex*
port*
pool*
slip*
ip*
max*.com
cust*.max*
*caribe.net
*.necleus.com
pc*.net
pc*.com
*.mwmicro.com
m*.lakeheadu.ca
ts*-*.*
ptp*.pig.net
s*-pm*-*
dyn*
*.boi.micron.net
as*-*.*
access*.abacom.com
*.highnet.co.at
*.onlink.net
node*
engine*.omnes.net
*dcn.davis.ca.us
*.cybernaute.com
eagle*.villagenet.com
d*.sonic.net
dlp*.center.eri.net
vav*.netaccess.on.ca
dol*.dol.net
*.acs.bolton.ac.uk
*.jaring.my
*.jovenet.fr
*.concentric.net
*.sojourn.net
*.compuserve.com
*.cwconnect.ca
*.telepac.pt
*.sat.texas.net
*.pcola.gulf.net
*.pi.net
*.compusmart.ab.ca
*.netvision.net.il
line*
*.accessus.net
xyp*.ltec.net
nts*.calstatela.edu
xy*port*.k12.ca.us
pc-*.ccfne.ns.ca
*.idt.net
dyn*.win.mnsi.net
col-*.erols.com
term*.jamstore.de
eburguser*.ncw.net
pc*.itpoint.org.uk
*max*.earthlink.net
ind*.iquest.net
*.ix.netcom.com
*.wchat.on.ca
caribe*.caribe.net
ivyland*.voicenet.com
*.direct.ca
*.xl.ca
*.li.net
pa*dsp*.orf.infi.net
ip*.interramp.com
usr*ip*
wthf*.gate.net
*gnn.com
*.i-link.net
*.vistech.net
pm*
castles*.castles.com
ras*.stic.net
info*.jet.es
apm*.realtime.net
as*.sci.net.mx
host*.rochelle.net
anc*.artic.net
agtd*.cadvision.com

11
admin.list Normal file
View File

@@ -0,0 +1,11 @@
Vienna.AT.EU.UnderNet.org lorenz@olymp.wu-wien.ac.at
austin.tx.us.undernet.org zitz@ccwf.cc.utexas.edu
Chicago.IL.US.Undernet.org irc@misha.net
davis.ca.us.undernet.org cmlambertus@ucdavis.edu
washington-1.dc.us.undernet.org enger@seka.reston.ans.net
washington.dc.us.undernet.org irc@aol.net
SanJose.CA.US.Undernet.Org dholmes@rahul.net
Oxford.UK.EU.UnderNet.Org oxowl@owlnest.demon.co.uk
montreal.qu.ca.undernet.org undernet@step.polymtl.ca
Rochester.MI.US.Undernet.org jeff@oakland.edu
Amsterdam.NL.EU.undernet.org cpbaltus@cs.vu.nl

100
banlist.c Normal file
View File

@@ -0,0 +1,100 @@
#include <stdio.h>
#include <string.h>
#include <time_t>
extern int sevsck;
struct aBan {
struct aBan *next;
char channel[255];
char mask[150];
char who[10];
time_t timeout;
};
struct *banlist=NULL;
int addban(char *who,char *mask,char *channel,time_t timeout)
{
struct aBan *tmpban;
char outputbuf[512];
tmpban=(struct aBan *) malloc(sizeof(struct aBan));
strcpy(tmpban->mask,mask);
strcpy(tmpban->who,who);
strcpy(tmpban->channel,channel);
tmpban->timeout = timeout;
tmpban->next=bansist;
banlist=tmpban;
sprintf(outputbuf,":chansvr MODE %s +b %s\n",tmpban->channel,tmpban->mask);
writeln(sevsck,outputbuf);
return 1;
}
int remove_ban(char *mask)
{ struct aBan *tmpban,*tmp2ban;
char outputbuf[512];
tmp2ban=banlist;
if(tmp2ban == NULL) return;
if(!strcasecmp(banlist->mask,mask))
{ banlist=banlist->next;
free(tmp2ban);
return 1;
}
tmpban = banlist->next;
while(tmpban != NULL)
{ if( !strcasecmp(tmpban->mask,mask))
{ tmp2ban->next=tmpban->next;
sprintf(outputbuf,":Chansvr MODE %s -b %s\n",tmpban->channel,
tmpban->mask);
writeln(sevsck,outputbuf);
free(tmpban);
return 1;
}
tmp2ban=tmpban;
tmpban=tmpban->next;
}
}
int timeout_ban()
{ struct aBan *tmpban,*tmp2ban;
char outputbuf[512];
tmp2ban=banlist;
if((tmp2ban == NULL) || (tmp2ban->next == NULL)) return;
/* if((banlist->timeout > 0) && (banlist->timeout < NOWTIME))
** { banlist=banlist->next;
** free(tmp2ban);
** return 1;
** }
*/
tmpban = banlist->next;
while(tmpban != NULL)
{ if((tmpban->timeout > 0) && (tmpban->timeout < NOWTIME))
{ tmp2ban->next=tmpban->next;
sprintf(outputbuf,":Chansvr MODE %s -b %s\n",tmpban->channel,
tmpban->mask);
writeln(sevsck,outputbuf);
free(tmpban);
tmpban=tmp2ban->next;
continue;
/* return 1;
*/
}
tmp2ban=tmpban;
tmpban=tmpban->next;
}
}

10
checkuworld Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
if (ps augxw | grep -i uworld | grep -v grep > /dev/null)
then
sleep 0
else
echo "* Uworld server started at" >> /ecn/ecnstf0/danny/dvmitche/uworld/uworldcronlog
date >> /ecn/ecnstf0/danny/dvmitche/uworld/uworldcronlog
/ecn/ecnstf0/danny/dvmitche/uworld/uworld > /dev/null &
exit 0
fi

310
clones.h Normal file
View File

@@ -0,0 +1,310 @@
/* this is the configuration file for the TSC/CLN anticlone program.
** Note that it scans multi-hosts FIRST and then goes to scan single hosts
** this is because there are fewer multihosts than there are single hosts.
*/
/* ANY host matching a mask listed here will automatically
** be GLINED if abusing the network.
*/
char *glinehost[]={
"*.telepac.pt","*.ms.uu.net","*.jaring.my","*.telepost.no",
"" };
char *kloneuser[]={"*Jobee","*klone","*kl0ne","*clone","clone*","user",
"*wassupfoo","*Jonnieboy","tORnfLESh","l33t",""};
/* Any host in this file will be reported as a CLONE if
** there are more than 3 connections from this site.
*/
char *singlehost[]={
"*dial*","*ppp*","*modem*", /* Standard MODEM dialups */
"antietam.nssl.uoknor.edu", /* TESTING HOST */
"*annex*",
"port*",
"pool*",
"slip*",
"ip*",
"max*.com",
"cust*.max*",
"*caribe.net",
"*.necleus.com",
"pc*.net",
"pc*.com",
"*.mwmicro.com",
"m*.lakeheadu.ca",
"ts*-*.*",
"ptp*.pig.net",
"s*-pm*-*",
"dyn*",
"*.boi.micron.net",
"as*-*.*",
"access*.abacom.com",
"*.highnet.co.at",
"*.onlink.net",
"node*",
"engine*.omnes.net",
"*dcn.davis.ca.us",
"*.cybernaute.com",
"eagle*.villagenet.com",
"d*.sonic.net",
"dlp*.center.eri.net",
"vav*.netaccess.on.ca",
"dol*.dol.net",
"*.acs.bolton.ac.uk",
"*.jaring.my",
"*.jovenet.fr",
"*.concentric.net",
"*.sojourn.net",
"*.compuserve.com",
"*.cwconnect.ca",
"*.telepac.pt",
"*.sat.texas.net",
"*.pcola.gulf.net",
"*.pi.net",
"*.compusmart.ab.ca",
"*.netvision.net.il",
"line*",
"*.accessus.net",
"xyp*.ltec.net",
"nts*.calstatela.edu",
"xy*port*.k12.ca.us",
"pc-*.ccfne.ns.ca",
"*.idt.net",
"dyn*.win.mnsi.net",
"col-*.erols.com",
"term*.jamstore.de",
"eburguser*.ncw.net",
"pc*.itpoint.org.uk",
"*max*.earthlink.net",
"ind*.iquest.net",
"*.ix.netcom.com", /* Netcom dialup lines */
"*.wchat.on.ca",
"caribe*.caribe.net",
"ivyland*.voicenet.com",
"*.direct.ca",
"*.xl.ca",
"*.li.net",
"pa*dsp*.orf.infi.net",
"ip*.interramp.com",
"usr*ip*",
"wthf*.gate.net",
"*gnn.com",
"*.i-link.net",
"*.vistech.net",
"pm*",
"castles*.castles.com",
"ras*.stic.net",
"info*.jet.es",
"apm*.realtime.net",
"as*.sci.net.mx",
"host*.rochelle.net",
"anc*.artic.net",
"agtd*.cadvision.com",
"" };
/* Any multiple connections from the below domains will
** be ignored by the clone scanner
*/
char *multihost[]={
"*.wildstar.net","*.wildstar.com",
"*irc.crystalball.com",
"osf1.gmu.edu",
"mail1.i1.net",
"net30.nucleus.com",
"Securit.nsuok.edu",
"ibm*.ensicaen.ismra.fr",
"foonix.foonet.net",
"zart.spiretech.com",
"jitter.rahul.net",
"chat.eskimo.com",
"phish.nether.net",
"*pipeline.com",
"gateway.telecom.ksu.edu",
"falcon.cc.ukans.edu",
"falcon.lhup.edu",
"taisun1.tamuk.edu",
"*.worldone.com",
"Serve.org",
"*.YFN.EDU",
"*.YSU.EDU",
"SecurIt.nsuok.edu",
"undernet.org",
"bbs.*",
"freenet.*",
"*.ksu.ksu.edu",
"irc.crystalball.com",
"infinity.c2.org",
"*.teleport.com",
"*.cns.hp.com",
"*.ucdavis.edu",
"karn.wright.edu",
"*.hp.com",
"200.20.157.*",
"bouncer.gnn.com",
"user1.iswest.com",
"ra1.randomc.com",
"*.sorostm.ro",
"alioth.pi.net",
"beatrix.btxgate.de",
"earth-le1.execpc.com",
"Bayou.UH.EDU",
"HOSS.EAC.CC.AZ.US",
"Kestrel.is.und.ac.za",
"MarLa.enDirect.qc.ca",
"Mercury.mcs.com",
"Mill2.MillComm.COM",
"Panther.UCIS.Dal.Ca",
"Pegasus.cc.ucf.edu",
"TURBO.Kean.EDU",
"UCS.ORST.EDU",
"academ01.tam.itesm.mx",
"aix2.uottawa.ca",
"alcor.Concordia.CA",
"alpha2-nf.luton.ac.uk",
"arad.bgu.ac.il",
"aristotle.algonet.se",
"ashur.cc.biu.ac.il",
"athena.compulink.gr",
"avalon.sul.com.br",
"*.u.washington.edu",
"bengt.algonet.se",
"*.lm.com",
"bessel.nando.net",
"bgsuvax.bgsu.edu",
"bigtca*.3-cities.com",
"bluestem.prairienet.org",
"boardwalk.ecst.csuchico.edu",
"box.degeer.norrkoping.se",
"carolina-chat.com",
"cin*.consumerinfonet.com",
"citicom.ag1.com",
"cnct.com",
"comp.uark.edu",
"connectnet1.connectnet.com",
"datastug1.ped.lundbygym.educ.goteborg.se",
"doorway.evansville.net",
/* "drake.cnu.edu",
*/
"dunx1.ocs.drexel.edu",
"eagle.ais.net",
"email.california.com",
"eskimo.com",
"exec.tscnet.com",
"expert.cc.purdue.edu",
"firefly.prairienet.org",
"grove.ufl.edu",
"gucis.cit.gu.edu.au",
"gumby.com",
"gw.cybalink.com",
"hasle.sn.no",
"helios.dmu.ac.uk",
"huk.a.sn.no",
"hunker.b4futures.net",
"hyper.shadow.net",
"iavbbs.com",
"ieat3.et.Uni-Magdeburg.DE",
"igs-gate.cng.on.ca",
"inde.com",
"infinity.c2.net",
"infolink.com.br",
"io.uwinnipeg.ca",
"is1.hk.super.net",
"iserv.datasvar.se",
"jagor.srce.hr",
"jove.acs.unt.edu",
"jupiter.neptune.fr",
"jupiter.telluric.com",
"kairos.algonet.se",
"kirk.dnaco.net",
"landslide.openix.com",
"learnet.freenet.hut.fi",
"legba.unsl.edu.ar",
"leonis.nus.sg",
"lnxland1.ccd.cccoes.edu",
"lux.latrobe.edu.au",
"mackten.asucla.ucla.edu",
"mail*",
"mallard2.duc.auburn.edu",
"manhattan.thirdwave.net",
"marikit.iphil.net",
"mercury.gaianet.net",
"merlin.si.uqam.ca",
"miso.wwa.com",
"msuvx1.memphis.edu",
"mugca.cc.monash.edu.au",
"mwr.mwr.is",
"neptune.uqtr.uquebec.ca",
"maroon.tc.umn.edu",
"netcom*.netcom.com",
"nova.dreamscape.com",
"novell.capecod.net",
"ns1.maf.mobile.al.us",
"ods.ods.net",
"nkuaxp.nku.edu",
"olci.com",
"onyx.valunet.com",
"orion.it.luc.edu",
"orion.scasd.k12.pa.us",
"pacx.com",
"paul.cclu.lv",
"piglet.cc.utexas.edu",
"playpen.com",
"pluto.njcc.com",
"prostar.com",
"diac.com",
"pulua.hcc.Hawaii.Edu",
"rainbow.descon.com",
"ramses.centic.utem.cl",
"rapidnet.com",
"real.on.ca",
"redash.qut.edu.au",
"rimmer.acs.bolton.ac.uk",
"sassynet.com",
"serv1.vossnet.co.uk",
"shell.flinet.com",
"shellx.best.com",
"shrike.depaul.edu",
"simply.ok.is",
"sodium.Mlink.NET",
"soleil.acomp.usf.edu",
"sophocles.algonet.se",
"spocyberlink.net",
"step.mother.com",
"step.polymtl.ca",
"storm.stud.ntnu.no",
"sunspot.tiac.net",
"talos.spark.net.gr",
"tao.sans.vuw.ac.nz",
"terranet.terranet.ab.ca",
"thetics.europa.com",
"titan.liunet.edu",
"twinkle.Generation.NET",
"unix.gsusa.org",
"verdi.NMSU.Edu",
"viper.nauticom.net",
"vr.virt.net",
"wally.ipa.net",
"world-f.std.com",
"zeus.compulink.gr",
"*.olinter.com",
"pewter.ing.unlp.edu.ar",
"206.116.71.230",
"talk.nacs.net",
"addman.rapid.co.uk",
"207.102.122.244",
"*.cs.vu.nl",
"199.170.84.240",
"200.250.252.191","200.250.252.192",
"*get-on.net",
"crash.nildram.co.uk",
"167.144.36.234",
"timberwolf.snip.net",
"phish.nether.net",
"" };

143
config.h Executable file
View File

@@ -0,0 +1,143 @@
#include <time.h>
/* USE_TSC enables the code that handles the TSC processing
*/
#define USE_TSC
#define GLINEFILE "Gline.file"
#define OPERCHANFILE "OperChan.file"
#define KILLCHANFILE "KillChan.file"
#define MAXGLINES 500
#define CHANSUSPENDFILE "NoChan.file"
#define SUSPENDFILE "NoOper.file"
#define USE_DCC
#define CMDHISTORY 15
#define MAXSUSPENDOPER 20
#define MAXCLIENTS 200
#define EGLINEFILE "NoGline.file"
#define AGLINEFILE "AGLhosts.file"
#define MHOSTFILE "Mhosts.file"
#define SHOSTFILE "Shosts.file"
#define MAXNOGLINES 100
#define MAXMHOST 200
#define MAXGLINEHOST 100
#define JUPE_CHANSERVICE
#define JUPE_BUGS
#define FLUDFILE "FLUD.log"
#define VERSION "Uworld2 -- the second calling -- v2.0+wild"
#define MYSERVER "198.245.27.2"
/*#define UPLINK "okc.ok.us.undernet.org"/* */
#define MYHOST "confusion.decade.net" /* */
#define SERVERNAME "Uworld.undernet.org"
#define SERVERINFO "Undernet Special Services Central Cordinator"
#define BOTNAME "Uworld"
#define BOTINFO "Uworld Version 2 :The channel saving bot"
#define DEFAULTPORT 4400
#define PASSWORD "hacker"
#define USERFILE "user.file"
#define PROTFILE "uworld.conf"
#define LOGFILE "Uworld.log"
#define FLOODFILE "Flood.log"
#define KILLFILE "kill.log"
#define HELPFILE "uworldhelp"
#define HELPBOT "UShelper"
#define OPERCHANNEL "uworld.floods"
#define MAXOPERCHAN 30
#define WASTEDUMP
#ifdef USE_DCC
#define S_ACTIVE 1
#define S_FREE 0
#define S_CLOSING -1
#endif
/*#define CLONE_REPORT "define this to do clonebot processing" /* */
/* REPORT_BADNICK -- reports user nicknames that are possible bots
** or clones.
*/
#undef REPORT_BADNICK
#define HELPBOTINFO "helpbot undernet.org Uworld.undernet.org :IRC HELP /msg <botname> help <COMMAND> "
#define USHELP "Help_US"
#define USHELPINFO "helpbot undernet.org Uworld.undernet.org :/msg <botname> <command>"
#define IRCHELP "ircIIhelp"
#define NICKSERV "NickServ"
#define NICKSERVINFO "Nickserv undernet.org Uworld.undernet.org :The nick machine"
#define CHANSVR "ChanSvr"
#define CHANSVRINFO "chansvr undernet.org Uworld.undernet.org :The channel saving bot"
#define HELPPATH "HELP"
#define DEFAULT_LEVEL 0
#define DEBUG 0
#define NOHELP 0 /* undefine this if you want the help services online */
#undef MAIL_GLINE
#define TSC_CHAN "Uworld.clones"
#define OPEROK -2
#define GLINE -5
#define RGLINE -6
#define ASSHOLE -15
#define KILL -20
#define KTEL -10
#define AUTO_BAN -25
#define CLEARCHAN 10
#define CLEAROPS 11
#define CLEARBANS 12
#define CLEARMODE 13
#define KILTEL 15
#define OPCOM 20
#define SCAN 21
#define AUTO_BAN_OPER 25
#define AUTO_UNBAN_OPER 26
#define AUTO_GLINE 27
#define AUTO_UNGLINE 28
#define SHOW_HOSTS 29
#define OPER 100
#define NOOPER -4
#define MAXUSERS 4000
#define TIMER 768845314
#define MINCHARS 6
#define MAXBUFSIZE 4096
/*#define MAXBUFSIZE 1024
**#define INPUTBUFFERSIZE 200000
**#define INPUTBUFFERSIZE 200000
*/
#define MAXFLOODHISTORY 20
#define MSGFLOOD 10
#define FLOODTIME 60
#undef FLOOD_BYHOST
struct aFloodProtect {
struct aFloodProtect *next;
struct aFloodProtect *prev;
char *hostname;
char *cmd;
int msgs;
int glined;
unsigned long reset;
};
#ifdef USE_DCC
struct aDccClient {
int fd;
int status;
char name[10];
char hostname[100];
char passwd[10];
time_t lasttime;
int umode;
};
#endif
#define DCC_ANY (1 << 0)
#define DCC_WALLOPS (1 << 1)
#define DCC_GLN (1 << 2)
#define DCC_TSC (1 << 3)
#define DCC_COMMAND (1 << 4)
#define DCC_MMG (1 << 5)
#define DCC_WALL (1 << 6)
#define USERMODES "catgwml"
#define DCC_DEFAULT (DCC_ANY | DCC_WALLOPS)

148
daemon.c Normal file
View File

@@ -0,0 +1,148 @@
#undef OSF1
/*
** This code written by danny@wildstar.net <-- wildThang -->
** You are free to use this code under the stipulation that it
** is not used to design any sort of clone/flood, or otherwise harassing
** type of application. I wrote this quickly and tried to keep it as
** basic as i could think up but enough to keep it interesting.
** Use it to LEARN! let me know if you have questions about it.
** -- this notice must remain in all code based on this code.
*/
/* DAEMON.C
This file handles moving program into the background.
and it also contains the routine needed to establish a port
in case of wanting to have it listne to a port as well
*/
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <netdb.h>
#include <time.h>
#include <ctype.h>
/*#ifdef SIGTSTP */
#include <sys/ioctl.h>
#include <sys/file.h>
/*#endif */
#include <sys/param.h>
#include <stdio.h>
#include <errno.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#include <signal.h>
#include "config.h"
handle_kids()
{int pid;
#ifdef OSF1
union wait *status;
while( (pid = wait3(status,WNOHANG, (struct rusage *)0)) > 0) { }
#else
/* union wait status;
*/
int status;
while( (pid = wait3(&status,WNOHANG, (struct rusage *)0)) > 0) { }
#endif /* OSF1 */
}
/* this function releases tty conrol and moves program into background */
goto_bg()
{
register int child,fd;
close(0); close(1); close(2);
if(getppid() == 1) goto out;
#ifdef SIGTTOU
signal(SIGTTOU,SIG_IGN);
#endif
#ifdef SIGTTIN
signal(SIGTTIN,SIG_IGN);
#endif
#ifdef SIGTSTP
signal(SIGTSTP,SIG_IGN);
#endif
if( (child =fork()) < 0)
perror("fork");
else if (child > 0)
exit(0);
#ifdef SIGTSTP
if (setpgrp(0,getpid()) == -1)
perror("SETGROUP");
if( (fd = open("/dev/tty",O_RDWR)) >= 0) {
ioctl(fd, TIOCNOTTY, (char *)NULL);
close(fd);
}
#else
if(setpgrp() == -1)
perror("set group");
signal(SIGHUP,SIG_IGN);
if( (child = fork()) < 0)
perror("cant fork");
else if (child > 0)
exit(0);
#endif
out:
for(fd=0;fd<NOFILE;fd++)
close(fd);
errno = 0;
#ifdef SIGTSTP
/*
signal(SIGCLD, handle_kids);
*/
#else
signal(SIGCLD, SIG_IGN);
#endif
}
/* this routine connects, binds, and listens to a port number */
int get_port(portnum)
int portnum;
{ int sock,l;
int opt = 1;
static struct sockaddr_in server;
sock = socket(AF_INET,SOCK_STREAM, 0);
if(sock < 0) exit(-1);
#ifdef SO_REUSEADDR
if(setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&opt,sizeof(opt)) < 0)
exit(-1);
#endif
server.sin_family = AF_INET;
server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons(portnum);
for(l=0;l<10;l++)
{ if(bind(sock, (struct sockaddr *) &server, sizeof(server)))
{ if(l > 9) exit(-1);
;
}
else break;
}
listen(sock,3);
return(sock);
}

64
debug.h Normal file
View File

@@ -0,0 +1,64 @@
/***********************************************************/
/* Telnet3d (the single process telnet service) written by
/* <WildThang> (dvmitche@nssl.uoknor.edu) ALL RIGHTS RESERVED.
/*
/* Duplication of this code is not permitted without explicit
/* aproval from the authors (dvmitche@nssl.uoknor.edu) in whole
/* or in parts.
/*
/* This project was designed to be used on UNDERNET IRC ONLY.
/* No exceptions to this without explicit permission from the
/* authors (dvmitche@nssl.uoknor.edu)
/*
/* Special Thanks for your ideas and support with this project.
/* go out to:
/* mandar@vinson.ecn.uoknor.edu
/*
/* NOTE: dvmitche@nssl.uoknor.edu is now danny@chatsystems.com
/*************************************************************/
/*#define DEBUG D_ALL /* */
FILE *debug_log;
#define DEBUG_LOGFILE "/tmp/debug.log"
#ifdef DEBUG
#define D_ALL (1 << 0)
#define D_WARNING (1 << 1)
#define D_ERROR (1 << 2)
#define D_FILE (1 << 3)
#define D_ERRNO (1 << 4)
#define D_MEMORY (1 << 5)
#define D_TRACE (1 << 6)
#define D_SOCKET (1 << 7)
#define D_INPUT (1 << 8)
#define D_KLINE (1 << 9)
#define D_NICKLIST (1 << 10)
#define D_BUFFER (1 << 11)
#define D_CHANLIST (1 << 12)
#endif
/******************************************************************/
/* SPECIAL THANKS to Robin Thelland (intru@hamming.info.polymtl.ca)
/* for his input and ideas in improving the debug functions
/******************************************************************/
#ifdef DEBUG
#define my_debug(X,Y) if((DEBUG == D_ALL) || (DEBUG & X)) \
{ if(debug_log != NULL) { \
fprintf(debug_log,"[%s:%d] ",__FILE__,__LINE__); \
fprintf Y; fprintf(debug_log,"\n"); fflush(debug_log); \
} \
}
#else
# define my_debug(X,Y)
#endif
#ifdef DEBUG
#define my_dump(X,Y) if(DUMPLOG == D_ALL) \
{ if(dump_log != NULL) { \
fprintf Y; fprintf(dump_log,"\n"); fflush(dump_log); \
} \
}
#else
# define my_debug(X,Y)
#endif

1340
file.c Executable file

File diff suppressed because it is too large Load Diff

131
helpservice.c Executable file
View File

@@ -0,0 +1,131 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "config.h"
extern char *token[],buf[];
extern int sevsck,botsck;
do_ushelp(int sck)
{int j,k,l;
char filename[512];
k=chk_num(0);
if(k > 10) return 0;
*token[0]++;
if (k > 3) {
*token[3]++;
strcpy(filename,HELPPATH);
if(k==4) {
if(!match(token[3],"ON")) {
strcat(filename,"/ON/ON");
catfile(filename,USHELP);
return;
}
else if(!strcmp(token[3],"?")) {
strcat(filename,"/helplist");
catfile(filename,USHELP);
return;
}
else if(!match(token[3],"ALAIS")) {
strcat(filename,"/ALIAS/ALIAS");
catfile(filename,USHELP);
return;
}
else if(!match(token[3],"FAQ")) {
strcat(filename,"/FAQ/FAQ");
catfile(filename,USHELP);
return;
}
}
for(j=3;j<k;j++) {
strcat(filename,"/");
strcat(filename,token[j]);
}
for(l=0;l<strlen(filename);l++) filename[l] = toupper(filename[l]);
catfile(filename,USHELP);
}
else if(!match(token[3],":help")) {
strcpy(filename,"HELP/helplist");
catfile(filename,USHELP);
}
}
do_helpirc(int sck)
{int j,k,l;
char filename[180];
k=chk_num(0);
*token[0]++;
if(k > 10) { sprintf(filename,"%s/JOIN",HELPPATH);
return; }
if (k > 3) {
*token[3]++;
strcpy(filename,HELPPATH);
if(k==4) {
if(!match(token[3],"ON")) {
strcat(filename,"/ON/ON");
catfile(filename,IRCHELP);
return;
}
else if(!strcmp(token[3],"?")) {
strcat(filename,"/helplist");
catfile(filename,IRCHELP);
return;
}
else if(!match(token[3],"ALAIS")) {
strcat(filename,"/ALIAS/ALIAS");
catfile(filename,IRCHELP);
return;
}
else if(!match(token[3],"FAQ")) {
strcat(filename,"/FAQ/FAQ");
catfile(filename,USHELP);
return;
}
}
for(j=3;j<k;j++) {
strcat(filename,"/");
if((strlen(filename)+strlen(token[j])) > 500) return;
strcat(filename,token[j]);
if((strchr(filename,';')) || (strchr(filename,'|')))
return;
}
for(l=0;l<strlen(filename);l++) filename[l] = toupper(filename[l]);
catfile(filename,IRCHELP);
}
else if(!match(token[3],":help")) {
strcpy(filename,"HELP/helplist");
catfile(filename,IRCHELP);
}
}
do_helpem(int sck)
{int j,k,l;
char filename[180];
k=chk_num(0);
*token[0]++;
if ((k > 4) && (!match(token[3],":help"))) {
strcpy(filename,"HELP/");
if(k=5)
if(!match(token[4],"ON")) strcpy(filename,"ON/ON");
else if(!match(token[4],"ALAIS")) strcpy(filename,"ALIAS/ALIAS");
else if(!match(token[4],"FAQ")) strcpy(filename,"FAQ/FAQ");
else strcat(filename,token[4]);
printf("filename for help -- %s\n",filename);
for(l=0;l<strlen(filename);l++) filename[l] = toupper(filename[l]);
catfile(filename,HELPBOT);
}
else if(!match(token[3],":help")) {
strcpy(filename,"HELP/helplist");
catfile(filename,HELPBOT);
}
}

13
logsrv/Makefile Executable file
View File

@@ -0,0 +1,13 @@
LIBS = -ltermcap
CC = cc
CFLAGS = -g
OBJECTS = client.o socket.o
SOURCES = client.c socket.c
.c.o:
${CC} ${CFLAGS} -c $<
client: ${OBJECTS}
${CC} ${CFLAGS} -o dataservd ${OBJECTS} ${LIBS}

8
logsrv/autostart Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/csh
cd /ecn/ecnstf0/irc/misc/dataserv
while(1)
if(-r core) then
rm core
dataservd
endif
end

295
logsrv/client.c Normal file
View File

@@ -0,0 +1,295 @@
/*
WILDTHANG DATA SERVER VERSION 1.0
WildThang is dvmitche@midway.ecn.uoknor.edu
Please note that due to the nature of this program
I have not opted to comment the code. I have done this for
Various reasons!
*/
/* do you REALLY think we need ALL of these *grin* */
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <netdb.h>
#include <time.h>
#include <ctype.h>
#include <arpa/inet.h>
#include <termios.h>
#ifdef SIGTSTP
#include <sys/ioctl.h>
#include <sys/file.h>
#endif
#include <sys/param.h>
#include <stdio.h>
#include <errno.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#include <signal.h>
#include "config.h"
int PORTNUM = PORT,newsockfd,level;
int NUMUSERS=0; /* counter of users logged in */
int REFPROCESS=0;
char buf[512],*hostname;
char *Serv;
char tempp[512];
char sockbuf[512],*sptr;
char loginname[20];
extern char *linetok[]; /* from socketc. */
extern int USEIDENT; /* from socket.c */
extern char *get_server(char *fromhost); /* from socket.c */
/* WARNING:THIS MUST NOT BE CHANGED... ELSE STRANGE THINGS SEEM TO HAPPEN */
#define SOCKLINK 9219423
#define VERSION "TELCLIENT_1.8"
void handle_kids()
{int pid;
#ifdef OSF1
union wait *status;
status = (union wait *)malloc(sizeof(long));
while( (pid = wait3(status,WNOHANG, (struct rusage *)0)) > 0) { }
#else
union wait status;
while( (pid = wait3(&status,WNOHANG, (struct rusage *)0)) > 0) { }
#endif /* OSF1 */
NUMUSERS--;
}
main(argc,argv)
int argc;
char **argv;
{ int m,j,sockfd,insockfd,retlen,retval,outfd,infd,i,route;
struct sockaddr_in sockst,insock;
struct hostent *hp;
int opt=1;
struct sockaddr_in from;
int fromlen;
char hostid[255],hosthld[255];
signal(SIGCLD,handle_kids);
if(BACKGROUND) goto_bg();
if(argc > 1) { /* process command line options */
if(*argv[1] == '-') {
*argv[1]++;
if(*argv[1]=='p')
if(atoi(argv[2])>6000) PORTNUM = atoi(argv[2]);
}
}
if ((sockfd=socket(AF_INET,SOCK_STREAM,0))<0) {
perror("socked");
exit(1);
}
if(!BACKGROUND) printf("GOT SOCKET %d\n",sockfd);
#ifdef SO_REUSEADDR
if (setsockopt(sockfd,SOL_SOCKET, SO_REUSEADDR,&opt,sizeof(opt)) <0)
{ exit(-1); }
#endif
sockst.sin_family=AF_INET;
sockst.sin_addr.s_addr=INADDR_ANY;
sockst.sin_port=htons(PORTNUM);
if ((bind(sockfd,(struct sockaddr *)&sockst,sizeof(sockst)))<0) {
perror("bind");
exit(1);
}
if(!BACKGROUND) printf("BIND SOCKET Complete\n");
if ((listen(sockfd,1))<0) {
perror("listen");
exit(1);
}
if(!BACKGROUND) printf("Listening for connections\n");
while(1)
{ if ((newsockfd=accept(sockfd,(struct sockaddr *) 0,(int *) 0))<0)
{
continue;
/* will receive a sig from dying children */
}
if(!BACKGROUND) printf("GOT CONNECTION %d\n",newsockfd);
if (!fork())
{
close(sockfd);
do_menu(newsockfd);
close(newsockfd);
exit(0);
}
close(newsockfd);
}
}
int bbs_cat(sck,filename)
int sck;
char *filename;
{
FILE *fp;
char *sbuf;
char line[512],command[512];
if ( (fp = fopen(filename,"r")) == NULL)
return 0;
for(; ;) {
if(fgets(line,80,fp) == NULL) { fclose(fp); return 1; }
if(write(sck,line,strlen(line)) != strlen(line)) {
fclose(fp); return 1; }
if(write(sck,"",0) != 0) {
fclose(fp); return 1; }
}
}
int bbs_pcom(sck,command)
int sck;
char *command;
{
FILE *fp;
char *sbuf;
char line[512];
if ( (fp = popen(command,"r")) == NULL)
return 0;
for(; ;) {
if(fgets(line,80,fp) == NULL) { pclose(fp); return 1; }
if(write(sck,line,strlen(line)) != strlen(line)) {
pclose(fp); return 1; }
if(write(sck,"",0) != 0) {
pclose(fp); return 1; }
}
}
int bbs_grep(sck,filename)
int sck;
char *filename;
{
FILE *fp;
int i;
char *sbuf,*token[256];
char line[512],command[512];
strcpy(line,sockbuf);
token[i=0]=strtok(sockbuf," ");
while(token[++i]=strtok(NULL, " ")); token[i]=NULL;
if(i < 1) return 0;
sprintf(command,"%s -i %s %s",GREPCOM,token[0],filename);
bbs_pcom(sck,command);
}
int bbs_tail(sck,filename)
int sck;
char *filename;
{
FILE *fp;
int i;
char *sbuf,*token[256];
char line[512],command[512];
strcpy(line,sockbuf);
token[i=0]=strtok(sockbuf," ");
while(token[++i]=strtok(NULL, " ")); token[i]=NULL;
if(i < 1) return 0;
sprintf(command,"%s -50 %s",TAILCOM,filename);
bbs_pcom(sck,command);
}
goto_bg()
{
register int child,fd;
#ifdef SUN
fclose(stdin); fclose(stdout); fclose(stderr);
#else
close(0); close(1); close(2);
#endif
if(getppid() == 1) goto out;
#ifdef SIGTTOU
signal(SIGTTOU,SIG_IGN);
#endif
#ifdef SIGTTIN
signal(SIGTTIN,SIG_IGN);
#endif
#ifdef SIGTSTP
signal(SIGTSTP,SIG_IGN);
#endif
if( (child =fork()) < 0)
perror("fork");
else if (child > 0)
exit(0);
#ifdef SIGTSTP
if (setpgrp(0,getpid()) == -1)
perror("SETGROUP");
if( (fd = open("/dev/tty",O_RDWR)) >= 0) {
ioctl(fd, TIOCNOTTY, (char *)NULL);
close(fd);
}
#else
if(setpgrp() == -1)
perror("set group");
signal(SIGHUP,SIG_IGN);
if( (child = fork()) < 0)
perror("cant fork");
else if (child > 0)
exit(0);
#endif
out:
for(fd=0;fd<NOFILE;fd++)
close(fd);
errno = 0;
#ifdef SIGTSTP
signal(SIGCLD, handle_kids);
#else
signal(SIGCLD, SIG_IGN);
#endif
}
do_menu(int sckfd)
{
writeln(sckfd," Welcome to WildThang's Uworld Log report Service\n");
writeln(sckfd," ==================================================\n");
writeln(sckfd," please specify the word you wish to search for\n");
writeln(sckfd," from the log database. some special commands are:\n");
writeln(sckfd," ALL -- Displays the entire log file to you\n");
writeln(sckfd," TAIL -- Displays the last 50 lines of the log\n");
writeln(sckfd," KTEL -- Displays the activity of BANNED telusers\n");
writeln(sckfd," KILL -- Displays the activity of KILLS by IRCops\n");
writeln(sckfd," <word> -- scans log file for occurances of 'word'\n");
writeln(sckfd," ==================================================\n");
writeln(sckfd,"\nEnter Choice: (press return when done) :");
readcom(sckfd,10);
if(strlen(sockbuf) < 1){ close(sckfd); exit(0); }
if(!strncasecmp(sockbuf,"tail",4)) bbs_tail(newsockfd,DATAFILE);
else if(!strncasecmp(sockbuf,"all",3)) bbs_cat(newsockfd,DATAFILE);
else bbs_grep(newsockfd,DATAFILE);
}

14
logsrv/com.c Normal file
View File

@@ -0,0 +1,14 @@
#include <stdio.h>
#include "config.h"
extern char *sptr,sockbuf[512];
/* i kept this seperate for ease in adding future commands. */
void bbs_com(sck)
int sck;
{
if(!match(sockbuf,"irc")) irc(sck,0);
else irc(sck,0);
return;
}

26
logsrv/config.h Executable file
View File

@@ -0,0 +1,26 @@
/* SYSTEM SPECIFIC CONFIGURATIONS */
/* ONLY ONE OF THE FOLLOWING MAY BE DEFINED */
#undef ULTRIX /* this should work for most systems */
#define OSF1 /* use this on DEC alpha machines */
#undef NEED_SETENV /* use this if your system doesnt support setenv() */
#define SUN
/* list of servers for client */
/* defualt port all ports must be > 6000 if specified from commandline */
#define PORT 9500
#define DATAFILE "/ecn/ecnstf0/danny/dvmitche/uworld/Uworld.log"
#define GREPCOM "/usr/ucb/grep"
#define TAILCOM "/usr/ucb/tail"
#define MAXLINE 512
#define TRUE 1
#define FALSE 0
#define BACKGROUND 1 /* +-integer for background */
#ifdef SUN
#ifndef NEED_SETENV
#define NEED_SETENV
#endif
#endif

144
logsrv/socket.c Normal file
View File

@@ -0,0 +1,144 @@
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <errno.h>
#include <sys/types.h>
#include <pwd.h>
#include <sys/time.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <signal.h>
#include "config.h"
extern char buf[512];
extern char sockbuf[512],*sptr;
extern int PORTNUM;
extern int level;
char *linetok[256];
int USEIDENT= 0;
int call_socket(hostname,portnum)
char *hostname;
int portnum;
{ struct sockaddr_in sa;
struct hostent *hp;
int a, s;
if((hp=gethostbyname(hostname))==NULL) {
errno=ECONNREFUSED;
return(-1); }
bzero(&sa, sizeof(sa));
bcopy(hp->h_addr, (char *)&sa.sin_addr, hp->h_length);
sa.sin_family = hp->h_addrtype;
sa.sin_port = htons((u_short)portnum);
if((s=socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) return(-1);
if(connect(s,(struct sockaddr *) &sa, sizeof(sa)) < 0) {
close(s);
return(-1); }
return(s);
}
int readln(int sckfd)
{ int i=0,valid=1; char c;
while(valid) {
if(read(sckfd,&c,1)<1) return(0);
if(i<511 && c != '\n') sockbuf[i++]=c; else valid=0; }
sockbuf[i]='\0'; return(1);
}
int writeln(sckfd,outbuf)
int sckfd;
char *outbuf;
{ int to=0;
if(write(sckfd, outbuf, strlen(outbuf)) < to )
return(0);
return(1);
}
int readcom(sck,tout)
int sck;
int tout;
{
int sok;
time_t time_in,time_out;
int dumb = 1;
fd_set readfs;
struct timeval *zimeout;
time_in=time(NULL);
while(1) {
time_out = time(NULL);
if(time_out - time_in > tout) return 0;
FD_ZERO(&readfs);
FD_SET(sck,&readfs);
if(select(FD_SETSIZE, &readfs, NULL, NULL,(dumb ? NULL : zimeout))) {
if(FD_ISSET(sck,&readfs)) {
if(!BACKGROUND) puts("READING REPLY");
sok = readln(sck);
if (sok) {
sptr=sockbuf;
*(sptr+strlen(sockbuf)-1)='\0';
return 1;
} }
}
}
}
int do_auth(hostname,sockfd)
char *hostname;
int sockfd;
{ int authfd,ulen,tlen,lcnt,ct;
struct sockaddr_in sock,us,them;
writeln(sockfd,"Checking your identification\n");
if( (authfd=call_socket(hostname,113)) < 0) /* host not running identd */
{
USEIDENT=0;
sprintf(buf,"[%d] [%s] You should ask your sysadmin to instal identd\n",
authfd,hostname);
writeln(sockfd,buf);
return 0;
}
if(getsockname(sockfd,(struct sockaddr *)&us,&ulen))
{ if(!BACKGROUND) puts("getsockname failed");
USEIDENT=0;
return 0;
}
if(getpeername(sockfd,(struct sockaddr *)&them,&tlen))
{ if(!BACKGROUND) puts("getpeername failed");
USEIDENT=0;
return 0;
}
sprintf(buf,"%u,%u \r\n",
(unsigned int) ntohs(them.sin_port),
(unsigned int) PORTNUM);
writeln(authfd,buf);
writeln(sockfd,"CHECKING IDENTD\n");
readcom(authfd,15);
if(!BACKGROUND) puts(sockbuf);
linetok[lcnt=0]=strtok(sockbuf," ");
while(linetok[++lcnt]=strtok(NULL, " ")); linetok[lcnt]=NULL;
if((lcnt > 7) && (!strcmp(linetok[4],"USERID")))
{ USEIDENT = 1;
sprintf(buf,"Greetings %s@%s, Welcome to our system\n",linetok[8],
hostname);
writeln(sockfd,buf);
if(!BACKGROUND)
{ printf("GOT IT %s %d\n",linetok[8],lcnt);
}
}
else USEIDENT = 0;
close(authfd);
}

125
map.c Normal file
View File

@@ -0,0 +1,125 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <malloc.h>
struct aServer {
struct aServer *next;
struct aServer *down;
char *name;
};
struct aServData {
int count;
int list;
};
struct aServer *MYuplink=NULL;
struct aServData ServerData;
int LinkServer(char *server, char *uplink)
{
struct aServer *ServerID;
ServerID=newserver();
ServerID->name=strdup(server);
if(MYuplink==NULL)
{ MYuplink=ServerID;
ServerData.list=1;
return 1;
}
return (AddServer(ServerID,uplink,&MYuplink));
}
struct aServer *newserver()
{ struct aServer *newserver;
newserver= (struct aServer *) calloc(1,sizeof(struct aServer));
ServerData.count++;
return newserver;
}
int AddServer(struct aServer *newserver,char *uplink,struct aServer **Startid)
{
struct aServer **UplinkID;
struct aServer *ServerID;
Uplinkid=FindServer(uplink,Startid);
if(Uplinkid == NULL) return 0; /* ERROR HERE */
ServerID= *Uplinkid;
/* This is a DOWNLINK of the said server..
** Downlinks go DOWN ->next -> next -> next ...
*/
if( ServerID->down == NULL)
{ ServerID->down = newserver;
ServerData.list++;
return 1;
}
ServerID=Serverid->down;
while(ServerID->next !=NULL) ServerID=ServerID->next;
ServerID->next=newserver;
ServerData.list++;
return 1;
}
struct aServer **FindServer(char *name,struct aServer **Startid)
{
struct aServer *SearchID;
struct aServer **ServerID;
if(!StartID ) return NULL;
SearchID= *Startid;
if(!strcasecmp(name,StartID->name)) return Startid;
/* This is not the server we are looking for */
** First scan NEXT as far as we can... Then try Down
** We are not modifying the information in the structures
** in this calls
*/
if( (ServerID=FindServer(name,&(SearchID->next))) != NULL) return ServerID;
if( (ServerID=FindServer(name,&(SearchID->down))) != NULL) return ServerID;
return NULL;
}
void dumpsubmap(struct aServer *server)
{
static char prefix[80]="";
static int offset=0;
char localbuf[512];
if(server==NULL)
return;
if(server->next==NULL)
{ sprintf(localbuf,"PRIVMSG WildThang :%s`-%s",prefix,server->name);
}
else
{ sprintf(localbuf,"PRIVMSG WildThang :%s|-%s",prefix,server->name);
}
writeln(botsck,localbuf);
if(server->next!=NULL)
strcpy(prefix+offset,"| ");
else
strcpy(prefix+offset," ");
offset+=2;
dumpsubmap(server->down);
offset-=2;
prefix[offset]='\0';
dumpsubmap(server->next);
}

41
match.c Executable file
View File

@@ -0,0 +1,41 @@
/************************************
* match(string1,string2) *
* wild card matching routine *
* origionally for Ultima1.0 *
* Written by WildThang *
* dvmitche@midway.ecn.uoknor.edu *
* based on ideas by hendrix *
************************************/
/* int do_match(char *string1,char *string2)
returns 0 if match
returns 1 if do not match */
#include <stdio.h>
#include <ctype.h>
int match(char *check,char *orig)
{
while(*check == '*' ||
tolower(*check)==tolower(*orig) ||
*check == '?')
if(*check == '*')
if(*++check) {
while(*orig)
if(!match(check,orig++)) return 0;
return 1;
}
else
return 0;
else if (!*check)
return 0;
else if (!*orig)
return 1;
else {
++check;
++orig;
}
return 1;
}

49
myfile.h Normal file
View File

@@ -0,0 +1,49 @@
#define HOSTHASH 4000
#ifdef __MYFILE__
struct aHosthash *host_hashid=NULL;
#else
extern struct aHosthash *host_hashid;
#endif
struct aGline {
char *mask;
char *nick;
time_t time;
char *comment;
};
struct aUser {
struct aUser *next;
struct aChan *chanlist;
int level;
int numbans;
int numkicks;
char mask[150];
char nick[150];
time_t timeout;
int vrfy;
char passwd[10];
char comment[512];
};
struct aHost {
struct aHost *next;
char *hostname;
int count;
};
struct aHosthash {
struct aHost *host[HOSTHASH];
};
struct aChan {
struct aChan *next;
char name[255];
};
struct aUser *chklevel(char *fromhost);
struct aUser *vrfy_oper(char *fromhost,char *passwd);
char *my_strcpy(char *inp);
int my_strfree(char *inp);
struct aHosthash *new_hosthash();

1579
nicklist.c Normal file

File diff suppressed because it is too large Load Diff

93
nicklist.h Normal file
View File

@@ -0,0 +1,93 @@
/***********************************************************/
/* Telnet3d (the single process telnet service) written by
/* <WildThang> (dvmitche@nssl.uoknor.edu) ALL RIGHTS RESERVED.
/*
/* Duplication of this code is not permitted without explicit
/* aproval from the authors (dvmitche@nssl.uoknor.edu) in whole
/* or in parts.
/*
/* This project was designed to be used on UNDERNET IRC ONLY.
/* No exceptions to this without explicit permission from the
/* authors (dvmitche@nssl.uoknor.edu) (intru@step.polymtl.ca)
/*
/* Special Thanks for your ideas and support with this project.
/* go out to:
/* mandar@vinson.ecn.uoknor.edu
/*************************************************************/
#include <time.h>
#define MAXNICKLEN 15
/* Original value 26 */
#define MAXNICKHASH 59
/*
#define MAXNICKHASH 2600
*/
#define KLINE_FILE "kline.request"
struct nicklist {
struct nicklist *next;
struct nicklist *prev;
int level;
char oper;
char vrfy;
char *serv;
char *name;
char *uname;
char *host;
char umode;
int hops;
int sck;
time_t ts;
int nickchange;
time_t lastchange;
char *ip;
char *iphost;
};
struct nick_hash {
struct nicklist *host[MAXNICKHASH];
};
struct nick_hash *new_nick_hash();
struct nicklist *new_nicklist();
int add_nickhash(struct nicklist *nicklistid);
int add_nicklist(struct nicklist *nicklistid,struct nicklist **startid);
int remove_nicklist(struct nicklist *nicklistid);
int myfree_nicklist(struct nicklist *nicklistid);
int nick_oper(char *nickname,int flag);
int nick_level(char *nickname);
char *nick_userhost(char *nickname);
int add_newuser(char *mytok[],int args,int offset);
int seperate_nicklist(struct nicklist *nicklistid);
struct nicklist *find_nicklist(char *name);
int switch_nickname(char *mytok[],int args);
int get_hashid(char *name,int MAXHASH);
char *my_strcpy(char *inp);
int my_strfree(char *inp);
int nick_info(char *nick,int sck);
int remove_nickname(char *name);
int total_users();
int scan_userid(char *fromhost);
int destroy_nickhash();
int dump_nicklist();
int add_kline(struct nicklist *nicklistid,char *filename);
#ifdef __NICKLIST__
long MEM_nicklist_total = 0;
long MEM_nickhash_total = 0;
int MEM_nicklist_cnt = 0;
long MEM_nicklist_used = 0;
long MEM_string=0;
struct nick_hash *nick_hashid=NULL;
#else
extern long MEM_nicklist_total;
extern long MEM_nickhash_total;
extern int MEM_nicklist_cnt;
extern long MEM_nicklist_used;
extern struct nick_hash *nick_hashid;
extern long MEM_string;
#endif

13
nickserv.c Executable file
View File

@@ -0,0 +1,13 @@
#include <stdio.h>
#include <string.h>
#include "config.h"
extern char buf[],sockbuf[], *token[];
extern int sevsck,botsck;
nickserv(char *target)
{
sprintf(buf,":%s NOTICE %s :You are using a registered nick\n",
NICKSERV,target); writeln(sevsck,buf);
sprintf(buf,"433 %s :Registered Nickname Please Choose another\n",
target); writeln(sevsck,buf);
}

1768
parse.c Executable file

File diff suppressed because it is too large Load Diff

11
servers.admin Normal file
View File

@@ -0,0 +1,11 @@
norman.ok.us.undernet.org
los-angeles.ca.us.undernet.org
London.UK.eu.Undernet.org
toronto.on.ca.undernet.org
Dublin.IE.EU.Undernet.Org
auckland.nz.undernet.org
okc.ok.us.undernet.org
phoenix.az.us.undernet.org
Chicago.IL.US.Undernet.org
Goettingen.DE.EU.undernet.org
Oslo-R.NO.EU.Undernet.org

253
sevnum.c Executable file
View File

@@ -0,0 +1,253 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "config.h"
#include "myfile.h"
#include "nicklist.h"
extern char UPLINK[];
extern char *token[], buf[], sockbuf[];
extern int sevsck, botsck;
extern int status,doclearkick,doclearops,docleanchan,docleanops;
extern time_t NOWTIME;
extern char channel[];
extern char opcommand[];
extern char comment[],orig[];
int have_names=0,have_bans=0;
extern int CLEAR_KICK;
char modelist[10];
char modemask[512];
int modecnt;
extern int DccCtr;
sevnum(int num)
{
int i,j,k;
char temp[512];
char mask[100];
struct aUser *myuser;
struct nicklist *nicklistid;
char *tptr,*sptr;
static time_t lastkill=0;
k=chk_num(0);
if(!lastkill) lastkill=NOWTIME-120;
switch(num) {
case 307: /* USERIP */
/*okc.ok.us.undernet.org 307 wildtest :WildThang*=-~danny@207.3.94.229*/
if(!token[3] || ((tptr=strchr(token[3],'=')) == NULL)) break;
token[3]++;
if(*(tptr-1) == '*') *(tptr-1)='\0';
else *tptr='\0';
if( (nicklistid = find_nicklist(token[3])) == NULL) break;
if( (tptr=strchr(tptr,'@'))!= NULL) break;
if(nicklistid->iphost) free(nicklistid->iphost);
nicklistid->iphost=strdup(tptr+1);
break;
case 313:
if(status == SHOW_HOSTS) show_hosts(token[3],1);
else if(status == KILTEL)
{ sprintf(buf,":%s NOTICE %s :You have been Terminated by %s\n",CHANSVR,channel,token[3]);
writeln(sevsck,buf);
sprintf(buf,":%s NOTICE %s :seeya Terminated by %s\n",
CHANSVR,channel,token[3]);
writeln(sevsck,buf);
sprintf(buf,"109 %s :Termination\n",channel);
writeln(sevsck,buf);
sprintf(buf,":%s NOTICE %s :%s has been Shot!\n",
CHANSVR,token[3], channel);
writeln(sevsck,buf);
}
else if(status == SCAN)
{
sprintf(buf,
":%s NOTICE %s :Total Users with %s userid is %d\n",
CHANSVR,channel,opcommand,scan_userid(opcommand));
writeln(sevsck,buf);
}
break;
case 324:
if((status == CLEARCHAN) || (status == CLEARMODE))
{
*token[4]='-';
strcpy(temp,token[4]);
for(i=5;i<k;i++) {
strcat(temp," ");
strcat(temp,token[i]);
}
sprintf(buf,"MODE %s %s 0\n",channel,temp);
writeln(sevsck,buf);
if(status == CLEARMODE) status=0;
}
break;
case 353:
if((status == CLEARCHAN) || (status == CLEAROPS))
{ char modechar[6];
char nicklist[60];
char kickbuf[255];
char hostmask[55];
int nck;
int opcnt=0;
strcpy(modechar,"-");
nicklist[0]='\0';
for(nck=5;nck<k;nck++)
{ if(*token[nck]==':') token[nck]++;
if((status == CLEARCHAN) && (docleanops) &&
(*token[nck]=='@'))
{ *token[nck]++;
if(*token[nck]=='+') *token[nck]++;
if (GetUserHost(token[nck],hostmask) <1) continue;
if(hostmask[0]!='\0')
{
do_gline(hostmask,"CHANNELBLAST",
(comment[0]!='\0')?comment:
"BANNED by Channel Cleanup", 600);
}
continue;
}
if((status == CLEARCHAN) && (docleanchan))
{
if(*token[nck]=='@') *token[nck]++;
if(*token[nck]=='+') *token[nck]++;
if (GetUserHost(token[nck],hostmask) <1) continue;
if(hostmask[0]!='\0')
{
do_gline(hostmask,"CHANNELBLAST",
(comment[0]!='\0')?comment:
"BANNED by Channel Cleanup", 600);
}
continue;
}
if(((status == CLEARCHAN) && (doclearops)) ||
(status== CLEAROPS))
{
if(*token[nck]=='@')
{ /* this is a chan op */
*token[nck]++;
if(!strcmp(token[nck],CHANSVR)) continue;
strcat(modechar,"o");
strcat(nicklist," ");
strcat(nicklist,token[nck]);
opcnt++;
if(opcnt > 6)
{ sprintf(buf,"MODE %s %s %s 0\n",
token[4],modechar,nicklist);
writeln(sevsck,buf);
opcnt=0;
strcpy(modechar,"-");
nicklist[0]='\0';
}
}
}
if( (*token[nck]=='+') || (*token[nck]=='@')) *token[nck]++;
if((CLEAR_KICK) || (doclearkick))
{ if(strcmp(token[nck],CHANSVR))
{ sprintf(kickbuf,"KICK %s %s :CLEARCHAN KICK\n",
token[4],token[nck]);
writeln(sevsck,kickbuf);
}
}
}
if(opcnt)
{ sprintf(buf,"MODE %s %s %s 0\n",
token[4],modechar,nicklist);
writeln(sevsck,buf);
opcnt=0;
}
}
break;
case 366:
if(status == CLEAROPS)
{ status=0;
doclearkick=0;
doclearops=0;
sprintf(buf,":%s PART %s\n",CHANSVR,channel);
writeln(sevsck,buf);
}
if(status == CLEARCHAN)
{ have_names=1;
docleanchan=0;
docleanops=0;
if(!CLEAR_KICK)
{ sprintf(buf,":%s PART %s\n",CHANSVR,channel);
writeln(sevsck,buf);
}
else
{ sprintf(buf,"MODE %s +o %s 0\n",channel,CHANSVR);
writeln(sevsck,buf);
}
}
break;
case 367:
if((status == CLEARCHAN) || (status == CLEARBANS))
{
if(modecnt==0)
{ strcpy(modelist,"-");
strcpy(modemask,"");
}
strcat(modelist,"b");
strcat(modemask," ");
strcat(modemask,token[4]);
modecnt++;
if(modecnt>3)
{ sprintf(buf,"MODE %s %s %s\n", channel,modelist,modemask);
writeln(sevsck,buf);
strcpy(modelist,"-");
strcpy(modemask,"");
modecnt=0;
}
}
break;
case 368:
if(modecnt)
{ sprintf(buf,"MODE %s %s %s\n", channel,modelist,modemask);
writeln(sevsck,buf);
strcpy(modelist,"-");
strcpy(modemask,"");
modecnt=0;
}
if(status == CLEARBANS)
{ status = 0;
if(!CLEAR_KICK)
{ sprintf(buf,":%s PART %s\n",CHANSVR,channel);
writeln(sevsck,buf);
}
}
if(status == CLEARCHAN) {
have_bans=1;
if( (have_bans && have_names) )
{ status=0;
have_names=0;
have_bans=0;
if(!CLEAR_KICK)
{ sprintf(buf,":%s PART %s\n",CHANSVR,channel);
writeln(sevsck,buf);
}
}
}
break;
case 433:
case 463:
if(DccCtr!=-2) break;
if(NOWTIME-lastkill < 90) break;
close(botsck);
sprintf(buf,"KILL UWORLD UWORLD :GO AWAY\n");
writeln(sevsck,buf);
botsck=bot_login(UPLINK);
break;
default:
return;
}
}

572
socket.c Executable file
View File

@@ -0,0 +1,572 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <termios.h>
#include <errno.h>
#include <sys/types.h>
#include <pwd.h>
#include <sys/time.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <signal.h>
#include "config.h"
#ifdef USE_DCC
extern struct aDccClient MyClient[];
#endif
extern char UPLINK[];
u_short IRCPORT = DEFAULTPORT;
extern char sockbuf[],buf[];
extern int sevsck,botsck;
extern long N_TOTAL,D_TOTAL;
extern time_t NOWTIME,BotIdle,ServIdle;
extern char *token[];
int DccCtr=-1;
int BotStatus,ServStatus;
int MAXDCCONLINE=0;
int call_socket(hostname,port)
char *hostname;
int port;
{ struct sockaddr_in sa;
struct hostent *hp;
int a, s;
if((hp=gethostbyname(hostname))==NULL) {
errno=ECONNREFUSED;
return(-1); }
bzero(&sa, sizeof(sa));
bcopy(hp->h_addr, (char *)&sa.sin_addr, hp->h_length);
sa.sin_family = hp->h_addrtype;
sa.sin_port = htons((u_short) port);
if((s=socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) return(-1);
/*
fcntl(s,F_SETFL,O_NONBLOCK);
*/
if(connect(s,(struct sockaddr *) &sa, sizeof(sa)) < 0) {
close(s);
return(-1); }
return(s);
}
int readln2(int sckfd)
{ int i=0,valid=1; char c;
if(sckfd<0) return 0;
while(valid) {
if(read(sckfd,&c,1)<1) return(0);
if(i<511 && (c != '\n') && (c != '
')) sockbuf[i++]=c; else valid=0; }
N_TOTAL++;
D_TOTAL += strlen(sockbuf);
sockbuf[i]='\0'; return(1);
}
int readln(int sckfd)
{ int i=0,valid=1; char c;
int length;
if(sckfd<0) return -1;
if((length=read(sckfd,sockbuf,MAXBUFSIZE-1))<1)
{
if(errno==EWOULDBLOCK || errno==EAGAIN) return(0);
else return -1;
}
D_TOTAL += length;
N_TOTAL++;
sockbuf[length]='\0';
return(length);
}
int writeln(sckfd,outbuf)
int sckfd;
char *outbuf;
{ int to=0;
if(sckfd <0) return 0;
if(write(sckfd, outbuf, strlen(outbuf)) < to )
return(0);
return(1);
}
int writeln_srv(sckfd,nick,outbuf)
int sckfd;
char *nick;
char *outbuf;
{ int to=0;
char templine[512];
if(sckfd <0) return 0;
strcpy(templine,":");
strcat(templine,nick);
strcat(templine," ");
strcat(templine,outbuf);
if(write(sckfd, templine, strlen(templine)) < to )
return(0);
return(1);
}
int login(char *hostname)
{int sckfd;
printf("*** trying port %d of %s\n\n\n",IRCPORT,hostname);
if ((sckfd=call_socket(hostname,IRCPORT))==-1) {
fprintf(stderr, "*** connection refused, aborting\n", hostname);
return -1;
}
sprintf(buf,"NICK %s\n",BOTNAME); writeln(sckfd,buf);
sprintf(buf, "USER %s 1 1 :%s\n",BOTNAME,BOTINFO);
writeln(sckfd,buf);
return( sckfd);
}
int bot_login(char *hostname)
{int sckfd;
printf("*** trying port %d of %s\n\n\n",IRCPORT,hostname);
if ((sckfd=call_socket(hostname,IRCPORT))==-1) {
fprintf(stderr, "*** connection refused, aborting\n", hostname);
BotStatus=S_FREE;
BotIdle=NOWTIME;
return -1;
}
sprintf(buf,"NICK %s\n",BOTNAME); writeln(sckfd,buf);
writeln(sckfd,buf);
sprintf(buf, "USER %s 1 1 :%s\n",BOTNAME,BOTINFO);
writeln(sckfd,buf);
BotStatus=S_ACTIVE;
return( sckfd);
}
int readin()
{
fd_set readfs;
struct timeval timeout;
char MyLocBuf[MAXBUFSIZE];
int dumb = 1;
static time_t last_squit=0;
static squit_loop=0;
int sok;
#ifdef USE_DCC
int mycnt;
#endif
static REFRESH=0;
while(1) {
timeout.tv_sec=5;
timeout.tv_usec=0;
FD_ZERO(&readfs);
if(ServStatus == S_ACTIVE) FD_SET(sevsck,&readfs);
else if (ServStatus == S_CLOSING)
{ close(sevsck);
ServStatus=S_FREE;
}
if(BotStatus == S_ACTIVE) FD_SET(botsck,&readfs);
else if (BotStatus == S_CLOSING)
{ close(botsck);
BotStatus = S_FREE;
}
if((BotStatus == S_FREE) && (NOWTIME-BotIdle > 60))
{ botsck=bot_login(UPLINK);
BotIdle=NOWTIME;
}
if((ServStatus == S_FREE) && (NOWTIME-ServIdle > 60))
{ sevsck=sev_login(UPLINK);
ServIdle=NOWTIME;
}
#ifdef USE_DCC
for(mycnt=0;mycnt<MAXDCCONLINE;mycnt++)
{ char outmsg[1024];
if(MyClient[mycnt].status == S_CLOSING)
{ close(MyClient[mycnt].fd);
MyClient[mycnt].fd=-1;
MyClient[mycnt].status=S_FREE;
sprintf(outmsg,"*** %s (%s) has hung up on us\n",
MyClient[mycnt].name,MyClient[mycnt].hostname);
DccGlobal(outmsg,DCC_ANY);
}
if(MyClient[mycnt].status == S_ACTIVE)
FD_SET(MyClient[mycnt].fd,&readfs);
}
#endif
if(select(FD_SETSIZE, &readfs, NULL, NULL,(dumb ? NULL : &timeout))) {
NOWTIME=time(NULL);
if(REFRESH < NOWTIME)
{ REFRESH = NOWTIME+600;
timeout_myuser();
}
if((ServStatus==S_ACTIVE) && (FD_ISSET(sevsck,&readfs))) {
DccCtr=-1;
sok = readln(sevsck);
ServIdle=NOWTIME;
if (sok>0) spitout(sevsck);
if (sok < 0)
{ close(sevsck);
sevsck = sev_login(UPLINK);
}
}
if((BotStatus == S_ACTIVE) && (FD_ISSET(botsck,&readfs))) {
DccCtr=-2;
sok = readln(botsck);
BotIdle=NOWTIME;
if (sok>0) spitout(botsck);
if (sok < 0)
{ close(botsck);
botsck = bot_login(UPLINK);
}
}
#ifdef USE_DCC
for(mycnt=0;mycnt<MAXDCCONLINE;mycnt++)
{ if(MyClient[mycnt].status == S_ACTIVE )
if(FD_ISSET(MyClient[mycnt].fd,&readfs)) {
DccCtr=mycnt;
MyClient[mycnt].lasttime=NOWTIME;
sok = readln(MyClient[mycnt].fd);
if(sok == -1)
{ MyClient[mycnt].status=S_CLOSING;
}
else if (sok>0)
{
if(sockbuf[0]== '\0') continue;
sprintf(MyLocBuf,":%s!%s DCC %s :%s",
MyClient[mycnt].name, MyClient[mycnt].hostname,
CHANSVR,sockbuf);
strcpy(sockbuf,MyLocBuf);
MyLocBuf[0]='\0';
spitout(botsck);
}
}
}
#endif
}
}
}
int sev_login(char hostname[])
{int sckfd;
if( (sckfd = call_socket(hostname,IRCPORT)) == -1) {
fprintf(stderr,"*** connection refused");
ServStatus=S_FREE;
ServIdle=NOWTIME;
return -1;
}
sprintf(buf,"PASS %s\n",PASSWORD);
writeln(sckfd,buf);
sprintf(buf,"SERVER %s 1 %ul %ul J09 :%s\n",SERVERNAME,time(NULL),time(NULL),
SERVERINFO);
ServStatus=S_ACTIVE;
writeln(sckfd,buf);
return( sckfd);
}
int sev_jupe(char hostname[],char *name)
{
sprintf(buf,"WALLOPS :%s is trying to jupe %s \n",name,hostname);
writeln(sevsck,buf);
sprintf(buf,":%s SQUIT %s JUPE TIME\n",CHANSVR,hostname);
writeln(sevsck,buf);
sprintf(buf,":%s SERVER %s 2 %ul %ul J09 :JUPE by %s \n",
SERVERNAME,hostname,time(NULL),time(NULL),name);
writeln(sevsck,buf);
}
makehelp(int sck,char *botname,char *botinfo)
{
sprintf(buf,"NICK %s 1 %ul %s %s %s :%s\n",botname,time(NULL)-86400,
botname,"undernet.org",SERVERNAME,botinfo);
writeln(sck,buf);
}
makedecoy(int sck,char *botname,char *bothost,char *botinfo)
{
sprintf(buf,"NICK %s 1 %ul %s %s %s :%s\n",botname,time(NULL)-86400,
botname,bothost,SERVERNAME,botinfo);
writeln(sck,buf);
}
makemybots(int j)
{ int i;
char mybot[10];
for(i=0;i<j;i++)
{
sprintf(mybot,"WT_%d",i);
sprintf(buf,"NICK %s 1 %ul %s %s %s :%s\n",mybot,time(NULL)-86400,
mybot,"it.happens.org",SERVERNAME,"Uworld Record Bot");
writeln(sevsck,buf);
sprintf(buf,":%s MODE %s +i\n",mybot,mybot);
writeln(sevsck,buf);
}
}
killmybots(int j)
{ int i=0;
char mybot[10];
for(i=0;i<j;i++)
{
sprintf(mybot,"WT_%d",i);
sprintf(buf,":%s QUIT %s\n",mybot,mybot);
writeln(sevsck,buf);
}
}
#ifdef USE_DCC
int accept_dcc(char *fromhost)
{ int myctr;
struct in_addr in;
int port,newfd;
char hostname[255];
port=(token[7] && *token[7])?atoi(token[7]):0;
if((port < 1024) || (port > 65535))
{
return 0;
}
if(token[6] && *token[6])
{ char mybufr[1024];
in.s_addr=ntohl(strtoul(token[6],NULL,0));
/* if the address is 0 then its bad...
*/
if(in.s_addr == 0) return 0;
strcpy(hostname,inet_ntoa(in));
for(myctr=0;myctr<MAXCLIENTS;myctr++)
{ if(MyClient[myctr].status == S_FREE)
{
if(myctr+1 > MAXDCCONLINE) MAXDCCONLINE=myctr+1;
sprintf(buf,":%s NOTICE %s :Received DCC Chat Request %s %d\n",
CHANSVR,token[0],hostname,port);
writeln(sevsck,buf);
MyClient[myctr].fd=call_socket(hostname,port);
if(MyClient[myctr].fd >=0)
{ int loopit;
char outmsg[1024];
strcpy(MyClient[myctr].hostname,fromhost);
strcpy(MyClient[myctr].name,token[0]);
MyClient[myctr].status = S_ACTIVE;
MyClient[myctr].lasttime = NOWTIME;
MyClient[myctr].umode = DCC_DEFAULT;
writeln(MyClient[myctr].fd,"Welcome to the Party Line\n");
sprintf(buf,"*** Known Usermodes: %s\n",USERMODES);
writeln(MyClient[myctr].fd,buf);
sprintf(buf,":%s PRIVMSG #uworld.floods :DCC %s %s %s\n",
CHANSVR,token[0],hostname,fromhost);
writeln(sevsck,buf);
sprintf(outmsg,"*** %s (%s) has joined the Party\n",
MyClient[myctr].name,MyClient[myctr].hostname);
DccGlobal(outmsg,DCC_ANY);
}
break;
}
}
}
return MyClient[myctr].fd;
}
#endif
int DccWall()
{ int ctr,i;
char outmsg[1024];
if(!(MyClient[DccCtr].umode & DCC_WALLOPS))
{ writeln(MyClient[DccCtr].fd,
"*** You are not +w. Please set umode +w before you wallops\n");
return 1;
}
if(token[4])
{ sprintf(outmsg,"[%s]",token[0]);
for(i=4;token[i];i++)
{ strcat(outmsg," ");
strcat(outmsg,token[i]);
}
strcat(outmsg,"\n");
}
else return 0;
DccGlobal(outmsg,DCC_WALLOPS);
return 1;
}
int DccMessage(char *targ)
{ int ctr,i;
char outmsg[1024];
if(token[4] && token[5])
{ sprintf(outmsg,"*%s*",token[0]);
for(i=5;token[i];i++)
{ strcat(outmsg," ");
strcat(outmsg,token[i]);
}
strcat(outmsg,"\n");
}
else return 0;
for(ctr=0;ctr<MAXDCCONLINE;ctr++)
{
if((MyClient[ctr].status == S_ACTIVE) &&
(!strcasecmp(MyClient[ctr].name,targ)))
{ writeln(MyClient[ctr].fd,outmsg);
break;
}
}
return 1;
}
int DccList()
{ int ctr;
int ct;
char outmsg[1024];
char tbuf[30];
ct=0;
strcpy(outmsg,"DLIST");
for(ctr=0;ctr<MAXDCCONLINE;ctr++)
{ if(MyClient[ctr].status == S_ACTIVE)
{
sprintf(tbuf," %s(%ld)",MyClient[ctr].name,NOWTIME-MyClient[ctr].lasttime);
strcat(outmsg,tbuf);
ct++;
if(ct>6)
{ strcat(outmsg,"\n");
writeln(MyClient[DccCtr].fd,outmsg);
strcpy(outmsg,"DLIST");
ct=0;
}
}
}
strcat(outmsg,"\n");
if(ct) writeln(MyClient[DccCtr].fd,outmsg);
return 1;
}
int DccWho(char *targ)
{ int ctr;
char outmsg[1024];
if(!token[4]) return 0;
for(ctr=0;ctr<MAXDCCONLINE;ctr++)
{ if(MyClient[ctr].status == S_ACTIVE)
{
if(!strcasecmp( targ,MyClient[ctr].name))
{ sprintf(outmsg,"DWHO %s is %s Idle %d\n",MyClient[ctr].name,
MyClient[ctr].hostname,NOWTIME-MyClient[ctr].lasttime);
writeln(MyClient[DccCtr].fd,outmsg);
}
}
}
return 1;
}
int DccGlobal(char *buffer,int MODE)
{ int loopit;
for(loopit=0;loopit<MAXDCCONLINE;loopit++)
{ if((MyClient[loopit].status == S_ACTIVE) &&
(MyClient[loopit].umode & MODE))
{
writeln(MyClient[loopit].fd,buffer);
}
}
return 0;
}
int DccUmode(char *modes)
{
int flag=1; /* default to set */
char *pos,upos=0;
char unknown[1024];
if(!modes)
{ DccMode();
return 0;
}
pos=modes;
unknown[0]='\0';
for(;*pos;pos++)
{
if(*pos=='-') {flag=0; continue; }
if(*pos=='+') {flag=1; continue; }
switch(tolower(*pos))
{ case 'w':
if(flag)MyClient[DccCtr].umode |= DCC_WALLOPS;
else MyClient[DccCtr].umode &= ~DCC_WALLOPS;
break;
case 'a':
if(flag)MyClient[DccCtr].umode |= DCC_ANY;
else MyClient[DccCtr].umode &= ~DCC_ANY;
break;
case 't':
if(flag)MyClient[DccCtr].umode |= DCC_TSC;
else MyClient[DccCtr].umode &= ~DCC_TSC;
break;
case 'g':
if(flag)MyClient[DccCtr].umode |= DCC_GLN;
else MyClient[DccCtr].umode &= ~DCC_GLN;
break;
case 'c':
if(flag)MyClient[DccCtr].umode |= DCC_COMMAND;
else MyClient[DccCtr].umode &= ~DCC_COMMAND;
break;
case 'm':
if(flag)MyClient[DccCtr].umode |= DCC_MMG;
else MyClient[DccCtr].umode &= ~DCC_MMG;
break;
case 'l':
if(flag)MyClient[DccCtr].umode |= DCC_WALL;
else MyClient[DccCtr].umode &= ~DCC_WALL;
break;
default:
unknown[upos++]= *pos;
unknown[upos]='\0';
break;
}
}
if(unknown[0]!='\0')
{ sprintf(buf,"*** Unknown Umodes: %s\n",unknown);
writeln(MyClient[DccCtr].fd,buf);
}
DccMode();
return 0;
}
int DccMode()
{ char modes[10];
modes[0]='\0';
if( MyClient[DccCtr].umode & DCC_ANY) strcat(modes,"a");
if( MyClient[DccCtr].umode & DCC_WALLOPS) strcat(modes,"w");
if( MyClient[DccCtr].umode & DCC_GLN) strcat(modes,"g");
if( MyClient[DccCtr].umode & DCC_TSC) strcat(modes,"t");
if( MyClient[DccCtr].umode & DCC_COMMAND) strcat(modes,"c");
if( MyClient[DccCtr].umode & DCC_MMG) strcat(modes,"m");
if( MyClient[DccCtr].umode & DCC_WALL) strcat(modes,"l");
sprintf(buf,"*** Your Usermode is: %s\n",modes);
writeln(MyClient[DccCtr].fd,buf);
return 1;
}
int DccKill(char *name)
{ int loopit;
char mybuf[1024];
for(loopit=0;loopit<MAXDCCONLINE;loopit++)
{ if((MyClient[loopit].status == S_ACTIVE) &&
(!strcasecmp(MyClient[loopit].name,name)))
{ sprintf(mybuf,
"*** Your DCC PartyLine connection has been terminated by %s\n",
token[0]);
writeln(MyClient[loopit].fd,mybuf);
MyClient[loopit].status = S_CLOSING;
break;
}
}
return 0;

50
user.file Executable file
View File

@@ -0,0 +1,50 @@
0!all opers!*@*!*!TEMP!
6!typos!*typos@*.wildstar.net!LV!LV!
6!bobkc!*bobskc@208.133.5.*!LV!LV!
6!bobkc!*bobskc@205.243.76.*!LV!LV!
6!phantomq!*phantomq@*.pacificnet.net!LV!LV!
6!Bfriendly!*nicedude@*.linknet.net!LV!LV!
6!unknown!*semtex@*.kf.kommorg.no!blah!blah!
6!unknown!*gressetv@*.sn.no!blah!blah!
6!unknown!*engebrec@*.sdstate.edu!blah!blah!
6!unknown!*@mary.blast.net!nielz!blah!
6!super!*super@*technical.net!vancouver-r!
6!super!*super@puck.nether.net!vancouver-r!
8!brummie!*glynn@*n-e-t.co.uk!*!london.uk!
8!brummie!*glynn@goldsub.demon.co.uk!*!london.uk!
8!buff!*buff@209.54.56.8!*!springfield.mo!
8!buff!*buff@tanzit.cetlink.net!*!springfield.mo!
8!Mmmm!*mandar@*.wildstar.net!*!okc.ok!
8!Mmmm!*mandar@csbh.mhv.net!*!okc.ok!
8!whizzard!*lambert@*.ucis.dal.ca!*!unknown!
8!whizzard!*whizzard@python.provision.NET!*!unknown!
8!whizzard!*whizzard@*.ucis.dal.ca!*!unknown!
10!wildthang!*danny@*.ok.us.undernet.org!*!The Creators!
10!wildthang!*danny@*.chatsystems.com!myPASS!The Creators!
9!try!*jemery@*.utexas.edu!*!austin.tx!
10!seks!*seks@seminole*.wildstar.net!yourPASS!The Creators!
10!seks!*seks@*.chatsystems.com!yourPASS!The Creators!
10!Seks!*intru@*.info.polymtl.ca!yourPASS!The Creators!
10!kev!*kev@seminole*.wildstar.net!yourPASS!The Creators!
10!moriah!*moriah@seminole*.wildstar.net!Moma!guest!
10!kev!*klmitch@*.mit.edu!whatever!Vancouver-r!
7!XW!*CService@undernet.org!yourPASS!The Creators!
9!rowan!*rowan@iconz1.iconz.co.nz!yourPASS!The Creators!
8!niels!*niels@*.holding.pi.net!*!amsterdam!
8!nielz!*cpbaltus@ekp.cs.vu.nl!*!The Creators!
8!nielz!*nbakker@kits.cs.vu.nl!*!The Creators!
0!Adam9!*glasscity.net!*!Flooding Uworld!
-4!romania!*fishnet.net!*!NOOPERS!
-4!romania!*.ro!*!NOOPERS!
-4!romania!*@193.226.*!*!NOOPERS!
-5!Absolute!*@202.96.26.*!*!CONTINUAL PROBLEMS!
-5!CallDan!*@southport.jpl.nasa.gov!a!a!
-5!CallDan!*@leia.gsilink.com!a!a!
-5!CallDan!*slh@shell1.shore.net!a!a!
-5!CallDan!*calldan@fenix.pue.udlap.mx!a!a!
-5!CallDan!*calldan@pancreas.com!a!a!
-5!CallDan!*calldan@dt4h4n1e.maine.rr.com!a!a!
-5!CallDan!*@*pub3.coos.or.us!a!a!
-5!FOONET!*@*foonet.net!a!a!
-5!FOONET!*@*something.org!a!a!
-5!FOONET!*@205.229.58.*!a!a!

493
uworld.c Executable file
View File

@@ -0,0 +1,493 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "config.h"
char UPLINK[255];
#ifdef USE_DCC
struct aDccClient MyClient[MAXCLIENTS];
#endif
char *snoop[]={"FA-Q","leet ","haxor",""};
int SNOOP=0;
extern int DccCtr; /* from socket.c */
char *SuspendChan[MAXSUSPENDOPER];
time_t SuspendChanTime[MAXSUSPENDOPER];
char *SuspendOper[MAXSUSPENDOPER];
time_t SuspendOperTime[MAXSUSPENDOPER];
extern char *mynicks[];
char *NoGlineHost[MAXNOGLINES],*GlineHost[MAXGLINEHOST];
char *MultiUserHost[MAXMHOST],*SingleUserHost[MAXMHOST];
char sockbuf[MAXBUFSIZE],buf[MAXBUFSIZE],storebuf[MAXBUFSIZE];
char input_buffer[3][3*MAXBUFSIZE],*input_start,*input_end;
char *token[256];
int sevsck,botsck;
FILE *fludfile = NULL;
char lastkill[255]="\0";
extern char *operchan[],*invitekiller[],*invitehosts[],*killchan[];
char LastKlr[20];
long D_JOIN=0,D_NICK=0,D_PART=0,D_MODE=0,D_KICK=0,D_SERVER=0,D_QUIT=0,D_USER=0;
long N_JOIN=0,N_NICK=0,N_PART=0,N_MODE=0,N_KICK=0,N_SERVER=0,N_QUIT=0,N_USER=0;
long D_TOTAL=0,N_TOTAL=0,D_SQUIT,N_SQUIT,N_OTHER=0,D_OTHER=0;
long D_KILL=0,N_KILL=0,FLOODLOGS=0;
long D_TOPIC=0,N_TOPIC=0;
int CLONE_UP=3,CLONE_LO=3,CLONE_DIG=3,LOGHOST=0;
int DO_AUTOKICK=0,DO_CORE=1;
time_t S_TIME=0;
int MAX_SESSIONS=5,MAX_ALLOWED=8;
time_t NOWTIME,BotIdle,ServIdle;
int SITE_CLONE=3,KILL_NICKFLOOD=1,num_servs=0;
char server_list[40][100];
char controlbot[255];
int NETBURST=0,FLOODPROTECTION=1;
main(int argc, char **argv)
{ int loop,loop2;
char *envptr;
if (argc <2) goto_bg();
strcpy(UPLINK,MYSERVER);
if( (envptr=getenv("UPLINK")) != NULL) strcpy(UPLINK,envptr);
#ifdef USE_DCC
for(loop=0;loop<MAXCLIENTS;loop++)
{ MyClient[loop].fd=-1;
MyClient[loop].status=S_FREE;
}
#endif
InitOperchan();
InitKillchan();
read_operchan(OPERCHANFILE);
read_killchan(KILLCHANFILE);
InitGlines();
read_glines(GLINEFILE);
S_TIME=time(NULL);
NOWTIME=S_TIME;
#ifdef DEBUG
srandom(S_TIME);
open_debug();
#endif
fludfile=fopen(FLUDFILE,"a");
sprintf(controlbot,"%s@%s",CHANSVR,SERVERNAME);
load_myuser("user.file");
load_serv("servers.admin");
clear_clients();
startlog();
sevsck = sev_login(UPLINK);
botsck = bot_login(UPLINK);
do_bots();
read_noglines(EGLINEFILE);
read_glinehost(AGLINEFILE);
read_mhost(MHOSTFILE);
read_shost(SHOSTFILE);
read_suspend(SUSPENDFILE);
read_Csuspend(CHANSUSPENDFILE);
for(loop=0;operchan[loop];loop++)
{
sprintf(buf,":CHANSVR JOIN #%s\n",operchan[loop]);
writeln(sevsck,buf);
sprintf(buf,"MODE #%s +pnoti Chansvr\n",operchan[loop]);
writeln(sevsck,buf);
}
sprintf(buf,":%s MODE %s +kido\n",CHANSVR,CHANSVR);
writeln(sevsck,buf);
#ifdef JUPE_BUGS
for(loop=0;*mynicks[loop];loop++)
makehelp(sevsck,mynicks[loop],"!JUPE Illegal nickname on this network");
#endif
makehelp(sevsck,"ChanLock","CHANNEL LOCKING SYSTEM");
makehelp(sevsck,"ChanServ","Undernet Juping Service");
writeln(sevsck,":ChanLock MODE Chanlock +kid\n");
#ifdef WASTEDUMP
StartWastedump();
sprintf(buf,":wastetest MODE wastetest +kid\n");
writeln(sevsck,buf);
#endif
loop2=0;
for(loop=0;*invitekiller[loop];loop++)
{ if(!(*invitehosts[loop2])) loop2=0;
makedecoy(sevsck,invitekiller[loop],invitehosts[loop2++],
invitekiller[loop]);
}
strcpy(LastKlr,"none");
readin();
}
spitout(int sckfd)
{ int i,num,k,loopcnt;
int bf,helpsv=0;
char *fromhost;
char *temp;
char *end_of_line;
int length,position=0,nbc=0;
static squit_loop=0;
static time_t last_squit=0;
char tempbuf[1024];
char killbuf[255];
char *ptr;
int ctr,ilp;
if(sckfd == sevsck) bf = 0; /* sevsck */
else if(sckfd == botsck) bf = 1; /* botsck */
else bf = 2; /* DccCtr */
/* BUFFER INPUT */
strcat(input_buffer[bf],sockbuf);
input_buffer[bf][strlen(input_buffer[bf])+1]='\0';
/* CHECK FOR NEWLINE */
input_start=input_buffer[bf];
length=strlen(input_buffer[bf]);
while( (input_end=strchr(input_start,'\n')) )
{ loopcnt++;
*input_end='\0';
position+= strlen(input_start);
if(strncmp(input_start,"PI",2)==0)
{ strcpy(buf,input_start);
strncpy(buf,"PO",2);
writeln(sckfd,strcat(buf,"\n"));
input_start=input_end+1;
continue;
} /* ping - pong */
if(*(input_start+strlen(input_start)-1) == '\r')
*(input_start+strlen(input_start)-1) = '\0';
strcpy(storebuf,input_start);
if(SNOOP)
{ for(ilp=0;*snoop[ilp];ilp++)
if(strstr(storebuf,snoop[ilp]))
{ FILE *ofp;
if( (ofp=fopen("Stats.log","a"))!=NULL)
{ fprintf(ofp,"%ld %s\n",NOWTIME,storebuf);
fclose(ofp);
break;
}
}
}
if((FLOODLOGS) && (fludfile != NULL))
fprintf(fludfile,"%s\n",storebuf);
token[i=0]=strtok(input_start," ");
while(token[++i]=strtok(NULL, " ")); token[i]=NULL;
input_start=input_end+1;
if(!token[0]) continue;
if(!token[1]) continue;
if(i > 2) do_count();
k=chk_num(0);
if(temp=strchr(token[0],'!'))
{
*temp='\0'; fromhost=temp+1;
if((k>3) && (FLOODPROTECTION)) FloodProtect(token[0]+1,token[2]);
parse(fromhost);
continue;
}
nbc=0;
if((!NETBURST) && (k>3) && ((!strcmp(token[nbc++],"SERVER")) ||
(!strcmp(token[nbc++],"SERVER")) ))
{ if(!NETBURST)
{ sprintf(buf,":%s PRIVMSG #uworld.floods :PROCESSING NETBURST %d\n",
CHANSVR,nbc);
writeln(sevsck,buf);
}
NETBURST=nbc;
}
if((!NETBURST) && (FLOODPROTECTION) && (!strchr(token[0],'.')))
{
if((k>3) && ((*token[1]=='P') || (*token[1]=='I') ||
(!strncmp(token[1],"NO",2))))
FloodProtect(token[0]+1,token[2]);
}
if((!strcmp(token[0],"ERROR")) &&
(!strcmp(token[1],":Closing")))
{
if(sckfd==sevsck)
{ close(sevsck);
writelog("SQUIT");
destroy_nickhash();
squit_loop++;
if(squit_loop > 5)
{ writelog("EXITING SQUIT LOOP");
exit(1);
}
if(NOWTIME - last_squit < 120) continue;
last_squit = NOWTIME;
if(k>5)
{
*token[5]++;
if(*token[5] != '!')
{
clear_clients();
sevsck=sev_login(UPLINK);
do_bots();
continue;
}
}
}
else /* client squit */
{ close(botsck);
botsck=bot_login(UPLINK);
continue;
}
}
if(k > 3)
{
if(!strcmp(token[3],":remakeuworld"))
{
close( botsck);
botsck=bot_login(UPLINK);
}
else if(atoi(token[1])) { sevnum(atoi(token[1])); continue; }
else if(!match(token[1],"KILL")) { record_kill(); continue; }
else if(strcasecmp(token[0],":helpbot"))
{ if(strlen(token[3])>80) continue;
if(strchr(token[3],'@')) continue;/* Should stop the silence bug */
if(!match(token[2],IRCHELP)) {do_helpirc(sevsck); continue; }
else if(!strcasecmp(token[2],controlbot))
{ OperCom(token[0]+1);
continue;
}
else if( (*token[1]=='P') || (*token[1]=='I') ||
(!strncmp(token[1],"NO",2)))
{
for(ctr=0;*invitekiller[ctr];ctr++)
{ if(!strcasecmp(token[2],invitekiller[ctr]))
{ GetFromhost(token[0]+1,killbuf);
sprintf(tempbuf,"MMG[%d] <%s!%s>",ctr,token[0]+1,killbuf);
for(ctr=3;token[ctr];ctr++)
{ strcat(tempbuf," ");
strcat(tempbuf,token[ctr]);
}
strcat(tempbuf,"\n");
mmg_log(tempbuf);
if((!strcasecmp(lastkill,killbuf)) &&
(strcasecmp(LastKlr,token[2])))
{ /*We've heard from this idiot already */
char ttbuf[1024],*tpt;
tpt=killbuf;
while( (*tpt=='*') ) tpt++;
if( (!match("*telnet@*.wildstar.net",tpt)) ||
(!match("*telnet@*.wildstar.com",tpt)) )
{
dump_nicklist(token[0]+1,"TELNET.FLOODERS");
}
else
{
/*
sprintf(ttbuf,"*%s",killbuf);
do_gline(ttbuf,"MASSMESSAGE",
"Unsolicited Mass Advertisements are prohibited - [Auto]",
3600);
*/
sprintf(ttbuf,
"KILL %s Uworld!uworld.undernet.org :MASS MESSAGE KILL FROM %s\n",
token[0]+1,killbuf);
writeln(sevsck,ttbuf);
}
}
strcpy(lastkill,killbuf);
strcpy(LastKlr,token[2]);
DccGlobal(tempbuf,DCC_MMG);
sprintf(buf,":%s PRIVMSG #uworld.floods :%s",CHANSVR,tempbuf);
writeln(sevsck,buf);
break;
}
}
continue;
}
else if(!strcasecmp(token[2],"chansvr"))
{ sprintf(buf,
":Chansvr NOTICE %s :Please use %s\n",token[0]+1,controlbot);
writeln(sevsck,buf);
continue;
}
else if(!match(token[2],USHELP)) {do_ushelp(sevsck); continue; }
else if((!match(token[2],HELPBOT)) &&
(!match(token[3],":help"))) {do_helpem(sevsck); continue; }
}
}
if(!helpsv) sevstuff(sevsck,fromhost);
} /* END BUFFER INPUT */
strcpy(input_buffer[bf],input_start);
}
finishline(start)
int start; { int i; i=start; while (token[i]) printf(" %s",token[i++]); }
int chk_num(int start)
{
int j;
j=start;
while (token[j]) {
j++;
}
return j;
}
do_scmd(int sck)
{int i,j,k;
char temp[512];
if(!i) i = 4;
j=chk_num(0);
strcpy(temp,"");
if (j>4)
for(i=4;i<j;i++) {
strcat(temp,token[i]);
strcat(temp," ");
}
sprintf(buf,"%s\n",temp); writeln(sck,buf);
}
Gline(fromhost)
char *fromhost;
{
static int counter=0;
*token[0]++;
if(match(fromhost,lastkill)) {
sprintf(buf,"463 %s :Global Kill Line\n",token[0]);
writeln(sevsck,buf);
sprintf(buf,"352 %s \n",token[0]);
writeln(sevsck,buf);
}
else {
counter++;
sprintf(buf,"352 %s \n",token[0]);
writeln(sevsck,buf);
sprintf(buf,"463 %s :Global Kill Line\n",token[0]);
writeln(sevsck,buf);
}
strcpy(lastkill,fromhost);
if(counter > 8) {
sprintf(buf,"NICK %s :1\n",token[0]);
writeln(sevsck,buf);
counter = 0;
}
if(counter = 5) {
sprintf(buf,"KILL %s :GLOBAL KILL LINE \n",token[0]);
writeln(sevsck,buf);
}
}
do_count()
{ if(!strcmp(token[1],"KICK"))
{ D_KICK += strlen(storebuf);
N_KICK++;
}
else if(!strcmp(token[1],"JOIN"))
{ D_JOIN += strlen(storebuf);
N_JOIN++;
}
else if(!strcmp(token[1],"PART"))
{ D_PART += strlen(storebuf);
N_PART++;
}
else if(!strcmp(token[1],"MODE"))
{ D_MODE += strlen(storebuf);
N_MODE++;
if((NETBURST) && strchr(token[0],'.'))
{ NETBURST=0;
sprintf(buf,":%s PRIVMSG #uworld.floods :Netburst Complete\n",
CHANSVR);
writeln(sevsck,buf);
}
}
else if(!strcmp(token[1],"SQUIT"))
{ D_SQUIT += strlen(storebuf);
N_SQUIT++;
}
else if(!strcmp(token[1],"QUIT"))
{ D_QUIT += strlen(storebuf);
N_QUIT++;
}
else if(!strcmp(token[1],"SERVER"))
{ D_SERVER += strlen(storebuf);
N_SERVER++;
}
else if(!strcmp(token[1],"USER"))
{ D_USER += strlen(storebuf);
N_USER++;
}
else if(!strcmp(token[1],"NICK"))
{ D_NICK += strlen(storebuf);
N_NICK++;
}
else if(!strcmp(token[0],"NICK"))
{ D_NICK += strlen(storebuf);
N_NICK++;
}
else if(!strcmp(token[1],"KILL"))
{ D_KILL += strlen(storebuf);
N_KILL++;
}
else if(!strcmp(token[1],"TOPIC"))
{ D_TOPIC += strlen(storebuf);
N_TOPIC++;
}
else
{ N_OTHER++;
D_OTHER += strlen(storebuf);
}
}
int load_serv(char *file)
{
FILE *infile;
char line[500];
if( (infile=fopen(file,"r")) == NULL) return;
for(num_servs=0;fgets(line,99,infile);num_servs++)
{
line[strlen(line)-1]='\0';
strcpy(server_list[num_servs],line);
}
fclose(infile);
return;
}
int join_opchan(char *channel)
{ int loop;
for(loop=0;operchan[loop];loop++)
{ if(strcasecmp(operchan[loop],channel)) continue;
sprintf(buf,":CHANSVR JOIN #%s\n",operchan[loop]);
writeln(sevsck,buf);
sprintf(buf,"MODE #%s +pnotil Chansvr 1\n",operchan[loop]);
writeln(sevsck,buf);
}
}

34
uworld.h Executable file
View File

@@ -0,0 +1,34 @@
#define VERSION "Uworld2 -- the second calling -- v2.0+wild"
/*#define UPLINK "pv1648.vincent.iastate.edu"
/*#define UPLINK "129.186.22.72" /* */
#define UPLINK "vinson.ecn.uoknor.edu"/* */
#define SERVERNAME "Uworld.undernet.org"
#define SERVERINFO ":The Undernet Service Saver (USS UWORLD)"
#define BOTNAME "Uworld"
#define BOTINFO "Uworld Version 2 :The channel saving bot"
#define DEFAULTPORT 6667
#define PASSWORD "hacker"
#define USERFILE "user.file"
#define PROTFILE "uworld.conf"
#define LOGFILE "Uworld.log"
#define KILLFILE "kill.log"
#define HELPFILE "uworldhelp"
#define HELPBOT "UShelper"
#define HELPBOTINFO "helpbot undernet.org Norman.Ok.Us.Undernet.org :IRC HELP /msg <botname> help <COMMAND> "
#define USHELP "Help_US"
#define USHELPINFO "helpbot undernet.org Norman.ok.us.undernet.org :/msg <botname> <command>"
#define IRCHELP "ircIIhelp"
#define NICKSERV "NickGuard"
#define NICKSERVINFO "Nickserv undernet.org Norman.ok.us.undernet.org :The nick machine"
#define CHANSVR "ChanSvr"
#define CHANSVRINFO "chansvr undernet.org Norman.ok.us.undernet.org :The channel saving bot"
#define HELPPATH "HELP"
#define DEBUG 1
#define NOHELP 0 /* undefine this if you want the help services online */
#define GLINE -5
#define CLEARCHAN 10
#define OPCOM 20

7
uworld.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/csh
cd ~dvmitche/misc/uworld
while(1)
midway nobackground thanks > /dev/null
echo Restart Uworld `date` >> Uworld.restart
end

62
uworldhelp Executable file
View File

@@ -0,0 +1,62 @@
* opcom mode/kick <arguments>
-- Allows operators issue special commands as a server
IE /msg Uworld opcom mode #Channel +o Walla
/msg Uworld kick #Channel Walla :Uworld kick
* clearchan [parms] <#channel>
-- Destroys <parms> on said channel.
Parameters available: o = Ops, m = Modes, k = kick users to resynch
default parameters are mob (Modes, Ops and Bans)
IE /msg Uworld clearchan #Channel
/msg Uworld clearchan o #Channel
* clearmodes <#channel>
-- Same as clearchan m, clears ALL modes of a said channel.
* clearops <#channel>
-- Same as clearchan o, clears ALL ops of a said channel.
* clearbans <#channel>
-- Same as clearchan b, clears ALL ops of a said channel.
* gline [seconds] [<user@host> OR <nick>] <reason>
-- Bans a mask from all Undernet servers.
the default seconds are 7200 (2 hours)
IE /msg Uworld gline *@ppp.somewhere.com clones
/msg Uworld gline 100 *@ppp.somewhere.com a 100 second gline for *@ppp.somewhere.com
/msg Uworld gline Cloner NO clones!
* operin <#channel>
-- To allow YOU to join an oper channel, #uworld.floods and #Valhalla
* nofloods
-- To Allow you to join #Uworld.Floods, this is just for the lazy people who can't type "operin #Uworld.Floods" ;-)
* join <#channel>
-- Make ChanSvr join a channel, use this only if you having troubles with channel losing Ops
IE /msg Uworld join #Channel
* leave <#channel>
-- Make ChanSvr leave said channel, use this if ChanSvr is stuck in a channel after a clearchan or after you use the join command
* operadd <#channel>
-- Make a channel an Oper channel ONLY, every oper must use the "operin" command to join and non oper'ed users will be kicked
* operrem <#channel>
-- Remove a channel from Oper mode
* help -- Outdated help file.
* wibble -- toggle Wibble Mode on or off
* stats -- Show network GLOBAL stats
* users -- Show you all users on Uworld database
* chanlevel #channel -- Show access on given channel
* reop #channel -- Gives you ops on #channel if you have access.
* kiltel nickanme -- terminates telnet/guest user from wildthang telnet.
* reconnect -- reconnect the Uworld Server side when split.
* makehelp -- Rebuild the helpbots if they are gone.
* info nickname -- simular to /whois nickname, tells you oper that oper level
* servs -- list servers protected by Uworld antiflood.
* protect -- add your server to the protected list.
* scan *user@*.host -- returns total number of users from matching mask.
* lusers -- returns users listing from uworlds database.
note that since uworld doesnt process splits
that this lusers gets hosed occassionaly.
** nohelp -- terminate help bots.
** nokill -- disarm antiflood kill power.
** dokill -- arm antiflood kill power
** jupe server.name -- Jupes said server.. server should be SQUIT FIRST, requires oper level 8
** masskill *mask* -- kills all users matching given mask.
** spew *mask* -- list all users with matching user@host
*- Uworld's help was provided to you by Walla. -*

61
wastedump.c Normal file
View File

@@ -0,0 +1,61 @@
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "config.h"
#include "myfile.h"
#include "nicklist.h"
#include "wastedump.h"
extern char storebuf[];
extern char *operchan[];
extern time_t S_TIME;
extern char *token[];
extern time_t NOWTIME;
extern char buf[];
extern int botsck,sevsck;
extern int noopers;
extern char channel[];
extern char comment[];
extern char orig[];
extern char opcommand[];
extern int status;
extern int showme;
int create_bot(char *botname,char *botuser, char *bothost,char *botinfo)
{
sprintf(buf,"NICK %s 1 %ul %s %s %s :%s\n",botname,time(NULL)-86400,
botuser,bothost,SERVERNAME,botinfo);
writeln(sevsck,buf);
}
int JoinChannel(char *botname,char *channel)
{ sprintf(buf,":%s JOIN %s\n",botname,channel);
writeln(sevsck,buf);
sprintf(buf,"MODE %s +nto %s\n",channel,botname);
writeln(sevsck,buf);
}
int StartWastedump()
{ create_bot(WASTE_BOTNAME,WASTE_BOTUSER,WASTE_BOTHOST,WASTE_BOTINFO);
sprintf(buf,":%s MODE %s +kid\n",WASTE_BOTNAME,WASTE_BOTNAME);
writeln(sevsck,buf);
JoinChannel(WASTE_BOTNAME,WASTE_CHANNEL);
}
int WriteWastedump(char *buffer)
{
writeln(sevsck,buffer);
return 1;
}
int ParseWastedump()
{
}

6
wastedump.h Normal file
View File

@@ -0,0 +1,6 @@
#define WASTE_BOTNAME "Immortal1"
#define WASTE_BOTUSER "Immortal"
#define WASTE_BOTHOST "There.can.be.only.ONE"
#define WASTE_BOTINFO "Keeper of the Immortal Realms"
#define WASTE_CHANNEL "#wildstar"