iOS Location Spoofer
4 views
136c1fe4...
Description
A Frida script that hijacks -[CLLocation coordinate] and returns spoofed GPS coordinates. It exposes simple movement helpers (right, left, up, down) that move the spoofed position by a configurable distance (default 50 m) and re-install the spoofed coordinate.
How to Use
Run this script using Frida CLI:
frida --codeshare karim-moftah/ios-location-spoofer -f YOUR_BINARY
Source Code
JavaScript
// Base coordinates
var spoof_latitude = 46.211275;
var spoof_longitude = 2.368013;
function spoof_location(lat, lon) {
var hook_cllocation = ObjC.classes["CLLocation"]["- coordinate"];
Interceptor.attach(hook_cllocation.implementation, {
onLeave: function (ret) {
var spoofed = (new ObjC.Object(ret)).initWithLatitude_longitude_(lat, lon);
ret.replace(spoofed);
}
});
}
// Convert meters to degrees (approx)
function metersToDegrees(m) {
return m / 111111; // ~111.111 km per degree latitude
}
function right(m = 50) {
spoof_longitude += metersToDegrees(m);
spoof_location(spoof_latitude, spoof_longitude);
}
function left(m = 50) {
spoof_longitude -= metersToDegrees(m);
spoof_location(spoof_latitude, spoof_longitude);
}
function up(m = 50) {
spoof_latitude += metersToDegrees(m);
spoof_location(spoof_latitude, spoof_longitude);
}
function down(m = 50) {
spoof_latitude -= metersToDegrees(m);
spoof_location(spoof_latitude, spoof_longitude);
}
// Initial spoof
spoof_location(spoof_latitude, spoof_longitude);
Comments