Skip to content

SkyhighSecurity/icap-client-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

icap-client-tester

A lightweight ICAP client testing script for validating ICAP servers and services.

Disclaimer

This tool is not officially supported or maintained by Security and is provided "as is" without warranties or guarantees of any kind. It is designed to be used while validating and testing against ICAP servers and services.

Quickstart

pip install requests
python icaptest.0.9.5.py

Dependencies

  • Python 3.x
  • requests (for RESPMOD URL fetches)
  • Tkinter (for GUI mode; usually included with Python)

Install requests if needed:

pip install requests

GUI Mode

Start the GUI:

python icaptest.0.9.5.py

In the GUI you can:

  • Select a file (optional)
  • Enter a URL (required if no file)
  • Set ICAP server address/port and timeout (defaults: host placeholder <FQDN or IP>, port 1344, timeout 10)
  • Optionally set an API key for Basic auth (Authorization: Basic <key>)
  • Toggle TLS/ICAPS and cert handling
  • Choose REQMOD/RESPMOD/OPTIONS
  • Enable Preview/Early 204
  • Send the request and view the response

CLI

Show CLI help:

python icaptest.0.9.5.py --help

Available CLI switches:

  • --cli, -c: Run in CLI mode
  • --file, -f: File to send
  • --url, -u: URL to fetch (required if no file)
  • --enforce-srv-cert, -e: Disable URL server cert verification for URL fetches
  • --server, -s: ICAP server address (required)
  • --port, -p: ICAP server port (default 1344)
  • --method, -m: ICAP method: REQMOD, RESPMOD, OPTIONS (default OPTIONS)
  • --tls, -t: Enable TLS/ICAPS
  • --ignore-cert-errors, -i: Ignore ICAP server cert errors
  • --accept-204, -a: Accept early 204 responses
  • --output, -o: Save response to a file
  • --preview: Number of preview bytes
  • --timeout: Socket timeout in seconds (default 10)
  • --api-key: Optional API key for Authorization: Basic header
  • --req_method, -r: HTTP method for REQMOD content: PUT or POST (default POST)

REQMOD with a file:

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method REQMOD --file /path/to/file.bin --url http://example.com/upload

REQMOD with URL only:

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method REQMOD --url http://example.com/

RESPMOD (fetches the URL and sends response body):

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method RESPMOD --url http://example.com/

OPTIONS:

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method OPTIONS --url http://example.com/

Set a custom timeout (default 10 seconds):

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method REQMOD --file /path/to/file.bin --url http://example.com/upload \
  --timeout 30

TLS (ICAPS) with optional ignore cert errors:

python icaptest.0.9.5.py --cli --server icap.example.com --port 11344 \
  --method REQMOD --file /path/to/file.bin --url http://example.com/upload \
  --tls --ignore-cert-errors

Preview + early 204:

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method REQMOD --file /path/to/file.bin --url http://example.com/upload \
  --accept-204 --preview 1024

Save response to a file:

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method REQMOD --file /path/to/file.bin --url http://example.com/upload \
  --output response.txt

REQMOD with API key (Basic auth header):

python icaptest.0.9.5.py --cli --server 127.0.0.1 --port 1344 \
  --method REQMOD --file /path/to/file.bin --url http://example.com/upload \
  --api-key YOUR_API_KEY_VALUE

Supported ICAP Features

  • REQMOD, RESPMOD, and OPTIONS
  • TLS/ICAPS
  • Preview mode and early 204 handling
  • Chunked transfer encoding for request bodies
  • URL-based RESPMOD (fetches URL content via requests)
  • CLI and GUI modes
  • Configurable timeout for socket operations
  • Optional Basic auth header via API key in GUI and CLI

About

A lightweight ICAP client testing script for validating ICAP servers and services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages