Morsmalleo / AhMyth

Cross-Platform Android Remote Administration Tool | Official maintained repository for the AhMyth R.A.T Project | A dedicated revival of the original repository at https://GitHub.com/AhMyth/AhMyth-Android-RAT
GNU General Public License v3.0
786 stars 191 forks source link

Signing Failed | Linux 64bit #378

Closed Ungaamma69 closed 1 year ago

Ungaamma69 commented 1 year ago

This is an issue with

To Reproduce

Steps to reproduce the behavior:

  1. Click the APK Builder Tab
  2. Configure the Server IP and Port
  3. Attempt to build a payload (either standalone or bound)
  4. See the [x] Signing Failed! error.

Logs

Always add the log files located at AhMyth/Logs based on your problem.

Error: Command failed: java -jar "/home/kali/AhMyth/AhMyth-Server/app/app/Factory/sign.jar" -a "/home/kali/AhMyth/Output/Ahmyth.apk"
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
could not execute zipalign
Run with '--debug' parameter to get additional information.



OS Info

  1. OS: Kali Linux

  2. OS Version: Kali 2023.3

  3. OS Architecture:
    • [ ] 32bit
    • [x] 64bit

Dependencies Check

  1. Checked dependencies by running...

    apt-cache policy openjdk-11-jdk

    If on 32bit linux then run...

    apt-cache policy openjdk-11-jdk zipalign



  2. See the results below.

    openjdk-11-jdk:
    Installed: 11.0.20~7-1
    Candidate: 11.0.20~7-1
    Version table:
    *** 11.0.20~7-1 100
        100 /var/lib/dpkg/status
    zipalign:
    Installed: 1:10.0.0+r36-1
    Candidate: 1:10.0.0+r36-1
    Version table:
    *** 1:10.0.0+r36-1 100
        100 /var/lib/dpkg/status                        
Morsmalleo commented 1 year ago

Seems this signing failed problem keeps arising, what I'll do is I'll setup a VM using the latest Kali 2023.3 release, I'll make sure EVERYTHING is updated and upgraded fully, and I'll see if I can't recreate the issue, this could be a problem with the signer itself, it also looks like I'm going to have to add the --debug flag to the signer when it's called for signing a payload, so that I can get full error reports stating why zipalign could not be executed

Ungaamma69 commented 1 year ago

Sure , I'll see if this problem presists on a 32-bit vm

Morsmalleo commented 1 year ago

Sure , I'll see if this problem presists on a 32-bit vm

I've got my Kali VM setup, it's just currently in the process of updating and upgrading.

Make sure you have zipalign installed for 32bit

What's weird is with 64bit, the AhMyth signer should be utilising it's built in zipalign but for some reason it won't execute for some users, and I see this problem arising more and more so that's why I'm looking into it

Morsmalleo commented 1 year ago

Sure , I'll see if this problem presists on a 32-bit vm

Just to check your definitely using the latest 2023.3 release of Kali Linux for Virtualbox/VMware?? Not Kali NetHunter??

Ungaamma69 commented 1 year ago

yeah , i am indeed using kali linux for vmware

Morsmalleo commented 1 year ago

yeah , i am indeed using kali linux for vmware

Ok no worries, were using the same OS then, I've got mine for Virtualbox however, but that shouldn't matter

Morsmalleo commented 1 year ago

Did you setup using the source code or Binary??

Ungaamma69 commented 1 year ago

Sure , I'll see if this problem presists on a 32-bit vm

I've got my Kali VM setup, it's just currently in the process of updating and upgrading.

Make sure you have zipalign installed for 32bit

What's weird is with 64bit, the AhMyth signer should be utilising it's built in zipalign but for some reason it won't execute for some users, and I see this problem arising more and more so that's why I'm looking into it

yeah , i checked eveything , even on 32bit vm , even after installing zipaling this issue still presists

Ungaamma69 commented 1 year ago

Did you setup using the source code or Binary??

source code

Morsmalleo commented 1 year ago

This is extremely weird man, because everything is working fine for me on my end for Kali 2023.3 (64bit) for Virtualbox, I'll upload a screenshot.

Morsmalleo commented 1 year ago

Signing Successful

As you can see everything is working for me.

Morsmalleo commented 1 year ago

These are my dependency versions.

nodejs:
  Installed: 18.13.0+dfsg1-1
  Candidate: 18.13.0+dfsg1-1
  Version table:
 *** 18.13.0+dfsg1-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
        100 /var/lib/dpkg/status
npm:
  Installed: 9.2.0~ds1-1
  Candidate: 9.2.0~ds1-1
  Version table:
 *** 9.2.0~ds1-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
        100 /var/lib/dpkg/status
openjdk-11-jdk:
  Installed: 11.0.20~7-1
  Candidate: 11.0.20~7-1
  Version table:
 *** 11.0.20~7-1 500
        500 http://http.kali.org/kali kali-rolling/main amd64 Packages
        100 /var/lib/dpkg/status
Morsmalleo commented 1 year ago

Hold up, I think I've FINALLY managed to recreate the issue!

Morsmalleo commented 1 year ago

Signing Failed

Yeah I think I have finally figured out the Signing problem for 64bit Linux Systems

Ungaamma69 commented 1 year ago

lessgoo , whats the problem excatly ?

Ungaamma69 commented 1 year ago

also it happens on 32 bit as well , i just tried .............. the same issue

Ungaamma69 commented 1 year ago

logs - Error: Command failed: java -jar "/home/kali/AhMyth/AhMyth-Server/app/app/Factory/sign.jar" -a "/home/kali/AhMyth/Output/Ahmyth.apk" Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true could not execute zipalign Run with '--debug' parameter to get additional information.

Morsmalleo commented 1 year ago

OK so to recreate this issue I ran through these steps here below:

These steps had AhMyth running beautifully, however I was baffled by this problem for 64bit Linux machines so I thought maybe users are installing something thats conflicting with the AhMyth Signer, so I ran through these steps below afterwards:

After runnning through those steps and booting up AhMyth for a second time, I was FINALLY greeted with the [x] Signing Failed! error.

it seems that 64bit Linux users are installing zipalign when its clearly stated in the setup instructions that you only need to do this for 32bit linux only.

The zipalign package installed via the terminal with sudo apt-get install <package-name> is conflicting with the built in zipalign that the AhMyth Signer uses, so for 64bit Linux Users, all you need to do is uninstall the zipalign version you installed via the terminal

sudo apt-get remove --purge zipalign* -y

and it should work like it has for me below, reboot your OS to make sure changes take effect properly Signing Fixed

Ungaamma69 commented 1 year ago

ohhhhh dammmm , gotchaa , will try and let you know if any issue presists , thank you soo much !

Morsmalleo commented 1 year ago

let me know how you go, as for 32bit Linux problems, I'm not sure, but zipalign must be set in PATH for 32bit users, so id imagine that means installing it via the terminal for Linux, i am not really bothered about this however because AhMyth is dropping support for 32bit Systems completely very soon.

Ungaamma69 commented 1 year ago

Lesssgooo !!! its wokrin like charm noww !! thank you soooo muchhhhhh !!!!

Morsmalleo commented 1 year ago

Lesssgooo !!! its wokrin like charm noww !! thank you soooo muchhhhhh !!!!

No problem 😁

Morsmalleo commented 1 year ago

For anyone else that comes across this problem here is some useful info about the APK Signer that AhMyth uses regarding Zipalign, which for the record is Uber APK Signer by Patrick Favre.

IMG_20230909_155257