Prefix & IP Checker
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Prefix & IP Checker

Started by GeceBekcisi, 10 July, 2005, 14:53:08

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GeceBekcisi

I need a script that will check users prefixes with IP ranges they should be used to. I need some table like
tPrefixIP = {
	{"[METU]", "144.122.0.0-144.122.255.255", "Orta Dogu Technical Unv"},
	{"[ITU]", "160.75.0.0-160.75.255.255", "Istanbul Technical Unv."},
	{"[KOC]", "193.140.56.0-193.140.63.255", "Koc Unv."},
	{"PREFIX", "IPRANGE", "COMMENT"},
}
If user is using specified prefix outside the IP range, he should be disconnected and feed must be sent to user and ops like
user:SendData(sBot, "You are using "..PREFIX.." in your nick but you are not from "..COMMENT.." so u will be disconnected.")
user:SendData(sBot, "If want to join our hub, pls remove that prefix from your nick and re-register from your new location..")
SendPmToOps(sBot, "An user with IP "..user.sIP.." from "..COMMENT.." is disconnected from hub due to using prefix "..PREFIX.." ")
Note: Script shouldn't check nicks having prefix after nick, like: GeceBekcisi[ITU]. At least this may be an option to be turned on/off.

Thanks...
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

TTB

I converted NL IPranger... search on the forum for Thor 2.0 IPranger
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

GeceBekcisi

I dont need an IP ranger. My request is completely different from an IP ranger.. BTW thanks for your reply..

Is there anyone willing to help me, by writing this script ?
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

TTB

Hmz. I do not understand...

Your request is... checking on an IP, if the prefix with that IP is correct... Thor 2.0 IPranger does that! Take a look at that script first, later we can mod that if needed!
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

ConejoDelMal

-- modded by jiten

sBot = "-=Brainu=-" 

sOpChatName = "-=OpChat=-"


--## Configuration ##-- 

-- Put in this table the Prefixes you want the users to have
 
sPrefix = { "[PT]" , "(PT)" , }

-- Put in this table the IP-Range or IP you want to be checked for

