Compare commits

...

3 Commits
v2.1.5 ... main

Author SHA1 Message Date
19525aec7d
sup roarie 2025-02-12 03:03:20 -05:00
f1f5a78ae0
sup tommyrot 2025-02-12 02:59:51 -05:00
9a4b7e977a
fixed chunk output 2025-02-12 02:57:44 -05:00
4 changed files with 23 additions and 15 deletions

View File

@ -6,4 +6,4 @@ from .colors import Colors
from .scanner import HTTPZScanner from .scanner import HTTPZScanner
__version__ = '2.1.5' __version__ = '2.1.8'

View File

@ -71,7 +71,7 @@ async def main():
parser.add_argument('-ct', '--content-type', action='store_true', help='Show content type') parser.add_argument('-ct', '--content-type', action='store_true', help='Show content type')
parser.add_argument('-f', '--favicon', action='store_true', help='Show favicon hash') parser.add_argument('-f', '--favicon', action='store_true', help='Show favicon hash')
parser.add_argument('-fr', '--follow-redirects', action='store_true', help='Follow redirects (max 10)') parser.add_argument('-fr', '--follow-redirects', action='store_true', help='Follow redirects (max 10)')
parser.add_argument('-hr', '--headers', action='store_true', help='Show response headers') parser.add_argument('-hr', '--show-headers', action='store_true', help='Show response headers')
parser.add_argument('-i', '--ip', action='store_true', help='Show IP addresses') parser.add_argument('-i', '--ip', action='store_true', help='Show IP addresses')
parser.add_argument('-sc', '--status-code', action='store_true', help='Show status code') parser.add_argument('-sc', '--status-code', action='store_true', help='Show status code')
parser.add_argument('-ti', '--title', action='store_true', help='Show page title') parser.add_argument('-ti', '--title', action='store_true', help='Show page title')
@ -82,6 +82,7 @@ async def main():
parser.add_argument('-ec', '--exclude-codes', type=parse_status_codes, help='Exclude these status codes (comma-separated, e.g., 404,500)') parser.add_argument('-ec', '--exclude-codes', type=parse_status_codes, help='Exclude these status codes (comma-separated, e.g., 404,500)')
parser.add_argument('-mc', '--match-codes', type=parse_status_codes, help='Only show these status codes (comma-separated, e.g., 200,301,404)') parser.add_argument('-mc', '--match-codes', type=parse_status_codes, help='Only show these status codes (comma-separated, e.g., 200,301,404)')
parser.add_argument('-p', '--progress', action='store_true', help='Show progress counter') parser.add_argument('-p', '--progress', action='store_true', help='Show progress counter')
parser.add_argument('-pd', '--post-data', help='Send POST request with this data')
parser.add_argument('-r', '--resolvers', help='File containing DNS resolvers (one per line)') parser.add_argument('-r', '--resolvers', help='File containing DNS resolvers (one per line)')
parser.add_argument('-to', '--timeout', type=int, default=5, help='Request timeout in seconds') parser.add_argument('-to', '--timeout', type=int, default=5, help='Request timeout in seconds')
@ -93,7 +94,6 @@ async def main():
# Add these arguments in the parser section # Add these arguments in the parser section
parser.add_argument('-hd', '--headers', help='Custom headers to send with each request (format: "Header1: value1,Header2: value2")') parser.add_argument('-hd', '--headers', help='Custom headers to send with each request (format: "Header1: value1,Header2: value2")')
parser.add_argument('-p', '--post', help='Send POST request with this data')
# If no arguments provided, print help and exit # If no arguments provided, print help and exit
if len(sys.argv) == 1: if len(sys.argv) == 1:
@ -126,7 +126,7 @@ async def main():
'body' : args.all_flags or args.body, 'body' : args.all_flags or args.body,
'ip' : args.all_flags or args.ip, 'ip' : args.all_flags or args.ip,
'favicon' : args.all_flags or args.favicon, 'favicon' : args.all_flags or args.favicon,
'headers' : args.all_flags or args.headers, 'headers' : args.all_flags or args.show_headers,
'follow_redirects' : args.all_flags or args.follow_redirects, 'follow_redirects' : args.all_flags or args.follow_redirects,
'cname' : args.all_flags or args.cname, 'cname' : args.all_flags or args.cname,
'tls' : args.all_flags or args.tls_info 'tls' : args.all_flags or args.tls_info
@ -153,7 +153,7 @@ async def main():
shard=args.shard, shard=args.shard,
paths=args.paths.split(',') if args.paths else None, paths=args.paths.split(',') if args.paths else None,
custom_headers=dict(h.split(': ', 1) for h in args.headers.split(',')) if args.headers else None, custom_headers=dict(h.split(': ', 1) for h in args.headers.split(',')) if args.headers else None,
post_data=args.post post_data=args.post_data
) )
count = 0 count = 0

View File

@ -38,9 +38,17 @@ def format_console_output(result: dict, debug: bool = False, show_fields: dict =
status = f"{Colors.RED}[{result['status']}]{Colors.RESET}" status = f"{Colors.RED}[{result['status']}]{Colors.RESET}"
parts.append(status) parts.append(status)
# Domain (always shown) # Domain/URL
parts.append(f"[{result['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 # Title
if show_fields.get('title') and result.get('title'): if show_fields.get('title') and result.get('title'):
parts.append(f"{Colors.DARK_GREEN}[{result['title']}]{Colors.RESET}") 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}") parts.append(f"{Colors.PURPLE}[{result['favicon_hash']}]{Colors.RESET}")
# Headers # Headers
if show_fields.get('headers') and result.get('headers'): if show_fields.get('headers') and result.get('response_headers'):
headers_text = [f"{k}: {v}" for k, v in result['headers'].items()] headers_text = [f"{k}: {v}" for k, v in result['response_headers'].items()]
parts.append(f"{Colors.CYAN}[{', '.join(headers_text)}]{Colors.RESET}") parts.append(f"{Colors.CYAN}[{', '.join(headers_text)}]{Colors.RESET}")
else: else:
if show_fields.get('content_type') and result.get('content_type'): 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}") parts.append(f"{Colors.PINK}[{size}]{Colors.RESET}")
except (ValueError, TypeError): except (ValueError, TypeError):
parts.append(f"{Colors.PINK}[{result['content_length']}]{Colors.RESET}") 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 # Redirect Chain
if show_fields.get('follow_redirects') and result.get('redirect_chain'): if show_fields.get('follow_redirects') and result.get('redirect_chain'):
chain = ' -> '.join(result['redirect_chain']) chain = ' -> '.join(result['redirect_chain'])
parts.append(f"{Colors.YELLOW}[Redirects: {chain}]{Colors.RESET}") 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 # TLS Certificate Info
if result.get('tls'): if show_fields.get('tls') and result.get('tls'):
cert = result['tls'] cert = result['tls']
tls_parts = [] tls_parts = []
if cert.get('common_name'): if cert.get('common_name'):

View File

@ -10,7 +10,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
setup( setup(
name='httpz_scanner', name='httpz_scanner',
version='2.1.5', version='2.1.8',
author='acidvegas', author='acidvegas',
author_email='acid.vegas@acid.vegas', author_email='acid.vegas@acid.vegas',
description='Hyper-fast HTTP Scraping Tool', description='Hyper-fast HTTP Scraping Tool',