Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.
/ DeTor Public archive

🙊 A simple REST API to identify requests made from TOR network.

Notifications You must be signed in to change notification settings

RD17/DeTor

Repository files navigation

DeTor

🙊 A simple REST API to identify requests made from TOR network.

DeTor uses TorDNSEL inside, not a static list of TOR exit nodes.

DeTor API call

GET http://detor.ambar.cloud/

Parameters

Name Type Description Default value
sourceIp String, optional

IP address the request was made from

Your IP

destIp String, optional

IP address the request was made to (e.g. your web server public IP)

Public IP address of DeTor API

destPort String, optional

Port number the request was made to (e.g. your web server public port)

80

Call Example

The Simple One

Just open http://detor.ambar.cloud/ in your browser and look at the found field, it its value us true - you're using TOR. Also you can use our smart TOR-detecting badge badge <img src="http://detor.ambar.cloud/badge"/> on your site.

The Right One

Image you have a web service running on 1.2.3.4 public IP address and 8080 port. You register an incoming request to your service from 2.3.4.5 IP address and want to check whether this request is made from TOR network or not.

In this case the call would be:

CURL

curl -X GET 'http://detor.ambar.cloud/?sourceIp=2.3.4.5&destIp=1.2.3.4&destPort=8080'

Node.js

var request = require("request");

var options = { method: 'GET',
  url: 'http://detor.ambar.cloud/',
  qs: { sourceIp: '2.3.4.5', destIp: '1.2.3.4', destPort: '8080' }
  };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Success Response

HTTP/1.1 200

JSON object, fields:

Name Type Description
sourceIp String sourceIp parameter value used for request
destIp String destIp parameter value used for request
destPort String destPort parameter value used for request
found Bool Request with specified parameters was made from TOR network or not

Example:

{
    "sourceIp": "104.200.20.46",
    "destIp": "89.207.89.82",
    "destPort": "8080",
    "found": true
}

Error Response

HTTP/1.1 500

JSON object, fields:

Name Type Description
error String Error description

Example:

{
    "error": "Error: Source IP (256.10.10.10) is invalid"
}

Running Your Own Instance

Use Docker image: docker run -p 80:80 -e port=80 -d --name=detor rd17/detor

About

🙊 A simple REST API to identify requests made from TOR network.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published