-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added supports for threats (PX9) & residential proxies (PX10).
- Loading branch information
1 parent
7f27228
commit 9df6cdf
Showing
5 changed files
with
58 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
# IP2Proxy Ruby Library | ||
|
||
This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots and data center ranges using IP2Proxy BIN database. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name and last seen date. | ||
This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges and residential proxies using IP2Proxy BIN database. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name, threats and last seen date. | ||
|
||
It lookup the proxy IP address from **IP2Proxy BIN Data** file. This data file can be downloaded at | ||
|
||
|
@@ -22,12 +22,12 @@ Below are the methods supported in this module. | |
|---|---| | ||
|open|Open the IP2Proxy BIN data with **File I/O** mode for lookup.| | ||
|close|Close and clean up the file pointer.| | ||
|get_package_version|Get the package version (1 to 8 for PX1 to PX8 respectively).| | ||
|get_package_version|Get the package version (1 to 10 for PX1 to PX10 respectively).| | ||
|get_module_version|Get the module version.| | ||
|get_database_version|Get the database version.| | ||
|is_proxy|Check whether if an IP address was a proxy. Please see [Proxy Type](#proxy-type) for details. Returned value:<ul><li>-1 : errors</li><li>0 : not a proxy</li><li>1 : a proxy</li><li>2 : a data center IP address</li></ul>| | ||
|get_all|Return the proxy information in array.| | ||
|get_proxytype|Return the proxy type. Please visit <a href="https://www.ip2location.com/databases/px8-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen" target="_blank">IP2Location</a> for the list of proxy types supported| | ||
|get_proxytype|Return the proxy type. Please visit <a href="https://www.ip2location.com/database/px10-ip-proxytype-country-region-city-isp-domain-usagetype-asn-lastseen-threat-residential" target="_blank">IP2Location</a> for the list of proxy types supported| | ||
|get_country_short|Return the ISO3166-1 country code (2-digits) of the proxy.| | ||
|get_country_long|Return the ISO3166-1 country name of the proxy.| | ||
|get_region|Return the ISO3166-2 region name of the proxy. Please visit <a href="https://www.ip2location.com/free/iso3166-2" target="_blank">ISO3166-2 Subdivision Code</a> for the information of ISO3166-2 supported| | ||
|
@@ -38,14 +38,15 @@ Below are the methods supported in this module. | |
|get_asn|Return the autonomous system number (ASN) of proxy's IP address or domain name.| | ||
|get_as|Return the autonomous system (AS) name of proxy's IP address or domain name.| | ||
|get_last_seen|Return the last seen days ago value of proxy's IP address or domain name.| | ||
|get_threat|Return the threat types reported to proxy's IP address or domain name. Please see [Threat Type](#threat-type) for details.| | ||
|
||
## Usage | ||
|
||
``` | ||
require 'ip2proxy_ruby' | ||
# open IP2Proxy BIN database for proxy lookup | ||
i2p = Ip2proxy.new.open("./data/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN.BIN") | ||
i2p = Ip2proxy.new.open("./data/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP-DOMAIN-USAGETYPE-ASN-LASTSEEN-THREAT-RESIDENTIAL.BIN") | ||
# get versioning information | ||
print 'Module Version: ' + i2p.get_module_version + "\n" | ||
|
@@ -65,6 +66,7 @@ print 'Usage Type: ' + i2p.get_usagetype('1.2.3.4') + "\n" | |
print 'ASN: ' + i2p.get_asn('1.2.3.4') + "\n" | ||
print 'AS: ' + i2p.get_as('1.2.3.4') + "\n" | ||
print 'Last Seen: ' + i2p.get_last_seen('1.2.3.4') + "\n" | ||
print 'Threat: ' + i2p.get_threat('1.2.3.4') + "\n" | ||
# single function to get all proxy data returned in array | ||
record = i2p.get_all('1.2.3.4') | ||
|
@@ -80,6 +82,7 @@ print 'Usage Type: ' + record['usagetype'] + "\n" | |
print 'ASN: ' + record['asn'] + "\n" | ||
print 'AS: ' + record['as'] + "\n" | ||
print 'Last Seen: ' + record['last_seen'] + "\n" | ||
print 'Threat: ' + record['threat'] + "\n" | ||
# close IP2Proxy BIN database | ||
i2p.close() | ||
|
@@ -89,12 +92,13 @@ i2p.close() | |
|
||
|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. | ||
|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+]| | ||
|
||
### Usage Type | ||
|
||
|
@@ -113,7 +117,15 @@ i2p.close() | |
|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] | ||
Email: [email protected] | ||
URL: [https://www.ip2location.com](https://www.ip2location.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,12 @@ | |
|
||
Gem::Specification.new do |s| | ||
s.name = "ip2proxy_ruby" | ||
s.version = "2.1.0" | ||
s.version = "3.0.0" | ||
s.authors = ["ip2location"] | ||
s.email = ["[email protected]"] | ||
|
||
s.summary = "IP2Proxy Ruby library" | ||
s.description = "The official IP2Proxy Ruby library to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots and data center ranges using IP2Proxy BIN database. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name and last seen date." | ||
s.description = "The official IP2Proxy Ruby library to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges and residential proxies using IP2Proxy BIN database. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name, threats and last seen date." | ||
s.homepage = "https://github.com/ip2location/ip2proxy-ruby" | ||
s.licenses = ["MIT"] | ||
s.require_paths = ["lib"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters