Порой на форумах возникает вопрос, как получить список ip диапазонов для какого-то города или штата.
Для этого и написана следующая программа.
Все данные берутся из 2 файлов:
-GeoLiteCity-Blocks.csv
-GeoLiteCity-Location.csv
Они должны лежать в папке с программой, взять их можно по адресу:
Пожалуйста,
Вход
или
Регистрация
для просмотра содержимого URL-адресов!
.Первый файл - это база блоков ip адресов, имеет вид "16777216","17301503","17" то есть начало и конец диапазона в десятичном представлении и идентификтор, связывающий наши 2 файла.
Второй файл - это база геолокации, она имеет формат 123715,"US","NY","Lisle","13797",42.3340,-76.0433,502,607 тут для нас представляют интерес первые 4 параметра, это соответственно идентификатор связи, страна, регион и город.
Если со страной и городом все понятно, то регион в большинстве случаев представляет просто число, например 08, и не несет никакой смысловой нагрузки.
Исключением являются 2 страны: США и Канада, для которых регион обозначает штат и провинцию соответственно.
При запуске сначала необходимо загрузить все данные из файлов в память, для этого предназначена кнопка "load". После загрузки баз в поле со странами появится список всех стран, а именно их аббревиатур. Для расшифровки можно использовать таблицу ниже:
Код:
A1,"Anonymous Proxy"
A2,"Satellite Provider"
O1,"Other Country"
AD,"Andorra"
AE,"United Arab Emirates"
AF,"Afghanistan"
AG,"Antigua and Barbuda"
AI,"Anguilla"
AL,"Albania"
AM,"Armenia"
AN,"Netherlands Antilles"
AO,"Angola"
AP,"Asia/Pacific Region"
AQ,"Antarctica"
AR,"Argentina"
AS,"American Samoa"
AT,"Austria"
AU,"Australia"
AW,"Aruba"
AX,"Aland Islands"
AZ,"Azerbaijan"
BA,"Bosnia and Herzegovina"
BB,"Barbados"
BD,"Bangladesh"
BE,"Belgium"
BF,"Burkina Faso"
BG,"Bulgaria"
BH,"Bahrain"
BI,"Burundi"
BJ,"Benin"
BL,"Saint Bartelemey"
BM,"Bermuda"
BN,"Brunei Darussalam"
BO,"Bolivia"
BR,"Brazil"
BS,"Bahamas"
BT,"Bhutan"
BV,"Bouvet Island"
BW,"Botswana"
BY,"Belarus"
BZ,"Belize"
CA,"Canada"
CC,"Cocos (Keeling) Islands"
CD,"Congo, The Democratic Republic of the"
CF,"Central African Republic"
CG,"Congo"
CH,"Switzerland"
CI,"Cote d'Ivoire"
CK,"Cook Islands"
CL,"Chile"
CM,"Cameroon"
CN,"China"
CO,"Colombia"
CR,"Costa Rica"
CU,"Cuba"
CV,"Cape Verde"
CX,"Christmas Island"
CY,"Cyprus"
CZ,"Czech Republic"
DE,"Germany"
DJ,"Djibouti"
DK,"Denmark"
DM,"Dominica"
DO,"Dominican Republic"
DZ,"Algeria"
EC,"Ecuador"
EE,"Estonia"
EG,"Egypt"
EH,"Western Sahara"
ER,"Eritrea"
ES,"Spain"
ET,"Ethiopia"
EU,"Europe"
FI,"Finland"
FJ,"Fiji"
FK,"Falkland Islands (Malvinas)"
FM,"Micronesia, Federated States of"
FO,"Faroe Islands"
FR,"France"
FX,"France, Metropolitan"
GA,"Gabon"
GB,"United Kingdom"
GD,"Grenada"
GE,"Georgia"
GF,"French Guiana"
GG,"Guernsey"
GH,"Ghana"
GI,"Gibraltar"
GL,"Greenland"
GM,"Gambia"
GN,"Guinea"
GP,"Guadeloupe"
GQ,"Equatorial Guinea"
GR,"Greece"
GS,"South Georgia and the South Sandwich Islands"
GT,"Guatemala"
GU,"Guam"
GW,"Guinea-Bissau"
GY,"Guyana"
HK,"Hong Kong"
HM,"Heard Island and McDonald Islands"
HN,"Honduras"
HR,"Croatia"
HT,"Haiti"
HU,"Hungary"
ID,"Indonesia"
IE,"Ireland"
IL,"Israel"
IM,"Isle of Man"
IN,"India"
IO,"British Indian Ocean Territory"
IQ,"Iraq"
IR,"Iran, Islamic Republic of"
IS,"Iceland"
IT,"Italy"
JE,"Jersey"
JM,"Jamaica"
JO,"Jordan"
JP,"Japan"
KE,"Kenya"
KG,"Kyrgyzstan"
KH,"Cambodia"
KI,"Kiribati"
KM,"Comoros"
KN,"Saint Kitts and Nevis"
KP,"Korea, Democratic People's Republic of"
KR,"Korea, Republic of"
KW,"Kuwait"
KY,"Cayman Islands"
KZ,"Kazakhstan"
LA,"Lao People's Democratic Republic"
LB,"Lebanon"
LC,"Saint Lucia"
LI,"Liechtenstein"
LK,"Sri Lanka"
LR,"Liberia"
LS,"Lesotho"
LT,"Lithuania"
LU,"Luxembourg"
LV,"Latvia"
LY,"Libyan Arab Jamahiriya"
MA,"Morocco"
MC,"Monaco"
MD,"Moldova, Republic of"
ME,"Montenegro"
MF,"Saint Martin"
MG,"Madagascar"
MH,"Marshall Islands"
MK,"Macedonia"
ML,"Mali"
MM,"Myanmar"
MN,"Mongolia"
MO,"Macao"
MP,"Northern Mariana Islands"
MQ,"Martinique"
MR,"Mauritania"
MS,"Montserrat"
MT,"Malta"
MU,"Mauritius"
MV,"Maldives"
MW,"Malawi"
MX,"Mexico"
MY,"Malaysia"
MZ,"Mozambique"
NA,"Namibia"
NC,"New Caledonia"
NE,"Niger"
NF,"Norfolk Island"
NG,"Nigeria"
NI,"Nicaragua"
NL,"Netherlands"
NO,"Norway"
NP,"Nepal"
NR,"Nauru"
NU,"Niue"
NZ,"New Zealand"
OM,"Oman"
PA,"Panama"
PE,"Peru"
PF,"French Polynesia"
PG,"Papua New Guinea"
PH,"Philippines"
PK,"Pakistan"
PL,"Poland"
PM,"Saint Pierre and Miquelon"
PN,"Pitcairn"
PR,"Puerto Rico"
PS,"Palestinian Territory"
PT,"Portugal"
PW,"Palau"
PY,"Paraguay"
QA,"Qatar"
RE,"Reunion"
RO,"Romania"
RS,"Serbia"
RU,"Russian Federation"
RW,"Rwanda"
SA,"Saudi Arabia"
SB,"Solomon Islands"
SC,"Seychelles"
SD,"Sudan"
SE,"Sweden"
SG,"Singapore"
SH,"Saint Helena"
SI,"Slovenia"
SJ,"Svalbard and Jan Mayen"
SK,"Slovakia"
SL,"Sierra Leone"
SM,"San Marino"
SN,"Senegal"
SO,"Somalia"
SR,"Suriname"
ST,"Sao Tome and Principe"
SV,"El Salvador"
SY,"Syrian Arab Republic"
SZ,"Swaziland"
TC,"Turks and Caicos Islands"
TD,"Chad"
TF,"French Southern Territories"
TG,"Togo"
TH,"Thailand"
TJ,"Tajikistan"
TK,"Tokelau"
TL,"Timor-Leste"
TM,"Turkmenistan"
TN,"Tunisia"
TO,"Tonga"
TR,"Turkey"
TT,"Trinidad and Tobago"
TV,"Tuvalu"
TW,"Taiwan"
TZ,"Tanzania, United Republic of"
UA,"Ukraine"
UG,"Uganda"
UM,"United States Minor Outlying Islands"
US,"United States"
UY,"Uruguay"
UZ,"Uzbekistan"
VA,"Holy See (Vatican City State)"
VC,"Saint Vincent and the Grenadines"
VE,"Venezuela"
VG,"Virgin Islands, British"
VI,"Virgin Islands, U.S."
VN,"Vietnam"
VU,"Vanuatu"
WF,"Wallis and Futuna"
WS,"Samoa"
YE,"Yemen"
YT,"Mayotte"
ZA,"South Africa"
ZM,"Zambia"
ZW,"Zimbabwe"
Код:
Провинции Канады
CA,AB,"Alberta"
CA,BC,"British Columbia"
CA,MB,"Manitoba"
CA,NB,"New Brunswick"
CA,NL,"Newfoundland"
CA,NS,"Nova Scotia"
CA,NU,"Nunavut"
CA,ON,"Ontario"
CA,PE,"Prince Edward Island"
CA,QC,"Quebec"
CA,SK,"Saskatchewan"
CA,NT,"Northwest Territories"
CA,YT,"Yukon Territory"
Штаты США
US,AA,"Armed Forces Americas"
US,AE,"Armed Forces Europe, Middle East, & Canada"
US,AK,"Alaska"
US,AL,"Alabama"
US,AP,"Armed Forces Pacific"
US,AR,"Arkansas"
US,AS,"American Samoa"
US,AZ,"Arizona"
US,CA,"California"
US,CO,"Colorado"
US,CT,"Connecticut"
US,DC,"District of Columbia"
US,DE,"Delaware"
US,FL,"Florida"
US,FM,"Federated States of Micronesia"
US,GA,"Georgia"
US,GU,"Guam"
US,HI,"Hawaii"
US,IA,"Iowa"
US,ID,"Idaho"
US,IL,"Illinois"
US,IN,"Indiana"
US,KS,"Kansas"
US,KY,"Kentucky"
US,LA,"Louisiana"
US,MA,"Massachusetts"
US,MD,"Maryland"
US,ME,"Maine"
US,MH,"Marshall Islands"
US,MI,"Michigan"
US,MN,"Minnesota"
US,MO,"Missouri"
US,MP,"Northern Mariana Islands"
US,MS,"Mississippi"
US,MT,"Montana"
US,NC,"North Carolina"
US,ND,"North Dakota"
US,NE,"Nebraska"
US,NH,"New Hampshire"
US,NJ,"New Jersey"
US,NM,"New Mexico"
US,NV,"Nevada"
US,NY,"New York"
US,OH,"Ohio"
US,OK,"Oklahoma"
US,OR,"Oregon"
US,PA,"Pennsylvania"
US,PR,"Puerto Rico"
US,PW,"Palau"
US,RI,"Rhode Island"
US,SC,"South Carolina"
US,SD,"South Dakota"
US,TN,"Tennessee"
US,TX,"Texas"
US,UT,"Utah"
US,VA,"Virginia"
US,VI,"Virgin Islands"
US,virustotal,"Vermont"
US,WA,"Washington"
US,WV,"West Virginia"
US,WI,"Wisconsin"
US,WY,"Wyoming"
Ниже под списками стран, регионов и городов находятся 3 кнопки. При нажатии на них вы получите соответственно список диапазонов для конкретной страны, для конкретного региона или города. Результаты отображаются в окне справа, также внизу можно увидеть количество полученных диапазонов и число айпишников в них.
Кнопка ALL. Служит для получения списка ВСЕХ городов в формате
город;регион;страна
Требуется тогда, когда вам нужен город X, но неизвестен регион либо страна.
Пожалуйста,
Вход
или
Регистрация
для просмотра содержимого URL-адресов!
Пожалуйста,
Вход
или
Регистрация
для просмотра содержимого URL-адресов!