├── oauth.ini.dist
├── .gitignore
├── credentials.php.dist
├── composer.json
├── README.md
├── LICENSE
├── config.dist.php
├── webhostconfig.php.dist
├── public_html
├── splash.php
├── iprange.php
├── stats.php
├── oauth.php
└── index.php
├── API.MD
├── checkhost
├── checkhost.php
└── computehosts.php
├── views
├── base.html.twig
└── results.html.twig
├── EXPLANATION.md
└── composer.lock
/oauth.ini.dist:
--------------------------------------------------------------------------------
1 | agent = IPCheck
2 | consumerKey = '';
3 | consumerSecret = '';
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor/
2 | .idea/
3 | webhostconfig.php
4 | credentials.php
5 | /sources/
6 | /cache/
7 | /stats/
8 |
--------------------------------------------------------------------------------
/credentials.php.dist:
--------------------------------------------------------------------------------
1 | "",
16 | );
17 |
18 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sql-enwiki/ipcheck",
3 | "description": "Tool to assist with identify IP proxies",
4 | "type": "project",
5 | "homepage": "https://tools.wmflabs.org/ipcheck/",
6 | "license": "MIT",
7 | "require": {
8 | "php" : "^7.2",
9 | "ext-curl": "*",
10 | "ext-json": "*",
11 | "twig/twig": "^2.6",
12 | "guzzlehttp/guzzle": "^6.3"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ipcheck
2 |
3 | IPCheck - Proxy Checker
4 |
5 | * Live at https://tools.wmflabs.org/ipcheck/
6 | * Development staging at https://tools.wmflabs.org/ipcheck-dev/
7 |
8 | ## Installation
9 |
10 | Requires PHP 7.2.
11 |
12 | 1. `cp credentials.php.dist credentials.php` and fill in your API keys.
13 | 1. `cp webhostconfig.php.dist webhostconfig.php` and fill in your webhost detection settings.
14 | 1. `cp oauth.ini.dist oauth.ini` and fill in your OAuth consumer keys.
15 | 1. `cp config.dist.php config.php` and change the configuration to your liking.
16 | 1. `composer install`
17 | 1. `cd public_html && php -S localhost:8000`
18 |
19 | You should now be up and running at http://localhost:8000
20 |
21 | ## Interpreting results
22 |
23 | * There are some tips / hints at [EXPLANATION.md](EXPLANATION.md)
24 | * Please don't hesitate to send a pull request for this file!
25 |
26 | ## API
27 |
28 | * Instructions on using the API can be found at [API.MD](API.MD)
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016-2018 SQL at the English Wikipedia
4 | ( https://en.wikipedia.org/wiki/User:SQL ) and contributors.
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
24 |
--------------------------------------------------------------------------------
/config.dist.php:
--------------------------------------------------------------------------------
1 | 'min', 'limit' => 15, 'type2' => 'day', 'limit2' => 5000 );
9 | $lservice['iphub'] = array( 'type' => 'day', 'limit' => 1000, 'type2' => 'day', 'limit2' => 1000 );
10 | $lservice['iphunter'] = array( 'type' => 'day', 'limit' => 1000, 'type2' => 'day', 'limit2' => 1000 );
11 | $lservice['ipqs'] = array( 'type' => 'month', 'limit' => 50000, 'type2' => 'month', 'limit2' => 50000 );
12 | /* $lservice['nofraud'] = array( 'type' => 'day', 'limit' => 600, 'type2' => 'day', 'limit2' => 600 ); */
13 | $lservice['proxycheck-io'] = array( 'type' => 'day', 'limit' => 1000, 'type2' => 'day', 'limit2' => 1000 );
14 | $lservice['sorbs'] = array( 'type' => 'min', 'limit' => 1000, 'type2' => 'min', 'limit2' => 1000 );
15 | $lservice['spamhaus'] = array( 'type' => 'min', 'limit' => 1000, 'type2' => 'min', 'limit2' => 1000 );
16 | $lservice['teoh'] = array( 'type' => 'day', 'limit' => 5000, 'type2' => 'day', 'limit2' => 5000 );
17 | $lservice['dshield'] = array( 'type' => 'min', 'limit' => 1000, 'type2' => 'min', 'limit2' => 1000 );
18 | $lservice['ipstack'] = array( 'type' => 'month', 'limit' => 10000, 'type2' => 'min', 'limit2' => 1000 );
19 | return( $lservice );
20 | }
21 |
22 | ?>
--------------------------------------------------------------------------------
/webhostconfig.php.dist:
--------------------------------------------------------------------------------
1 | "", //Set the name to be displayed in headers
7 | 'asns' => array( '' ), //List of ASNs
8 | 'searchterms' => array( '' ), //List of items to search for in the whois
9 | 'blockname' => '' ); //Name to display in the block message
10 | */
11 | $hosts['azure'] = array(
12 | 'name' => "Microsoft Azure", //Set the name to be displayed in headers
13 | 'asns' => array( 'azure' ), //List of ASNs
14 | 'searchterms' => array( ), //List of items to search for in the whois
15 | 'blockname' => 'Microsoft Azure' ); //Name to display in the block message
16 | $hosts['amazon'] = array(
17 | 'name' => "Amazon AWS", //Set the name to be displayed in headers
18 | 'asns' => array( 'amazon' ), //List of ASNs
19 | 'searchterms' => array( ), //List of items to search for in the whois
20 | 'blockname' => 'Amazon AWS' ); //Name to display in the block message
21 | $hosts['google'] = array(
22 | 'name' => "Google Cloud", //Set the name to be displayed in headers
23 | 'asns' => array( 'google' ), //List of ASNs
24 | 'searchterms' => array( ), //List of items to search for in the whois
25 | 'blockname' => 'Google Cloud' ); //Name to display in the block message
26 | $hosts['digitalocean'] = array(
27 | 'name' => "DigitalOcean", //Set the name to be displayed in headers
28 | 'asns' => array( '14061' ), //List of ASNs
29 | 'searchterms' => array( 'digitalocean', 'serverstack' ), //List of items to search for in the whois
30 | 'blockname' => 'DigitalOcean' ); //Name to display in the block message
31 | ?>
--------------------------------------------------------------------------------
/public_html/splash.php:
--------------------------------------------------------------------------------
1 | true ] );
11 | $twig->addExtension(new Twig_Extension_Debug());
12 |
13 | $currentver = substr( file_get_contents( __DIR__. '/../.git/refs/heads/master' ), 0, 7 );
14 |
15 | $ts_pw = posix_getpwuid(posix_getuid());
16 | $ts_mycnf = parse_ini_file($ts_pw['dir'] . "/replica.my.cnf");
17 |
18 | $mysqli = new mysqli('meta.web.db.svc.eqiad.wmflabs', $ts_mycnf['user'], $ts_mycnf['password'], 'meta_p');
19 |
20 | $query = 'select url, lang, family, dbname from wiki where is_closed = 0 order by dbname asc;';
21 | session_start();
22 | if( isset( $_GET['ip'] ) ) { $_SESSION['ip'] = $_GET['ip']; }
23 | session_write_close();
24 | $res = mysqli_query( $mysqli, $query );
25 | $opt = array();
26 | $enwikiIndex = 0;
27 | $commonswikiIndex = 0;
28 | $metawikiIndex = 0;
29 | $baseindex = 0;
30 | while( $row = mysqli_fetch_assoc( $res ) ) {
31 | $murl = parse_url( $row['url'], PHP_URL_HOST );
32 | $murl = substr( $murl, 0, -4 );
33 | $row['url'] = $murl;
34 | if( $row['dbname'] == "enwiki" ) { $enwikiIndex = $baseindex; }
35 | if( $row['dbname'] == "commonswiki" ) { $commonswikiIndex = $baseindex; }
36 | if( $row['dbname'] == "metawiki" ) { $metawikiIndex = $baseindex; }
37 | array_push( $opt, $row );
38 | $baseindex++;
39 | }
40 | echo $twig->render( 'base.html.twig', [
41 | 'splash' => '1',
42 | 'currentver' => $currentver,
43 | 'options' => $opt,
44 | 'commonswiki' => $commonswikiIndex,
45 | 'enwiki' => $enwikiIndex,
46 | 'metawiki' => $metawikiIndex
47 | ] );
48 | ?>
--------------------------------------------------------------------------------
/API.MD:
--------------------------------------------------------------------------------
1 | # API Usage
2 |
3 | * Get paramaters:
4 | * ip - The IP Address
5 | * api - Set to true if using the API
6 | * key - Your personal API key (found at the bottom of the page after logging in)
7 | * Example URL: https://ipcheck.toolforge.org/index.php?ip=8.8.8.8&api=true&key=APIKEYHERE
8 |
9 | Example result:
10 | ```javascript
11 | {
12 | "proxycheck": {
13 | "title": "proxycheck.io",
14 | "result": {
15 | "proxy": false
16 | }
17 | },
18 | "getIPIntel": {
19 | "title": "GetIPIntel",
20 | "result": {
21 | "chance": "0.0"
22 | }
23 | },
24 | "ipQualityScore": {
25 | "title": "IPQualityScore",
26 | "result": {
27 | "proxy": true,
28 | "isp": "Google",
29 | "vpn": true,
30 | "mobile": false
31 | }
32 | },
33 | "ipHub": {
34 | "title": "IPHub",
35 | "result": {
36 | "isp": "GOOGLE",
37 | "block": 1
38 | }
39 | },
40 | "teohio": {
41 | "title": "Teoh.io",
42 | "result": {
43 | "hosting": false,
44 | "vpnOrProxy": true,
45 | "type": "business",
46 | "risk": "high"
47 | }
48 | },
49 | "ipHunter": {
50 | "title": "IPHunter",
51 | "result": {
52 | "isp": "Google Inc.",
53 | "block": 1
54 | }
55 | },
56 | "noFraud": {
57 | "title": "Nofraud",
58 | "result": {
59 | "chance": 100
60 | }
61 | },
62 | "computeHosts": {
63 | "title": "Compute Hosts",
64 | "result": {
65 | "cloud": "This IP is not an AWS/Azure/GoogleCloud node.\n"
66 | }
67 | },
68 | "sorbs": {
69 | "title": "SORBS DNSBL"
70 | },
71 | "spamhaus": {
72 | "title": "Spamhaus ZEN DNSBL"
73 | },
74 | "dshield": {
75 | "title": "DShield",
76 | "result": {
77 | "attacks": 45,
78 | "tfeeds": "forumspam lastseen(2018-12-05), qakbot lastseen(2015-04-03)"
79 | }
80 | },
81 | "hola": {
82 | "title": "Hola"
83 | },
84 | "cache": {
85 | "title": "Cache",
86 | "result": {
87 | "cached": "yes",
88 | "cachedate": "Feb 4 19:26:17 UTC 2019",
89 | "cacheuntil": "Feb 11 19:26:17 UTC 2019"
90 | }
91 | }
92 | }
93 | ```
94 |
95 | #Notes
96 |
97 | * Misusing, or overusing the API is grounds for a ban
98 | * We have finite resources, please don't take more than your share.
99 |
--------------------------------------------------------------------------------
/checkhost/checkhost.php:
--------------------------------------------------------------------------------
1 |
73 |
--------------------------------------------------------------------------------
/checkhost/computehosts.php:
--------------------------------------------------------------------------------
1 |
99 |
--------------------------------------------------------------------------------
/public_html/iprange.php:
--------------------------------------------------------------------------------
1 |
26 | IP Range Resolver by [[User:SQL]]
Check out my other tools!
27 |