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
714 stars 177 forks source link

Instant client disconnection upon saving large files #162

Closed comodoro64 closed 7 months ago

comodoro64 commented 1 year ago

This is an issue with the

Describe the bug

I've had the same issue on both, virtual device with Genymotion and an actual Android cellphone. If the files are small they are usually saved, but if their size are close to 16.7 megabytes, a disconnection may happen before the file is actually saved, although, in this case, the disconnection does not happen as soon as I click on the diskette icon, which happens for larger files.

To Reproduce

Steps to reproduce the behavior: 1 - Install standalone payload 2 - Connect to the target 3 - Go to the File manager 4 - Click on the diskette icon to save a file larger than 16.7 megabytes 5 - Target disconnects instantly, reconnecting right after and the file is not saved.

Expected behavior

The file to be saved on the Downloads directory and the connection to be kept.

Client Issue

please complete the following information:

Checklist

Morsmalleo commented 1 year ago

I will look into this IMMEDIATELY! This should not happen, so whatever is causing the bug, I'm going to fix it whether it likes it or not lol πŸ˜‚ give me some time and I'll get back to you on this one πŸ˜πŸ‘

Morsmalleo commented 1 year ago

I will look into this IMMEDIATELY! This should not happen, so whatever is causing the bug, I'm going to fix it whether it likes it or not lol πŸ˜‚ give me some time and I'll get back to you on this one πŸ˜πŸ‘

it seems that this could be a problem with the Chunk (Block) Size that is currently set in the clients Java code for the File Manager, I'll run some tests today and I'll let you know how they go, if I don't make it back here today and I'll let you know tomorrow

comodoro64 commented 1 year ago

Thank you @Morsmalleo

Morsmalleo commented 1 year ago

Thank you @Morsmalleo

You're welcome

comodoro64 commented 1 year ago

Hello @Morsmalleo , Do you have any news about this bug?

Morsmalleo commented 1 year ago

Hello @Morsmalleo , Do you have any news about this bug?

My bad I posted to the wrong issue πŸ˜‚ no nothing yet but it's definitely going to be solved soon I promise.

Morsmalleo commented 1 year ago

Hi guys sorry for the inactivity, I've been unwell for a while, but all is good, I'll be back at it tomorrow

airwilb commented 1 year ago

Hope you're doing better now!

geektropicalis commented 1 year ago

Yeah I am also having problems with large files

Morsmalleo commented 1 year ago

Yeah I can definitely confirm that I'm facing this bug also, so the bug is definitely confirmed, I'll let everyone know ASAP as soon as it's fixed

alexmarfe21 commented 1 year ago

@Morsmalleo Sir, even with the new update, the problem has not been solved.

Morsmalleo commented 1 year ago

@Morsmalleo Sir, even with the new update, the problem has not been solved.

Well obviously πŸ˜‚ why do you think the issue is still open, I'm not going to close issues if they haven't been solved.

Morsmalleo commented 1 year ago

@Morsmalleo Sir, even with the new update, the problem has not been solved.

Most updates for the new release were for the Server, namely for Binding, people that know how to analyse payloads will find that AhMyth now uses a new hook method borrowed from metasploit, I had to implement functions for SDK changes when Binding, java code for the new hook function, I'm only one person, be patient.

Morsmalleo commented 1 year ago

@Morsmalleo Sir, even with the new update, the problem has not been solved.

Other updates you'll see when Binding On Launch, as for the issues currently still open including this one, they'll be fixed in the next release

alexmarfe21 commented 1 year ago

@Morsmalleo Sir, even with the new update, the problem has not been solved.

Other updates you'll see when Binding On Launch, as for the issues currently still open including this one, they'll be fixed in the next release

@Morsmalleo Thanks for your feedback sir πŸ’

alexmarfe21 commented 1 year ago

@Morsmalleo Sir, even with the new update, the problem has not been solved.

Most updates for the new release were for the Server, namely for Binding, people that know how to analyse payloads will find that AhMyth now uses a new hook method borrowed from metasploit, I had to implement functions for SDK changes when Binding, java code for the new hook function, I'm only one person, be patient.

@Morsmalleo We have complete confidence in you, keep it up πŸ’

timodz commented 1 year ago

@Morsmalleo any update about this bug!!! good luck

Morsmalleo commented 1 year ago

@Morsmalleo any update about this bug!!! good luck

No not yet, I'm still working on the last of the Server updates, once I've done this I'll be fixing the issue for the client, starting with this one. I'll update everyone as soon as I start work on this bug.

timodz commented 1 year ago

@Morsmalleo any update about this bug!!! good luck

No not yet, I'm still working on the last of the Server updates, once I've done this I'll be fixing the issue for the client, starting with this one. I'll update everyone as soon as I start work on this bug.

Nice to hear you not forgot about this bug, you do a awsom job good luck

Morsmalleo commented 11 months ago

could not implement the fixes for this in beta.5, but I'm jumping on to this issue in the next few weeks.

TheDarkLord05 commented 11 months ago

could not implement the fixes for this in beta.5, but I'm jumping on to this issue in the next few weeks.

This Bug is Very Very Bad. But Cant Do Anything. Even If an Image is morethan 5 MBs , Disconnection is Promised πŸ˜“. Anu Update on this Bug Bro

Morsmalleo commented 9 months ago

could not implement the fixes for this in beta.5, but I'm jumping on to this issue in the next few weeks.

This Bug is Very Very Bad. But Cant Do Anything. Even If an Image is morethan 5 MBs , Disconnection is Promised πŸ˜“. Anu Update on this Bug Bro

How many times do I have to tell people? I WILL POST HERE WHEN THERE ARE UPDATES TO INFORM PEOPLE ABOUT THIS BUG, BUT UNTIL THEN WAIT PATIENTLY

sorry but the next person to ask me "is there any update on this" when I haven't even posted anything to do with updates regarding this issue yet, I'll be issuing a temporary 3 day ban.

No one on here seems to understand so I'll put in terms they can understand.

  1. There is only 1 Person maintaining this project and that person is ME!

  2. Because I'm only 1 Person, that means I'm not superman so I can't develop at the speed of light like everyone on here expects me to do.

  3. No one on here understands how hard it is to maintain this project by myself, there is only one person who has genuinely helped with development and unfortunately I haven't been able to work with him for a long time now, contact was lost and I don't know why, which leaves me as sole maintainer of this project.

  4. So if people want this fixed as soon as possible, they can either A. Help me out with development, Or B. Be quiet and wait patiently! People who cant wait patiently and quietly will be met with a 3 day repo ban, I'm sick and tired of people bombarding me about issues that haven't been fixed when they have no idea of the workload that comes with upgrading this project as well as integrating new feature into it, it's not a simple "I'll just stick this code here and it will work" its MUCH MORE complicated than that.

Sorry for the rant but when people constantly ask about this when they can CLEARLY SEE that I haven't issued any comments about any actual updates about implementing it, it pisses me off, especially the people that use emojis to try and grab sympathy from me when bombarding me about things like this.

AfaqShahid commented 7 months ago

I solved this isuue: Reason is in socket.io version 2.5.0 the default value of the maxHttpBufferSize option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service. Thats why its dissonnect when buffer size increases to 1mb.

Solution

Hope this will resolve the issue ☺️

Morsmalleo commented 7 months ago

I solved this isuue: Reason is in socket.io version 2.5.0 the default value of the maxHttpBufferSize option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service. Thats why its dissonnect when buffer size increases to 1mb.

Solution Capture Set maxHttpBufferSize according to your requirement. image And on client side set timeOut according to your requirement or "-1" for infinite timeout.

Hope this will resolve the issue ☺️

Well done! I was literally about to start working on this bug to, and believe it or not we've actually come across the same solution as well, so the fact the another person has presented the same solution that I've come across has just fastracked the fixing of this bug!

You're a legend mate 😁😎

Morsmalleo commented 7 months ago

I solved this isuue: Reason is in socket.io version 2.5.0 the default value of the maxHttpBufferSize option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service. Thats why its dissonnect when buffer size increases to 1mb.

Solution Capture Set maxHttpBufferSize according to your requirement. image And on client side set timeOut according to your requirement or "-1" for infinite timeout.

Hope this will resolve the issue ☺️

You'll be named in the Credits section of the README for this one when the new release comes out 😁❀️

AfaqShahid commented 7 months ago

I solved this isuue: Reason is in socket.io version 2.5.0 the default value of the maxHttpBufferSize option has been decreased from 100 MB to 1 MB, in order to prevent attacks by denial of service. Thats why its dissonnect when buffer size increases to 1mb. Solution Capture Set maxHttpBufferSize according to your requirement. image And on client side set timeOut according to your requirement or "-1" for infinite timeout. Hope this will resolve the issue ☺️

You'll be named in the Credits section of the README for this one when the new release comes out 😁❀️

Thank you @Morsmalleo for the fantastic news! Excited to be part of the credits in the upcoming release! πŸ˜πŸ™Œβ€οΈ