arrIP = { 
   ["192.168.0.1"] = "192.168.255.255",   -- REDE LOCAL
   ["127.0.0.1"] = "127.0.0.1",      -- LOCAL HOST
   ["81.84.0.0"] = "81.84.255.255",   --  TVCABO
   ["83.132.0.0"] = "83.132.255.255",      --  TVCABO
   ["85.138.0.0"] = "85.139.255.255",   --  TVCABO
   ["212.113.160.0"] = "212.113.191.255",      --  TVCABO
   ["213.22.0.0"] = "213.22.255.255",   --  TVCABO
   ["195.245.234.0"] = "195.245.234.255",      --  BPN
   ["193.221.96.0"] = "193.221.111.255",   --  ITM-PORTUGAL
   ["195.138.0.0"] = "195.138.31.255",      --  SIBS
   ["194.145.121.0"] = "194.145.121.255",   --  ESDI
   ["193.53.22.0"] = "193.53.22.255",      --  SERVIBANCA
   ["193.194.155.0"] = "193.194.155.255",   --  SHOPPING DIRECT
   ["213.129.128.0"] = "213.129.159.255",      --  netway
   ["193.236.127.0"] = "193.236.127.255",   --  Sistema de Mail para Todos do MCT
   ["146.193.0.0"] = "146.193.31.255",      --  INESC
   ["146.193.32.0"] = "146.193.63.255",   --  INESC
   ["146.193.64.0"] = "146.193.127.255",      --  INESC
   ["146.193.128.0"] = "146.193.255.255",   --  INESC
   ["192.12.232.0"] = "192.12.232.255",      --  INESC
   ["192.35.246.0"] = "192.35.246.255",   --  INESC
   ["192.135.129.0"] = "192.135.129.255",      --  INESC
   ["192.136.49.0"] = "192.136.49.255",   --  INESC
   ["194.117.24.0"] = "194.117.31.255",      --  INESC
   ["194.117.32.0"] = "194.117.35.255",   --  INESC
   ["213.63.0.0"] = "213.63.127.255",      --  Jazztel Portugal
   ["213.63.128.0"] = "213.63.255.255",   --  Jazztel Portugal
   ["213.141.0.0"] = "213.141.31.255",      --  Jazztel Portugal
   ["194.153.132.0"] = "194.153.132.255",   --  BPI, SA
   ["195.85.221.0"] = "195.85.221.255",      --  BPI, SA
   ["83.223.160.0"] = "83.223.191.255",   --  CABOTVM.PT
   ["213.190.192.0"] = "213.190.223.255",      --  CABOTVM.PT
   ["213.138.224.0"] = "213.138.255.255",   --  CABOTVM.PT
   ["62.229.64.0"] = "62.229.95.255",      --  GLOBAL-ONE-PORTUGAL
   ["194.235.128.0"] = "194.235.135.255",   --  GLOBAL-ONE-PORTUGAL
   ["194.235.136.0"] = "194.235.139.255",      --  GLOBAL-ONE-PORTUGAL
   ["195.61.64.0"] = "195.61.95.255",   --  GLOBAL-ONE-PORTUGAL
   ["193.41.114.0"] = "193.41.115.255",      --  YASP
   ["212.48.64.0"] = "212.48.95.255",   --  HLC
   ["212.54.128.0"] = "212.54.159.255",      --  ITNET-Network
   ["212.54.144.0"] = "212.54.159.255",   --  ITNET-Network
   ["194.145.59.0"] = "194.145.59.255",      --  Siemens
   ["194.145.60.0"] = "194.145.60.255",   --  Siemens
   ["194.145.61.0"] = "194.145.61.255",      --  Siemens
   ["194.145.62.0"] = "194.145.62.255",   --  Siemens
   ["192.67.76.0"] = "192.67.76.255",      --  Centro de Calculo da Faculdade de Ciencias de Lisboa
   ["192.104.37.0"] = "192.104.37.255",   --  Edinet
   ["195.95.236.0"] = "195.95.237.255",      --  Edinet
   ["195.245.128.0"] = "195.245.191.255",   --  Edinet
   ["213.58.0.0"] = "213.58.255.255",      --  Edinet
   ["217.70.64.0"] = "217.70.71.255",   --  Edinet
   ["217.70.72.0"] = "217.70.79.255",      --  Edinet
   ["80.172.0.0"] = "80.172.255.255",   --  VIA NET.WORKS Portugal
   ["194.8.30.0"] = "194.8.30.255",      --  VIA NET.WORKS Portugal
   ["194.130.254.0"] = "194.130.255.255",      --  VIA NET.WORKS Portugal
   ["195.22.0.0"] = "195.22.31.255",   --  VIA NET.WORKS Portugal
   ["62.48.128.0"] = "62.48.255.255",      --  PT Prime
   ["83.240.128.0"] = "83.240.255.255",   --  PT Prime
   ["158.162.120.0"] = "158.162.127.255",      --  PT Prime
   ["193.176.0.0"] = "193.176.0.255",   --  PT Prime
   ["195.35.66.0"] = "195.35.66.255",      --  PT Prime
   ["139.83.0.0"] = "139.83.255.255",   --  RCCN-NET
   ["158.162.0.0"] = "158.162.63.255",      --    RCCN-NET
   ["158.162.64.0"] = "158.162.95.255",      --  RCCN-NET
   ["158.162.96.0"] = "158.162.111.255",   --  RCCN-NET
   ["158.162.112.0"] = "158.162.119.255",      --  RCCN-NET
   ["158.162.128.0"] = "158.162.191.255",   --  RCCN-NET
   ["158.162.192.0"] = "158.162.255.255",      --  RCCN-NET
   ["192.88.99.0"] = "192.88.99.255",   --  RCCN-NET
   ["193.136.0.0"] = "193.137.255.255",      --    RCCN-NET
   ["194.117.0.0"] = "194.117.15.255",      --  RCCN-NET
   ["194.117.16.0"] = "194.117.23.255",   --  RCCN-NET
   ["194.117.40.0"] = "194.117.43.255",      --  RCCN-NET
   ["194.210.0.0"] = "194.210.255.255",   --  RCCN-NET
   ["82.140.192.0"] = "82.140.207.255",      --  KPNQwest
   ["193.126.0.0"] = "193.126.255.255",   --  KPNQwest
   ["193.192.1.0"] = "193.192.1.255",      --    KPNQwest
   ["193.192.2.0"] = "193.192.2.255",      --  KPNQwest
   ["193.192.3.0"] = "193.192.3.255",   --  KPNQwest
   ["81.193.0.0"] = "81.193.255.255",      --  Telepac
   ["82.154.0.0"] = "82.155.255.255",   --  Telepac
   ["85.240.0.0"] = "85.247.255.255",      --  Telepac
   ["192.92.150.0"] = "192.92.150.255",   --  Telepac
   ["194.65.0.0"] = "194.65.255.255",      --    Telepac
   ["212.55.128.0"] = "212.55.191.255",      --  Telepac
   ["213.13.0.0"] = "213.13.255.255",   --  Telepac
   ["192.188.10.0"] = "192.188.10.255",      --  Novis
   ["192.199.16.0"] = "192.199.31.255",   --  Novis
   ["193.236.120.0"] = "193.236.120.255",      --  Novis
   ["193.236.121.0"] = "193.236.121.255",   --  Novis
   ["193.236.122.0"] = "193.236.122.255",      --    Novis
   ["193.236.123.0"] = "193.236.123.255",      --  Novis
   ["194.79.64.0"] = "194.79.95.255",   --  Novis
   ["194.117.36.0"] = "194.117.39.255",      --  Novis
   ["195.23.0.0"] = "195.23.255.255",   --  Novis
   ["195.225.220.0"] = "195.225.223.255",      --  Novis
   ["212.0.160.0"] = "212.0.167.255",   --  Novis
   ["213.205.64.0"] = "213.205.95.255",      --    Novis
   ["194.38.128.0"] = "194.38.159.255",      --  COMNEXO, SA
   ["213.146.192.0"] = "213.146.223.255",   --  COMNEXO, SA
   ["193.219.96.0"] = "193.219.103.255",      --  IP Global
   ["81.20.240.0"] = "81.20.255.255",   --  CPRM
   ["195.8.0.0"] = "195.8.31.255",      --    CPRM
   ["217.168.112.0"] = "217.168.127.255",      --  CPRM
   ["83.174.0.0"] = "83.174.63.255",   --  Vodafone
   ["212.18.160.0"] = "212.18.191.255",      --  Vodafone
   ["213.30.0.0"] = "213.30.127.255",   --  Vodafone
   ["212.16.128.0"] = "212.16.159.255",      --  Teleweb
   ["212.251.128.0"] = "212.251.255.255",   --  Teleweb
   ["212.13.32.0"] = "212.13.63.255",      --    NorteNet
   ["212.113.128.0"] = "212.113.159.255",   --  MaxitelCom, SA
   ["80.90.192.0"] = "80.90.223.255",      --  Oni Way
   ["195.245.197.0"] = "195.245.197.255",   --  Inst Informatica e Estat da Solidariedade
   ["217.23.0.0"] = "217.23.15.255",      --  Cofina.com
   ["80.79.0.0"] = "80.79.15.255",      --    Guiao, S.A.
   ["193.111.42.0"] = "193.111.42.255",      --  Finibanco, SA
   ["193.192.4.0"] = "193.192.7.255",   --  INE
   ["193.192.8.0"] = "193.192.11.255",      --  INE
   ["81.92.192.0"] = "81.92.223.255",   --  NFSi-Solucoes Internet Lda.
   ["82.102.0.0"] = "82.102.63.255",      --  NFSi-Solucoes Internet Lda.
   ["195.234.134.0"] = "195.234.134.255",   --  CAIXANET
   ["62.169.64.0"] = "62.169.95.255",      --Optimus
   ["192.35.96.0"] = "192.35.96.63",      --  BanifServ
   ["195.35.96.0"] = "195.35.96.255",   --  BanifServ
   ["195.60.162.0"] = "195.60.163.255",      --  Instituto Superior de Linguas e Administra??o
   ["217.70.72.0"] = "217.70.79.255",   --  Bragatel
   ["80.251.161.128"] = "80.251.161.143",      --  PHC
   ["217.112.192.0"] = "217.112.195.255",      --  WTS
   ["217.112.196.0"] = "217.112.196.255",      --  WTS
   ["62.249.8.176"] = "62.249.8.191",      --  DATABOX-PT
   ["80.251.160.0"] = "80.251.175.255",      --  COLT
   ["80.91.80.0"] = "80.91.83.255",      --  LNCES
   ["83.144.128.0"] = "83.144.191.255",      --  Pluricanal, SA
   ["193.17.0.0"] = "193.17.0.255",      --  Imprensa Nacional 
}
--## END ##-- 

function Main()
	frmHub:RegBot(sBot) 
end 

function NewUserConnected(user) 
	if (CheckUserPrefix(user) == nil) and not (isGoodIP(user.sIP) == nil) then 
		user:SendPM(sBot, "Inclui o prefixo [PT]  no teu nick, para permitir um melhor controlo do trafego efectuado")
		user:SendPM(sBot, "Se precisares de ajuda, ou tiveres d?vidas contacta um Operador")
	end 
end 

OpConnected = NewUserConnected 

function ConnectToMeArrival(user,data)
	if (CheckUserPrefix(user) == nil) and not (isGoodIP(user.sIP) == nil) then 
		user:SendData(sBot, "N?o podes fazer downloads/uploads at? colocares o prefixo [PT], exemplo: [PT]nick , digita !nick")
		return 1
	end
end

RevConnectToMeArrival = ConnectToMeArrival

function CheckUserPrefix(user)
	for key,pre in sPrefix do 
		if string.find(string.lower(user.sName), string.lower(pre),1,1) then 
			return 1 
		end 
	end 
end

function isGoodIP(sIP) 
	sIP = ipToNumber(sIP) 
	local iFirst,iLast 
	for iFirst, iLast in arrIP do 
		if (sIP >= ipToNumber(iFirst) and sIP <= ipToNumber(iLast)) then 
			return 1 
		end 
	end 
	return nil 
end 

function ipToNumber(sIP) 
	iAux = "" 
	string.gsub(sIP,"(%d+)", function(w) 
		w = tonumber(w) 
		if (w < 10) then 
			iAux = iAux.."00"..w 
		elseif (w < 100) then 
			iAux = iAux.."0"..w 
		else 
			iAux = iAux..w 
		end 
	end) 
	return tonumber(iAux) 
end

This seems more or less what you need, just this one is warning and bloking traffic until they dont change the prefix... good for newbies..

Also this is only for an amount of prefixes.. the same ranges... hope it helps
Rede-DC Comunidade Portuguesa de DC

GeceBekcisi

#5
Hmm these two scripts seem useful, I just had a quick look cos I'm in laboratory now, maybe in the evening I'll do some kinds of tests to be sure but as far as I understood; the script [AT]conejodelmal posted checks for if user doesnt have specified prefixes from sPrefix table and connecting from outside of arrIP table, and warns if these two statements are true. This script is not satisfying my wish but I think it can be modified easily to satisfy.

tPrefixIP = {
	{"[METU]", "144.122.0.0-144.122.255.255", "Orta Dogu Technical Unv"},
	{"[ITU]", "160.75.0.0-160.75.255.255", "Istanbul Technical Unv."},
	{"[KOC]", "193.140.56.0-193.140.63.255", "Koc Unv."},
	{"PREFIX", "IPRANGE", "COMMENT"},
}
Let me explain how my hub works and what kind of script I need more. Suppose that we have an ISP table just like the one above. I am connecting to hub as an user from ITU. I have an IP within bound of [ITU] prefix's "IPRANGE". The hub doesn't allow searching and downloading without registration, so I am sending registration request to OPs. They check my IP range, and if I am inside an university's IP range ( *in this case, I am inside ITU) they register me as "[ITU]GeceBekcisi". Later weekend, I go back to home from university dormitory and connect to hub via DSL. I am regged with nick "[ITU]GeceBekcisi", so I can enjoy hub. But this shouldn't be so since I can only use [ITU] tag from inside ITU's IP range. I must use [ADSL]GeceBekcisi instead but I am not using.

So our script goes here like this:
tPrefixIP = {
	{"[METU]", "144.122.0.0-144.122.255.255", "Orta Dogu Technical Unv"},
	{"[ITU]", "160.75.0.0-160.75.255.255", "Istanbul Technical Unv."},
	{"[KOC]", "193.140.56.0-193.140.63.255", "Koc Unv."},
	{"PREFIX", "IPRANGE", "COMMENT"},
}

function NewUserConnected(user)
	if not (CheckUserPrefix(user) == nil) and not (IPisFrom(user.sIP) == nil) then 
		user:SendData(sBot, "You are using "..PREFIX.." in your nick but you are not from "..COMMENT.." so u will be disconnected.")
		user:SendData(sBot, "If want to join our hub, pls remove that prefix from your nick and re-register from your new location..")
		SendPmToOps(sBot, "An user with IP "..user.sIP.." from "..COMMENT.." is disconnected from hub due to using prefix "..PREFIX.." ")
	end
end

function CheckUserPrefix(user)
-- I don't know how to state this part, I'll write in English instead of LUA
	if user has a prefix from tPrefixIP table, "PREFIX" columnn
	return 1 
	end
end

function IPisFrom(sIP) 
-- I don't know how to state this part, I'll write in English instead of LUA
	if user has an IP from tPrefixIP table, "IPRANGE" columnn
	return 1 
	end
