Caterpillar Proxy - The simple and parasitic web proxy with SPAM filter (formerly, php-httpproxy)
Go to file
2024-02-21 02:24:06 +09:00
.gitignore Update .gitignore 2024-02-20 16:20:37 +09:00
ca.crt Add HTTPS decryption (Experimental) 2022-11-25 17:12:58 +09:00
ca.key Add HTTPS decryption (Experimental) 2022-11-25 17:12:58 +09:00
caterpillar.service Create caterpillar.service 2024-02-21 02:24:06 +09:00
cert.key Add HTTPS decryption (Experimental) 2022-11-25 17:12:58 +09:00
index.php Update index.php 2024-02-20 11:46:26 +09:00
LICENSE Initial commit 2022-10-06 02:16:30 +09:00
README.md Update README.md 2024-02-20 18:12:46 +09:00
requirements.txt Create requirements.txt 2022-10-06 13:29:24 +09:00
server.py Update server.py 2024-02-21 02:11:32 +09:00
title.jfif Add files via upload 2024-02-19 14:16:06 +09:00

gnh1201/caterpillar

Caterpillar - The simple and parasitic web proxy with spam filter

title image

How it works

Basic structure

You <-> Proxy client (Python) <-> Parasitized proxy server (Optional, PHP) <-> On the Web

For example, build a simple web debugging proxy on the shared servers.

Spam filtering strategy

  • K-Anonymity test - Estimating whether the characters has been arranged by humans. (use Have I Been Pwned)
  • Not CAPTCHA - Image spam containing characters that look very similar to CAPTCHA. (use TrueCaptcha)
  • VowelRatio10 - In characters arranged by humans, there is a high frequency of vowels (aeiou) included in strings that are 10 characters.
  • Palindrome5 - Detect palindromes composed of 5 or more characters.
  • SSL decryption (MITM) when relaying to federated servers.

The strategies were implemented to respond to the Fediverse Spam Attacks which started on the 15th of February.

(Optional) Before to use

If you have an will be parasitize server that you want to proxy, you can install the index.php file.

How to use

  1. Write a file .env(Linux) or settings.ini(Windows). Like this:
[settings]
PORT=5555
SERVER_URL=http://example.org
CA_KEY=ca.key
CA_CERT=ca.crt
CERT_KEY=cert.key
CERT_DIR=certs/
OPENSSL_BINPATH=openssl
CLIENT_ENCODING=utf-8
LOCAL_DOMAIN=example.org
PROXY_PASS=http://127.0.0.1:3000
MASTODON_SERVER=
MASTODON_USER_TOKEN=
TRUECAPTCHA_USERID=
TRUECAPTCHA_APIKEY=
sudo apt-get install -y ca-certificates
sudo cp ca.crt /usr/local/share/ca-certificates/caterpillar-ca.crt
sudo update-ca-certificates
  1. Run python3 server.py and set HTTP(S) proxy in your web browser (e.g. Firefox)

  2. Test 100MB/SSL, 1GB/SSL, 10GB/SSL download and check the speed (e.g. https://speed.hetzner.de/1GB.bin)

  3. Enjoy it

  4. (Optional) With Cloudflare, we can expect to accelerate the 4x speed and reduce the network stuck.

(Optional) For Mastodon users

In [Caterpillar installed directory]/settings.ini or .env

  1. set SERVER_URL variable to localhost in .env (e.g. SERVER_URL=localhost)
  2. set PROXY_PASS variable to Mastodon backend URI (e.g. http://127.0.0.1:3000)
  3. if you want use notification, set MASTODON_SERVER(server domain) and MASTODON_USER_TOKEN(access token) variables

In [Mastodon installed directory]/env.production

  1. set http_proxy variable to http://localhost:5555 (e.g. http_proxy=http://localhost:5555)

In NGINX configuration

  1. Check your port number of Caterpillar (default: 5555)
  2. In NGINX configuration (e.g. /etc/nginx/conf.d/mastodon.conf), edit the proxy_pass like a proxy_pass http://localhost:5555

References

Contact