GithubHelp home page GithubHelp logo

ip2location / ip2proxy-python Goto Github PK

View Code? Open in Web Editor NEW
25.0 6.0 7.0 100 KB

Python library for IP2Proxy database lookup. It can be used to find the IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits.

Home Page: https://www.ip2location.com

License: MIT License

Python 100.00%
python-library ip2proxy-python anonymous-proxy ip2proxy-database proxy-database tor vpn proxies

ip2proxy-python's Introduction

IP2Proxy Python Library

This library allows user to query an IP address if it was being used as VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges, residential proxies, consumer privacy networks, and enterprise private networks. It lookup the proxy IP address from IP2Proxy BIN Data file. This data file can be downloaded at

For more details, please visit: https://www.ip2location.com/ip2proxy/developers/python

Developer Documentation

To learn more about installation, usage, and code examples, please visit the developer documentation at https://ip2proxy-python.readthedocs.io/en/latest/index.html.

Proxy Type

Proxy Type Description
VPN Anonymizing VPN services.
TOR Tor Exit Nodes.
PUB Public Proxies.
WEB Web Proxies.
DCH Hosting Providers/Data Center.
SES Search Engine Robots.
RES Residential Proxies [PX10+]
CPN Consumer Privacy Networks. [PX11+]
EPN Enterprise Private Networks. [PX11+]

Usage Type

Usage Type Description
COM Commercial
ORG Organization
GOV Government
MIL Military
EDU University/College/School
LIB Library
CDN Content Delivery Network
ISP Fixed Line ISP
MOB Mobile ISP
DCH Data Center/Web Hosting/Transit
SES Search Engine Spider
RSV Reserved

Threat Type

Threat Type Description
SPAM Spammer
SCANNER Security Scanner or Attack
BOTNET Spyware or Malware

Support

Email: [email protected]. URL: https://www.ip2location.com

ip2proxy-python's People

Contributors

chrislim2888 avatar ip2location avatar mailboxvalidator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ip2proxy-python's Issues

No results from IP2Proxy-lite databases

I'm not sure if this is related to #1 but I'm having issues with the IP2Proxy-lite databases. I tried a few different databases from https://lite.ip2location.com/file-download (PX1LITEBIN, PX10LITEBIN, etc.) but I didn't get any results for any known Tor exit nodes.

import IP2Proxy
db = IP2Proxy.IP2Proxy()
db.open('IP2PROXY-LITE-PX10.BIN')
db.get_all("109.169.33.163") # {'is_proxy': 0, 'proxy_type': '-', 'country_short': '-', 'country_long': '-', 'region': '-', 'city': '-', 'isp': '-', 'domain': '-', 'usage_type': '-', 'asn': '-', 'as_name': '-', 'last_seen': '-'}
db.get_all("167.86.94.107")  # {'is_proxy': 0, 'proxy_type': '-', 'country_short': '-', 'country_long': '-', 'region': '-', 'city': '-', 'isp': '-', 'domain': '-', 'usage_type': '-', 'asn': '-', 'as_name': '-', 'last_seen': '-'}
db.get_all("199.249.230.82") # {'is_proxy': 0, 'proxy_type': '-', 'country_short': '-', 'country_long': '-', 'region': '-', 'city': '-', 'isp': '-', 'domain': '-', 'usage_type': '-', 'asn': '-', 'as_name': '-', 'last_seen': '-'}
print ('Module Version: ' + db.get_module_version()) # Module Version: 3.0.0
print ('Package Version: ' + db.get_package_version()) # Package Version: 10
print ('Database Version: ' + db.get_database_version()) # Database Version: 2020.7.1

I tried version 2.2.0 of the IP2Proxy python module but that didn't change the results. However, when I tried the sample DB available here I was able to get good results for the 3 IPs listed here. Is this just a matter of the limited accuracy of the lite databases or is there a larger issue with the library? I took a cursory look in the CSV versions of the databases and it looks like these exit nodes weren't present.

Method get thread not resolved

I just followed the example and I noticed that the method "get_threat" is an unresolved reference for the class IP2Proxy, could not find any info about its deprecation or is it available only on the commercial version?

Not detecting proxy

I took the python code and BIN file (IP2Proxy PX10 Sample BIN File) from here:

https://www.ip2location.com/development-libraries/ip2proxy/python

It works fine. However, the sample files are 2 months old so I tried to download the July version of proxy BIN file from here:

https://lite.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential

Now for every proxy IP it says "not a proxy". For example, here is a Tor ip: 23.160.208.249

Here is the sample code:

