Skip to content

Service for fanging and defanging URLs

License

Notifications You must be signed in to change notification settings

nryang/fangfangfang

Repository files navigation

fangfangfang

fangfangfang is a web application that allows you to defang and refang URLs in text.

Many applications convert URLs in documents to clickable links. These links could be malicious, and users may accidentally click on them. The goal of defanging is to prevent these URLs from being clickable but still human-readable. Refanging, on the other hand, involves taking a defanged piece of text and converting it back to the original text.

fangfangfang supports multiple defanging and refanging translation models. Currently, the following models are supported:

Model Example Input Example Defang
homoglyph The fangfangfang source code is located at https://github.com/nryang/fangfangfang :) The fangfangfang source code is located at һttрƽ://ƍıtһʋƄ.соm/nгɣɑnƍ/ſɑnƍſɑnƍſɑnƍ :)

Disclaimer

All information and code are provided for educational purposes only. The author is not responsible for any direct or consequential damage or loss arising from any person or organization acting or failing to act on the basis of information contained in this repository.

Please refer to the LICENSE.

Requirements

Usage

Build the docker container:

docker-compose build

Start the docker container:

docker-compose up

Open your browser and navigate to:

http://localhost:56732/

If everything is working, you should see the following page:

UI

fangfangfang also provides API endpoints for defanging or refanging text. You can access the API documentation in your browser by navigating to:

http://localhost:56732/ui

If the API docs are working, you should see the following page:

Generated API documentation

To stop the application, press Ctrl+C from your terminal.

Developer Notes

This project uses an API-first approach. The API spec is written in OpenAPI 3 and is defined in openapi/openapi.yaml.

openapi-generator takes the OpenAPI spec and auto-generates the controllers, models, and basic integration tests.

To auto-generate the files (requires Java 8+):

cd bin
./codegen.sh

The auto-generated controllers call the implementation controller modules like api_controller_impl.py.

Connexion uses the controllers to serve the REST endpoints. It also serves static files like the Swagger UI documentation.

To run all tests (requires tox):

./test_python3.sh

Credits

About

Service for fanging and defanging URLs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published