PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: (=CyberPimp=) on 08 March, 2004, 20:26:45

Title: Not allowed clients
Post by: (=CyberPimp=) on 08 March, 2004, 20:26:45
Can someone make a script that detects client emulation like in PhantomDC++. I don?t want this client on my hub or any other clients that uses speed limitation. A script that can tell the real client not based on the tag. PLZ!!!
Title:
Post by: NightLitch on 08 March, 2004, 20:42:32
try this one:

-- Simple Bandwidh Checker by: NightLitch

function DataArrival(curUser, data)
if (strsub(data,1,7) == "$MyINFO") then
local Bwidh = "unlimited"
if strfind(MyInfo, "L:") then
local _,_,Ls = strfind(MyInfo , "L:(%d+)")
Bwidh = Ls
elseif strfind(MyInfo, "B:") then
local _,_,Bs = strfind(MyInfo , "B:(%d+)")
Bwidh = Bs
elseif strfind(MyInfo, "F:") then
local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
Bwidh = Fs
end
if Bwidh ~="unlimited" then
curUser:SendData("PtokaX","Bandwidh Limiter is not Allowed here !")
curUser:Disconnect()
end
end
end

This one will not allow any Bandwidh Limiters in.

/NL
Title:
Post by: tezlo on 08 March, 2004, 21:33:59
that one will give you an error..
function DataArrival(user, data)
if strsub(data,1,7) == "$MyINFO" then
local s, e, limiter = strfind(data, "[LBF]:%d*%/?(%d+)")
if s then
user:SendData("Hub-Security", "We dont like bw limiters.")
user:Disconnect()
end
end
end
Title:
Post by: NightLitch on 08 March, 2004, 21:43:54
ok, well thx for the nice little correction. :-)
Title:
Post by: (=CyberPimp=) on 08 March, 2004, 22:59:13
Tanx hope this helps.
Title:
Post by: (=CyberPimp=) on 09 March, 2004, 03:05:23
This did not work!!!    PLZ find a way to stop this PhantomDC++ and clients like that
Title:
Post by: majinsoftware on 09 March, 2004, 09:25:51
This is the one i use it stops phantom DC and all other bw limiting ones.

-----------------------------------------------------------------

---------------------------------------------------------------------
kb = 1024
gb = kb*kb*kb
tb = kb*kb*kb*kb
---------------------------------------------------------------------
Bot = "Z-LeZ"

--Level Checks / 1:on/0:off

