Production hardening: REAPER all-in-one launcher, rdpthread UX, logic fixes
- Add REAPER.bat single entry (pip, dirs, smoke test, launch); MASTER/MASTERSTER shim to it - bruteforce: rdpthread helpers, safe writer close, spray_all_hosts incremental writes, progress - gui: credential banner, spray messaging without spam; cmdkey TERMSRV host - scanner: adaptive progress; proxy: retry cap on open_connection - ip_utils: /32 CIDR, count_ips aligned with large dash ranges - README/install/run: deployment docs and REAPER.bat references Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
19
scanner.py
19
scanner.py
@@ -119,6 +119,16 @@ async def scan_ips(
|
||||
|
||||
checker = check_rdp_with_banner if banner_check else check_rdp_port
|
||||
|
||||
if progress_callback and total > 0:
|
||||
if total <= 1000:
|
||||
progress_every = max(1, total // 50 or 1)
|
||||
elif total <= 10000:
|
||||
progress_every = 100
|
||||
else:
|
||||
progress_every = 1000
|
||||
else:
|
||||
progress_every = 0
|
||||
|
||||
async def check_one(ip: str, port: int):
|
||||
nonlocal checked
|
||||
async with sem:
|
||||
@@ -130,10 +140,11 @@ async def scan_ips(
|
||||
if live_callback:
|
||||
live_callback(ip, p)
|
||||
checked += 1
|
||||
if progress_callback and checked % 1000 == 0:
|
||||
elapsed = time.time() - start_time
|
||||
rate = checked / elapsed if elapsed > 0 else 0
|
||||
progress_callback(checked, total, len(live_hosts), rate)
|
||||
if progress_callback and progress_every:
|
||||
if checked == total or checked % progress_every == 0:
|
||||
elapsed = time.time() - start_time
|
||||
rate = checked / elapsed if elapsed > 0 else 0
|
||||
progress_callback(checked, total, len(live_hosts), rate)
|
||||
|
||||
# Fire all tasks concurrently
|
||||
tasks = []
|
||||
|
||||
Reference in New Issue
Block a user