PtokaX forum

Stuff => Offtopic => Topic started by: enema on 22 December, 2004, 18:23:33

Title: IP hiding behind freekin' number
Post by: enema on 22 December, 2004, 18:23:33
Have anyone saw something like this before? try to connect to this number (as an address) 1357446059 and it really works! It connects to hub! What the hell is that? How does it possible?
Title:
Post by: n1ck on 22 December, 2004, 20:14:05
Ive seen that before, cant remember where tho, its not a mac addy - or hex?
Title:
Post by: UwV on 22 December, 2004, 20:49:53
hexi-deci
Title:
Post by: [PT]CableGuy on 22 December, 2004, 21:46:17
QuoteOriginally posted by enema
...How does it possible?...
Like mentioned , it's only a calculation between decimal and hexadecimal numbers.
Take a look at the following link , that contains a java applet , capable to calculate the ip address.

A Java calculator with intuitive controls (http://www.subnetonline.com/subcalc/subnet4.html)
Title:
Post by: plop on 22 December, 2004, 22:59:13
QuoteOriginally posted by [PT]CableGuy
QuoteOriginally posted by enema
...How does it possible?...
Like mentioned , it's only a calculation between decimal and hexadecimal numbers.
Take a look at the following link , that contains a java applet , capable to calculate the ip address.

A Java calculator with intuitive controls (http://www.subnetonline.com/subcalc/subnet4.html)
hex = 0 1 2 3 4 5 6 7 8 9 a b c d e f.
dec = 0 1 2 3 4 5 6 7 8 9
but an ip = xxx.xxx.xxx.xxx, where xxx can be from 0 to 255.
this can be converted into decimal format in the next way.
(xxx * 16777216) + (xxx * 65536) + (xxx * 256) + (xxx).
maby best 2 explain it with an example from binairy format.
0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
which can be turned into.
0.0.0.0 = 0
0.0.0.1 = 1
0.0.1.0 = 2
0.0.1.1 = 3
0.1.0.0 = 4
only on ip's it goes from 0 to 255 instead of 0 to 1.
so 0.0.1.1 makes 257 (the 1st 1 = 256, and the last is 1).

plop
Title:
Post by: kepp on 22 December, 2004, 23:12:29
OK, i need a headache pill now, lol
Title:
Post by: chill on 22 December, 2004, 23:51:47
To Compute and DeCompute

----------------------------------------------------------------------------------
--// Compute IP
----------------------------------------------------------------------------------
function ComputeIP(curIP)
local _,_,a,b,c,d = strfind(curIP, "^(%d+)%.(%d+)%.(%d+)%.(%d+)$")
return a*16777216 + b*65536 + c*256 + d
end


----------------------------------------------------------------------------------
--// DeCompute IP
----------------------------------------------------------------------------------
function DeComputeIP(cIP)
local temp1 = mod(cIP,16777216)
local temp2 = mod(temp1,65536)
return (floor(cIP/16777216).."."..floor(temp1/65536).."."..floor(temp2/256).."."..floor(mod(temp2,256)))
end


there is also a way for decomputing from rabid wombat, somewhere  I think it was for i = 1, 4 do
something^weird
end

* found it
function Int64ToIPString(iIP)

   local sRet = "";

   for j = 0, j < 4, 1 do

      if( j ~= 0) then sRet = "." .. sRet; end

      sRet = mod(iIP, 256) .. sRet;

      iIP = floor(iIP / 256);

   end



   return sRet;

end
but working finest
Title:
Post by: enema on 23 December, 2004, 07:27:26
I know, this should be in request section, but it allso fits here... Could you guys create an antispam script that kicks users if they type so big numbers in chat like these? please!
Title:
Post by: blackwings on 23 December, 2004, 08:15:20
QuoteOriginally posted by enema
I know, this should be in request section, but it allso fits here... Could you guys create an antispam script that kicks users if they type so big numbers in chat like these? please!
well I think this can kick innocent users.

But a script that report to operator, but only if the script can convert the number to a possible IP (non of the number is above 255 in the IP), then it will report to the OP the user's username + the whole message which this number was in(maybe also show the number in the orignal way and the converted version made by script, like = 3563445622/212.33.112.85).