LC = {
[1]) then
         vClient = ClientTAG[2]
      end
   end
   
   local Version = ""
   local _,_,Slots = strfind( MyInfo, "S:(%d+)")
   local _,_,Mode = strfind( MyInfo, "M:([S,A,P])")
   local _,_, DcVer = strfind(MyInfo,"V:(%x+.%x+)")
   Version = DcVer
   if strfind(MyInfo,"      local _,_,oDCVer = strfind(MyInfo,"")
      Version = oDCVer
      vClient = "oDC"
   elseif vClient=="Italian DC++" then
      local _,_,IDCVer = strfind(MyInfo,"")
      Version = IDCVer
   end

   local Hubs = ""
   local Regged = ""
   local Opped = ""
   local _,_, gethub = strfind(MyInfo,"H:(%x+)/")
   if gethub == nil then
      _,_, Hubs = strfind(MyInfo,"H:(%x+)")
      Regged = 0
      Opped = 0
   else
      Hubs = gethub
      _,_, Regged = strfind(MyInfo,"H:%x+/(%x+)/")
      _,_, Opped = strfind(MyInfo,"H:%x+/%x+/(%x+)")
   end
   
   if strfind(MyInfo,"H:\"%d+/%d+/%d+\",S") then
      vClient = "Fake Client"
      _,_,Hubs,Regged,Opped = strfind(MyInfo,"H:\"(%x+)/(%x+)/(%x+)\"")
   end

   if strfind( MyInfo,"V:%S+(k),M") then vClient = "DC++k" end

   
   if strfind(MyInfo, "L:") then
      local _,_,Ls = strfind(MyInfo , "L:(%d+)")
      Bwidh = Ls
      vClient = "CZDC++"
   elseif strfind(MyInfo, "B:") then
      local _,_,Bs = strfind(MyInfo , "B:(%d+)")
      Bwidh = Bs
      if not vClient=="Phantom DC++" then
         vClient = "BCDC++"
      end
   elseif strfind(MyInfo, "F:") then
      local _,_,Fs = strfind(MyInfo , "F:%d+/(%d+)")
      Bwidh = Fs
   else
      Bwidh = "unlimited"
   end

   if Version == nil then Version = "0" end
   if Mode == nil then Mode = "0" end
   if Hubs == nil then Hubs = "0" end
   if Slots == nil then Slots = "0" end

   tMode = {
   ["S"] = "Socks",
   ["A"] = "Active",
   ["P"] = "Passive",
   ["0"] = "N/A",
   }
   vTag = { ["H"] = Hubs, ["S"] = Slots, ["B"] = Bwidh,["V"] = Version, ["M"] = tMode[Mode], ["RH"] = Regged,  ["OH"] = Opped}
   return vClient, vTag, vSpeed, vShare
end

function AllowClients(curUser,vClient,vTag)
   if (LC[curUser.iProfile]==1) then
      if (vClient =="oDC" and AllowODC==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,ODCver,"http://gempond.com/odc")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="DC++" and AllowDCPP==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="DC:PRO" and AllowDCPRO==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,DCPROver,"http://btpro.altervista.org/index.php")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="DCGUI" and AllowDCGUI==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,DCGUIver,"http://dc.ketelhot.de")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="NeoModus 2" and AllowNMDC2==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,NMDC2ver,"http://neo-modus.com")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="BCDC++" and AllowBCDC==1)  then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,DCPPver,"http://utrum.dyndns.org:8000/index.html")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="CZDC++" and AllowCZDC==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,DCPPver,"http://www.czdcplusplus.tk/")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="Phantom DC++" and AllowPDC==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,DCPPver,"http://pdc.recoil.net.nz/index.php")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="Italian DC++" and AllowIDC==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,IDCver,"http://www.p2pitalia.com/")
         BandwidhCheck(curUser,vTag)

      elseif (vClient =="Fake Client" and AllowFAKE==1) then
         CheckSlotsHubs(curUser,vTag)
         VersionCheck(curUser,vClient,vTag,DCPPver,"http://dcplusplus.sourceforge.net")
         BandwidhCheck(curUser,vTag)
      elseif (vClient =="Unknown" and AllowNOTAG==1) then

      elseif (vClient =="Fake Client" and AllowFAKE==0) then
         curUser:SendData(BotName,curUser.sName.." you are using a fake tag or client!")
         curUser:Disconnect()
      elseif (vClient =="Unknown" and AllowNOTAG==0) then
         curUser:SendData(BotName,curUser.sName.." you are using a client with no tag!")
         curUser:Disconnect()
      else
         SendPmToNick(curUser.sName, "Client Blocker", " Your DC Cleint isnt wanted here please get another one E.G MS++V at http://www.computec.dynu.com/MS++V/")
         curUser:Disconnect()
      end
   end
end

function CheckSlotsHubs(curUser,vTag)
   if (vTag["S"] == "N/A" or vTag["H"] == "N/A") then
   elseif (tonumber(vTag["S"]) < MinSlots) then
         SendPmToNick(curUser.sName, BotName,"You have too litle slots open ( "..vTag["S"].." ) Minimum slots is ( "..MinSlots.." ). ")
      curUser:Disconnect()
   elseif (tonumber(vTag["S"]) > MaxSlots) then
         SendPmToNick(curUser.sName, BotName,"You have too many slots open ( "..vTag["S"].." ) Maximum slots is ( "..MaxSlots.." ). ")
      curUser:Disconnect()
   elseif (tonumber(vTag["H"]) > MaxHubs) then
         SendPmToNick(curUser.sName, BotName,"You are in too many hubs ( "..vTag["H"].." ) Max Hubs is ( "..MaxHubs.." ). ")
      curUser:Disconnect()
   end
end

function VersionCheck(curUser,vClient,vTag,Version,Download)
   if (vClient == "DCGUI" or vClient == "DC:PRO") then
      if (vTag["V"] == "N/A") then
      elseif (vTag["V"] < Version) then
         SendPmToNick(curUser.sName, BotName,"You are using "..vClient.." version [ "..vTag["V"].." ]")
         SendPmToNick(curUser.sName, BotName,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
         curUser:Disconnect()
      end
   else
      if (vTag["V"] == "N/A") then
      elseif (vTag["V"] < Version) then
         SendPmToNick(curUser.sName, BotName,"You are using "..vClient.." version [ "..vTag["V"].." ]")
         SendPmToNick(curUser.sName, BotName,"The oldest version allowed is "..vClient.." [ "..Version.." ], you may download the latest "..vClient.." at "..Download)
         curUser:Disconnect()
      end
   end
end

function BandwidhCheck(curUser,vTag)
   if vTag["B"] == "unlimited" then
   elseif (tonumber(vTag["B"]) < LockBW) then
         SendPmToNick(curUser.sName, BotName,"You are using a Bandwidh Locker, locked to ( "..vTag["B"].."  kB/s  ), Minimum is ( "..LockBW.." kB/s ).")
      curUser:Disconnect()
   end
end
 ------------------------------------------------------------------------
Title:
Post by: NightLitch on 09 March, 2004, 11:37:40
hehe, Nice one, but next time, plz remember to include witch one created it, know I know I created it but. ;-)

That one should take care of the most things.

Update on that will come.

/NL
Title:
Post by: (=CyberPimp=) on 09 March, 2004, 15:20:56
I can still get in with no prob useing the PhantomDC++ 1,19b useing bl and just as a reg user. em I doing someting wrong?? I?m useing Robocop, ip bot and spam blocker.
Title:
Post by: plop on 09 March, 2004, 15:53:44
QuoteOriginally posted by (=CyberPimp=)
I can still get in with no prob useing the PhantomDC++ 1,19b useing bl and just as a reg user. em I doing someting wrong?? I?m useing Robocop, ip bot and spam blocker.
you are running it in dc++ mode, this script only detects the phantomDC mode.
for what you want 2 do you need dc++k CDM.

plop
Title:
Post by: (=CyberPimp=) on 11 March, 2004, 05:02:28
Quoteyou are running it in dc++ mode, this script only detects the phantomDC mode.
for what you want 2 do you need dc++k CDM
.

Tried that, did not work.
I?m gona ban DC++ on my hub hehe, it?s the only way. I?ve tried meny clients like: PhantomDC++, StrongDC, zDC and more, thay all have the emulation of DC++.
Just one problem, there is no script that bans DC++ hehe. I?m gonna alow oDC, iDC, DCGui, DCGui-QT and NMDC.
Can you make a script that bans DC++, I like the CLIENT CHECKER by NightLitch from NXS 3,3 but it?s not done and there is no option for DC++
Title:
Post by: majinsoftware on 11 March, 2004, 08:54:11
sorry NightLitch had no idea i just copyed it as it was in the .lua file
Title:
Post by: [NL]trucker on 11 March, 2004, 08:57:03
(=CyberPimp=)

have you tried dc++k cmd?
Title:
Post by: (=CyberPimp=) on 11 March, 2004, 12:58:36
have you tried dc++k cmd?.........yes I have.........have you tried to use the newest version of PhantomDC++ and try to detect it?? Did not work for me.

majinsoftware I was refering to http://board.univ-angers.fr/thread.php?threadid=1133&boardid=12&styleid=1&sid=76c59139503b95f84f8e17e3ed93e65c ....this script.

PLZ help me!!  I hate this clients and thay are not good for the DC comunite. I think evryone agrees to that.

Sorry for my EN..hehe
Title:
Post by: (=CyberPimp=) on 11 March, 2004, 13:03:14
Oh sorry...there is an option for DC++ in that script.
It would be good if someone fixed it.
Title:
Post by: dvxjunkie on 12 March, 2004, 06:39:57
um about that first script I tried it and got bad argument to strngfind string expected got nil cant seem to see the %{[("problem")]} |