
Cobalt Strike BOF that retrieves Windows geolocation coordinates via WinRT and legacy ILocation APIs, with automatic registry permission management.
A Cobalt Strike BOF that attempts to retrieve Windows geolocation coordinates without fork & run. It uses the WinRT Geolocator API first and falls back to the legacy ILocation API.
Simple BOF that uses WinRT geolocation with a legacy ILocation fallback. Will flip the following registry keys:
HKCU\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location
Value = AllowHKCU\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location\NonPackaged\<encoded process path>
Value = AllowHKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location
Value = AllowHKLM\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors
DisableLocation = 0DisableWindowsLocationProvider = 0HKLM\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy
LetAppsAccessLocation = 1HKLM\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration
Status = 1Admin execution also temporarily changes the lfsvc service start type to demand start and attempts to start the service.
All changes are undone after execution.
makeGeoLocationBOF.cna script into Cobalt Strikegeolocation_bofbeacon> geolocation_bof
[*] Running geolocation_bof by (@codex_tf2)
[+] host called home, sent: 30095 bytes
[+] received output:
latitude=12.34567890
longitude=-12.34567890
accuracy_radius_meters=25.00
This BOF is meant to provide a direct in-process way to request Windows geolocation data.
usual disclaimer here, I am not responsible for any crimes against humanity you may commit or nuclear war you may cause using this piece of poorly written code.