# DOES NOT WORK WITH JULY BIN FILE
import IP2Proxy
IP_ADD = "192.95.39.118"
db = IP2Proxy.IP2Proxy()
### open IP2Proxy BIN database for proxy lookup
db.open("/Users/ostester1/Downloads/IP2PROXY-LITE-PX10.BIN/IP2PROXY-LITE-PX10.BIN")
### get versioning information
print ('Module Version: ' + db.get_module_version())
print ('Package Version: ' + db.get_package_version())
print ('Database Version: ' + db.get_database_version())
### single function to get all proxy data returned in array
record = db.get_all(IP_ADD)
print ('Is Proxy: ' + str(db.is_proxy(IP_ADD)))
### close IP2Proxy BIN database
db.close()
# WORKS GREAT WITH FOLLOWING BIN FILE
import IP2Proxy
IP_ADD = "192.95.39.118"
db = IP2Proxy.IP2Proxy()
### open IP2Proxy BIN database for proxy lookup
db.open("/Users/ostester1/Downloads/sample.bin.px10/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN-THREAT-RESIDENTIAL.BIN")
### get versioning information
print ('Module Version: ' + db.get_module_version())
print ('Package Version: ' + db.get_package_version())
print ('Database Version: ' + db.get_database_version())
### single function to get all proxy data returned in array
record = db.get_all(IP_ADD)
print ('Is Proxy: ' + str(db.is_proxy(IP_ADD)))
### close IP2Proxy BIN database
db.close()

INVALID IP ADDRESS

IP2Proxy.IP2Proxy().get_all("8.8.8.8")
{'is_proxy': -1, 'proxy_type': 'INVALID IP ADDRESS', 'country_short': 'INVALID IP ADDRESS', 'country_long': 'INVALID IP ADDRESS', 'region': 'INVALID IP ADDRESS', 'city': 'INVALID IP ADDRESS', 'isp': 'INVALID IP ADDRESS', 'domain': 'INVALID IP ADDRESS', 'usage_type': 'INVALID IP ADDRESS', 'asn': 'INVALID IP ADDRESS', 'as_name': 'INVALID IP ADDRESS', 'last_seen': 'INVALID IP ADDRESS', 'threat': 'INVALID IP ADDRESS', 'provider': 'INVALID IP ADDRESS'}

im using IP2PROXY-LITE-PX11.BIN

IP2Proxy-lite db with IP2Proxy==2.2.0 not working.

I tested with Google's ip (8.8.8.8) and with a known TOR exit node (109.169.33.163).
Both IPs are not showing any info in the country code and the is_proxy is always 0.

Tested on Python 3.6, installed the version from pypi.
I tried with the IP2PROXY binary databases of level 2 and level 5, same result.

Am I doing something wrong?

import IP2Proxy

db = IP2Proxy.IP2Proxy('IP2PROXY.BIN')


db.get_all("8.8.8.8") 
{'is_proxy': 0, 'proxy_type': '-', 'country_short': '-', 'country_long': '-', 'region': 'NOT SUPPORTED', 'city': 'NOT SUPPORTED', 'isp': 'NOT SUPPORTED', 'domain': 'NOT SUPPORTED', 'usage_type': 'NOT SUPPORTED', 'asn': 'NOT SUPPORTED', 'as_name': 'NOT SUPPORTED', 'last_seen': 'NOT SUPPORTED'}


db.get_all("109.169.33.163") 
{'is_proxy': 0, 'proxy_type': '-', 'country_short': '-', 'country_long': '-', 'region': 'NOT SUPPORTED', 'city': 'NOT SUPPORTED', 'isp': 'NOT SUPPORTED', 'domain': 'NOT SUPPORTED', 'usage_type': 'NOT SUPPORTED', 'asn': 'NOT SUPPORTED', 'as_name': 'NOT SUPPORTED', 'last_seen': 'NOT SUPPORTED'}

getting invalid ip address for all IPs

Here is the code:

Code:
db = IP2Proxy.IP2Proxy()
db.open(os.path.join("IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN-THREAT-RESIDENTIAL.BIN.part"))
proxy_type=db.get_proxy_type("204.199.119.10")
usage_type=db.get_usage_type("204.199.119.10")
print(proxy_type)
print(usage_type)

Response:
INVALID IP ADDRESS
INVALID IP ADDRESS

Code
record = db.get_all("172.250.213.36")
record

Response:
{'is_proxy': -1,
'proxy_type': 'INVALID IP ADDRESS',
'country_short': 'INVALID IP ADDRESS',
'country_long': 'INVALID IP ADDRESS',
'region': 'INVALID IP ADDRESS',
'city': 'INVALID IP ADDRESS',
'isp': 'INVALID IP ADDRESS',
'domain': 'INVALID IP ADDRESS',
'usage_type': 'INVALID IP ADDRESS',
'asn': 'INVALID IP ADDRESS',
'as_name': 'INVALID IP ADDRESS',
'last_seen': 'INVALID IP ADDRESS',
'threat': 'INVALID IP ADDRESS',
'provider': 'INVALID IP ADDRESS'}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.