-
Notifications
You must be signed in to change notification settings - Fork 941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CID info via API and SCREEN_STATE #88
Comments
I decided to get a little in android coding. Here my first android code: I took Mobilog and modified it so that it can obtain the GPS-coordinates of mobile networks (including neighbour cells) using Google's API. But you need to compile it yourself, I haven't learned yet how to sign apks. At first I thought I try to modify our application but it doesn't work on my android 4.4.4 system. It is not able to obtain network information and doesn't display neighbour cells. The map viewer crashes the application although I have GMaps installed - still too many bugs. I will see if I can add more cool things in Mobilog. (( Screw you all, I will write my own IMSI-Catcher Detector 100% optimized for MTK using openstreetmaps, and let it switch to 3G-only when I want to make calls (which I don't really need because I use always SIP calling) :P )) If I get skilled enough, I will see if I can help with developing our app. (( Do you want to pay me with my donated Dark Coins? xD )) |
@andr3jx, thanks for your extensive research and deep digging on Mobilog! Now, before you develop you own IMSI-Catcher, I'd be happy if you stay with us on our Project. 😺 Is there anything I can help you with? Feel free to send me your DarkCoin address through XDA. Once we have enough donations (unfortunately not yet) I'll send you a piece of the pie. Cheers and keep on coding awesome stuff! |
Yes, Danilo Valerio's Mobilog is a very nicely made app, accompanied by some very informative and well written design notes. Of particular interest is the following passage:
We need to verify if this is still true for API > 17. |
@SecUpwN Of course I will stay on our Project ;). If I can make something work on Mobilog, I can port it later to our app, but now I'm not ready to deal with so many bugs in our app.
There is also an app screen standby root, which can switch off the screen without putting the device into sleep mode. |
@andr3jx Yes, for that App, I think the HW switching check is done here. public GenericHardwareObserver (String hardware_switch_name) throws HardwareNotFoundException {
HARDWARE_UEVENT_MATCH = "DEVPATH=/devices/virtual/switch/" + hardware_switch_name;
HARDWARE_STATE_PATH = "/sys/class/switch/" + hardware_switch_name + "/state";
HARDWARE_NAME_PATH = "/sys/class/switch/" + hardware_switch_name + "/name";
mHardwareSwitch = hardware_switch_name;
mChangeHandlers = new java.util.ArrayList<UEventStateChangeHandler>();
init();
} |
Let me ask, after the switch over to OSMAnd, is this issue a non-issue? |
@E3V3A, I am all against scattering all the useful Information into thousands of Issues. Please rename this Issue appropriately to fit the current state and development without GMaps API. Thank you. |
We need to understand the current status of this. Does our app collect correct signal data after going to (or during) sleep, where screen is off? |
It hurts admitting this, but even I don't know for sure. @tobykurien, do you know? |
I haven't tested it, so I can't say for sure, but in theory, yes it should continue collecting data, due to the listener here: https://github.com/SecUpwN/Android-IMSI-Catcher-Detector/blob/master/app/src/main/java/com/SecUpwN/AIMSICD/service/CellTracker.java#L438 |
@andr3jx since you opened this Issue, what is the current status of this? |
Can someone please test the status of this? (I'm not sure what to look for here...) Can we close this? |
The core of this issue is to find out if the app collects correct data while the screen is off.
These questions can be answered by debugging the app / logging + using a second device to check if the collected values are correct. This needs to be properly checked because the info I found shows that problems occur when you collect cellular data while the screen is off: "You’ve mentioned that the screen needs to be on. Does the app not collect data when the screen is off? "NOTE that the Android operating system provides RSSI through the API, ONLY AND ONLY IF the screen is ON. Therefore, if this option is enabled the application will try to keep the screen ON (but at minimum brightness) by acquiring a wakelock. If you switch off the screen (for example by pressing the power button) the RSSI value will not be updated anymore (at least as of Gingerbread)." SOURCE "Due Android limitations it's necessary to have screen on during monitoring." SOURCE |
yes, i would like to have that cleared, too |
yes, you can also e.g. go from A to B keeping the screen on and then go from B to A with switched off screen. In the end you compare if you collected the same data. Take into account that there can be some differences because handovers can happen on different locations. |
sorry we have to close a few issues - if this still needs clarification pls let me know. 1 Does the app collect all available data (LAC, CID, Neighbor cells etc.) while the screen is off? maybe we need to add a table with phones that are checked? |
I guess that our app does, given the fact that the locked phone launches the short vibration on CID changes. Adding yet another table with phones will do no good. And see this on device support. ;-) |
Hi Sec, Conclusion: AIMSICD can't detect threats while the screen is off (and actually never could). I can file a new bug but it's very sad to know that nobody paid attention to this issue. Of course if anybody can prove me wrong by verifying that this is really not the case I will be very thankful. |
Good morning @andr3jx, thanks for running these important tests! If our app does not analyze the network variables while the screen is off, why does the phone vibrate when set to vibrate on any CID change then? Indeed, our app would be pretty useless if nothing gets analyzed while the screen is off. How exactly did you run your tests? Maybe @smarek can verify your findings? |
Can you show me the code where it triggers vibration on any CID change? My observation is that the phone only vibrates if there are problems like no neighboring cells for a CID.
First I added additional logs in the code so I see exactly which functions get called. Then I connected my phone over adb and monitored what gets logged when the screen is on and when the screen is off. But more interesting is the question if really somebody can confirm that this is definitely the case or not the case for your devices (maybe this problem occurs only on my device). This behavior is known, multiple sources cited in my post confirm this. |
Sorry @andr3jx i don't know why we left this conversation. |
You can download apk and source code here: |
I also did now a quick test on my Nexus 7 3G (2012) running Android 5.1.1 Here is a logcat:
|
good that i saved the email with a link to this issue :) it's a jungle out there! when i switch off the display:
thats all - there is no log until i move the phone. Than the routine gets triggered to prevent signal strength measurement.
Just for me, to remember: Didn't we implement some service task that keeps running in the background, when the App is working in the background? |
You can sort the issues by "recently updated" to see if something new got added. One line remains the same so it is not clear if the API only returns the same CID(until the screen is switched on) or if there was really no CID change. (on my phone the first is the case). 11-24 02:09:37.824 1053-1053/? I/AIMSICDDbAdapter﹕ DBi_bts updated: CID=xxx79 LAC=xx71
Can you keep the phone moving or change the refresh rate from automatic to 10 seconds? Are neighboring cells not obtained while screen is off? It's also not good if signal strength measurements can't work. Can you perform my test procedure? Switch Flight mode off and put screen off immediately (before it connects to BTS).
Yes, the service works but it doesn't mean that all APIs work while the screen is off.
Not only custom roms but also stock roms. |
When i switch off the display and keep moving the phone it's updating the DBi_bts
When i switch off the "Flight Mode" and turn off the lights i get CellID= -1
======Switch Flight mode off and put screen off immediately ========
I don't get any information about the neighbouring cell list in this log. When you switch off the display and don't move the phone - does it also stop producing any log? |
I checked now, yes it stops logging. If I keep moving then eventually last known GPS location is logged.
Yes this might be worth a try. Good to know that at least on some phones CID and LAC can be obtained. Still it's not good that signal strength and neighboring cells are not logged. |
We know that Google has more accurate information about cell towers in comparison to OpenCellID. I did some research on their non-public api. I downloaded Gmaps.apk and decompiled it to smali. There I found a url "http://www.google.com/glm/mmap", which I googled. Here info how to use this api (redundant):
http://www.open-electronics.org/how-to-find-the-location-with-gsm-cells/ (later I realized that it was already posted here).
https://code.google.com/p/birdnest/source/browse/branches/gae/birdnest/glm.py?spec=svn82&r=82
https://gist.github.com/creotiv/3713832
http://www.codeproject.com/Articles/31965/Learn-How-to-Find-GPS-Location-on-Any-SmartPhone-a
https://code.google.com/p/mwop/source/browse/sandbox/server/mwop-server/src/com/mwop/server/cellID/AbstractCellIDProvider.java?r=18
http://cdacians.blogspot.de/2012/08/convert-celllocation-to-real-location.html
So what we can do is simply use their hidden api to check if they have a particular cell in their database and if they do we can get GPS coordinates of the cell + submit it to OpenCellID. We can also get the coordinates of Neighbour-Cells and calculate a more or less precise location based on signal stregth of the cells. The question is how reliable is Googles mobile network info? If we have a cell which is not in Google's database, it could be an indicator that it is an IMSI Catcher.
It would be better if we could download all mobile network info in an area. I'm interested which data is stored in Google's offline maps and if it is possible to access this data somehow. I tried to intercept offline maps data but couldn't bypass SSL encryption (Certificate pinning and other problems). But I found these tools so I'm sure there is a way to bypass SSL or attach a debugger to GMaps.
There is also the official Google Geolocation API, but you need to pay for an API key.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: