LINE SCRIPT TO DETECT A SINGULAR FILE

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

Locked
InnerCity
Posts: 105
Joined: 2003-05-17 00:35

LINE SCRIPT TO DETECT A SINGULAR FILE

Post by InnerCity » 2003-05-17 00:58

yeah, this is the method to kick users with dynamic IP that doesn't like the rules but always try to come to the hub: if the bot detect a singular file that only this user is sharing...kick by bot with a stupid phrase "you've been kicked 'cos your SO is brown", or "you've been kicked 'cos your nose is too long". But i am using generalbot0241 and only know how to ban generic file types. could anyone tell me what do i have to writte inside the script for this example file: "popo.red" (the exact file)
------------------------
Array("T?F?10485760?1?.wav","T?F?1048576?1?.mp3","T?F?104857600?1?.avi","T?F?104857600?1?.mpg","T?F?0?1?download1$.dat","T?F?0?1?.vob","T?F?0?1?msimn.exe","T?F?0?1?__incomplete__","T?F?0?1?share$faker")
-----------------------------------------
If iSearchBadFiles Then
aFileinfo=Split(Mid(LCase(sCurData),Len(curUser.sName)+6),Chr(5))
iFilesize=CDbl(Left(aFileinfo(1),InStr(aFileinfo(1)," ")-1))
sFiletype=Right(aFileinfo(0),4)
If sFiletype=".vob" Then iReason=17
If sFiletype=".dat" And InStr(aFileinfo(0),"download10")>1 Then iReason=17
If sFiletype=".wav" And iFilesize>10*1024^2 Then iReason=17
If sFiletype=".mp3" And iFilesize>1*1024^2 Then iReason=17
If sFiletype=".avi" And iFilesize>100*1024^2 Then iReason=17
If sFiletype=".mpg" And iFilesize>100*1024^2 Then iReason=17
If Right(aFileinfo(0),17)="express\msimn.exe" Then iReason=17
If InStr(aFileinfo(0),"\__incomplete__") Then iReason=17
If InStr(aFileinfo(0),"share faker") Then iReason=17
If iFilesize>iMaxFileSize Then iReason=17
End If
---------------------------------------------
another question is...what do i have to do if i don't want the bot to sent the message like [07:51] <0-Cancerbero> There is at least one bad file in your share. (e:\bakalao\popo.red).
I don't want that the user know what is wrong with his shared files (it should be a secret). i have noted that the bot shows (e:\bakalao\popo.red) with any reason police that you type
thanks
Hi hi hoo

Paul_Don
Posts: 146
Joined: 2003-01-29 06:41
Location: uk
Contact:

Post by Paul_Don » 2003-05-17 05:23

ive found a way let the wankers come in like another 5-10 times and keep kicking them think they got the better of ya take note of there ips
then gets ades iprang blocker then ban there ip range this will also bann people in the same area than him/her but the chances of people living near them and tryin to get in your hub are slim so give that a goo :P

ButterflySoul
Posts: 210
Joined: 2003-01-23 17:24
Location: Nevada
Contact:

Post by ButterflySoul » 2003-05-17 12:12

ban there ip range this will also bann people in the same area than him/her
No. It will ban everyone using that provider (it all depends on what you call a "range", of course)
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best

InnerCity
Posts: 105
Joined: 2003-05-17 00:35

Post by InnerCity » 2003-05-17 13:15

Not always you have a range of IPs to ban (Ej:213.80.xxx.xxx). sometimes the different IPs of the same user have no identical numbers. so the only method i know is the descripted above
Hi hi hoo

Paul_Don
Posts: 146
Joined: 2003-01-29 06:41
Location: uk
Contact:

Post by Paul_Don » 2003-05-17 21:36

well i use aDes ipblockers and it seems in uk people ip range dont change too drastic so banning ranges works fine i dont know whether this is the case for other countrys but it seems too work ok for banning certain people in the uk

Paul_Don
Posts: 146
Joined: 2003-01-29 06:41
Location: uk
Contact:

Post by Paul_Don » 2003-05-17 21:39

well and on another note the range aint too much usualy like 81.6.83.xxx so it aint too bad it snot like your banning everyone with 81.6 in there ip

ButterflySoul
Posts: 210
Joined: 2003-01-23 17:24
Location: Nevada
Contact:

Post by ButterflySoul » 2003-05-18 14:07

