caterpillar/README.md

100 lines
4.7 KiB
Markdown
Raw Permalink Normal View History

2024-02-19 04:41:01 +00:00
# gnh1201/caterpillar
2024-08-20 05:50:06 +00:00
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fgnh1201%2Fcaterpillar.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fgnh1201%2Fcaterpillar?ref=badge_shield)
2024-08-20 10:45:04 +00:00
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13346533.svg)](https://doi.org/10.5281/zenodo.13346533)
2024-08-20 05:50:06 +00:00
2024-06-20 08:21:34 +00:00
Caterpillar Proxy - The simple web debugging proxy (formerly, php-httpproxy)
2022-10-05 17:19:11 +00:00
2024-08-20 05:36:26 +00:00
![Cover image - Caterpillar on a tree looking at a rocket flying over the clouds](assets/img/cover.png)
2024-02-19 05:16:42 +00:00
2024-08-20 11:11:10 +00:00
You can connect all physical and logical channels with communication capabilities to the web!
2024-08-20 11:11:55 +00:00
Imagine various means such as time machines, satellites, quantum technology, sound, light, the Philosopher's Stone, or Excalibur, just like in science fiction movies! Caterpillar Proxy supports the implementation of extensions for Connectors, Filters, and RPC methods to bring your imagination to life.
2024-08-20 10:45:04 +00:00
2024-06-20 08:48:26 +00:00
## Use cases
* [Build a network tunnel using Python and the LAMP(PHP) stack.](https://qiita.com/gnh1201/items/40f9350ca6d308def6d4)
* [K-Anonymity for Spam Filtering: Case with Mastodon, and Misskey](https://qiita.com/gnh1201/items/09f4081f84610db3a9d3)
2024-06-28 05:27:27 +00:00
* [[YouTube Video] File Upload Vulnerability Attack Test (Caterpillar Proxy)](https://youtu.be/sPZOCgYtLRw)
2024-06-20 08:48:26 +00:00
2024-02-19 12:13:11 +00:00
## How it works
2024-02-19 07:30:43 +00:00
### Basic structure
2022-10-05 17:19:11 +00:00
```
2024-08-20 11:00:55 +00:00
* You <-> Proxy client (Python) <-> Parasitized proxy server (Optional, PHP/LAMP) <-> On the Web
2024-08-20 11:03:30 +00:00
* You <-> Proxy client (Python) <-> Connector extensions (Optional, Python) <-> On the Web
2022-10-05 17:19:11 +00:00
```
2024-08-20 05:36:26 +00:00
2024-02-19 07:30:43 +00:00
For example, build a simple web debugging proxy on the shared servers.
2022-10-05 17:19:11 +00:00
2024-03-04 08:26:38 +00:00
### Stateful mode
2024-03-04 08:38:18 +00:00
This project supports two modes of connection. The default is stateless. You can use the stateful mode to avoid being constrained by transfer capacity limits. See the [Stateful mode (github.com/gnh1201/caterpillar wiki)](https://github.com/gnh1201/caterpillar/wiki/Stateful-mode).
2024-02-26 13:29:57 +00:00
2024-08-20 11:04:35 +00:00
### Connector extensions
This project supports the implementation of Connector extensions. The provided basic examples include implementations of web archives (caches) and serial communication as Connector extensions.
2024-08-20 11:03:30 +00:00
2024-02-19 05:20:01 +00:00
## (Optional) Before to use
2024-02-28 08:00:25 +00:00
If you have a server that ***will be parasitized*** and you want to proxy it, you should upload the `index.php` file to a shared server. The index.php file is located in the `assets/php` directory within this repository.
2022-10-07 17:19:19 +00:00
2024-02-19 04:41:01 +00:00
## How to use
1. Write a file `.env`(Linux) or `settings.ini`(Windows). Like this:
2022-10-07 17:19:19 +00:00
```
[settings]
PORT=5555
2024-07-11 15:34:33 +00:00
SERVER_URL=localhost
SERVER_CONNECTION_TYPE=
2022-11-25 08:12:58 +00:00
CA_KEY=ca.key
CA_CERT=ca.crt
CERT_KEY=cert.key
CERT_DIR=certs/
2022-11-25 12:58:03 +00:00
OPENSSL_BINPATH=openssl
2022-11-25 12:35:02 +00:00
CLIENT_ENCODING=utf-8
2024-07-09 07:31:41 +00:00
USE_EXTENSIONS=wayback.Wayback,bio.PyBio
2022-10-07 17:19:19 +00:00
```
2024-07-11 15:34:33 +00:00
***Note***: If using Caterpillar Proxy (Python) alone, set `SERVER_URL=localhost`. Otherwise, use the endpoint URL of the Worker script (PHP or Java), e.g., `SERVER_URL=http://example.org`.
2024-06-09 20:31:51 +00:00
- (Optional) Create a certificate for SSL decryption
2024-02-20 07:19:46 +00:00
2024-02-17 09:01:59 +00:00
```bash
2024-06-09 20:31:51 +00:00
chmod +x configure_certs.sh
./configure_certs.sh
2024-02-17 09:04:50 +00:00
sudo apt-get install -y ca-certificates
2024-02-19 04:49:51 +00:00
sudo cp ca.crt /usr/local/share/ca-certificates/caterpillar-ca.crt
2024-02-17 09:04:50 +00:00
sudo update-ca-certificates
2024-02-17 09:01:59 +00:00
```
2024-06-09 20:31:51 +00:00
2. Run `python3 server.py` and set HTTP(S) proxy in your web browser (e.g. Firefox, Chromium)
2022-10-07 17:19:19 +00:00
2024-06-09 20:32:58 +00:00
3. Test [100MB](http://speed.hetzner.de/100MB.bin)/[SSL](https://speed.hetzner.de/100MB.bin), [1GB](http://speed.hetzner.de/1GB.bin)/[SSL](https://speed.hetzner.de/1GB.bin), [10GB](http://speed.hetzner.de/10GB.bin)/[SSL](http://speed.hetzner.de/10GB.bin) download and check the speed.
2022-10-07 17:32:53 +00:00
2022-10-07 17:19:19 +00:00
3. Enjoy it
2022-10-08 15:51:58 +00:00
4. (Optional) With [Cloudflare](https://cloudflare.com), we can expect to accelerate the 4x speed and reduce the network stuck.
2022-10-08 15:48:25 +00:00
2024-03-13 08:14:37 +00:00
## Extensions
2024-06-21 03:43:19 +00:00
* [Web Console Available](https://pub-1a7a176eea68479cb5423e44273657ad.r2.dev/console.html)
2024-03-13 08:22:17 +00:00
* Fediverse (e.g., Mastodon): See the [Fediverse (github.com/gnh1201/caterpillar wiki)](https://github.com/gnh1201/caterpillar/wiki/Fediverse).
2024-03-13 08:21:40 +00:00
* Wayback (Private browsing with Google or Wayback cache): See the [Wayback (github.com/gnh1201/caterpillar wiki)](https://github.com/gnh1201/caterpillar/wiki/Wayback).
2022-10-05 17:21:12 +00:00
2024-02-26 13:38:53 +00:00
## Thanks to
2024-07-12 02:28:05 +00:00
* Pan Art by [@yeohangdang@i.peacht.art](#): [Image File](assets/img/logo.png)
2024-06-21 05:27:01 +00:00
* [GitHub Sponsors](https://github.com/sponsors/gnh1201)
2024-02-26 13:38:53 +00:00
2024-07-12 02:23:42 +00:00
## Contributors
2024-07-19 02:43:00 +00:00
<a href="https://github.com/gnh1201/caterpillar/graphs/contributors">
<img src="https://contrib.rocks/image?repo=gnh1201/caterpillar" alt="Contributors" />
</a>
2024-07-12 02:23:42 +00:00
2024-07-11 11:53:06 +00:00
## Our roadmap
2024-07-12 02:23:42 +00:00
![Roadmap image](assets/img/roadmap.png)
2024-07-11 11:53:06 +00:00
2024-02-29 18:10:30 +00:00
## Report abuse
2024-02-17 09:14:45 +00:00
* ActivityPub [@gnh1201@catswords.social](https://catswords.social/@gnh1201)
2022-11-25 14:05:24 +00:00
* abuse@catswords.net
2024-07-12 07:28:40 +00:00
* [Join Catswords on Microsoft Teams](https://teams.live.com/l/community/FEACHncAhq8ldnojAI)
## License
2024-08-20 10:45:04 +00:00
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fgnh1201%2Fcaterpillar.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fgnh1201%2Fcaterpillar?ref=badge_large)