PDA

View Full Version : ioFTPD SiteKill


FTPServerTools
05-20-2003, 03:41 AM
Ok I think I tested it enough this should be good for the final.
For those that dont know it, SiteKill is an external command which can be executed via the scheduler or via a dos box to kill certain connections in ioFTPD.
Goto http://ftpservertools.tripod.com and visit the download page.
The site is not accessible for opera I heard, sorry it's tripod's fault.

Users of version 0.3 or 0.9 be aware the syntax has changed.

Parameters are any combination of
user=username - Kicks connections of user
ip=ipnr - Kicks connections of ip
ident=ident@ipnr - Kicks connections of ident@ip
host=hostname - Kicks connections of hostname
idle>seconds - Kicks idlers that are seconds idle
idle>=seconds - Kicks idlers that are seconds idle
path=somepath - Kicks connections on a path
group=groupname - Kicks connections from a maingroup
groups=groupname - Kicks connections from a group that the user is in
action=lastaction - Kicks connections with last action
flags=userflags - Kicks users with certain flags
times=all|once|nr - Number for the amount of kicks, all for all connections
service=ftp|http|telnet - kick only people on this service
servicename=name - name if ioftpd service (from ioftpd.ini) e.g. FTP_Service
up>nr - kick speed > nr for connections that are uploading K/s
up>=nr - kick speed >= nr for connections that are uploading K/s
up<nr - kick speed < nr for connections that are uploading K/s
up<=nr - kick speed <= nr for connections that are uploading K/s
down>nr - kick speed > nr for connections that are downloading K/s
down>=nr - kick speed >= nr for connections that are downloading K/s
down<nr - kick speed < nr for connections that are downloading K/s
down<=nr - kick speed <= nr for connections that are downloading K/s
transfer=idle|up|down|list - kick connections in the mentioned transfer mode
Preceed a parameter with a - and it will exclude that option
Wildcards are * and ? are allowed

Due to the windows rdirection (using < and >) you will need to surround your partial or complete query with double quotes.
Also when the string you comapre with has a space in it you need to surround the argument with double quotes.

Be aware that the parameters are used as AND so:
site kill groups=group1 groups=group2
will kill everyone belonging to group1 AND group2.
Thus someone only belonging to group1 will not be killed.



Examples:
site kill user=lamer - kills the user lamer
site kill user=lamer times=once - kills the user lamer once
site kill user=lamer times=25 - kills max 25 lamer users
site kill user=l*r - kills users that match the l*u wildcard so lamer looser leecher in this example but not winner
site kill ip=127.0.0.1 - kills the 127.0.0.1 connections
site kill ip=192.168.*.* - kills the 192.168.*.* connections
site kill "idle>120" - kills idlers that are longer then 120 secs idle
site kill group=l*s - kills connections with main group l*s so leechers, loosers, lamers
site kill action=noop - kills connections where the last command was NOOP
site kill ident=TEST@* - kills connections with TEST as ident
site kill user!=sitebot path=/movies/svcd/* "idle>120"
- kills all connections that are in /path/movies/svcd/ somewhere and that are 120 seconds or
more idle but dont kill user sitebot in this process
site kill servicename=FTP_Service "down<10"
- kill all ftp leechers that are downloaading < 10K/s
site kill "path=/Stay out *" "login>600"
- kill all ftp services that are logged in longer then 600 seconds.


How to use this command in ioFTPD?
Lets say we for example want to kick all idle ftp users.

[Schedule]
KillIdlers = 0,5,10,15,20,25,30,35,40,45,50,55 * * * ..\scripts\SiteKill.exe "idle>120" service=ftp


To run this same command from a tcl script you could use:
[exec -- "c:\\ioFTPD\\scripts\\SiteKill.exe" "idle>120" "service=ftp"]

The0ne
05-20-2003, 03:48 AM
sweet thx for the update FTPServerTools, i couldn't quite get teh older sitekills to work properly but i will give this new version a go, thx again :)

FTPServerTools
05-20-2003, 03:56 AM
O yes I forgot... If you run the unpatched ioFTPD on win2k or winXP (no SP1) then it wont run. So see the forum somewhere to find the patches. The actual criteria to need is patch is the following:
Goto your windows system32 dir. View inside your Shell32.dll and find the string SHLock if it exists then you do NOT need a patched io to get sitekill to work.

iXi
05-20-2003, 04:39 AM
hehe nice man;)
i wanna mary you*gg

cya

Linkster
05-20-2003, 07:32 AM
wouldn't this also work? assuming io scheduler supports same syntax as unix...

[Schedule]
KillIdlers = */5 * * * &..\scripts\SiteKill.exe "idle>120" service=ftp

