Skip to content

bivex/RedirectChecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Redirect Checker

A smart URL redirect checker that traces redirect chains with intelligent logging.

Features

  • πŸ” Traces complete redirect chains
  • πŸ“ Smart logging to both console and files
  • πŸ”„ Detects redirect loops
  • πŸ“Š Generates JSON reports for detailed analysis
  • 🌐 Tracks unique domains visited
  • ⏱️ Measures redirect chain duration
  • πŸ›‘οΈ Handles various redirect types (301, 302, 303, 307, 308)

Installation

pip install -r requirements.txt

Usage

Command Line

python redirect_checker.py "https://example.com/redirect"

As a Module

from redirect_checker import RedirectChecker

checker = RedirectChecker(log_dir="logs")
result = checker.check_redirects("https://example.com/redirect")

if result['success']:
    print(f"Found {result['redirect_count']} redirects")
    print(f"Final destination: {result['chain'][-1]['url']}")

Output

The tool generates two types of logs in the logs/ directory:

  1. Text Log (redirect_check_YYYYMMDD_HHMMSS.log)

    • Human-readable log with timestamps
    • Shows each redirect step
    • Includes response headers
    • Summary statistics
  2. JSON Report (redirect_chain_<hash>_YYYYMMDD_HHMMSS.json)

    • Machine-readable format
    • Complete redirect chain data
    • All response headers
    • Duration metrics

Example Output

2026-01-14 12:00:00 - INFO - Starting redirect check...
2026-01-14 12:00:00 - INFO - Initial URL domain: rt.pornhub.com
2026-01-14 12:00:01 - INFO - β†’ Redirecting to: https://track.llinkosec.com/...
2026-01-14 12:00:02 - INFO - βœ“ Final destination reached
2026-01-14 12:00:02 - INFO - Total Redirects: 3

Configuration

You can customize the behavior:

  • max_redirects: Maximum redirects to follow (default: 20)
  • timeout: Request timeout in seconds (default: 10)
  • log_dir: Directory for logs (default: "logs")

About

πŸ”— REDIRECT TRACKER EXTRAORDINAIRE. Follow the trail. Audit URL chains. Security reconnaissance tool. πŸ•΅οΈ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages