Skip to main content

A defang/refang utility written in Python.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydefang-0.0.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file pydefang-0.0.1.tar.gz.

File metadata

  • Download URL: pydefang-0.0.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pydefang-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0724acfa05ec3b0105073a814e348e90c3258c2d0a0488291fbba345b7b44291
MD5 3b04b036dbb807e2454ef186289099e4
BLAKE2b-256 342cd90cbbc41c13f2627964250a52613162c8b42772b0940666c105231849b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page