Re: Apple changed their documentation at my request but it proves they don't care about privacy
Maria Sophia <[email protected]>
| Newsgroups | alt.comp.os.windows-10,alt.internet.wireless,comp.lang.python,comp.mobile.android,misc.phone.mobile.iphone |
|---|---|
| Organization | BWH Usenet Archive (https://usenet.blueworldhosting.com) |
| Message-ID | <[email protected]> |
Keith Thompson wrote:
>> So, together, the Windows & Python newsgroup honed the working code.
>> Do you need me to supply the code for you again so you can run it?
>
> You haven't supplied it once. If you did, I personally would not be
> interested in running it, but it might at least be topical in
> comp.lang.python *if* anyone actually discusses the code.
Hi Keith Thompson,
Thank you for bringing up your point of view, as all points are valid here.
This is Usenet where we welcome deep detailed discussion of tech topics.
Jon Ribbens clearly ran the code so we have proof that it was referenced
properly enough for him to have run it on his machine to prove the point.
Nonetheless, it's good you're *asking* for the Python code, which I only
ran on Windows 10, and which I'm happy to supply to you for all to review.
Please keep in mind the progression of this topic started with this paper:
*Surveilling the Masses with Wi-Fi-Based Positioning Systems*
<https://arxiv.org/abs/2405.14975>
As Jon Ribbens did, I simply ran the Python code in that article on my PC.
Since all the dozens of access points on my property have always had both a
hidden broadcast & a _nomap prefix, I was horrified to see them on the map!
At that time, we discussed this issue at length, where the following code
resulted which I will provide to the team to try themselves on their PC.
12/17/2025 02:28 PM 2,934 bssid.bat.txt
12/17/2025 02:28 PM 4,309 bssidcheck.bat.txt
12/17/2025 02:28 PM 1,979 bssidcompare.bat.txt
12/17/2025 02:28 PM 316 bssidgenerate.bat.txt
12/17/2025 02:28 PM 4,312 bssidgenerate.ps1.txt
12/17/2025 02:28 PM 1,348 bssidplot.py.txt
12/17/2025 02:28 PM 27,527 bssid_results.txt
Let's start with the first on that list, and proceed from there, so that
anyone with this code can track every single router location in the world.
Here is bssid.bat
@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
--
bssid.bat