end

If I was able to tell what I need exactly, I'll be glad now. And I must say one more word, I need to use "..PREFIX.." and "..COMMENT.." in warnings (most of my users are really inexperienced with computers so I have to tell them everything clearly and step-by-step) so please write or modify script in such a way letting me to use them. Thanks for dealing with me..


EDIT: This script may be used to pick fake [BBB] or [HUN] users if you're strict about that, so I think I'll not be the only one to use this script...
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

GeceBekcisi

Nobody here to code the way I requested? Please help me!  :(
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

Mogli


GeceBekcisi

Me and a friend did this script below and it's working fine now. Thanks for your reply & script mogli; I'll try it as well.
--  =======================================================================  --
--// GeceBekcisi ve Mateci'nin yazdigi HubBekcisi v0.666 'den alintidir
--// Stripped from HubBekcisi v0.666 by GeceBekcisi
--  =======================================================================  --
--//   Features:
--// - Tag Range Checher by GeceBekcisi and Mateci
--  =======================================================================  --

--  =======================================================================  --
--// Settings start here.. 
--  =======================================================================  --

-------------------------------------------------------------------------------
--// Global Settings / Initialize Variables
-------------------------------------------------------------------------------
sBot = frmHub:GetHubBotName()		-- Bot's Name

-------------------------------------------------------------------------------
--// Prefix-Range Tables
-------------------------------------------------------------------------------
tPrefixIP = { 
	{"ITU", "160.75.0.0", "160.75.255.255", "Istanbul Teknik ?niversitesi, Istanbul"},
	{"ITU", "161.9.0.0", "161.9.255.255", "Istanbul Teknik ?niversitesi, Istanbul"},
	{"ITU", "193.255.139.0", "193.255.139.255", "Istanbul Teknik ?niversitesi, Istanbul"},
	{"ITICU", "194.27.149.0", "194.27.150.255", "Istanbul Ticaret ?niversitesi, Istanbul"},
	{"ITICU", "193.255.82.0", "193.255.82.255", "Istanbul Ticaret ?niversitesi, Istanbul"},
	{"KU", "193.140.56.0", "193.140.63.255", "Ko? ?niversitesi, Istanbul"},
	{"KOC", "193.140.56.0", "193.140.63.255", "Ko? ?niversitesi, Istanbul"},
	{"ODTU", "144.122.0.0", "144.122.255.255", "Orta Dogu Teknik ?niversitesi, Ankara"},
} 

--  =======================================================================  --
--// Settings end here.. 
--  =======================================================================  --
--// Prefix-Range Check starts here..
--  =======================================================================  --

-------------------------------------------------------------------------------
--// Prefix-Range Check on User Connection
--// MyINFO arrival instead of NewUserConnected
--// to avoid sending "This hub is running ..." msg
-------------------------------------------------------------------------------
function MyINFOArrival(curUser, sData)
	if curUser.sName then
		CheckUser(curUser.sName,curUser.sIP,curUser)
		if curUser.bRegistered then
			CheckCase(curUser.sName,curUser)
		end
	end	
end
-------------------------------------------------------------------------------
--// Prefix-Range Checker by GeceBekcisi and Mateci
-------------------------------------------------------------------------------
maximum=8
function CheckUser(username,userip,user)
local str=0
	for key=1,8 do 
		s,e=string.find(username,"%["..tPrefixIP[key][1].."%]")
		if tPrefixIP[key][1] == tPrefixIP[key+1][1] then
			if s == 1 and isGoodIP(userip,key) == 1 then
				str=1
			end
		elseif s == 1 and isGoodIP(userip,key) == nil then
			if str == 0 then
				user:SendData(sBot, "You are using ["..tPrefixIP[key][1].."] in your nick but you are not from "..tPrefixIP[key][4].." so u will be disconnected.")
				user:SendData(sBot, "If want to join our hub, pls remove that prefix from your nick and re-register from your new location..")
				SendPmToOps(sBot, "An user with IP "..user.sIP.." from "..tPrefixIP[key][4].." is disconnected from hub due to using prefix ["..tPrefixIP[key][1].."] ")
				user:Disconnect()
			break
			end
		end 
	end 
end
-------------------------------------------------------------------------------
--// Prefix Case Checker by GeceBekcisi and Mateci
-------------------------------------------------------------------------------
function CheckCase(username,user)
local ktr=0
	for key=1,maximum do 
		s,e=string.find(username,"%["..tPrefixIP[key][1].."%]")
		if s == nil then 
			s,e=string.find(string.upper(username),"%["..tPrefixIP[key][1].."%]")
			if ktr == 0 and s == 1 then
				user:SendData(sBot, "You should use your prefix in UPPERCASE just like ["..tPrefixIP[key][1].."] ")
				user:SendData(sBot, "If want to join our hub, please edit your prefix as seen above..")
				ktr=1
				user:Disconnect()
			end
		end
	end
end
-------------------------------------------------------------------------------
--// IP Checker by ?
-------------------------------------------------------------------------------
function isGoodIP(sIP,key) 
	sIP = ipToNumber(sIP)
	if (sIP >= ipToNumber(tPrefixIP[key][2]) and sIP <= ipToNumber(tPrefixIP[key][3])) then 
		return 1 
	end 
	
	return nil 
end 

function ipToNumber(sIP) 
	iAux = "" 
	string.gsub(sIP,"(%d+)", function(w) 
		w = tonumber(w) 
		if (w < 10) then 
			iAux = iAux.."00"..w 
		elseif (w < 100) then 
			iAux = iAux.."0"..w 
		else 
			iAux = iAux..w 
		end 
	end) 
	return tonumber(iAux) 
end
--  =======================================================================  --
--// Prefix-Range Check ends
--  =======================================================================  --
Please feel free to edit and help us learn how to code more effectively with shorter codes..
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

GeceBekcisi

#9
Can anyone modify the script above to send report to ops ( line 67 ) only once if user is automatically reconnecting? Reports are really helpful but if user doesn't see the data sent to him; client keeps automatically reconnects and also my bot starts annoying spam :(

AFAIR autoreconnect time interval is 2 minutes in DC++.. Maybe a function that will count the reconnection with the same nick more than 1 times in 5 minutes and another function to see only if this is false, and send report to ops would be effective..

0.23 (2003-01-30)
If DC++ receives "banned" during the login phase, it'll stop automatically reconnecting
I tried a tempban of 5 mins but it didnt work. Client tried to connect again.
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

ConejoDelMal

Just nickban them, you anyway want them to change the nick  :D
Rede-DC Comunidade Portuguesa de DC

GeceBekcisi

Nickbanning is not a good solution cos my users are from universities; they stay in university dormitories, but they go their homes at weekends or longer holidays, they still use their tag that they have taken while connecting from universities IP range, but this is forbidden due to our rules ( we try to help people finding the exact nick to download stuff cos most users are passive outbound and can be active for students connecting from inside university, and also this tag rule helps us to check netlimiting better cos we have ops from most universities connecting to our hub )..

I know I messed up while trying to tell but I'm tired now and this is my best I can do now, so forgive me..
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

ConejoDelMal

Well, if you want them to find their tag, maybe its better if you just block their traffic till they correct it, so that if they need help, somebody can explain them how to. And they will surely be interested in changing it :P

I'm just trying to help with what i know.. cause i cant code your requests
Rede-DC Comunidade Portuguesa de DC

Alexinno

here is a script

-- Requested by GeceBekcisi
-- Simple IP Checker by Mogli

-- include IPBot
if not IPBot then
	dofile( "IP-Bot/IPBot-0.24.lua" )
end

function Main()

	IPRange = IPBot:NewRange()

	-- Add some Ranges
	--IPRange:addRange( "IP1", "IP2", "UniName", "Prefix" )
	IPRange:addRange( "144.122.0.0", "144.122.255.255", "Orta Dogu Technical Unv", "[METU]" )
	IPRange:addRange( "160.75.0.0", "160.75.255.255", "Istanbul Technical Unv.", "[ITU]" )
	IPRange:addRange( "193.140.56.0", "193.140.63.255", "Koc Unv.", "[KOC]" )
end

function NewUserConnected( user )

	local trange = IPRange:checkIP( user.sIP )
	if trange then
		local inum, ip1, ip2, uniname, prefix = unpack( trange )
		-- what you want with it here e.g.
		if string.sub( user.sName, -(string.len(prefix)), -1 ) == prefix then
		-- do something
		end
	end
end
OPConnected = NewUserConnected


cand somebody add rightclick suport for it ?

GeceBekcisi

What exactly do you want the script to do?
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

Alexinno

to add IP-ranges -> rightclick  :D

but i don't need it anymore because UserBekcisi.v1.00.RC3.lua is the best :)))


SMF spam blocked by CleanTalk