Superblue
05-20-2003, 12:31 PM
Having some probs when I do:
site kill "idle>120"

it kills me even though I've only been idle a few seconds?

m0B
05-20-2003, 01:29 PM
I have the same problem as SuperBlue.

Vampirix
05-20-2003, 05:04 PM
same here... i tried for about an hour all the possible combinations to kill idlers>180 secs but it kills every user in the ftp even if he's idle for just 1 second :( i hope this will be fixed soon cause it's a great addon!

FTPServerTools
05-20-2003, 05:13 PM
Which io version and which os?
And I made a typo in the scheduler line.. The & shouldnt be there (deleted now).

m0B
05-20-2003, 05:39 PM
I knew about the schelduler so that part 'worked'.
But when it does 'site kill "idle>120"' it kicks everyone including me..

WinXP with SP1
Latest ioFTPD 4.6.2u

Superblue
05-20-2003, 11:11 PM
Originally posted by m0B
I knew about the schelduler so that part 'worked'.
But when it does 'site kill "idle>120"' it kicks everyone including me..

WinXP with SP1
Latest ioFTPD 4.6.2u

Same as above, disabled scheduler part, just trying to pass the cmd from ftp program.

Vampirix
05-21-2003, 01:51 AM
OS: Win 2003 Server SE
iO: beta 4.6.2u

I tried to make it work by a dos prompt, by a site command and by the scheduler but no way it kill everyone who is idle just for few seconds :(

iXi
05-21-2003, 04:56 AM
moin,

ive the same problem sitekill wont work..

os windows XP sp1 ioFTPD latest unregisted version

cya

TaNiZi0
05-21-2003, 05:31 AM
I have the same problem..... into XP SP1 and ioFTPD lastest.

4 example:

c:\io\scripts\> SiteKill.exe "idle=pepe"
Kicked: TaNiS ____Ó@127.0.0.1
Totally 1 connections kicked


LoL :D

darkone
05-21-2003, 07:04 AM
Have you determinated wheter this is an issue with sitekill or scheduler?

Vampirix
05-21-2003, 07:12 AM
it's a sitekill error (i think) cause it fails when it's run from a dos prompt or as a raw site command...

FTPServerTools
05-21-2003, 09:24 AM
sitekill idle=pepe ?? huh??
that would resolve to sitekill idle=0
read = .
Thus it shouldnt kick anyone. The odd thing is that it seems to run fine here.. I'll put another version in here (1.0.1) somewhat later.
Be aware I can only test with win XP SP1.

and idle= would do an exact compare.. Meaning kick all who have idle=0 (this probably everyone downloading etc).
It is "idle>120" that really amazes me since it works good here...
So I think I better add a debug option in there so it can make debug logs. Otherwise it becomes impossible for me to find out why it doesnt work on someone else's machine.

Superblue
05-21-2003, 10:05 AM
I sent site kill "idle>120" and then it killed everyone..

I'd be happy to do a debug for ya..

m0B
05-21-2003, 10:21 AM
This is a problem with sitekill and not the schelduler.
I can have the schelduler disabled and try to do a " site kill "idle120" " and it will kick eveyrone including me..even if I run it from the command prompt does the same thing.

Vampirix
05-21-2003, 12:46 PM
Look:


200-+---------------°----|______________\___|_____|_______|------------------------+
200-| vampirix / xXx | idle 00:00:05 | %: |
200-| Vote ioFTPD for president | since 00:00:06 | p: / |


Now i'll try to kick idlers>120 (there's no one idling except vampirix but he's idle only since 5 secs):


D:\Internet\ioFTPD\scripts>SiteKill.exe "idle>120"
Kicked: prova @127.0.0.1
Totally 1 connections kicked


Now I'm disconnected from iO:


Connection lost: 127.0.0.1


I'm asking myself why it says "Kicked: prova @127.0.0.1" when prova is not logged in... there's just "vampirix" and the connection killed is the "vampirix" connection not prova which is not connected... maybe this is related with the bug... i dont know =)

m0B
05-21-2003, 05:25 PM
Actually now that u mention it Vampirix..Its the same here..
It kicks me off but in CMD it puts another username, not mine! But it still kicks 127.0.0.1 .. wich is 'me' ..

FTPServerTools
05-21-2003, 06:04 PM
Ok this is some code rewritten and a debug mode.
The debug mode gets activated if you start if with debug as first paramater. So if you say it doesnt work then I need th debug info.
sitekill.exe debug "idle>120" -> runs in debug mode
sitekill.exe "idle>120" ->runs in normal mode

FTPServerTools
05-21-2003, 07:03 PM
ok thanks to Doc- I got another bug fixed. He confirmed it working for me.. Wonderfull so get it from http://ftpservertools.tripod.com form the download page or just grab the one from this forum.

Vampirix
05-22-2003, 12:01 AM
wow i'm trying version 1.0.2 and seems workin very well! very nice job m8, if anything goes wrong i'll re-post something here now i'll go to check it again :P

Vampirix
05-22-2003, 12:38 AM
D:\Internet\ioFTPD\scripts>SiteKill.exe debug "idle>180"
Password_File=..\etc\passwd
Group_File=..\etc\group
Connection 0 uid=113 gid=106 Username=prova Groupname=ViP IP=127.0.0.1 Ident=Bre
ndon@127.0.0.1
CompareNumber:idle>180 result:14
TimesToKill=-1 compare:idle>180 ArgumentResult=2, TotalResult=1
Final compare result of all arguments 2
Connection 1 uid=106 gid=103 Username=vampirix Groupname=xXx IP=127.0.0.1 Ident=
Brendon@127.0.0.1
TimesToKill=-1 compare:idle>180 ArgumentResult=0, TotalResult=1
Final compare result of all arguments 1
Kicked: vampirix Brendon@127.0.0.1
Totally 1 connections kicked


As you can see sometimes it skips the "CompareNumber:idle>180 result:sec_idle_on_ioFTPD" and it kills the user

FTPServerTools
05-22-2003, 03:26 AM
Yep.. Luckily I made the debug option now I can find it quite quickly. Expect a v1.0.3 to be coming...

It should have said:
Final compare result of all arguments 0 in the last one.

FTPServerTools
05-22-2003, 07:37 AM
Well that was easy to find with the debug info. Version 1.0.3 should fix that last issue as well.

Vampirix
05-22-2003, 08:03 AM
very good now it works fine ;)
great addon =)

iXi
05-22-2003, 01:35 PM
moin

ive got a problem with latest version..
i allways geht this msg..
site antiidle
200-SHELL32.DLL routines can not be found
200 Command Successful.

FTPServerTools
05-22-2003, 07:47 PM
Version 1.0.4 should fix that...

Superblue
05-22-2003, 08:07 PM
1.0.3 works great for me, nice work!

FTPServerTools
05-23-2003, 06:42 PM
Yes we are already a bit further.

1.0.5:Fixes - idle could also kick long up and downloads
Added:sitekill uid and sitekill gid these are treted like numbers.
Fixed:Long user list displayed when a connection in ioFTPD is invalid (uid=-1)
Fixed:uid=-1 and other weird connections are now handled properly. A warning is being made that uid xxx or gid xxx can not be found.

pwet
05-24-2003, 04:46 AM
really nice script bro

perhaps someone could make a public irc command which can kick idlers on site

<X>!killidlers
<Bot> Done, 2****in idlers killed



sorry i m noob with tcl scripting :(

FTPServerTools
05-25-2003, 02:55 PM
bind pub - !killidlers killidlers

proc killidlers {nick uhost hand chan args}
{
[exec -- "c:\\ioftpd\\scripts\\sitekill" "idle>120" "service=ftp"]
}

If I didnt make any typos.... (untested)...

But why would you? Use the scheduler instead....

m0B
05-25-2003, 03:56 PM
I dont use the schelduler anymore, it just wont work ok..

Using it a couple of days users start to complain that they are getting dropped while FXPing or Leeching, and Im not around to catch when it exactly happends.. So u should add some sort of debug.log..

So I disable it, and users stop get kicked off while FXPing or Leeching..

So I dunno if I dare to use in in schelduler, somehow I always get troubles..

FTPServerTools
05-26-2003, 03:16 AM
There is debugging. But you will have to find yourself when it happens.
Then run sitekill debug "idle>120" etc...

Yet be aware 1.0.4 indeed had a bug in which it kicked people that were doing a long down or upload. That is fixed in 1.0.5

I havent been able to test with 4.9.0 yet, since It isnt in my mailbox (yet......)

TaNiZi0
05-27-2003, 11:54 AM
Don't work :(

I'm using 4.9.3u and sitekill 1.0.5 and... WinXP SP1

1 user login ("edu") with 5min idle

>SiteKill.exe debug "user=edu"
Password_File=..\etc\passwd
Group_File=..\etc\group
Totally 0 connections kicked

>SiteKill.exe debug "idle>10"
Password_File=..\etc\passwd
Group_File=..\etc\group
Totally 0 connections kicked

site kill debug user=edu
200-Password_File=..\etc\passwd
200-Group_File=..\etc\group
200-Totally 0 connections kicked
200 Command Successful.

site kill debug idle>10
200-Password_File=..\etc\passwd
200-Group_File=..\etc\group
200-Totally 0 connections kicked
200 Command Successful.

:confused:

Vampirix
05-28-2003, 03:28 AM
tanizio it does the same think with a friend of mine which uses Win 2k... i hope this wonderful tool could be used on win 2k too =)

FTPServerTools
05-28-2003, 09:21 AM
1.0.6:added:error is returned in debug mode if io doesnt give a shared memory block (it shouldnt occur normally).
fixed:forgot to initialize a variable


And yes you can use it on win2k provided you use 4.6.2 patched or the new ioftpd.

And that what you described with 1.0.5 should be working now..

Popop56
07-09-2003, 09:12 AM
OS : WIN 2k SP3

c:\ioFTPD\scripts\sitekill.exe debug "user=Popop56"
ioFTPD window can not be found

SiteKill script need open ioFTPD window ?

FTPServerTools
07-10-2003, 03:44 AM
sitekill needs to find ioftpd and it does so by finding its window. If the windo can not be found then ioftpd isnt running.

MrManc
08-14-2003, 08:53 AM
I get an error when doing

SiteKill.exe "idle>120" service=FTP_Service

from a cmd window

SiteKill.exe - Entry Point Not Found

The procedure entry point Proccess32Next could not be located in the dynamic link library Kernel32.dll

Using winnt 4 and ioFTPD-beta4-9-4u

Thanks for any help

Razor
08-14-2003, 08:05 PM
i made a !kickidlers cmd

works fine

just ported the cmd to ftp :)

and it announces the reply in irc :)

like

(xXx): Kicked: **** *@*
(xXx): Kicked: *** *@*
(xXx): Kicked: Razor *@*
(xXx): Totally 3 connections kicked

as u see it gives the ip's also.. people dont like there ip in iRC :|

any way to make it just Kicked: Nick

no ip?

FTPServerTools
08-19-2003, 04:46 AM
SiteKill.exe - Entry Point Not Found

The procedure entry point Proccess32Next could not be located in the dynamic link library Kernel32.dll

This error is correct I think. Process32Next doesnt exist in Kernel32.dll. I would have to recompile SiteKill seperately for Win NT4. But since win NT4 is no longer supported by microsoft and since everyone seems to be running win2K/9X/XP/2k3 I didnt bother. NT4 is SLOW so to be honest I advise to update your OS.
The routine is used to find ioFTPD in the task list and extract its current path. As you may have noticed, sitekill actually find the users and groups directories all by itself, no ini file is needed. :) Aint that cute?
When I investigated the dll's from NT4 I couldnt find a Process32Next contrary to the microsoft claims:

Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Tlhelp32.h.
Library: Use Kernel32.lib.

Thus I conclude that this isnt possible. I dont have a usefull NT4 so recompiling it is not really an option. Anyway thatnks for showing it, now I can say it is not supported by NT4 since NT4 doesnt support this call, as Win9X,Win2K,WinME,Win2k3,WinXP and even WinCE do.

MrManc
08-19-2003, 05:08 AM
hehe,

ok thanks for looking into it :)
the box owner is stubbern and won't update, but bought myself a registered copy of io now, to fix the idle problems i was having :)

MrManc

FTPServerTools
08-21-2003, 03:25 AM
Hmm silly of him, win2k/xp is a lot faster on the internet as well.
I am also not 100% sure if the shell32.dll of win NT4 supports the undocumented shared memory functions. I have no way of checking that. Otherwise I could easily recompile a sitekill for nt4.
So can you check if sitewho from caladan or the recompiled version I made is running?

chimera
09-09-2003, 11:51 PM
Hey.

I'm using
ioFTPD 4.9.4u
SiteKill 1.0.6
WinXP + SP1

From .ini
[Scheduler]
KillIdlers = 0,5,10,15,20,25,30,35,40,45,50,55 * * * ..\scripts\SiteKill.exe service=FTP_Service "idle>120"

When running debug..
> sitekill debug service=FTP_Service "idle>120"
Password_File=..\etc\passwd
Group_File=..\etc\group
Totally 0 connections kicked

Using as raw command SITE KILL "idle>120" works fine.

In all cases above the user has been idle for more than 2 minutes.

So you see, my problem is that i'm not able to get it working running under scheduler. Any clues?

*edit* after running debug mode i can't get it to work in any config? i've tried both prompt, raw command, waiting for scheduler and now i always get the result 0 connections kicked *edit*

MaistroX
09-15-2003, 04:12 PM
Will sitekill be able to use in Beta 5+ of ioFTPD soon ? :)

FTPServerTools
09-16-2003, 02:54 AM
Yes.