Groups | Search | Server Info | Login | Register


Groups > alt.comp.microsoft.windows > #2921

Re: PSA: You may be surprised what's in your HKCU:Run registry key

From Marion <marionb@fact.com>
Newsgroups alt.comp.os.windows-10, alt.comp.os.windows-11, alt.comp.microsoft.windows
Subject Re: PSA: You may be surprised what's in your HKCU:Run registry key
Date 2025-10-23 12:36 -0600
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <10ddsk9$1mjv$1@nnrp.usenet.blueworldhosting.com> (permalink)
References <10db5jc$11sj$1@nnrp.usenet.blueworldhosting.com> <op.3et6emcf1svx94@desktop-57ei6ka.attlocal.net> <10dbo37$1l25$1@nnrp.usenet.blueworldhosting.com> <10dbpdb$31i8$1@nnrp.usenet.blueworldhosting.com> <10dbrmg$2msu$1@nnrp.usenet.blueworldhosting.com>

Cross-posted to 3 groups.

Show all headers | View raw


Marion wrote:
> Aurgh. It turns out ProxyBridge uses extremely non-standard saving methods.
> It's like someone just decided to make up any old way to save the settings.

Here is the latest revision with the vast improvement in usability.
This script enables ANYONE to block or proxy any Windows TCP/UDP binary.

Many thanks to Allan Higdon for informing me yesterday that ProxyBridge 
exists, as in just a dozen hours we've made a quantum leap in privacy!

  @echo off
  REM ============================================================
  REM  C:\app\network\proxy\proxybridge\pb.bat 20251022 
  REM  This is version 2p7
  REM ============================================================
  REM  Runs FOSS ProxyBridge to proxy any desired Windows program
  REM   <github.com/InterceptSuite/ProxyBridge/releases/tag/v2.0>
  REM  Requires existing proxy server (e.g., Psiphon SOCKS5 proxy)
  REM   <https://psiphon.ca/en/download-store.html>
  REM ============================================================
  REM  v1p0 20251022 15L
  REM   Launches ProxyBridge CLI using Psiphon SOCKS5 proxy.
  REM   Uses the CLI to apply rules for Brave, Chromium & stunnel.
  REM   Exits with control-C
  REM  v1p1 20251022 22L
  REM   Added process:hosts:ports:protocol:action format.
  REM   EXAMPLE: --rule stunnel.exe:*:119,563:TCP:PROXY 
  REM   Test with curl https://icanhazip.com
  REM  v1p2 20251022 39L
  REM   Added "--dns-via-proxy" & "--verbose 3" flags.
  REM  v1p3 20251022 52L
  REM   Added a prompt for UAC since ProxyBridges requires admin.
  REM  v1p4 20251022 65L
  REM   Added automatic external IP check via curl after launch.
  REM  v1p5 20251022 108L
  REM   Added logging of all output to with timestamped files.
  REM   But exiting out of multiple consoles is inefficient.
  REM  v1p6 20251022 115L
  REM   Simplified: single console window, inline ProxyBridge run,
  REM   Added a graceful quit with Ctrl+C, with logging intact.
  REM  v1p7 20251022 94L
  REM   Further simplified: one Ctrl+C stops ProxyBridge and exits,
  REM   removed pause and post-run commands for clean quit.
  REM   Cleaned up the formatting to remove blank lines.
  REM  v1p8 20251022 107L
  REM   Added cleanup section to ensure ProxyBridge is killed.
  REM  v1p9 20251022 101L
  REM   Simplified logging: one log file per run, no tmp clutter,
  REM   Modified the flow so one Ctrl+C stops everything cleanly.
  REM  v2p0 20251022 107L
  REM   Corrected logging: live console + single log file,
  REM   one Ctrl+C exits cleanly, cleanup guaranteed.
  REM  v2p1 20251022 103L
  REM   Live streaming fixed by having PowerShell read 
  REM   stdout/stderr in real time, mirrors to console 
  REM   and appends to one log file.
  REM  v2p2 20251022 74L
  REM   This became a mess so I started over with version 1p3 
  REM   Changed ProxyBridge launch to "start /wait" so one Ctrl+C
  REM   stops ProxyBridge cleanly without the Y/N batch prompt.
  REM  v2p3 20251022 92L (whew, got it working again by backtracking)
  REM   Added timestamped log file with live console output.
  REM   One console, one Ctrl+C to stop ProxyBridge.
  REM  v2p4 20251022 
  REM   Added back UAC elevation block 
  REM  v2p5 20251023 
  REM   Moved rules to a rules.txt file for easier maintenance
  REM   Added a safety check to ensure rules.txt exists
  REM   Maintained logging and UAC elevation
  REM   Preserved the single-console, Ctrl+C exit behavior
  REM   PowerShell invocation uses %PBARGS% instead of a 
  REM   nonexistent ProxyBridge --config flag to break lines up
  REM  v2p6 20251023
  REM   Modified so that only one control-C is needed (sans YES)
  REM  v2p7 20251023 144L 
  REM   Added usability to include inline comments in rules.txt
  REM   Added common examples of block, direct, ports & proxy
  REM    --rule brave.exe:*:*:TCP:PROXY # Brave browser
  REM    --rule stunnel.exe:*:119,563:TCP:PROXY # proxy NNTP/SMTPS traffic
  REM    --rule svchost.exe:*:*:TCP:DIRECT # Windows services host 
  REM    --rule CompatTelRunner.exe:*:*:TCP:BLOCK # Block telemetry