the range aint too much usualy like 81.6.83.xxx so it aint too bad
First, if it's a very small provider or a modest non-provider structure that just started or with small needs, they'll have a netrange smaller than 256 IPs. Likely a /27 or a /26 network. Systematically banning a range of 256 IPs and always assuming the netblock is a /24 won't get you far; especially considering that :
- providers are allowed to have non-contiguous CIDR blocks to cover eventual expansions
- the internet addressing authorities won't allocate you a large pool of IPs anymore. You must provide justification for extra allocation.

A few years ago, you could have gone away with it, when all the IPs were assigned using the old A, B, C & D classes notation. With ipv4 and ipv6 (and the CIDR assignement) you can't really do that anymore, because a contiguous range of 256 IPs might cover several providers or infrastructures. Furthermore, since they can be non-contiguous, the person you are trying to block might be able to connect again from the same provider, even if you banned 81.6.xxx.xxx (which can't be done with a nmdc hub without also banning x81.6x.xxx.xxx, xxx.x81.6x.xxx and xxx.xxx.x81.6x anyway). By just simply banning random ranges of 256 IPs, you're pretty much helpless in preventing the person from coming back, and worse, you're also also preventing other people on other providers from plain coming. You won't efficiently prevent the guy from coming back until he logs back in with each and every netblock of his provider, and you ban them all; unless I missed something.

If you use AdE's IP blocker meant for copyright enforcement agencies, you'll get around the nmdc hub limitation described above, but have a look at the original IPs that come with it. Only 4 of these ranges are full 256 IPs ranges. All the others are /27 , /26 and /25

Go on metacrawler or any search engine you like, and make a search for Classless Inter-Domain Routing
Then come back, and we can have a serious discussion on IP bans vs more accurate bans -filename or nick based- if you like =)
what do i have to writte inside the script for this example file: "popo.red"
The best one to answer that would be gadget himself, and he's often around around these boards, but you'd probably get a better chance to catch his attention with a thread mentioning "general bot" in the title =)

My guess is you would need to expand the original array with
"T?F?0?1?popo.red" and add an
If RightB(aFileinfo(0),16)="popo.red" Then iReason=17
in the lines below

The part of the script you posted is part of the message string building. The real PM happens later. To remove the filename from the reason message, you'd have to edit something futher down, after that End If
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best

InnerCity
Posts: 105
Joined: 2003-05-17 00:35

Post by InnerCity » 2003-05-18 16:05

thanks for your explanation
i tried
If InStr(aFileinfo(0),"popo.red") Then iReason=20
but it bans also "popo.redo" or "apopo.red" and seems to need something like
If InStr(aFileinfo(0),"\popo.red") Then iReason=20
if the file is inside a directory
so, why rightb instead right?
and
isn't 16 the number of characters of the string?
i saw this line
If Right(aFileinfo(0),17)="express\msimn.exe" Then iReason=17
and i thought just this
Hi hi hoo

ButterflySoul
Posts: 210
Joined: 2003-01-23 17:24
Location: Nevada
Contact:

Post by ButterflySoul » 2003-05-18 18:50

so, why rightb instead right?
RightB goes faster than Right (counts bytes instead of characters).
Of course, with RightB, you need to give the number of bytes instead of the number of characters; and in unicode a character is 2 bytes.
isn't 16 the number of characters of the string?
8 characters x 2 bytes per character = 16 bytes
(with a classic "right" , the number to use in the code would have been 8, indeed)
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best

ButterflySoul
Posts: 210
Joined: 2003-01-23 17:24
Location: Nevada
Contact:

Post by ButterflySoul » 2003-05-18 19:25

If InStr(aFileinfo(0),"popo.red") Then iReason=20
(...)
it bans also "popo.redo" or "apopo.red"
If you start counting from the right, you'll avoid catching the "popo.redo", however, it will still catch "apopo.red".
The search result will always mention the directory, so using \popo.red, as you suggested would be the best way to catch only that file. Instr would be slower than right (or rightb) because you have to search the whole string for a match that could start at the begining of the string, at the second character, at the third character, etc.
Use Instr only if you don't know in advance the position of what you're looking for within the original string. If you know the exact position, use right, left and mid.

Which makes your "safe" code :

Code: Select all

If RightB(aFileinfo(0),18)="\popo.red" Then iReason=17
-also note that If InStr(aFileinfo(0),"\popo.red") Then iReason=20 would still catch someone with a file named \popo.redo, since the \popo.red sequence is contained within the filename-
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best

InnerCity
Posts: 105
Joined: 2003-05-17 00:35

Post by InnerCity » 2003-05-18 23:52

ok, thanks
Hi hi hoo

Locked