-
Notifications
You must be signed in to change notification settings - Fork 693
Problem with apktool #547
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
Comments
There's not enough information to reproduce your issue. Works for me.
What |
I used Facebook lite apk downloaded from playstore. I download it on my android device from playstore and I extracted the apk file with apk extractor. I then transfered the extracted apk file to my desktop and decided to perform the payload operation. (On linux Terminal) The error I got was: " Let me try to perform the operation again and send you the whole command process. |
@bcoles This is the issue I'm currently facing. Can you get anything from this? |
I noticed your port number is just 4 digit. Mine is 5 digit and I think it's because I'm using Ngrok tunneling service. I will try the same process with another apk (myidea.apk) and I will send the output so you can see it's working for Myidea apk. |
This is the output for myidea.apk. It was successful. Please why is this happening? I really don't know where the mistake comes from. |
@bcoles @darkbushido @todb @techpeace please help with the above issue🙏 |
You could try updating apktool. Version Remove apktool:
Then install the latest apktool: |
Ok. Please don't close this issue yet. I will update you on what happen after updating apktool. Please keep in touch... Thanks! |
samshow@samshow-VirtualBox:
samshow@samshow-VirtualBox:~/Downloads$
samshow@samshow-VirtualBox:~/Downloads$
samshow@samshow-VirtualBox:~/Downloads$
| Hello @bcoles Here are different trials of payload binding using the latest apktool version (2.6.1) with different apk files. The last one I tried with myidea.apk is not even proceeding. I honestly don't know why this is happening. Please help! |
Do you have a link to the apk files? |
Some of those apk files are extracted from the applications on my android device. I extracted those apps on my android device using apk extractor so as to get the apk files. It's only the "Myidea.apk" I downloaded from apkpure.com website. Can it be those apk files that has problem? |
And the Myidea.apk worked with apktool version 2.4.0 dirty. But freezes in the latest version. While other apks I tried failed to be rebuilded by apktool version 2.4.0 dirty and say 'Nil class' in the latest version. Please check anything you can do to help. If you need more information, I can provide. Thanks @bcoles and I awaits your response. |
Maybe. Have you removed the old version of apktool? Ensure
https://apkpure.com/my-idea/com.abosch.miidea/download?from=details works for me.
|
Perhaps the following diff will offer some clues: # git diff lib/msf/core/payload/apk.rb
diff --git a/lib/msf/core/payload/apk.rb b/lib/msf/core/payload/apk.rb
index 9d1357109b..6051def40f 100644
--- a/lib/msf/core/payload/apk.rb
+++ b/lib/msf/core/payload/apk.rb
@@ -208,6 +208,7 @@ class Msf::Payload::Apk
amanifest = parse_manifest("#{tempdir}/original/AndroidManifest.xml")
print_status "Locating hook point..\n"
+ puts amanifest.inspect
hookable_class = find_hook_point(amanifest)
smalifile = "#{tempdir}/original/smali*/" + hookable_class.gsub(/\./, "/") + ".smali"
smalifiles = Dir.glob(smalifile) I presume that the package = amanifest.xpath("//manifest").first['package'] But it is impossible to debug without being able to reproduce the issue. |
So what's the next Go-to now? Please direct me on what to do. Please!!🙏 Are you saying I should enter the above commands for clues? Please reply as soon as possible. THANKS |
Maybe there's a particular software that is not in place or a particular system software needs update. I'm confused. I tried the apktool version. And it printed the right version 2.6.1 |
@bcoles can it be because of the LHOST and LPORT? Coz yours looks like this: LHOST=192.168.200.130 LPORT=1337 and I am using the Ngrok server which give a particular lhost and lport number (5 digit). Can that cause the issue? |
Edit Try to create your APK again. Paste the output.
Possibly but unlikely. |
Possible. See if you can use this as a template: https://apkpure.com/my-idea/com.abosch.miidea/download?from=details |
I really don't know what to do with the above colored codes you wrote. I don't fully understand. I have made tons of researches on how to understand what you wrote so I won't disturb you too much but I didn't get any clue. Please can you make it simple for me to understand? I would really appreciate if you can break the steps down for me. What to write first and after (Like step 1, do this, step 2 do this and like that) so I will be able to understand. I actually tried the git command but my terminal said I should install git, which I did but I still don't get it. Please comment the step by step process as soon as you see this. Thank you @bcoles |
Look at the apkpure file you used and worked... Its still doing the same on my side. Stops at This is seriously serious bro. Lol |
Edit Try to create your APK again. Paste the output. |
Are you sure your APK files are valid? I was able to reproduce this error using a malformed APK file (an empty file).
I installed Metasploit, apktool 2.6.1, Does your APK file match the md5sum
|
Can you paste the output of these commands?
|
user@linux-mint-20-x64: In this case, did you save the apk file inside Desktop/metasploit-framework path? |
Yes |
This is what I got when I used these commands |
Please run those commands on the |
Yeah check the updated comment. I got error messages |
Please run those commands on the |
Its still got stuck again. SMH! |
samshow@samshow-VirtualBox:~/Downloads$ ```
|
Find these lines in print_status "Decompiling original APK..\n"
run_cmd(['apktool', 'd', "#{tempdir}/original.apk", '-o', "#{tempdir}/original"]) Change them to: print_status "Decompiling original APK..\n"
puts run_cmd(['apktool', 'd', "#{tempdir}/original.apk", '-o', "#{tempdir}/original"]) (note the extra Then try again and paste the output. |
What does this means? |
Do you mean I will open a new terminal and run this command |
No. I mean open that file in a text editor. |
Probably for the best. The APK parsing is undergoing a bunch of improvements. Check back in a few weeks. |
So I will have to wait for few weeks? Why is the path not showing on my computer? |
I couldn't find msf inside lib. Why is it not there? Please let me know |
@bcoles please before you leave me. Can you tell me why I couldn't find the file on my computer? |
It is located in the root of the metasploit directory - wherever it is installed. Probably: |
Hey @bcoles. I finally located the file and I edited the lines you told me to edit by adding Could it be because I installed my Metasploit from the Terminal? Coz the path where I found the Metasploit installed was in |
Adding Some changes have been made to the APK parsing, but didn't make it into the release this week. They will be in the release on Friday next week and should be available when you update Metasploit. These changes won't fix your issue, but they will print additional information which may help diagnose the root cause.
no |
Ok when I added
|
Don't include the The diff provided is a diff. You can learn more about diff formatting here: In short:
|
Ok |
This what I got when I added
|
Your bug is with apktool. It looks a lot like this one: iBotPeaches/Apktool#2669 Do you have a broken symlink?
If so, try removing it:
|
I got something new when I re-added the
|
What does this mean? What exactly have you done? Can you paste the line you changed + 2 lines either side of it for context? Did you remove |
Does this mean something is broken? Its showing in red |
Most likely yes. The symlink points to
If not, the symlink is broken and should be removed.
|
Issue not fixed yet. I went on to re-add the |
No I don't think it exists |
Waaoooowwwww! @bcoles It worked after removing the symlink. Wow, you're the best! |
Uh oh!
There was an error while loading. Please reload this page.
Good day my fellow Ethical Hackers... I'm having a frustrating issue with apktool when binding payload to an apk file.
I actually binded a payload to an app called "Myidea.apk" and it was successful. But when I tried to do the same for other apk files like Messenger, FacebookLite, etc. I always get an error saying "Unable to rebuild apk with apktool" And its the same apktool I used for the "Myidea.apk". Why is it working on this apk and not working on others? I think it's a problem with Apktool. Is there a way I can use Apk Easy Tool in Linux Terminal? Please help!!
The text was updated successfully, but these errors were encountered: