RangeFucker
 

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

RangeFucker

Started by bastya_elvtars, 24 April, 2006, 17:50:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bastya_elvtars

http://ptxscriptdb.psycho-chihuahua.net/e107_plugins/docrep_menu/docrep.php?0.view.69.18.

-- rewritten cmpletely for use with PtokaX 0.3.4.0 range management
-- added CIDR support (RFC 1518)
-- removed listing of range bans, added searching instead
-- separate temp. and perm. ban management
-- configurable with LuaSlave
-- full rightclick support


Enjoy!
Everything could have been anything else and it would have just as much meaning.

6Marilyn6Manson6

Quote from: bastya_elvtars on 24 April, 2006, 17:50:25
http://ptxscriptdb.psycho-chihuahua.net/e107_plugins/docrep_menu/docrep.php?0.view.69.18.

-- rewritten cmpletely for use with PtokaX 0.3.4.0 range management
-- added CIDR support (RFC 1518)
-- removed listing of range bans, added searching instead
-- separate temp. and perm. ban management
-- configurable with LuaSlave
-- full rightclick support


Enjoy!


I love this script... very nice work ;)

GeceBekcisi

#2
CIDR --> IP Range conversion works in non-standard way in this script...

? ? ? local sIP=RangeFucker.Calculate(ip)+1
? ? ? local eIP=RangeFucker.Calculate(ip)+2^(32-cidr)-1


will fail to give same IP ranges for 192.168.1.10/24 and 192.168.1.100/24 but they are both the same thing. You can test here or here.


Check my code here, as far as I tested it's working as it should..
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...

bastya_elvtars

Quote from: GeceBekcisi on 29 May, 2006, 23:19:50
CIDR --> IP Range conversion works in non-standard way in this script...

      local sIP=RangeFucker.Calculate(ip)+1
      local eIP=RangeFucker.Calculate(ip)+2^(32-cidr)-1


will fail to give same IP ranges for 192.168.1.10/24 and 192.168.1.100/24 but they are both the same thing. You can test here or here.


Check my code here, as far as I tested it's working as it should..

Well, if this is non-standard, it sure would not be in e. g. OpenBSD's pf in the way it is in my little script. Or, this is a quitem widespread nonstandard thing,  I'll leave it as is.
Everything could have been anything else and it would have just as much meaning.

GeceBekcisi

Quote from: bastya_elvtars on 29 May, 2006, 23:42:47
Well, if this is non-standard, it sure would not be in e. g. OpenBSD's pf in the way it is in my little script. Or, this is a quitem widespread nonstandard thing,? I'll leave it as is.

Calculate(ip)+2^(32-cidr)-1 will give you the size of the IP range, and yes, you're true, it's widely believed that this can give you you the IP range but you can't make simple calculations based on that..

Check any CIDR --> IP range tool you can find and try the examples above; 192.168.1.10/24 & 192.168.1.100/24 and compare them with your results...


Your script will produce

192.168.1.10/24 --> 192.168.1.10 - 192.168.2.9
192.168.1.100/24 --> 192.168.1.100 - 192.168.2.99

where they have to be same and 192.168.1.0 - 192.168.1.255
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...

bastya_elvtars

Yes, true, but from my point of view this is absolutely OK, since I want to get on with this common mistake. I know I should binarize IPs and do bitwise operations to check who belongs under what netmask, but since PtokaX range ban implementation is permissive enough to allow such addressing schemes, I'll stick with this, even though it would be easy to switch, cause this is the more popular one.
Everything could have been anything else and it would have just as much meaning.

GeceBekcisi

Thanks mate, if it's OK for you it's OK for me too.. I was just trying to point that your CIDR support is not RFC-1518 compliant..
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...

bastya_elvtars

Quote from: GeceBekcisi on 30 May, 2006, 00:17:44
Thanks mate, if it's OK for you it's OK for me too.. I was just trying to point that your CIDR support is not RFC-1518 compliant..

Anyhow, supporting CIDR is just eyecandy, very few use it actually. :-)
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

2.5 is going to come soon. I wrote bitwise routines using LuaBit , will be 5.1 only and will have dotted netmask support as well.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk