diff --git a/httpz_scanner/__init__.py b/httpz_scanner/__init__.py index 0520212..c5f2f58 100644 --- a/httpz_scanner/__init__.py +++ b/httpz_scanner/__init__.py @@ -6,4 +6,4 @@ from .colors import Colors from .scanner import HTTPZScanner -__version__ = '2.1.7' \ No newline at end of file +__version__ = '2.1.8' \ No newline at end of file diff --git a/httpz_scanner/formatters.py b/httpz_scanner/formatters.py index 9264fcc..d493efe 100644 --- a/httpz_scanner/formatters.py +++ b/httpz_scanner/formatters.py @@ -38,9 +38,17 @@ def format_console_output(result: dict, debug: bool = False, show_fields: dict = status = f"{Colors.RED}[{result['status']}]{Colors.RESET}" parts.append(status) - # Domain (always shown) + # Domain/URL parts.append(f"[{result['url']}]") + # Content Type + if show_fields.get('content_type') and result.get('content_type'): + parts.append(f"{Colors.CYAN}[{result['content_type']}]{Colors.RESET}") + + # Content Length + if show_fields.get('content_length') and result.get('content_length'): + parts.append(f"{Colors.PINK}[{result['content_length']}]{Colors.RESET}") + # Title if show_fields.get('title') and result.get('title'): parts.append(f"{Colors.DARK_GREEN}[{result['title']}]{Colors.RESET}") @@ -60,8 +68,8 @@ def format_console_output(result: dict, debug: bool = False, show_fields: dict = parts.append(f"{Colors.PURPLE}[{result['favicon_hash']}]{Colors.RESET}") # Headers - if show_fields.get('headers') and result.get('headers'): - headers_text = [f"{k}: {v}" for k, v in result['headers'].items()] + if show_fields.get('headers') and result.get('response_headers'): + headers_text = [f"{k}: {v}" for k, v in result['response_headers'].items()] parts.append(f"{Colors.CYAN}[{', '.join(headers_text)}]{Colors.RESET}") else: if show_fields.get('content_type') and result.get('content_type'): @@ -73,18 +81,18 @@ def format_console_output(result: dict, debug: bool = False, show_fields: dict = parts.append(f"{Colors.PINK}[{size}]{Colors.RESET}") except (ValueError, TypeError): parts.append(f"{Colors.PINK}[{result['content_length']}]{Colors.RESET}") - - # CNAME - if show_fields.get('cname') and result.get('cname'): - parts.append(f"{Colors.PURPLE}[CNAME: {result['cname']}]{Colors.RESET}") - + # Redirect Chain if show_fields.get('follow_redirects') and result.get('redirect_chain'): chain = ' -> '.join(result['redirect_chain']) parts.append(f"{Colors.YELLOW}[Redirects: {chain}]{Colors.RESET}") + # CNAME + if show_fields.get('cname') and result.get('cname'): + parts.append(f"{Colors.PURPLE}[CNAME: {result['cname']}]{Colors.RESET}") + # TLS Certificate Info - if result.get('tls'): + if show_fields.get('tls') and result.get('tls'): cert = result['tls'] tls_parts = [] if cert.get('common_name'): diff --git a/setup.py b/setup.py index 7fd77c3..364d24a 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ with open('README.md', 'r', encoding='utf-8') as f: setup( name='httpz_scanner', - version='2.1.7', + version='2.1.8', author='acidvegas', author_email='acid.vegas@acid.vegas', description='Hyper-fast HTTP Scraping Tool',