uploader
  REM ============================================================
  :: Delayed expansion is required for building %PBARGS% 
  :: %PBARGS% is needed because ProxyBridge has no --config option
  setlocal enabledelayedexpansion
  
  :: --- UAC Elevation Check ---
  net session >nul 2>&1
  if %errorLevel% neq 0 (
      echo Requesting Administrator privileges...
      powershell -Command "Start-Process '%~f0' -Verb RunAs"
      exit /b
  )
  :: --- End UAC Elevation Check ---
  
  :: --- Logging setup ---
  set "LOGDIR=C:\data\sys\log"
  if not exist "%LOGDIR%" md "%LOGDIR%" 2>nul
  for /f "tokens=1-4 delims=/ " %%a in ("%DATE%") do (
    set YYYY=%%d
    set MM=%%b
    set DD=%%c
  )
  for /f "tokens=1-3 delims=:." %%a in ("%TIME%") do (
    set HH=%%a
    set Min=%%b
    set Sec=%%c
  )
  if "%HH:~0,1%"==" " set HH=0%HH:~1,1%
  set LOGSTAMP=%YYYY%%MM%%DD%_%HH%%Min%%Sec%
  set "LOGFILE=%LOGDIR%\pb_%LOGSTAMP%.log"
  echo Logging to %LOGFILE%
  :: --- End logging setup ---
  
  cd /d C:\app\network\proxy\proxybridge
  if not exist "rules.txt" (
    echo ERROR: rules.txt not found in %CD%
    exit /b
  )
  
  :: In version 2p5, rules were moved to a rules.txt file
  :: The loop skips blank lines & lines starting with # for comments.
  :: # This is rules.txt  (blank lines are ignored)
  :: --proxy socks5://127.0.0.1:1080
  :: --rule brave.exe:*:*:TCP:PROXY
  :: --rule chrome.exe:*:*:TCP:PROXY
  :: --rule dialog.exe:*:*:TCP:PROXY
  :: --rule telegram.exe:*:*:TCP:PROXY
  :: --rule stunnel.exe:*:119,563:TCP:PROXY
  :: --rule curl.exe:*:*:TCP:PROXY
  :: --dns-via-proxy
  :: --verbose 3
  
  :: --- Build arguments from rules.txt ---
  set "PBARGS="
  for /f "usebackq delims=" %%A in ("rules.txt") do (
      set "LINE=%%A"
      if not "!LINE!"=="" if /i not "!LINE:~0,1!"=="#" (
          rem Strip inline comments: take everything before first #
          for /f "tokens=1 delims=#" %%B in ("!LINE!") do (
              set "PBARGS=!PBARGS! %%B"
          )
      )
  )
  
  taskkill /im ProxyBridge_CLI.exe /f >nul 2>&1
  
  echo ProxyBridge starting... Press Ctrl+C to stop.
  
  :: Wrapped with cmd /c to avoid "Terminate batch job (Y/N)?" prompt.
  cmd /c powershell -NoLogo -NoProfile -Command "Set-Location '%CD%'; &
'%CD%\ProxyBridge_CLI.exe' %PBARGS% | Tee-Object -File '%LOGFILE%'"
  
  echo ProxyBridge exited.
  endlocal
  :: end of C:\app\network\proxy\proxybridge\pb.bat 
-- 
If you wonder why my posts are different, I'm nothing like most
people who post to Usenet. Most people who post are stupid trolls.
There is more value in this one post than they can add in
their entire lives. Trolls hate that they're stupid. So be it.

Back to alt.comp.microsoft.windows | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

PSA: You may be surprised what's in your HKCU:Run registry key Marion <mariona@fact.com> - 2025-10-22 10:51 -0700
  Re: PSA: You may be surprised what's in your HKCU:Run registry key "Allan Higdon" <allanh@vivaldi.net> - 2025-10-22 15:41 -0500
    Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-22 17:07 -0600
      Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-22 17:29 -0600
        Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-22 18:08 -0600
          Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-23 12:36 -0600
            Re: PSA: You may be surprised what's in your HKCU:Run registry key Hank Rogers <Hank@nospam.invalid> - 2025-10-23 17:35 -0500
              Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-23 23:29 -0600
                Re: PSA: You may be surprised what's in your HKCU:Run registry key Hank Rogers <invalid@nospam.com> - 2025-10-24 05:48 +0000
                Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionc@facts.com> - 2025-10-24 00:06 -0600
                Re: PSA: You may be surprised what's in your HKCU:Run registry key Andy Burns <usenet@andyburns.uk> - 2025-10-24 09:09 +0100
                Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionc@facts.com> - 2025-10-24 03:30 -0600
                Re: PSA: You may be surprised what's in your HKCU:Run registry key Andy Burns <usenet@andyburns.uk> - 2025-10-24 11:56 +0100
                Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionc@facts.com> - 2025-10-24 05:15 -0600
  Re: PSA: You may be surprised what's in your HKCU:Run registry key "Allan Higdon" <allanh@vivaldi.net> - 2025-10-22 15:41 -0500
    Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-22 15:26 -0600
      Re: PSA: You may be surprised what's in your HKCU:Run registry key Hank Rogers <Hank@nospam.invalid> - 2025-10-22 18:56 -0500
        Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-22 18:21 -0600
        Re: PSA: You may be surprised what's in your HKCU:Run registry key "J. P. Gilliver" <G6JPG@255soft.uk> - 2025-10-23 01:23 +0100
          Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-22 19:09 -0600
            Re: PSA: You may be surprised what's in your HKCU:Run registry key Marion <marionb@fact.com> - 2025-10-22 21:08 -0600
  Re: PSA: You may be surprised what's in your HKCU:Run registry key "Steve Silverwood [KB6OJS]" <steve.silverwood@gmail.com> - 2026-02-11 17:26 -0800
  Re: PSA: You may be surprised what's in your HKCU:Run registry key "Steve Silverwood [KB6OJS]" <steve.silverwood@gmail.com> - 2026-03-28 13:23 -0700

csiph-web