Morsmalleo commented 7 months ago

Everyone can thank @AfaqShahid for what you see below!

Screenshot 2023-11-27 104055

the The Renovation.mp3 file you see that was successfully downloaded without any disconnection, has a file size of 7.1mb, I will be pushing this fix to the master branch ASAP because this bug cant wait for a fix in a new release!

once this is done users should be able to download file of up to 100mb

Morsmalleo commented 7 months ago

might even add an additional Download Progress bar to show up in the black log box there to show the percentage of the download if its possible

Morsmalleo commented 7 months ago

Fix has been pushed to the master branch, please delete your old AhMyth and git clone AhMyth again, build another payload, install it and test it, then let me the results.

there were a few disconnections that happened for me when entering some directories, but I had a lot of shit running in the background of PC and my phone when doing this, it only happened twice though, everything worked fine afterwards, but if anyone else does experience this or any other problems when downloading large files from the client, PLEASE LET KNOW!

Morsmalleo commented 7 months ago

Can people give me an update on this please? I can't close this issue and mark it as completed unless I know the problem has been solved for all users

AfaqShahid commented 7 months ago

Fix has been pushed to the master branch, please delete your old AhMyth and git clone AhMyth again, build another payload, install it and test it, then let me the results.

there were a few disconnections that happened for me when entering some directories, but I had a lot of shit running in the background of PC and my phone when doing this, it only happened twice though, everything worked fine afterwards, but if anyone else does experience this or any other problems when downloading large files from the client, PLEASE LET KNOW!

@Morsmalleo this is because i think you don't set "timeout" value on client side in "IOSocket.java" file. I don't see it in master branch please confirm.

Morsmalleo commented 7 months ago

Fix has been pushed to the master branch, please delete your old AhMyth and git clone AhMyth again, build another payload, install it and test it, then let me the results. there were a few disconnections that happened for me when entering some directories, but I had a lot of shit running in the background of PC and my phone when doing this, it only happened twice though, everything worked fine afterwards, but if anyone else does experience this or any other problems when downloading large files from the client, PLEASE LET KNOW!

@Morsmalleo this is because i think you don't set "timeout" value on client side in "IOSocket.java" file. I don't see it in master branch please confirm.

No I did this, i applied the changes in android studio, built the payload, decompiled it for AhMyth and that's that, the Smali equivalent of the IOSocket.java file was updated in the server directory if you take a look here

https://github.com/Morsmalleo/AhMyth/commit/3902a05d161a5c99faf69d054e1ed23278290fa4

This was a major bug that needed immediate fixing, this is why you don't see the change in the java code yet, just the Smali code

Morsmalleo commented 7 months ago

Fix has been pushed to the master branch, please delete your old AhMyth and git clone AhMyth again, build another payload, install it and test it, then let me the results. there were a few disconnections that happened for me when entering some directories, but I had a lot of shit running in the background of PC and my phone when doing this, it only happened twice though, everything worked fine afterwards, but if anyone else does experience this or any other problems when downloading large files from the client, PLEASE LET KNOW!

@Morsmalleo this is because i think you don't set "timeout" value on client side in "IOSocket.java" file. I don't see it in master branch please confirm.

No I did this, i applied the changes in android studio, built the payload, decompiled it for AhMyth and that's that, the Smali equivalent of the IOSocket.java file was updated in the server directory if you take a look here

3902a05

This was a major bug that needed immediate fixing, this is why you don't see the change in the java code yet, just the Smali code

Oh for the record, the Smali equivalent of the IOSocket.java file is called e.smali due to proguard

Morsmalleo commented 7 months ago

I need confirmation that the bug is fixed otherwise I'll retest it on a few devices I have here, and if it works on them all without disconnections I'll mark this issue as completed, if I experience even 1 disconnection, I'll leave the issue open.

Morsmalleo commented 7 months ago

Everything seems to be working fine for me on my end since I pushed the fix, so I'm closing this issue as completed.

cybiz-tva commented 4 months ago

I appreciate the entire discussion here but it seems like this issue is still not resolved, i tried building the current version of the code and running with npm command, still facing the same issue.

sourxsunny commented 4 months ago

I appreciate the entire discussion here but it seems like this issue is still not resolved, i tried building the current version of the code and running with npm command, still facing the same issue.

still facing the same issue too.

Morsmalleo commented 4 months ago

I appreciate the entire discussion here but it seems like this issue is still not resolved, i tried building the current version of the code and running with npm command, still facing the same issue.

Well I don't know what you're doing because everytime I test this on my end, I don't face any problems unless the file is larger than 50mb