https://github.com/charmander/iptooled
Basic spam stats collection tool for IP addresses
https://github.com/charmander/iptooled
Last synced: over 1 year ago
JSON representation
Basic spam stats collection tool for IP addresses
- Host: GitHub
- URL: https://github.com/charmander/iptooled
- Owner: charmander
- Created: 2019-12-12T00:12:45.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-20T07:48:13.000Z (almost 2 years ago)
- Last Synced: 2025-01-22T19:47:10.405Z (over 1 year ago)
- Language: Rust
- Size: 55.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
An address-based spam tree, based on the idea that a signup from a region of the address space containing confirmed spam is worth flagging.
The tree should be persistent in general, but it’s okay if some writes are lost.
The address length is set at compile time. By default, the length is 16 bytes to fit IPv6 (with IPv4 in ::ffff:0:0/96).
## Use
Enqueue a trust message:
- when a user is marked as trusted
- when a trusted user authenticates
- randomly when a trusted user makes a request
Enqueue a spam message:
- when a user is marked as spam
- when a spam user authenticates
- randomly when a spam user makes a request
Query:
- when a user signs up
(The user ids provided to iptooled can, and often should, be keyed-hashed or encrypted versions of actual user ids.)
## Protocol
A request’s type is identified by its first byte.
- [0, *address*×*address-bytes*]
Requests information about an address. The response is [*trusted*×4, *spam*×4, *bits*], where *bits* is the size of the prefix used to determine the result, *trusted* is the number of trusted hits with that prefix, and *spam* is the number of spam hits with that prefix. All values are big-endian and unsigned.
- [1, *address*×*address-bytes*, *user*×*user-bytes*]
Marks an address as associated with a trusted user. The response is [0] for success, [1] for failure.
- [2, *address*×*address-bytes*, *user*×*user-bytes*]
Marks an address as associated with a spam user. The response is [0] for success, [1] for failure.
It’s okay to send multiple requests without waiting for a response; the responses will come back in order.