Skip to main content

pydefang

A defang/refang utility written in Python.

Usage

pydefang is installed as two command-line utilities accessible as defang and refang from the command-line.

You can use it to convert a url to a defanged version (make it safe(r) to share):

-$ defang 'https://www.malicious.org/legit.exe'
hxxps[:]//www[.]malicious[.]org/legit[.]exe

or if you need to make something a 'real' url again you can refang:

-$ refang 'hxxps[:]//www[.]malicious[.]org/legit[.]exe'
https://www.malicious.org/legit.exe

You can also use it programmatically:

In [1]: from defang import defang, refang

In [2]: defang('https://www.malicious.org/legit.exe')
Out[2]: 'hxxps[:]//www[.]malicious[.]org/legit[.]exe'

In [3]: refang('hxxps[:]//www[.]malicious[.]org/legit[.]exe')
Out[3]: 'https://www.malicious.org/legit.exe'

Bugs

Feel free to report issues, this 'utility' was build out of ease as I got frustrated with manual conversion of timestamps and strings the whole time.

Metadata

Release files for pydefang 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydefang 0.0.1
File Size Uploaded Provenance Actions
pydefang-0.0.1.tar.gz 2.4 kB Without provenance Details for pydefang-0.0.1.tar.gz

Release files / pydefang-0.0.1.tar.gz

Download URL pydefang-0.0.1.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0724acfa05ec3b0105073a814e348e90c3258c2d0a0488291fbba345b7b44291
BLAKE2b-256 checksum
How to use checksums
342cd90cbbc41c13f2627964250a52613162c8b42772b0940666c105231849b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Security for pydefang 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page