'Hub Protection Script made by Satyricon =) 'made by Satyricon onAugust 13,2002 'v1.0 Dim sBotName Dim oSearchCount Dim iSearchCount Dim sLastUser Dim sYNChatFlood Dim lMaxRepeat Dim oUserMsgs Dim oMsgCount Dim lstIP Dim oMyInfo Dim sTheText Dim sUsrName Dim lPos '-------------------------------------------------- Sub Main Set oSearchCount = CreateObject("Scripting.Dictionary") Set oUserMsgs = CreateObject("Scripting.Dictionary") Set oMsgCount = CreateObject("Scripting.Dictionary") Set oMyInfo = CreateObject("Scripting.Dictionary") tmrScriptTimer.interval=60000 tmrScriptTimer.enabled=TRUE lMaxRepeat = 5 sBotName = "Uñtøücháblè-Security" End Sub '-------------------------------------------------- Sub tmrScriptTimer_Timer() oSearchCount.RemoveAll oUserMsgs.RemoveAll oMsgCount.RemoveAll oMyInfo.RemoveAll lstIP = "" End sub '-------------------------------------------------- Sub DataArival (curUser, sCurData) ' Search Flood and Search Spam Protection If Left(sCurData, 7) = "$Search" Then If InStr(sCurData, "F?F?0?1?.") Then KickAndNotify curUser.sName, "Flooder" Exit Sub End If If oSearchCount.Exists (curUser.sName) then iSearchCount = oSearchCount.Item (curUser.sName) iSearchCount = iSearchCount +1 If iSearchCount = 7 then KickAndNotify curUser.sName, "SpamSearch" Exit Sub End If oSearchCount.Item (curUser.sName) = iSearchCount Else oSearchCount.Add curUser.sName, 1 End If End If '$MyInfo Flood Protection If Left(sCurData, 7) = "$MyINFO" Then If oMyInfo.Exists(CStr(curUser.sName)) Then oMyInfo(CStr(curUser.sName)) = oMyInfo(CStr(curUser.sName)) + 1 If oMyInfo(CStr(curUser.sName)) >8 and colUsers.Online(CStr(curUser.sName)) Then KickAndNotify curUser.sName, "MyInfoFlood" oMyInfo.Remove (CStr(curUser.sName)) Exit Sub End If Else oMyInfo(CStr(curUser.sName)) = 1 End If End If ' Chat Flood Protection If Left(sCurdata, 1) = "<" Then lPos = InStr(1, sCurData, "> ") sTheText = Mid(sCurData, lPos + 2) sUsrName = curUser.sName If Not curUser.bOperator Then CheckChatFlood sUsrName, sTheText End If End If End Sub '-------------------------------------------------- Sub KickAndNotify(User, Reason) Dim sbanIP Dim sMessage If colUsers.Online(CStr(User)) And Not sLastUser = User Then sLastUser = User End If If Reason = "Flooder" or Reason = "MyInfoFlood" Then frmHub.lstPermBan.AddItem CStr(colUsers.ItemByName(CStr(User)).ip) sbanIP = CStr(colUsers.ItemByName(CStr(User)).ip) colUsers.SendChatToAll CStr(sBotName), "" + CStr(User) + " was banned because he/she tried to hack the hub program!" colUsers.SendChatToAll CStr(sBotName), "" + CStr(User) + "´s IP is: " + CStr(sbanIP) +"." colUsers.ItemByName(CStr(User)).Disconnect lookForIP (sbanIP) Else sbanIP = CStr(colUsers.ItemByName(CStr(User)).ip) frmHub.DoEventsForMe colUsers.ItemByName(CStr(User)).Kick Select Case Reason Case "SpamSearch" sMessage = "" + CStr(User) + " was kicked because search spamming!" colUsers.SendChatToAll CStr(sBotName), cstr(sMessage) colUsers.SendChatToAll CStr(sBotName), "" + CStr(User) + "´s IP is: " + CStr(sbanIP) +"." Case "LameSearch" sMessage = "" + CStr(User) + " was kicked because submitting Lame-search." colUsers.SendChatToAll CStr(sBotName), cstr(sMessage) colUsers.SendChatToAll CStr(sBotName), "" + CStr(User) + "´s IP is: " + CStr(sbanIP) +"." End Select End If End Sub '-------------------------------------------------- Sub lookForIP(ip) Dim userIP Dim messageIP Dim c c=0 messageIP="Other users connected from this IP" For each userIP in colUsers If userIP.IP()=ip then messageIP=messageIP+":"+userIP.sName userIP.Kick() c=c+1 End If Next If Not(c=0) then colUsers.SendChatToAll cstr(sBotName),cstr(messageIP)+" . Their IP numbers got banned too..." End If End Sub '-------------------------------------------------- Sub CheckChatFlood(User, Message) Dim sChatIP sChatIP = CStr(colUsers.ItemByName(CStr(User)).ip) If oUserMsgs.Exists(sChatIP) Then If CStr(Message) = CStr(oUserMsgs(sChatIP)) Then oMsgCount(sChatIP) = oMsgCount(sChatIP) + 1 Else oMsgCount(sChatIP) = 1 End If Else oMsgCount(sChatIP) = 1 End If oUserMsgs(sChatIP) = CStr(Message) If oMsgCount(sChatIP) = lMaxRepeat - 1 Then colUsers.SendChatToAll CStr(sBotName), User + ", only lamers flood the chat with the same stupid message!" ElseIf oMsgCount(sChatIP) = lMaxRepeat Then If lstIP <> sChatIP Then lstIP = sChatIP frmHub.lstTempBan.AddItem CStr(sChatIP) colUsers.SendChatToAll CStr(sBotName), User + "... You better stop that if you are smart!" colUsers.SendChatToAll CStr(sBotName), "" + User + " was kicked because he/she was flooding the main-chat." colUsers.SendChatToAll CStr(sBotName), "" + User + "´s IP is: " + CStr(sChatIP) +"." frmHub.DoEventsForMe oMsgCount.Remove (CStr(sChatIP)) oUserMsgs.Remove (CStr(sChatIP)) lookForIP (CStr(sChatIP)) End If End If End Sub '-------------------------------------------------- sub Error() 'This sub goes off when there is an error. msgbox "Error: " & err.description end sub