fuck
This commit is contained in:
parent
ef115eb3da
commit
d5ce06ed1e
@ -6,4 +6,4 @@ from .scanner import HTTPZScanner
|
|||||||
from .colors import Colors
|
from .colors import Colors
|
||||||
|
|
||||||
|
|
||||||
__version__ = '2.0.4'
|
__version__ = '2.0.5'
|
@ -148,18 +148,23 @@ async def main():
|
|||||||
shard=args.shard
|
shard=args.shard
|
||||||
)
|
)
|
||||||
|
|
||||||
# Run the scanner and handle output in ONE place
|
# Run the scanner and handle ALL output here
|
||||||
|
count = 0
|
||||||
async for result in scanner.scan(args.file):
|
async for result in scanner.scan(args.file):
|
||||||
# Write to output file if specified
|
# Write to output file if specified
|
||||||
if args.output:
|
if args.output:
|
||||||
with open(args.output, 'a') as f:
|
with open(args.output, 'a') as f:
|
||||||
f.write(json.dumps(result) + '\n')
|
f.write(json.dumps(result) + '\n')
|
||||||
|
|
||||||
# Print to console based on format
|
# Console output
|
||||||
if args.jsonl:
|
if args.progress:
|
||||||
print(json.dumps(result))
|
count += 1
|
||||||
|
info(f"[{count}] {format_console_output(result, args.debug, show_fields, args.match_codes, args.exclude_codes)}")
|
||||||
else:
|
else:
|
||||||
print(format_console_output(result, args.debug, show_fields, args.match_codes, args.exclude_codes))
|
if args.jsonl:
|
||||||
|
print(json.dumps(result))
|
||||||
|
else:
|
||||||
|
print(format_console_output(result, args.debug, show_fields, args.match_codes, args.exclude_codes))
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
logging.warning('Process interrupted by user')
|
logging.warning('Process interrupted by user')
|
||||||
|
@ -179,13 +179,6 @@ class HTTPZScanner:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
async def process_result(self, result):
|
|
||||||
'''Process a scan result'''
|
|
||||||
if self.show_progress:
|
|
||||||
self.progress_count += 1
|
|
||||||
info(f'[{self.progress_count}] {format_console_output(result, self.debug_mode, self.show_fields, self.match_codes, self.exclude_codes)}')
|
|
||||||
|
|
||||||
|
|
||||||
async def scan(self, input_source):
|
async def scan(self, input_source):
|
||||||
'''
|
'''
|
||||||
Scan domains from a file, stdin, or async generator
|
Scan domains from a file, stdin, or async generator
|
||||||
@ -203,6 +196,7 @@ class HTTPZScanner:
|
|||||||
|
|
||||||
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False)) as session:
|
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False)) as session:
|
||||||
tasks = set()
|
tasks = set()
|
||||||
|
count = 0 # Move counter here since that's all process_result was doing
|
||||||
|
|
||||||
# Handle different input types
|
# Handle different input types
|
||||||
if isinstance(input_source, str):
|
if isinstance(input_source, str):
|
||||||
@ -215,7 +209,8 @@ class HTTPZScanner:
|
|||||||
)
|
)
|
||||||
for task in done:
|
for task in done:
|
||||||
result = await task
|
result = await task
|
||||||
await self.process_result(result)
|
if self.show_progress:
|
||||||
|
count += 1 # Increment counter here
|
||||||
yield result
|
yield result
|
||||||
|
|
||||||
task = asyncio.create_task(self.check_domain(session, domain))
|
task = asyncio.create_task(self.check_domain(session, domain))
|
||||||
@ -231,7 +226,8 @@ class HTTPZScanner:
|
|||||||
)
|
)
|
||||||
for task in done:
|
for task in done:
|
||||||
result = await task
|
result = await task
|
||||||
await self.process_result(result)
|
if self.show_progress:
|
||||||
|
count += 1
|
||||||
yield result
|
yield result
|
||||||
|
|
||||||
task = asyncio.create_task(self.check_domain(session, domain))
|
task = asyncio.create_task(self.check_domain(session, domain))
|
||||||
@ -252,7 +248,8 @@ class HTTPZScanner:
|
|||||||
)
|
)
|
||||||
for task in done:
|
for task in done:
|
||||||
result = await task
|
result = await task
|
||||||
await self.process_result(result)
|
if self.show_progress:
|
||||||
|
count += 1
|
||||||
yield result
|
yield result
|
||||||
|
|
||||||
task = asyncio.create_task(self.check_domain(session, domain))
|
task = asyncio.create_task(self.check_domain(session, domain))
|
||||||
@ -264,5 +261,6 @@ class HTTPZScanner:
|
|||||||
done, _ = await asyncio.wait(tasks)
|
done, _ = await asyncio.wait(tasks)
|
||||||
for task in done:
|
for task in done:
|
||||||
result = await task
|
result = await task
|
||||||
await self.process_result(result)
|
if self.show_progress:
|
||||||
|
count += 1
|
||||||
yield result
|
yield result
|
2
setup.py
2
setup.py
@ -10,7 +10,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='httpz_scanner',
|
name='httpz_scanner',
|
||||||
version='2.0.4',
|
version='2.0.5',
|
||||||
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',
|
||||||
|
Loading…
Reference in New Issue
Block a user