This is an update to the WPS scripts that I posted a few months ago.

Those scripts proved I could collect a list of every single access 
point in Apple's database, just as researchers Eric Rye and Dave 
Levin did, using a simple perl script which proved the results of 
their paper, and which went further to prove that my own 
hidden-broadcast SSIDs were in that database.

I complained to my next-door neighbor, who is a top-level exec 
at Apple Maps, where he (to his credit) pushed this wording 
through, but it proves, yet again, beyond any semblance of 
doubt, that Apple doesn't care about our privacy.

Even Google doesn't stoop this low.
And that's saying something.

https://support.apple.com/en-ie/102515

"The owner of a Wi-Fi access point can opt it out of Apple's 
Location Services by changing the access point's SSID (name)
 to end with _nomap.

For example, ´Access_Point¡ would be changed to ´Access_Point_nomap¡. 
This prevents devices from sending the access pointÿs location to 
Apple to include in Appleÿs crowd-sourced location database. 

This opt-out doesnÿt work for hidden networks because they make 
their network name only available to known devices, so other 
devices can't detect _nomap."

This last sentence is a bold lie, by the way, since they can 
certainly detect it, given the field has a null value. 
But they lie about that too.

Below is code reproducing my tests... from which the claims are made.

  @echo off
  setlocal EnableDelayedExpansion
  :: C:\app\os\python\apple_bssid_locator\bssid.bat
  :: Use: bssid.bat <Enter> (then enter desired BSSID to look up)
  :: Sample values:
  ::  00:18:f8:c1:4a:65 
  ::  00:07:89:d7:82:e8
  ::  04:09:A5:3B:34:67
  ::
  :: Logs up to 400 BSSID:GPS pairs from Apple's WPS public database
  :: Loop until user types q
  ::
  :: Changelog:
  :: v1p0 20251205 - Query Apple's highly insecure WPS database 
  :: v1p1 20251214 - Saves to time-date stamped results.txt log file
  :: v1p2 20251215 - Timestamp results.txt so it's not overwritten
  :: v1p3 20251219 - Limit the human-readable GPS to 6 decimal places
  :: v1p4 20251219 - Show original raw integers + converted decimals
  :: v1p5 20251219 - Tried to accomodate Google Maps query to new format
  :: v1p6 20251219 - Changed to block-aware parsing with debug output
  :: v1p7 20251219 - Enable delayed expansion to fix parsing inside loops
  
  set LOGDIR=%~dp0log
  if not exist "%LOGDIR%" mkdir "%LOGDIR%"
  
  :: Create a unique session log (YYYYMMDD_HHMMSS)
  for /f %%A in ('wmic os get localdatetime ^| find "."') do set dt0=%%A
  set "session_ts=%dt0:~0,8%_%dt0:~8,6%"
  set "session_log=%LOGDIR%\session_%session_ts%.log"
  
  echo === New BSSID lookup session started at %date% %time% === >> 
"%session_log%"
  
  echo.
  echo === Nearby Wi-Fi Networks ===
  netsh wlan show networks mode=bssid
  echo =============================
  
  :loop
  echo.
  set /p BSSID=Enter the BSSID (or q to quit): 
  
  if /I "%BSSID%"=="q" goto end
  
  :: --- Clean up input ---
  set "BSSID=%BSSID:"=%"
  set "BSSID=%BSSID: =%"
  
  :: --- Make filename-safe version ---
  set "safeBSSID=%BSSID::=-%"
  
  :: --- Generate timestamp for THIS lookup ---
  for /f %%A in ('wmic os get localdatetime ^| find "."') do set dt=%%A
  set "ts=%dt:~0,8%_%dt:~8,6%"
  
  :: --- Timestamped output file ---
  set "outfile=%LOGDIR%\bssid_%safeBSSID%_%ts%.txt"
  
  :: --- Clear previous coordinates ---
  set "LAT="
  set "LON="
  
  echo === Lookup started at %date% %time% === > "%outfile%"
  echo BSSID: %BSSID% >> "%outfile%"
  echo. >> "%outfile%"
  
  :: --- Run Python lookup ---
  python.exe apple_bssid_locator.py %BSSID% --all >> "%outfile%"
  
  :: --- Display results ---
  echo -----------------------------------------------
  type "%outfile%"
  echo -----------------------------------------------
  
  :: --- Block-aware parsing of coordinates (with delayed expansion) ---
  set "CAPTURE="
  set "LAT="
  set "LON="
  
  for /f "usebackq delims=" %%L in ("%outfile%") do (
      if /i "%%L"=="BSSID: %BSSID%" (
          set "CAPTURE=1"
          set "LAT="
          set "LON="
          echo [DEBUG] Found block start for %BSSID%
      ) else if defined CAPTURE (
          echo [DEBUG] Line in block: %%L
  
          echo %%L | findstr /i /c:"Latitude (degrees):" >nul
          if not errorlevel 1 (
              for /f "tokens=2 delims=:" %%A in ("%%L") do set "LAT=%%A"
              if defined LAT set "LAT=!LAT: =!"
              echo [DEBUG] Parsed LAT candidate = "!LAT!"
          )
  
          echo %%L | findstr /i /c:"Longitude (degrees):" >nul
          if not errorlevel 1 (
              for /f "tokens=2 delims=:" %%B in ("%%L") do set "LON=%%B"
              if defined LON set "LON=!LON: =!"
              echo [DEBUG] Parsed LON candidate = "!LON!"
          )
  
          if defined LAT if defined LON (
              goto :gotCoords
          )
  
          echo %%L | findstr /i /c:"BSSID:" >nul
          if not errorlevel 1 (
              set "CAPTURE="
          )
      )
  )
  
  :gotCoords
  echo [DEBUG] Final LAT = "!LAT!"
  echo [DEBUG] Final LON = "!LON!"
  
  :: --- Validate parsed coordinates ---
  if not defined LAT echo [DEBUG][ERROR] Latitude not captured. Check Python 
output format near "BSSID: %BSSID%".
  if not defined LON echo [DEBUG][ERROR] Longitude not captured. Check Python 
output format near "BSSID: %BSSID%".
  
  :: --- Save results --- 
  echo === Lookup finished at %date% %time% === >> "%outfile%"
  echo. >> "%outfile%"
  
  :: --- Append to session log ---
  echo [%date% %time%] BSSID: %BSSID% >> "%session_log%"
  echo Latitude: !LAT! >> "%session_log%"
  echo Longitude: !LON! >> "%session_log%"
  echo. >> "%session_log%"
  
  :: --- Append to master log ---
  echo [%date% %time%] BSSID: %BSSID% >> "%LOGDIR%\results.log"
  echo Latitude: !LAT! >> "%LOGDIR%\results.log"
  echo Longitude: !LON! >> "%LOGDIR%\results.log"
  echo. >> "%LOGDIR%\results.log"
  
  :: --- Open in Google Maps ---
  if defined LAT if defined LON start msedge 
"https://www.google.com/maps/search/?api=1&query=!LAT!,!LON!";
  
  goto loop
  
  :end
  echo Exiting. Goodbye!
  endlocal
  
  :: end of C:\app\os\python\apple_bssid_locator\bssid.bat
-- 
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to