-
Notifications
You must be signed in to change notification settings - Fork 159
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
bugs found #8
Comments
Hello riridehou, Thanks for you feedback. |
I have some questions on the core part about the data flow analysis, just a little confused. 1 Assume that sendtextMessage() function have 5 parameters from v1- v5, what if the third parameter v3's value is based on other method. e.x there is a call relations between b -> a(p0,p1). And this sensitive API sendtextMessage() is contained in method b. How can we deal with this case? the VManalysis.tainted_packages.search_methods in androguard can provide some functionality to locate which method will call a, but I found that it have something confuses me: if there are one method with different parameters, we will get the smali code looks like: .method public static a(Ljava/lang/String;Ljava/lang/String;)V .method public static a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z and the sendtextMessage() only happened in And in the package it have different calls like: but VManalysis.tainted_packages.search_methods in androguard seems cannot distinguish the 2 different situations. And I think this is a little hard to accomplish it in static analysis. in the regular pattern in "match_current_instruction" in core method. why androwarn does not consider "iget" "aget" instruction? also the "invoke" may have 3 or more registers. if we get something like in the smali code: invoke-static {v15}, Lcom/geinimi/Ad;->c(I)Ljava/lang/String; where "Lcom/geinimi/Ad;->c(I)Ljava/lang/String" means a will call c and store the return value in register "v15". I try to finish them but found that there are so many exceptions there. :) |
I have tried this tool by analyzing application writen by myself.
It has a sensitive smsMessage sending API to read content from user 's input (editText) and then send it to a constant number.
But from the report we can see:
it seems contradictary from my source codes becasue it shows sending "1" to "1".
Then I output the telephone-service part:
Class 'Landroid/telephony/SmsManager;' - Method 'sendTextMessage' - Register state before call [{'0': 'Landroid/telephony/SmsManager;->getDefault()Landroid/telephony/SmsManager;'}, {'1': '1'}, {'2': 'button pressed'}, {'1': '1'}, {'4': 'v2'}, {'5': 'v2'}]
also why {'4': 'v2'} exists is becasue we have a instruction "move-object v4, v2", but it seems match_current_instruction() method does not split it correctly and regards "v2" as a constant value not a register.
Then I found that the bug contained in the backtrace_registers_before_call method in core.py.
It seems that there is a misunderstanding about how opcode "move-result" works.
After I modified the code, Here is new results output from the same apk I tested:
I am currently working on this and will update the codes after I finishing it.
The text was updated successfully, but these errors were encountered: