Skip to main content

Test whether request Content-Type influences response Content-Type

Project description

penterepTools

ptcontenttype - Content-Type Testing Tool

ptcontenttype tests whether changing the request Content-Type header influences the returned response Content-Type.

Installation

pip install ptcontenttype

Adding to PATH

If you're unable to invoke the script from your terminal, it's likely because it's not included in your PATH. You can resolve this issue by executing the following commands, depending on the shell you're using:

For Bash Users

echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.bashrc
source ~/.bashrc

For ZSH Users

echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.zshrc
source ~/.zshrc

Usage examples

ptcontenttype -u https://www.example.com/
ptcontenttype -u https://www.example.com/api -m POST -d '{"test":true}'
ptcontenttype -u https://www.example.com/ -ct application/json text/xml text/plain

Options

-u   --url            <url>           Connect to URL
-m   --method         <method>        Set request method (default GET)
-d   --data           <data>          Set request body data
-ct  --content-types  <type>          Set request Content-Type values to test
-p   --proxy          <proxy>         Set proxy (e.g. http://127.0.0.1:8080)
-T   --timeout                        Set timeout (default 10)
-c   --cookie         <cookie>        Set cookie
-a   --user-agent     <a>             Set User-Agent header
-H   --headers        <header:value>  Set custom header(s)
-r   --redirects                      Follow redirects (default False)
-C   --cache                          Cache HTTP communication (load from tmp in future)
-v   --version                        Show script version and exit
-h   --help                           Show this help message and exit
-j   --json                           Output in JSON format

Dependencies

ptlibs

License

Copyright (c) 2025 Penterep Security s.r.o.

ptcontenttype is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ptcontenttype is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ptcontenttype. If not, see https://www.gnu.org/licenses/.

Warning

You are only allowed to run the tool against the websites which you have been given permission to pentest. We do not accept any responsibility for any damage/harm that this application causes to your computer, or your network. Penterep is not responsible for any illegal or malicious use of this code. Be Ethical!

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

ptcontenttype-0.0.1.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ptcontenttype-0.0.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptcontenttype-0.0.1.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for ptcontenttype-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9adaac4ab34d2a57798761f9c033971f3ebc4cf053d5710510575a7e2fdeb7c5
MD5 9cca52c64e3013e2cca3ac3a09122359
BLAKE2b-256 8323af635af480564eeded9a63681ec685861ecf1f2616eec545b5e559cfecaa

See more details on using hashes here.

File details

Details for the file ptcontenttype-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ptcontenttype-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for ptcontenttype-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c328e252a020420bc119e2033a5155458f7673189abbf5138eac897c1f15b65
MD5 f838531817de17991d1b995f80ae1424
BLAKE2b-256 fb8a4ac13180ad22ccd8ecc3510ce076b8a78423bb71a90e977ea4e67ad4be8b

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