一款 Cobalt Strike BOF,尝试在不进行 fork & run 的情况下检索 Windows 地理位置坐标。它首先使用 WinRT Geolocator API,如果失败则回退到旧版 ILocation API。
简单的 BOF,使用 WinRT 地理定位并回退到旧版 ILocation。它将翻转以下注册表项:
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 = 1以管理员身份执行时,还会临时将 lfsvc 服务的启动类型改为按需启动,并尝试启动该服务。
所有更改在执行后都会恢复。
makeGeoLocationBOF.cna 脚本导入 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
此 BOF 旨在提供一种直接在进程中请求 Windows 地理位置数据的方法。
常规免责声明在此,本人不对您使用此段糟糕代码可能造成的任何反人类罪行或核战争负责。