Home > Networking > Converting an IP address to an IP Number & Retrieving the Country Name and Country Code from the IP Number
Converting an IP address to an IP Number & Retrieving the Country Name and Country Code from the IP Number
Posted on 12 Februari 2010 by c0decstuff
IP address (IPv4 / IPv6) is divided into 4 sub-blocks. Each sub-block has a different weight number each powered by 256. IP number is being used in the database because it is efficient to search between a range of number in database.
Beginning IP number and Ending IP Number are calculated based on following formula:
IP Number = 16777216*w + 65536*x + 256*y + z (Formula 1)
where
IP Address = w.x.y.z
For example, if IP address is "202.186.13.4", then its IP Number "3401190660" is based on the Formula 1.
IP Address = 202.186.13.4
So, w = 202, x = 186, y = 13 and z = 4
IP Number = 16777216*202 + 65536*186 + 256*13 + 4
= 3388997632 + 12189696 + 3328 + 4
= 3401190660
To reverse IP number to IP address,
w = int ( IP Number / 16777216 ) % 256
x = int ( IP Number / 65536 ) % 256
y = int ( IP Number / 256 ) % 256
z = int ( IP Number ) % 256
where % is the mod operator and int is return the integer part of the division.
[Top]
For example, IP Address "202.186.13.4" is equivalent to IP Number "3401190660". It falls in the following range of IP number in the table because it is between the "From IP number" and the "To IP number".
"3401056256","3401400319","MY","MALAYSIA"
From the IP range, the Country Name is Malaysia and Country Code is MY.
IP-COUNTRY TABLE
credit to:hackingspirits
Beginning IP number and Ending IP Number are calculated based on following formula:
IP Number = 16777216*w + 65536*x + 256*y + z (Formula 1)
where
IP Address = w.x.y.z
For example, if IP address is "202.186.13.4", then its IP Number "3401190660" is based on the Formula 1.
IP Address = 202.186.13.4
So, w = 202, x = 186, y = 13 and z = 4
IP Number = 16777216*202 + 65536*186 + 256*13 + 4
= 3388997632 + 12189696 + 3328 + 4
= 3401190660
To reverse IP number to IP address,
w = int ( IP Number / 16777216 ) % 256
x = int ( IP Number / 65536 ) % 256
y = int ( IP Number / 256 ) % 256
z = int ( IP Number ) % 256
where % is the mod operator and int is return the integer part of the division.
[Top]
2. Retrieving the Country Name and Country Code from the IP Number
Search the IP-COUNTRY TABLE to match a unique record that has the IP number fits between From IP Number and To IP Number.For example, IP Address "202.186.13.4" is equivalent to IP Number "3401190660". It falls in the following range of IP number in the table because it is between the "From IP number" and the "To IP number".
"3401056256","3401400319","MY","MALAYSIA"
From the IP range, the Country Name is Malaysia and Country Code is MY.
IP-COUNTRY TABLE
From IP Number | To IP Number | Country Code | Country Name |
3400892416 | 3400925183 | HK | HONG KONG |
3400925184 | 3400933375 | TH | THAILAND |
3400941568 | 3400949759 | AU | AUSTRALIA |
3400957952 | 3400966143 | AU | AUSTRALIA |
3400982528 | 3400990719 | HK | HONG KONG |
3400990720 | 3400998911 | ID | INDONESIA |
3400998912 | 3401003007 | PH | PHILIPPINES |
3401007104 | 3401011199 | IN | INDIA |
3401023488 | 3401056255 | TH | THAILAND |
3401056256 | 3401400319 | MY | MALAYSIA |
3401408512 | 3401416703 | HK | HONG KONG |
3401416704 | 3401420799 | KR | KOREA, REPU |
3401441280 | 3401449471 | PH | PHILIPPINES |
3401449472 | 3401515263 | MY | MALAYSIA |
3401531392 | 3401539583 | IN | INDIA |
3401547776 | 3401580543 | MY | MALAYSIA |
3401580544 | 3402629119 | CN | CHINA |
3402629120 | 3404464127 | JP | JAPAN |
3405774848 | 3406434303 | AU | AUSTRALIA |
3406436352 | 3409969151 | AU | AUSTRALIA |
3409969152 | 3410755583 | TW | TAIWAN |
3410755584 | 3410780159 | AU | AUSTRALIA |
3410788352 | 3410796543 | HK | HONG KONG |
3410796544 | 3410800639 | LK | SRI LANKA |
3410812928 | 3410821119 | AU | AUSTRALIA |
3410821120 | 3410853887 | TW | TAIWAN |
3410853888 | 3410862079 | HK | HONG KONG |
3410870272 | 3410874367 | IN | INDIA |
3410878464 | 3410886655 | ID | INDONESIA |
3410886656 | 3410887679 | TW | TAIWAN |
3410894848 | 3410898943 | HK | HONG KONG |
3410903040 | 3410911231 | HK | HONG KONG |
3410919424 | 3410927615 | IN | INDIA |
3410944000 | 3410952191 | PH | PHILIPPINES |
3410952192 | 3410960383 | TW | TAIWAN |
3410968576 | 3410984959 | NZ | NEW ZEALAND |
3410984960 | 3411017727 | TW | TAIWAN |
3411017728 | 3411018751 | HK | HONG KONG |
3411034112 | 3411051519 | HK | HONG KONG |
3411058688 | 3411062783 | AU | AUSTRALIA |
3411066880 | 3411083775 | HK | HONG KONG |
3411087360 | 3411091455 | CN | CHINA |
3411091456 | 3411095551 | SG | SINGAPORE |
3411099648 | 3411107839 | MM | MYANMAR |
3411116032 | 3411124223 | IN | INDIA |
3411132416 | 3411136511 | PK | PAKISTAN |
3411147776 | 3411149311 | HK | HONG KONG |
3411156992 | 3411161087 | PH | PHILIPPINES |
3411165184 | 3411173375 | MY | MALAYSIA |
3411181568 | 3411189759 | JP | JAPAN |
3411197952 | 3411202047 | BD | BANGLADESH |
3411213312 | 3411215359 | HK | HONG KONG |
3411230720 | 3411247103 | HK | HONG KONG |
3411247104 | 3411255295 | AU | AUSTRALIA |
3411278848 | 3411296255 | HK | HONG KONG |
3411312640 | 3411313151 | HK | HONG KONG |
3411329024 | 3411337215 | PH | PHILIPPINES |
3411337216 | 3411341311 | AU | AUSTRALIA |
3411345408 | 3411411967 | HK | HONG KONG |
3411435520 | 3411443711 | IN | INDIA |
3411443712 | 3411460095 | HK | HONG KONG |
3411475456 | 3411476479 | HK | HONG KONG |
3411476480 | 3411509247 | AU | AUSTRALIA |
3411509248 | 3411517439 | PH | PHILIPPINES |
3411525632 | 3411529727 | SG | SINGAPORE |
3411533824 | 3411543039 | CN | CHINA |
3411558400 | 3411566591 | AU | AUSTRALIA |
3411574784 | 3411582975 | IN | INDIA |
3411591168 | 3411595263 | HK | HONG KONG |
3411599360 | 3411607551 | AU | AUSTRALIA |
3411607552 | 3411608575 | CN | CHINA |
3411623936 | 3411632127 | AU | AUSTRALIA |
3411640320 | 3411648511 | PK | PAKISTAN |
3411656704 | 3411673087 | AU | AUSTRALIA |
3411673088 | 3411674111 | CN | CHINA |
3411689472 | 3411701759 | IN | INDIA |
3411722240 | 3411726335 | PH | PHILIPPINES |
3411730432 | 3411738623 | HK | HONG KONG |
3411738624 | 3411739647 | CN | CHINA |
3411755008 | 3411763199 | AU | AUSTRALIA |
3411771392 | 3411779583 | HK | HONG KONG |
3411795968 | 3411804159 | AU | AUSTRALIA |
3411804160 | 3411805183 | CN | CHINA |
3411820544 | 3411832831 | SG | SINGAPORE |
3411836928 | 3411845119 | MY | MALAYSIA |
3411853312 | 3411857407 | IN | INDIA |
3411861504 | 3411869695 | AU | AUSTRALIA |
3411869696 | 3411943423 | CN | CHINA |
3411951616 | 3411967999 | LK | SRI LANKA |
3411968000 | 3411984383 | AU | AUSTRALIA |
3411984384 | 3412000767 | IN | INDIA |
3412000768 | 3412002815 | CN | CHINA |
3412017152 | 3412025343 | SG | SINGAPORE |
3412033536 | 3412066303 | TW | TAIWAN |
3412066304 | 3412213759 | NZ | NEW ZEALAND |
3412213760 | 3412221951 | AU | AUSTRALIA |
3412230144 | 3412246527 | HK | HONG KONG |
3412254720 | 3412262911 | NR | NAURU |
3412262912 | 3412273151 | NZ | NEW ZEALAND |
3412279296 | 3412281343 | NZ | NEW ZEALAND |
Category Article Networking
5 Responses to “c0decstuff”
Total Pageviews
Labels
- Android (1)
- Aplication (14)
- ARP (1)
- Backdoored (2)
- Browser (1)
- Cloud (1)
- Exploitation (1)
- Exploits (7)
- Facebook (2)
- forensics (3)
- Hacking (11)
- Hijacking (1)
- Honeypot (1)
- HTML5 (1)
- ios (2)
- Jailbreak (2)
- Linux (1)
- Malware (5)
- metasploit (2)
- Meterpreter (1)
- Movie (1)
- Networking (1)
- News (2)
- password attack (2)
- Penetration Test (2)
- Python (1)
- reverse engineering (1)
- Rootkits (1)
- Security (12)
- shellcode (2)
- Stuxnet/Duqu (2)
- Uncategories (1)
- Virus (1)
- Vulnerability (8)
- Web (5)
- Wifi (1)
- Windows (5)
Blog Archive
-
▼
10
(67)
-
▼
Feb
(12)
- How to Prevent Joomla from being hacked or exploited
- HOW TO COVER YOUR TRACKS
- Converting an IP address to an IP Number & Retriev...
- Spoofing Technique
- TinyMCE WYSIWYG Editor Multiple Vulnerabilities
- LDAP Injection
- Fingerprinting web applications (Joomla, Mediawiki...
- Zenoss Multiple Admin CSRF
- phpldapadmin packages fix remote file inclusion
- [Full-disclosure] e107 latest download link is bac...
- Significant Number Of WordPress Websites Compromis...
- Web 2.0 Pivot Attacks
-
▼
Feb
(12)
Friendlist
Security Resources
-
-
-
This feed contains no entries
-
-
-
-
-
-
-
-
-
تعالى معنا نعرفك ونضع يديك على انه من افضل الأعمال التي تقدم خدمات منزلية تلك الخدمات في مكافحة الحشرات المنزلية ورش المبيدات ولهذا فان شركة مكافحة حشرات بجدة التي تختص برش المبيدات في المنازل لكي تقضي على الحشرات تقدم أعمال جيدة وفي مكة المكرمة شركة مكافحة حشرات بمكة لديها خبرة كبيرة وعمال جيدين في تقديم خدمات مكافحة الحشرات في العاصمة المقدسة وعند الانتقال الى مدينة الطائف فقد تجد شركة مكافحة حشرات بالطائف التي تتصدر قائمة الشركات في الطائف من حيث أفضلية الخدمات المقدمة من تلك الشركات والتي تختص برش مبيدات في الطائف وايضا في المدينه المنوره ترى شركة مكافحة حشرات بالمدينة المنورة التي تقدم اعمال مكافحة الحشرات داخل المنازل بمنتهى الاحترافية والجودة
yurtdışı kargo
resimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
2PS
salt likit
salt likit
dr mood likit
big boss likit
dl likit
dark likit
İGH
تسليك مجاري zoX9993axK
شركة تسليك مجاري في دبي Rp3bTsKkBM