How to secure may own android app from hacking? - Security Discussion

How to secure my own android app from hacking?

Wasleed said:
How to secure my own android app from hacking?
Click to expand...
Click to collapse
It may be good to specify what you want to protect against. Do you want to make sure the data handled by the app cannot be accesed/altered? Do you want to secure the connection to a host? There are multiple guides available for secure coding, including the Android Dev site: http://developer.android.com/training/articles/security-tips.html
Good luck.

Wasleed said:
How to secure my own android app from hacking?
Click to expand...
Click to collapse
Ok, lets get some clarification. Reverse engineering? Or exploiting a vulnerability?
Protect from reverse engineering? Not possible. You can use something like Allatori, DexGuard, Dasho etc to make it more difficult to reverse engineer but it is impossible to stop it. An experience reverse engineer will rip through it. Don't believe anyone (even Google) if they say ProGuard makes reverse engineering impossible, or more difficult, it doesn't.
Protect from exploitation? Use best practices when writing the app. Network traffic? SSL with certificate pinning. Attacks against components (services, broadcast receivers etc? Don't export unless absolutely needed. Use the least amount of permissions needed to accomplish your goal. Maintain the absolute minimum permissions for files, they dont need to ever be world write-able. Injections? valid and sanitize input. The list goes on and on. Get someone knowledgable in the area to do an audit of the app if possible.

jcase said:
Ok, lets get some clarification. Reverse engineering? Or exploiting a vulnerability?
Protect from reverse engineering? Not possible. You can use something like Allatori, DexGuard, Dasho etc to make it more difficult to reverse engineer but it is impossible to stop it. An experience reverse engineer will rip through it. Don't believe anyone (even Google) if they say ProGuard makes reverse engineering impossible, or more difficult, it doesn't.
Click to expand...
Click to collapse
There is dirty trick here. You can move some part(logic) of your code in native lib. It will complicate the decompilation. Because not so many reversers familiar with arm assembler. But I'm agree, it's not possible to fully protect app from cracking.

Its simply impossible to protect your app from reverse engineering.....
Sent from my GT-I9300 using XDA Free mobile app

Java bytecode can be easily decompiled.
It's possible to use obfuscators to make it difficult to reverse engineer bytecode.
But, it doesn't give 100% guarantee from reverse engineering - decompiled code will be just messy.
Android development tools include Proguard obfuscator - you can use it.
The best way to protect code is to move some parts of it to native part (NDK, C++).
Best regards.
---------- Post added at 02:37 PM ---------- Previous post was at 02:20 PM ----------
danelab said:
There is dirty trick here. You can move some part(logic) of your code in native lib. It will complicate the decompilation. Because not so many reversers familiar with arm assembler. But I'm agree, it's not possible to fully protect app from cracking.
Click to expand...
Click to collapse
I agree with you, that not many people know it.
But, Arm assembler is easy to understand. If somebody understands x86 assembler, he can understand Arm assembler too.
IDA is a great tool for reverse engineering. If you have understanding of Arm assembler, you can use IDA to check how it's hard to reverse engineer your software.
Some tips:
Don't make simple to understand function names, such as checkLicense, isLicenseValid, isTrialValid, isItemBrought. Make names, that will confuse. For example: function that check license or trial will be loadIcons or something like this.
Don't make functions easily to patch. For example, your function check if item in your game is brought, and it returns bool. Someone can replace a few asm instructions, and func will always return true. It's better to make not only one check from different places. If one check func is patched, others are not. And it will make your app cracking more difficult.
Scramble strings. Strings, such as urls, message texts, log messages, can make cracking more easy. For example, your app gets the list of brought items from your server. Server url can be used to identify the place, where check is performed. Cracker can reveal logic and patch your app. The same is with messages and log messages. These strings can be used to identify place in code and what your app perform in this place. Make xor for all chars in such strings, and it will be more difficult to find it.
I hope this help you.
Best regards,

Related

[Q] WP7 Api Questions

Im new to WP7 and app making, so I want to find some things out about making apps for it before I decide to buy a device, Ive been making some small apps over the past few days using the emulator and found some things that i thought would be useful to make some kick ass apps).
1. Is there such api that will help me with finding locations of stores (example: if i request information on Walmart and my gps coordinates it returns a list of close walmarts and their locations).
2. Anyway to take control of certain system settings with permission from user? (change ringer profile on monday - friday 8 am - 5 pm to vibrate automatically)
3. Say I want to have an app that uses GPS and saves my location during a specific time, does that mean I have to have the app running in the foreground since microsoft does not allow people to have their apps run in the background, is this correct?
Thanks
1.no
2.no
3.no, not possible
vetvito said:
1.no
2.no
3.no, not possible
Click to expand...
Click to collapse
1. So any app that has any sort of feature maintains its own database for store locations?
2. How about in the future? I know multi tasking will probably come but what about system settings and what not, do you think they will provide an API to work with if the user gives some sort of permission (like UAC in windows 7).
i think flat out responses that vetvito are more not quite true. my corrections to them would be these answers...
1. if there is a web version of this around or an app you see on iOS/Android which utilises GPS but uses an online database, it's quite easily doable on windows phone provided it uses simple HTTP web requests.
2. at this present, this isn't possible, that is for sure.
3. you are correct in your understanding. it does require being in the forground. if the app is running in the forground, it could easily do as you say provided it doesn't get put into tombstone state. it just requires the write coding done which is quite doable.
The Gate Keeper said:
i think flat out responses that vetvito are more not quite true. my corrections to them would be these answers...
1. if there is a web version of this around or an app you see on iOS/Android which utilises GPS but uses an online database, it's quite easily doable on windows phone provided it uses simple HTTP web requests.
2. at this present, this isn't possible, that is for sure.
3. you are correct in your understanding. it does require being in the forground. if the app is running in the forground, it could easily do as you say provided it doesn't get put into tombstone state. it just requires the write coding done which is quite doable.
Click to expand...
Click to collapse
Thanks! !
The Gate Keeper said:
i think flat out responses that vetvito are more not quite true. my corrections to them would be these answers...
1. if there is a web version of this around or an app you see on iOS/Android which utilises GPS but uses an online database, it's quite easily doable on windows phone provided it uses simple HTTP web requests.
2. at this present, this isn't possible, that is for sure.
3. you are correct in your understanding. it does require being in the forground. if the app is running in the forground, it could easily do as you say provided it doesn't get put into tombstone state. it just requires the write coding done which is quite doable.
Click to expand...
Click to collapse
how were my answers wrong. You just provided workarounds that makes the app useless. Not worth the time or effort.
3. wouldn't work at all, it would be pointless.
1. may work, but it has to be simple.
1. Nothing like that is built into the platform, but there may be publicly available webservices for that. Here are some options
Yelp (http://www.yelp.com/developers/documentation)
Foursquare (http://developer.foursquare.com/)
Facebook Places (http://developers.facebook.com/docs/reference/api/)
Google Places (http://code.google.com/apis/maps/documentation/places/#PlaceSearchRequests)
The WP7 API should support communication with these services.
PG2G said:
1. Nothing like that is built into the platform, but there may be publicly available webservices for that. Here are some options
The WP7 API should support communication with these services.
Click to expand...
Click to collapse
Thanks, I appreciate it!

android malware prototype

Hi,guys, l want to implement a malware on android as my graduation paper, and now i am hard to think more good ideas, would you like to share your novel ideas with me ?
thank you very much!
How bout something useful, like gps logger, call log, browser history. Make an app/server side interface that can customize various parameters such as minutes between gps logs and upload server. Several small companies would love to trace their employees activities on company phones. Might even get you paid.
westwind1120 said:
Hi,guys, l want to implement a malware on android as my graduation paper, and now i am hard to think more good ideas, would you like to share your novel ideas with me ?
thank you very much!
Click to expand...
Click to collapse
Sent from my MB855 using XDA App
1) Build an android HTTP server that parses the user agent and serves a different browser exploit depending on what android version is on, if it's a miss, forward to the actual requested page, if it's a hit, go for it!
2) + Arpspoof
3) ???
4) Graduation
Or something that will overwrite the default CD .iso image in the device (the one that is mounted when you plug the phone on the pc) and make a modified version of that with something evil that will jump on the pc.
jk... so is it going to be some app or PoC or a paper explaining potentials of exploiting from/to Android (like Zimperium - Anti / Faceniff / Droidsheep)?
I made a malware-related graduation paper many years ago...
jokersax11 said:
How bout something useful, like gps logger, call log, browser history. Make an app/server side interface that can customize various parameters such as minutes between gps logs and upload server. Several small companies would love to trace their employees activities on company phones. Might even get you paid.
Sent from my MB855 using XDA App
Click to expand...
Click to collapse
As a matter of fact, i want to write a rootkit on android, but at moment, it is lack of some useful cases, so as above, i need some ideas.....i promise it is just for study not for profits
ell3 said:
1) Build an android HTTP server that parses the user agent and serves a different browser exploit depending on what android version is on, if it's a miss, forward to the actual requested page, if it's a hit, go for it!
2) + Arpspoof
3) ???
4) Graduation
Or something that will overwrite the default CD .iso image in the device (the one that is mounted when you plug the phone on the pc) and make a modified version of that with something evil that will jump on the pc.
jk... so is it going to be some app or PoC or a paper explaining potentials of exploiting from/to Android (like Zimperium - Anti / Faceniff / Droidsheep)?
I made a malware-related graduation paper many years ago...
Click to expand...
Click to collapse
oh, guy, i just want to do some security research on mobile phone,and i don't want to attack others, i am a student who love researching information security.Forgive my poor english
This is the kind of thing you need to learn about yourself. Knowledge is a dangerous thing, and those who know how to exploit Android aren't about to share that kind of knowledge here unless it is clearly as a part of how to PREVENT such exploits.
lotherius said:
This is the kind of thing you need to learn about yourself. Knowledge is a dangerous thing, and those who know how to exploit Android aren't about to share that kind of knowledge here unless it is clearly as a part of how to PREVENT such exploits.
Click to expand...
Click to collapse
thanks, my friend, i am also realize that it is a long way to study android,and i will do my best,thank you again
I would recommend start learning reversing android malware, As you progress you will know the tricks of the trade and you can write your own stuff.
I been doing some reversing for a while as part of my job, A simple idea would be to write a small piece of code which sends sms to preminum rate numbers with out users knowlege (there are loads of them already doing it)etc..Start with simple ones which does not have support for command and Control center (C&C).
Read more about exsiting malwares which are around and i am sure you can prototype the one you wish to start with.
Random off the top of my head something I'd probably consider playing with someday:
if running on rooted device: install a system app and whatever is necessary, to then attempt overclocking the CPU enough to make the device go ape . 5Ghz Optimus One anyone?
Sent from my Transformer TF101 using Tapatalk

Detection of law enforcement malware (e.g. FinFisher)

Ladies and Gentlemen,
I am opening this discussion in order to not only receive some high-quality answers on the following questions, but also to learn what everyone does in order to ensure security and integrity of Apps on their phones (especially when working in environments where attacks are likely or possible due to intersting files on the phone or similar).
Here is my question: Let's suppose a phone is ROOTED, is locked with a Pattern, is updated daily, has TitaniumBackup installed, runs Trust as well as an Antivirus App and on top of that, installed Apps are monitored in a regular basis through TitaniumBackup. Is it even possible for law enforcements or hackers to install malware? If so, what would be necessary for them to do so? Physical access? Malformed Apps with matching signature? Other types of attacks (encouraging @He3556 the owner of Smartphone Attack Vector to chime in)?
Second question (hope @jcase can answer this): What would be the best way of preventing attacks of afforementioned groups and alike? What do YOU personally do?
SecUpwN said:
Ladies and Gentlemen,
I am opening this discussion in order to not only receive some high-quality answers on the following questions, but also to learn what everyone does in order to ensure security and integrity of Apps on their phones (especially when working in environments where attacks are likely or possible due to intersting files on the phone or similar).
Here is my question: Let's suppose a phone is ROOTED, is locked with a Pattern, is updated daily, has TitaniumBackup installed, runs Trust as well as an Antivirus App and on top of that, installed Apps are monitored in a regular basis through TitaniumBackup. Is it even possible for law enforcements or hackers to install malware? If so, what would be necessary for them to do so? Physical access? Malformed Apps with matching signature? Other types of attacks (encouraging @He3556 the owner of Smartphone Attack Vector to chime in)?
Second question (hope @jcase can answer this): What would be the best way of preventing attacks of afforementioned groups and alike? What do YOU personally do?
Click to expand...
Click to collapse
Pe rooted, with common rooted apps installed? Would be easy to compromise that phone, as you have already done it for them.
Use a stock firmware, chose a vendor with a recent history of good security (Samsung, nexus, motorola in that order imo), keep it up to date, reduce the number of apps you run, don't root it. Disabled usb debugging.
jcase said:
Pe rooted, with common rooted apps installed? Would be easy to compromise that phone, as you have already done it for them.
Use a stock firmware, chose a vendor with a recent history of good security (Samsung, nexus, motorola in that order imo), keep it up to date, reduce the number of apps you run, don't root it. Disabled usb debugging.
Click to expand...
Click to collapse
Thanks for answering. So that means, in short words, buy a phone and only update official stuff. How boring, I wouldn't be here on XDA then! But I get your point. I'm especially interested in the question of detection. If such agencies have installed anything that would leak data (and I'm sure it's fairly easy to do for them), how would they hide that specific App from the list of TitaniumBackup? Also, how would they trick the Trust Even Logger created by @Dark3n to not show any installation?
Most importantly though, is there some way of detecting such installations or manipulations afterwards?
There is growing so called "Zero-Day-Exploit" Industry, with names like vupen or FinFisher , the one who are working for the German Gov. but also for countries like Saudia Arabia and Iran. They know how to find exploits, nobody knows about (zero-day) and program trojans for all kinds of platforms. So antivirus software can't help here. And it is easy to bypass security if you know one of the bugs - and we know there are many of them in firmware, operating systems, plugins, frameworks and so on... Beside this "white" marked there is also a grey and black marked. So if you need to track your woman or steal information from other companies, you will find somebody with a tool for that, i suppose.
You would need a "Intrusion Detection Software" - sorry but this won't work for Smartphones, because there is a lot of calculation, data and energy needed - you find this special hardware in big data centers.
Do not root and do not install Apps you don't really need is still a good advice, specially when people don't know so much about all this.
Another way to sneak in is to compromise the users pc, that is (maybe) connected to the phone sometimes (work with iphone sync but also with android to change DNS and get SMS with e-tan's - you will find more info it in the media)
Or if you have the "power" you can can use the cloud services (iOS, Google, Windows or other 3rd party services) to steal user data (sms, pictures, GPS history...) or just let it sync the malware to the phone. So you don't have to break in directly.
What would be the best way of preventing attacks of afforementioned groups and alike?
Click to expand...
Click to collapse
tomorrow i will have time, there are to many possibilities
Thanks for clarifying, @He3556!
Now I know that phones in general are hard to lock down for such agencies. Time to quote myself:
SecUpwN said:
Most importantly though, is there some way of detecting such installations or manipulations afterwards?
Click to expand...
Click to collapse
Hey @He3556, if you've been following security news the past weeks, this topic here is becoming more relevant with each revelation. Since the trojan-coding company FinFisher has highly likely been hacked and some cool whisteblowers are publishing very sensitve data like price lists and handbooks on their Twitter account GammaGroupPR, more details of their secret software FinSpy Mobile is being revealed. And this is exactly the type of software that I am talking about here in this thread. I want to know how users can protect themselves from crap like that. According to the video that has been leaked, It is being installed through a fake update, or even through messages via E-Mail to "please" install this "very important update":
And just to make everyone more curious, FinSpy Mobile has been leaked on Twitter! It obviously works for all operating systems, including Android, Blackberry, Windows Mobile, and Symbian. Another trophy is source code of FinFly Web, which found its way the code hosting platform GitHub. It is designed to provide remote and covert infection of a Target System by using a wide range of web-based attacks. FinFly Web provides a point-and-click interface, enabling the Agent to easily create a custom infection code according to selected modules. Target Systems visiting a prepared website with the implemented infection code will be covertly infected with the configured software. Regarding FinSpy Mobile and similar software: How would law enforcements possibly attack a cautious member of XDA (or any other site)? I mean, people that have been in the field of flashing new ROMs, updating their firmware and recovery themselves, not installing strange APKs sent via E-Mail and controlling installed Apps through TitaniumBackup should be somewhat immune to such type of attacks, right?
It appears to me as if their software might work for the general masses, but highly-likely not on people like @jcase or other Android security-gurus. Since I linked you, I'd be very happy if you could expand on that a little. I am sure such companies might even have the possibility of messing with the baseband of a target phone through only knowing the phone number of a target. But I am really curious what their "standard procedure" is if they face a target with thorough Android knowledge, maybe even a security-enthusiastic Android developer. Wouldn't their only option be to manually manipulate the handset?
There are two methods to keep away all kinds of trojan and malware...
1. use a SIM with data connections only: There are SIM cards on the marked you can use in a USB Stick for Notebooks or tablets.
You won't have a cell phone number and can't receive SMS. You won't be able to use the circuit switched (GSM & UMTS-cs) part of your cell phone. For communication you have to use a VoIP provider - with Secure SIP and SRTP.
2. Web browser, Apps, e-mail client and all other connection must be use VPN.
But there is one more stepp to take.
The virtualization of all services and Apps you are using. This works like Team Viewer on a PC. The App is running on a cloud server while you only see the desktop of the remote controlled application. This technique is already used when you want to use flash with iOS device (photon, cloudbrowse, puffin and so on..)
More details about this you can find here: http://itwatch.info/Products/ReCAppS
But i am sure there are more projects about this out there...
He3556 said:
There are two methods to keep away all kinds of trojan and malware...
1. use a SIM with data connections only: There are SIM cards on the marked you can use in a USB Stick for Notebooks or tablets.
You won't have a cell phone number and can't receive SMS. You won't be able to use the circuit switched (GSM & UMTS-cs) part of your cell phone. For communication you have to use a VoIP provider - with Secure SIP and SRTP.
Click to expand...
Click to collapse
I know this works, but the only guy who is so insane and is already doing that is probably @InvaderX.
Honestly, what's the purpose of a phone if I can't receive SMS and call anyone without internet connection?
He3556 said:
2. Web browser, Apps, e-mail client and all other connection must be use VPN.
But there is one more stepp to take.
The virtualization of all services and Apps you are using. This works like Team Viewer on a PC. The App is running on a cloud server while you only see the desktop of the remote controlled application. This technique is already used when you want to use flash with iOS device (photon, cloudbrowse, puffin and so on..)
More details about this you can find here: http://itwatch.info/Products/ReCAppS
But i am sure there are more projects about this out there...
Click to expand...
Click to collapse
Better yet: Living under a rock should solve all these problems. Seriously though, can such law enforcement agencies silently update stuff on my phone (possibly baseband) that goes unnoticed even when using TitaniumBackup and flashing a fresh ROM every month? From the things you mentioned as for protection, I highly doubt that I'll move that way. And no matter how hard I try, the bad guys (or, to put it in the wording of those companies: the agencies that are "protecting our freedom") will likely always find a way in - even if that means tapping the phone through listining in on my calls or deploying an IMSI-Catcher. But talking about this makes me wonder: It seems as if the probability is high that most of the time they are selling a fake update to the target. Is there a convenient way of knowing that stuff like FinSpy Mobile has been installed, where such agencies can't possibly tinker with any records of what was happening on the phone? I especially check the Trust - Event Logger by @Dark3n very often. Could they change such records? Is there a better App to warn about unauthorizes access or (hidden) App installation?
Trust is not a security app!
If an attacker has root, you can just alter the database of apps like Trust, which would be the easiest way.
There are probably also ways to alter the system so it does not broadcast certain events(which is how Trust monitors most things).
It is just not build to withstand such attacks.
SecUpwN said:
Seriously though, can such law enforcement agencies silently update stuff on my phone (possibly baseband) that goes unnoticed
Click to expand...
Click to collapse
Maybe? But there are much easier ways if it is not desired to target specific persons.
I'll brain storm a bit for you:
I would divide the attack vectors into those that work with root and those that don't.
Without root apps can still do plenty of malicious actions, including tracking your position or uploading all files on your sdcard (INTERNET;SDCARD;LOCATION permissions) etc.
If an attacker gains root permission he could install rootkits, modify existing apps, inject malicious code into dex files of installed apps etc.
Basicly do what the hell he wants.
While not using a rooted device would certainly make it more difficult to do malicious things, it's doesn't prevent it.
A normal app you install could still root your phone through vulnerabilities. It works the same way apps such as TowelRoot or ZergRush root your phone.
Downloading new apps that request root is also very dangerous ofc, once you pressed "grant", it's too late, anything could have been done. So be wary when trying out new root apps of devs you don't know/trust?
Abusing trust in existing apps is probably the biggest danger.
The most obvious danger here is downloading apps you usually trust but from unknown sources.
Sure there could be signature issues when updating over your current app, but what if you don't have it installed? I could also think about a few ways to inject malicious code without altering the signature (did not try, just a thought, might be impossible).
The issue is that you probably wouldn't even notice, as the compromised app retains it's original functionality.
Want a botnet?
Inject malicious code into a popular root up that is paid, crack it and upload it somewhere.
While this more dangerous (or worth for an attacker) with root apps, it's still viable for non root apps, just pick one that already aquires many permissions.
It's way too easy, people constantly underestimate the danger of this. It's not all about piracy it's bad, it's a barn door sized security hole.
A bit more difficult variant would be abusing known security holes in existing apps that can be root or nonroot apps, such as modifying files the other apps uses, such that it executes your malicious code for you, so some type of code injection. First thought would be looking for root apps that use scripts or binary files and then check the permissions on those files to see whether they are writeable.
Now those are all ways to target a broad mass of users.
If a single user is the target, it would be more difficult, but there are still plenty of options:
- MITM attacks at public hotspots,
- Pressuring developers of apps you use. What dev wouldn't implement a security hole into an app of his, if a guy in a black suit comes up and points a gun to his head? Well that escalated quickly... But with "secret courts" and all the **** that happens secretly sanctioned or is just done by some agencies because they are above the law, is it really such an impossible scenario? The ends justify the means? Do they?
- My favorite plan yet, making a popular app themselves that they know you will try
It is usually never impossible, just a matter of resources and whether its unfeasible to spend so many resources on that goal.
edit: So the best course of action? Don't install anything you don't trust. Don't trust the manufactor either? Install a custom ROM, but as those often use binary blobs for certain parts of the software, it's not really a 100% solution... There could also be compromising hardware built in, but now I'm really climing up the tinfoil tree, but as recents new story suggest that the NSA is intercepting hardware packets from manufactors such as cisco to modify them, what's really impossible?
TL;DR Best course of action that is feasible to adhere to is probably to just not install stuff one doesn't know or trust.
edit2: More specific answers to your questions.
You might be able to monitor files changes on an a system level, but if your attacker gains highlevel priviledges, what keeps him from changing the monitoring system?
SecUpwN said:
Seriously though, can such law enforcement agencies silently update stuff on my phone (possibly baseband) that goes unnoticed even when using TitaniumBackup and flashing a fresh ROM every month?
Click to expand...
Click to collapse
How does TiBu help prevent such injection? Flashing a new ROM would probably undo such changes, but what prevents "them" from just doing it again.
SecUpwN said:
And no matter how hard I try, the bad guys (or, to put it in the wording of those companies: the agencies that are "protecting our freedom") will likely always find a way in - even if that means tapping the phone through listining in on my calls or deploying an IMSI-Catcher.
Click to expand...
Click to collapse
This is the thing, with enough resources, there is always a way.
SecUpwN said:
It seems as if the probability is high that most of the time they are selling a fake update to the target.
Click to expand...
Click to collapse
Exactly disguising as something legit is the cheapest way, "trojan horse".
SecUpwN said:
Is there a convenient way of knowing that stuff like FinSpy Mobile has been installed, where such agencies can't possibly tinker with any records of what was happening on the phone? I especially check the Trust - Event Logger by @Dark3n very often. Could they change such records? Is there a better App to warn about unauthorizes access or (hidden) App installation?
Click to expand...
Click to collapse
I don't know any surefire way to detect this. The issue is that with enough priviledges (which can be gained without authorization, zero day exploits are worth a lot money to "agencies" as well as criminal organisations, though I'm no longer sure where the difference is), you can just clean up your track of malicious behavior.
Whoa, this has to be the longest answer I've received since registering here. Huge thanks! Grab a coffee..
Dark3n said:
Trust is not a security app!
If an attacker has root, you can just alter the database of apps like Trust, which would be the easiest way.
There are probably also ways to alter the system so it does not broadcast certain events(which is how Trust monitors most things).
It is just not build to withstand such attacks.
Click to expand...
Click to collapse
Ok, fair. Will keep it anyhow.
Dark3n said:
Maybe? But there are much easier ways if it is not desired to target specific persons.
I'll brain storm a bit for you:
I would divide the attack vectors into those that work with root and those that don't.
Click to expand...
Click to collapse
Just to mention it here: An awesome site to see which attack vectors and vulnerabilities exist is Smartphone Attack Vektor by @He3556.
Dark3n said:
Without root apps can still do plenty of malicious actions, including tracking your position or uploading all files on your sdcard (INTERNET;SDCARD;LOCATION permissions) etc.
If an attacker gains root permission he could install rootkits, modify existing apps, inject malicious code into dex files of installed apps etc.
Basicly do what the hell he wants.
Click to expand...
Click to collapse
Ok, I get the point. Also like @jcase already pointed out: If we root, we pwn ourselves. And if we don't, too.
Dark3n said:
While not using a rooted device would certainly make it more difficult to do malicious things, it's doesn't prevent it.
A normal app you install could still root your phone through vulnerabilities. It works the same way apps such as TowelRoot or ZergRush root your phone.
Downloading new apps that request root is also very dangerous ofc, once you pressed "grant", it's too late, anything could have been done. So be wary when trying out new root apps of devs you don't know/trust?
Click to expand...
Click to collapse
I only install trusted Applications.
Dark3n said:
Abusing trust in existing apps is probably the biggest danger.
The most obvious danger here is downloading apps you usually trust but from unknown sources.
Sure there could be signature issues when updating over your current app, but what if you don't have it installed? I could also think about a few ways to inject malicious code without altering the signature (did not try, just a thought, might be impossible).
The issue is that you probably wouldn't even notice, as the compromised app retains it's original functionality.
Click to expand...
Click to collapse
Guess if I use the F-Droid Store I should be pretty safe, right? But don't worry, I don't rely on it - as for me, smartphones are huge bugs with touchscreens. That is why I also built a phone signal blocking pouch for myself and friends. Further good recommendations can be found on the bottom of my GitHub.
Dark3n said:
Want a botnet?
Inject malicious code into a popular root up that is paid, crack it and upload it somewhere.
While this more dangerous (or worth for an attacker) with root apps, it's still viable for non root apps, just pick one that already aquires many permissions.
It's way too easy, people constantly underestimate the danger of this. It's not all about piracy it's bad, it's a barn door sized security hole.
Click to expand...
Click to collapse
Actually, no. I already have two or three. Or maybe even four?
Dark3n said:
A bit more difficult variant would be abusing known security holes in existing apps that can be root or nonroot apps, such as modifying files the other apps uses, such that it executes your malicious code for you, so some type of code injection. First thought would be looking for root apps that use scripts or binary files and then check the permissions on those files to see whether they are writeable.
Now those are all ways to target a broad mass of users.
Click to expand...
Click to collapse
Good to know we've come to an end here. Reading all this makes me want to throw my phone out of the window.
Dark3n said:
If a single user is the target, it would be more difficult, but there are still plenty of options:
- MITM attacks at public hotspots,
Click to expand...
Click to collapse
I DON'T use public hotspots. Why? Because you can be almost certain that stuff will be logged and analyzed once you use that. Over here in my town, we've got a HUGE Apple Store. And guess what - FREE WIFI for everyone! Yeyyy... not.
- Pressuring developers of apps you use. What dev wouldn't implement a security hole into an app of his, if a guy in a black suit comes up and points a gun to his head? Well that escalated quickly... But with "secret courts" and all the **** that happens secretly sanctioned or is just done by some agencies because they are above the law, is it really such an impossible scenario? The ends justify the means? Do they?
You are right, threats against family, friends and relatives are a no-go. If I remember correctly, something similar had happened to my beloved XDA developer @idcrisis who invented CrossBreeder. He left development of his toolset because starnge things occured in his life which he linked to his development. Shortly after leaving his project, he proposed a new license: The Aware License. Hope this guy is still living a happy life, though. Added to the above security-issues: Trust NOONE! How come? Well, just read this stunning story I discovered yesterday where a US critical infrastructure company last year revealed that its star developer had outsourced his own job to a Chinese subcontractor and was spending all his work time playing around on the internet adn surfing cat videos. ^^
Dark3n said:
- My favorite plan yet, making a popular app themselves that they know you will try
Click to expand...
Click to collapse
I don't quite get what you meanb by that. Please clarify, it sounds interesting.
Dark3n said:
It is usually never impossible, just a matter of resources and whether its unfeasible to spend so many resources on that goal.
Click to expand...
Click to collapse
The way I see it: The only thing that we have no real access to, is the baseband. I am sure that these are full of backdoors and switches for agencies that they just need to trigger - just like the Samsung Galaxy Backdoor discovered by Replicant.
Dark3n said:
edit: So the best course of action? Don't install anything you don't trust. Don't trust the manufactor either? Install a custom ROM, but as those often use binary blobs for certain parts of the software, it's not really a 100% solution...
Click to expand...
Click to collapse
Nope, I don't trust the manufacturer either. And I am SICK of bloatware! hence, I am a happy user of AOKP since several years - but regarding the binary blobs, I would certainly love to try out Replicant (sadly not yet available for the HTC One).
Dark3n said:
There could also be compromising hardware built in, but now I'm really climing up the tinfoil tree, but as recents new story suggest that the NSA is intercepting hardware packets from manufactors such as cisco to modify them, what's really impossible?
Click to expand...
Click to collapse
Nothing is impossible, everything can be done. A wise man once said: Everything you can imagine, will happen.
Dark3n said:
TL;DR Best course of action that is feasible to adhere to is probably to just not install stuff one doesn't know or trust.
Click to expand...
Click to collapse
Good advice, I already do follow that one. As already said, if I were a spy company, I'd just team up with manufacturers of basebands..
Dark3n said:
You might be able to monitor files changes on an a system level, but if your attacker gains highlevel priviledges, what keeps him from changing the monitoring system?
Click to expand...
Click to collapse
Highly-likely nothing. I already know that there is not much I can do to prevent them to get in, but at least I do want to detect them - and having such a detection mechanism raises the bar in disguising their actions even further - and who knows, maybe they're not interested anymore then?
Dark3n said:
How does TiBu help prevent such injection? Flashing a new ROM would probably undo such changes, but what prevents "them" from just doing it again.
Click to expand...
Click to collapse
Not much.
Dark3n said:
This is the thing, with enough resources, there is always a way.
Exactly disguising as something legit is the cheapest way, "trojan horse".
Click to expand...
Click to collapse
Absolutely right. But what I am really curious of: How do people from the security-community really protect their phones? Do you have friends that are using their phones to just communicate via VPN and VOIP, not sending SMS and never calling people? Perfect place for @InvaderX to chime in, he told me before to really do a combination of that approach.
Dark3n said:
I don't know any surefire way to detect this. The issue is that with enough priviledges (which can be gained without authorization, zero day exploits are worth a lot money to "agencies" as well as criminal organisations, though I'm no longer sure where the difference is), you can just clean up your track of malicious behavior.
Click to expand...
Click to collapse
Sigh.. mobile phones are a total threat to humanity, I get it..
At least I am not the only one paranoid about this kind of thing. LOL
lostangelintx said:
At least I am not the only one paranoid about this kind of thing. LOL
Click to expand...
Click to collapse
It doesn't have much to do with "Paranoia". The very reason you started to care about this, is because phones are in fact very insecure devices - most people just don't realize or care about it. Another very interesting thread I found lately: Android Security for Conscious Mind.
a tool against 0-day exploits
don't freak out to early - this tool is only for windows desktops.
But at least it shows how it could work for mobile devices, too.
It is called Enhanced Mitigation Experience Toolkit (EMET 5.0) ...is a utility that helps prevent vulnerabilities in software from being successfully exploited.
These technologies function as special protections and obstacles that an exploit author must defeat to exploit software vulnerabilities. These security mitigation technologies do not guarantee that vulnerabilities cannot be exploited. However, they work to make exploitation as difficult as possible to perform.
SSL/TLS certificate pinning - This feature is intended to detect (and stop, with EMET 5.0) man-in-the-middle attacks that are leveraging the public key infrastructure (PKI).
Ok, they do not guarantee 100% security - but who could? Even this software comes from Microsoft, it's still a good solution and closes the gap between anti-virus, firewall and keeping your software updated.
Here is a test from 2010 (EMET 2.0) http://www.rationallyparanoid.com/articles/emet-testing.html
And one of 2014 http://www.offensive-security.com/vulndev/disarming-enhanced-mitigation-experience-toolkit-emet/
Does anybody know a APP for Android, iOS, WP8 or BB?
Just a small side note:
In regard to device security vs. rooting.
There are essentially 2 schools of thought. On the one side we have those who believe we should trust the device manufacturers experience and knowledge to keep malware out of AOS, and you phone from spilling your data when stolen, which also means keeping users from rooting their devices, simply because they know security better, than the average user. (I think @jcase may be one of those, but he'd have to answer for himself.) On the other hand we have people like me, who firmly believe that the best way to keep your device secure is by being rooted, since we cannot trust anyone, especially large companies who scream "TRUST US". For us, we own the device and everything it does, and that your phone should not be able to send a single photon of radiation, without your permission. Then at least we have the choice to provide our own security by Firewalls, open source baseband, and encrypted phone calls etc. So no, this is not part of the majority of phone owners. But we think it should be. So who's right? Well, we're both right of course. What we need is to be able to make this choice at the time of purchase, and independent of the device you like. To be able to choose if you have a fully open device that you can secure on your own or if you like one that is claimed as secure, but you will never be able to check or control on your own. But unfortunately, this is not possible in most circumstances.
I trust neither the ODMs, nor the custom roms. However I KNOW the average custom rom is just as if not MORE vulnerable than current stock roms, add su into the mix and it is without a doubt more vulnerable. Show me a custom rom dev that claims he ships a secure firmware, and I'll show you someone ignorant of the facts. Ask most of them what CTS is, and they will look at you like you are referencing 18th century medical terms.
That is my stance. In regards to root making a device more vulnerable, I can back that statement time and time again. From key compromises of the superuser apps, to vulnerabilities in the app, to vulns in the su binaries, to vulns in apps that typical make su requests, to stupid users who will grant it to anyone. Having any access point to "root" makes turning a small vuln to a complete compromise relatively easy.
E:V:A said:
Just a small side note:
In regard to device security vs. rooting.
There are essentially 2 schools of thought. On the one side we have those who believe we should trust the device manufacturers experience and knowledge to keep malware out of AOS, and you phone from spilling your data when stolen, which also means keeping users from rooting their devices, simply because they know security better, than the average user. (I think @jcase may be one of those, but he'd have to answer for himself.) On the other hand we have people like me, who firmly believe that the best way to keep your device secure is by being rooted, since we cannot trust anyone, especially large companies who scream "TRUST US". For us, we own the device and everything it does, and that your phone should not be able to send a single photon of radiation, without your permission. Then at least we have the choice to provide our own security by Firewalls, open source baseband, and encrypted phone calls etc. So no, this is not part of the majority of phone owners. But we think it should be. So who's right? Well, we're both right of course. What we need is to be able to make this choice at the time of purchase, and independent of the device you like. To be able to choose if you have a fully open device that you can secure on your own or if you like one that is claimed as secure, but you will never be able to check or control on your own. But unfortunately, this is not possible in most circumstances.
Click to expand...
Click to collapse
@jcase : So I think we agree on that what you say, but from another perspective, we can ask ourselves whether or not a stupid user with root, can possibly endanger a smart user with root? I think this is not generally possible, apart from some automated DDOS attack, which would ultimately originate from a smart user with root, using the stupid user as a transport.
To what extent should ODM's be able to decide who is a smart root user and stupid root user? (And regardless their decision, why should we believe them?) There may not be an answer here, but the discussion is interesting also from a political point of view. How much should the "government" be responsible for a certain individual's action, regardless of their intelligence? Personally I think they're not, and should only provide security to prevent individuals from directly hurting each other, and not preventing them from hurting themselves, if they choose to do so.
Reading all this, it makes me wonder if the antivirus apps help at all..
stefeman said:
Reading all this, it makes me wonder if the antivirus apps help at all..
Click to expand...
Click to collapse
Let's put it this way.
In 6 years of heavy 24/7 PC use, my anti-virus have prevented me from a "possible" remote exploit exactly once, while having annoyed me with lengthy uninterruptible scans and ignoring my ignore settings about a 1000 times, due to adware and various other false positives. Then only god knows how many different countries governments are already present in my PC. Go figure. And yes, I have tweaked every possible setting and tried multiple well know AV's.
Forget AV's and get a good FW and with a well tuned host file, and well tuned common sense.
E:V:A said:
@jcase : So I think we agree on that what you say, but from another perspective, we can ask ourselves whether or not a stupid user with root, can possibly endanger a smart user with root? I think this is not generally possible, apart from some automated DDOS attack, which would ultimately originate from a smart user with root, using the stupid user as a transport.
To what extent should ODM's be able to decide who is a smart root user and stupid root user? (And regardless their decision, why should we believe them?) There may not be an answer here, but the discussion is interesting also from a political point of view. How much should the "government" be responsible for a certain individual's action, regardless of their intelligence? Personally I think they're not, and should only provide security to prevent individuals from directly hurting each other, and not preventing them from hurting themselves, if they choose to do so.
Click to expand...
Click to collapse
Really, I dont want to do this again, this conversation.
Most stupid people don't realize they are stupid, they assume they are smart. (We are all stupid in some regards).
I think I could endanger a user from root, pretty sure I can either screw the phone up, or possibly catch it on fire. If it had a sim in it, and was on the network I am certain I could make them regret ever rooting their device.
Here is a question, how many of you understand how these unlocks/exploits work?
I sometimes leave messages hidden in mine, and have only had ONE person reply to the hidden message, out of 100,000s of runs. People don't even know what they are running to gain root, let alone any idea what these "rom devs" do.
Open source is the answer right? Everyone can read the code, and everyone does! Thats why no backdoors or vulns have ever been in open source projects. Every open source project gets a line by line audit by a team of security professionals.</sarcasm>
I'll join back in when someone shows me a custom rom/open device that has the same or better security precautions taken by leading ODMs. Until then, it is generally just as easy or (generally) easier to abuse and exploit one of these custom roms floating around.
stefeman said:
Reading all this, it makes me wonder if the antivirus apps help at all..
Click to expand...
Click to collapse
Won't help a lick for anything originating from a government.

Cannot delete

Cannot delete.
AlexCoetzee said:
I am tired of playing games and have really been interested in tinkering with them for a while now. I don't plan on doing this for illicit purposes but I wish to learn to modify games and tweak values in IDA Pro with hexedit so that I can do more than what things like gamekiller allow me. Anyone know any good places to start learning?
Click to expand...
Click to collapse
Despite your stated positive intentions, I would say as a general answer that this is not the place to be seeking such information. While you may be looking to expand a game, or simply make harmless mods for your personal entertainment, this process generally involves reverse engineering and violating the terms set forth by the developer(s) for fair and legal use of their publication.
That being said, you should start your learning with a good understanding of Java, coding for the Android platform, smali code, and arm/arm64 assembly, as well as a basic understanding of c# and actionscript. These were the foundations of knowledge for successful apk modification for me in my self-education process. Google is infinitely helpful! Just be sure to respect the wishes of developers with regard to working with their releases, especially closed-source applications.

Run app logic as a server

Forgive me if this is a stupid question or not the correct place to post this but it is the only active community I can find that will be helpful to me.
I am at the beginning of developing a mobile app. I am trying to figure out and weigh out options of frameworks and languages that I can develop my app with.
I currently have a Python script that has the main intensive business logic processes. Essentially it is fetching and scraping data from several websites at once and stores that data.
My question is; where can I deploy this script and /or hook it up to a database of some sort so that I can design and build my app to communicate with this script and /or the database. I have looked into potentially using Firebase or Heroku but not sure if this is the correct path to go down or if I am just completely wrong?

Categories

Resources