[Q] Compiling Metasploit for the ARM architecture - Android Q&A, Help & Troubleshooting

Hello everyone, I just recently got Kali Linux installed on my galaxy tab 10.1 (vnc, working on a dual boot) and was wondering how hard it would be to port the 32 bit version of the metasploit framework to arm. I really want to use these tools on my tab, could some show me some of the steps I would need to take to port this? Thanks!

Kobalt.Kitsune said:
Hello everyone, I just recently got Kali Linux installed on my galaxy tab 10.1 (vnc, working on a dual boot) and was wondering how hard it would be to port the 32 bit version of the metasploit framework to arm. I really want to use these tools on my tab, could some show me some of the steps I would need to take to port this? Thanks!
Click to expand...
Click to collapse
Using a complete GNU/Linux distribution (as opposed to Android/Linux), I'd say it's more or less just to compile it. No porting needed.

kuisma said:
Using a complete GNU/Linux distribution (as opposed to Android/Linux), I'd say it's more or less just to compile it. No porting needed.
Click to expand...
Click to collapse
Your right, I was able to install it through the synaptic package manager.
I had the hardest time trying to get the terminal to work though. I kept getting an error saying something about Xterm not being able to find system/bin/sh. I couldn't find the file to change the path to /bin/sh so I ended up just creating a system/bin folder, copying and renaming dash to sh, and placing it in the new directory. Now the console works, but it just shows the hash sign: #. I don't know about this distribution, but when I was using Backtrack and Ubuntu, it would say '[email protected]' or '<username>@ubuntu' something other then just the hash sign... Any thoughts on this?

Kobalt.Kitsune said:
Your right, I was able to install it through the synaptic package manager.
I had the hardest time trying to get the terminal to work though. I kept getting an error saying something about Xterm not being able to find system/bin/sh. I couldn't find the file to change the path to /bin/sh so I ended up just creating a system/bin folder, copying and renaming dash to sh, and placing it in the new directory. Now the console works, but it just shows the hash sign: #. I don't know about this distribution, but when I was using Backtrack and Ubuntu, it would say '[email protected]' or '<username>@ubuntu' something other then just the hash sign... Any thoughts on this?
Click to expand...
Click to collapse
I have no idea what "Xterm" you are trying to run, but most GNU/Linux distributions have replaced it with something different flavored, such as "gnome-terminal", leaving ol' xterm quite butchered. To me, it sounds you've tried to invoke some xterm from the Android world (using a script beginning with the line "#!/system/bin/sh"). Look for the proper terminal instead. I'll bet a virtual peanut it's "gnome-terminal".

Related

[Q] Setting up the Android SDK in Ubuntu...

Ok, I'm sure this is been asked before and I'm sure there's references somewhere...I've looked for a couple of days and found what should be answers, but nothing is working like the instructions I've seen...
Here's the simple question; How do I get the Android SDK and Java JDK setup in Ubuntu? I've tried the sudo commands to get the JDK to install, not working for me (as Ubuntu tells me it can't find the files I'm looking for). I've tried moving the SDK into the Root Folder (in the File System area itself), don't have permissions even though I'm logged in as the administrator. I've tried getting the SDK Manager to run through Terminal (home/android-sdk-xxxxx_xxxx/tools/android), can't find the file in terminal, but it's there in the file system exactly where I'm pointing it to.
I'm very new to Linux, but if I'm going to do things that I want to do, I'm going to have to learn. For the most part, I'm prepared to read whatever I need to in order to learn from this, but I also know when I need to ask for some help here. It seems like every command shown to get this started is just not working in the partition I have setup for this. If anyone can help get me started, I'm sure I can pick the rest up along the way!
Thanks in advance!
Macrodroid said:
Ok, I'm sure this is been asked before and I'm sure there's references somewhere...I've looked for a couple of days and found what should be answers, but nothing is working like the instructions I've seen...
Here's the simple question; How do I get the Android SDK and Java JDK setup in Ubuntu? I've tried the sudo commands to get the JDK to install, not working for me (as Ubuntu tells me it can't find the files I'm looking for). I've tried moving the SDK into the Root Folder (in the File System area itself), don't have permissions even though I'm logged in as the administrator. I've tried getting the SDK Manager to run through Terminal (home/android-sdk-xxxxx_xxxx/tools/android), can't find the file in terminal, but it's there in the file system exactly where I'm pointing it to.
I'm very new to Linux, but if I'm going to do things that I want to do, I'm going to have to learn. For the most part, I'm prepared to read whatever I need to in order to learn from this, but I also know when I need to ask for some help here. It seems like every command shown to get this started is just not working in the partition I have setup for this. If anyone can help get me started, I'm sure I can pick the rest up along the way!
Thanks in advance!
Click to expand...
Click to collapse
I think you could possibly use part of the EasyDev-v6 script in the Development and just cut out everything after installing prerequesites. It probably installs the JDK and the SDK among everything else, and it probably wouldn't hurt with the other things that installs, too. Just cut out everything after the prerequesites (it's just a regular text file but it'll be easier to edit in Ubuntu with OpenOffice).
Also check out http://maketecheasier.com/install-android-sdk-in-ubuntu-karmic/2010/01/11. As far as I know it worked when I tried it.
roirraW "edor" ehT said:
I think you could possibly use part of the EasyDev-v6 script in the Development and just cut out everything after installing prerequesites. It probably installs the JDK and the SDK among everything else, and it probably wouldn't hurt with the other things that installs, too. Just cut out everything after the prerequesites (it's just a regular text file but it'll be easier to edit in Ubuntu with OpenOffice).
Also check out http://maketecheasier.com/install-android-sdk-in-ubuntu-karmic/2010/01/11. As far as I know it worked when I tried it.
Click to expand...
Click to collapse
Dude, thanks so much! That worked perfectly. Thanks!
Sent from my Froyo Tazz using XDA App
You're welcome!

[Q] Transmission Daemon on Prime

Hi I want to get transmission-daemon running on prime, and I think am getting closer, but I'm completely green to linux so I could be way of :/
I build and installed Arm Ubuntu chroot'ed on my prime and used it to compile the transmission-daemon source, I had to do some fiddling to get the libevent to compile, but I did get the executable up and running in Ubuntu.
If it is running on the arm platform in Ubuntu, it should be possible to get it to run on android right?
Then i transferred the files to android, added the shared libs, moved the files to system/bin/transmission and chmoded to x.
But when i try to run ./transmission-daemon for that dir it tells me that the file dose not exist :/ .. i can see em there, and the file names get suggested to me, but no :/
I have posted the files, if some one wants to have a go at it
transmission-bins.rar
Perhaps you mistyped some of the commands...
Did you run ldconfig again to 'register' the shared library? Are you sure the shared library is in the LD_PATH?
protocol113 said:
Perhaps you mistyped some of the commands...
Click to expand...
Click to collapse
I certainly did misspell commands along the way, cause as everybody can see English is not my first language.. But I don't see the need to be rude..
leppie said:
Did you run ldconfig again to 'register' the shared library? Are you sure the shared library is in the LD_PATH?
Click to expand...
Click to collapse
Thanks you, you seam to be right, looks like it uses more libs then i thought, will try to make the build more static.
But in theory, a statically linked executable compiled on the tablet, in ubuntu should be able to run right?
Statically linked should work and does work, I've done it (hint: it helps if you statically link the runtime library too; Android doesn't use glibc or libstdc++).
Dynamically linked should work if you have all the libs and make sure the linker can find them. I haven't played much with that.
The differences between Android and chroot on Android, are the runtime environment (which the rutime libraries are apart of unless you _especially_ tell gcc to be static about them).`
Sent from my Transformer Prime TF201 using Tapatalk
entropin said:
I certainly did misspell commands along the way, cause as everybody can see English is not my first language.. But I don't see the need to be rude..
Click to expand...
Click to collapse
i dont think he/she was trying to be rude....

[Q] Decompile on Android?

Just as the title says: decompile on android? I don't have a computer, so can i decompile an apk on Android. Just wanna see the files inside like the android manifest file and res folder. For some reason when i download an apk from the stock browser, then click on the notification when it is done, think free office opens and acts like it's extracting a zip file. Idk why this happens, but it only happened to me 2 times and any other time it just goes to package installer (like it should).
Sent from my SCH-I500 using Tapatalk 2
PenguinxEnjoi said:
Just as the title says: decompile on android? I don't have a computer, so can i decompile an apk on Android. Just wanna see the files inside like the android manifest file and res folder. For some reason when i download an apk from the stock browser, then click on the notification when it is done, think free office opens and acts like it's extracting a zip file. Idk why this happens, but it only happened to me 2 times and any other time it just goes to package installer (like it should).
Click to expand...
Click to collapse
I'm not sure what you are asking about here, but I'll give it a try answering it anyway.
Yes, you can decompile and do other "computer" work using you android device in the place of a computer. It's not fast, and you may have to install the tools you need, but it is perfectly possible, since it's a Linux system by itself.
But it's not a GNU system, and most Linux distributions, such as Debian, Ubuntu, Red Hat etc, are actually GNU/Linux system. This causes you problems because most software for Linux depends on the GNU environment for libraries etc. Due to this, you'll lack many tools you will need, such as the GNU C compiler, emacs, utilities to mention a few. Myself I've solved the problem extending my Android Linux environment with a complete GNU environment as well. You can read all about it if you check the link in my signature.
And finally, the browser opens your download depending of the MIME type the download servers claims it to be. A file foo.apk can (incorrectly) have the MIME type application/zip and opened by the zip handler, or more correctly, application/vnd.android.package-archive and opened by the package manager. In the absence of MIME type from the server, your device may guess what it is by looking at the file suffix (or even content).

Ubuntu OS app extension?

Just wondering is anyone new what kind of apps Ubuntu OS will use. will they use .apk like android? or are they going to make a whole other kind of app?
AW: Ubuntu OS app extension?
They will use .deb ... Debian Packaging, that's one of the things what makes ubuntu ..
Sent from my Galaxy Nexus using xda premium
jscurtu said:
They will use .deb ... Debian Packaging, that's one of the things what makes ubuntu ..
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
Good question! But in response to jscurtu: That will just be the dpkg package manager extension (that's only good for installing an "app" and cannot be executed like an apk). As you are probably aware android is basically a JVM on Linux. Ubuntu will be different. There will be no "apps" per se and will probably just be extensionless binary ELFs residing in /usr/bin with an icon and application shortcut in /usr/share/applications/ like regular Ubuntu and most other GNU/Linux OS's .
Sent from my SGH-T999 using xda app-developers app
joshumax said:
Good question! But in response to jscurtu: That will just be the dpkg package manager extension (that's only good for installing an "app" and cannot be executed like an apk). As you are probably aware android is basically a JVM on Linux. Ubuntu will be different. There will be no "apps" per se and will probably just be extensionless binary ELFs residing in /usr/bin with an icon and application shortcut in /usr/share/applications/ like regular Ubuntu and most other GNU/Linux OS's .
Sent from my SGH-T999 using xda app-developers app
Click to expand...
Click to collapse
WT...? Yep, you got it right that the .deb format is the package format for the package manager..
..........but the rest just don't make any real sense with the OP question and the one has nothing to do with the other.
Anyway, ill be nice and get the things straight here for ya..
So what you are saying is that there will be no "apps" because its not in a single file, sorry i mean package??
That is just ridiculous ... "App" is just a term for a small Application no matter what the freaking execution is ..
Android programs are compiled into .dex (Dalvik Executable) files, which are basically "zipped" into a apk "package". .
So basically... Android don't execute apk's either, it opens the apk at run time and executes the binary's in the package .. Similar to what a .JAR is for Java programs.
But on Ubuntu and Linux in general, there are allot of ways to execute a program depending on what programming language you have choosed.
So in a GUI environment, users will usually start their programs from a .desktop file that has in short explanation the instructions to the executable optional with parameters, the path and the path to the icon file ..
I am sure the Ubuntu Phone will do that as well..
But because Canonical will allow carriers and manufactures to remove root capability like android... the installed files from the deb package would need to be installed where the phone (user) has rights .. So that might not be standard way, I guess there will be a special folder for phone apps .. Cant wait to find out..
here is a example how a .desktop file looks like :
Code:
[Desktop Entry]
Version=1.0
Name=Firefox Web Browser
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupNotify=true
Actions=NewWindow;
[Desktop Action NewWindow]
Name=Open a New Window
Exec=firefox -new-window
OnlyShowIn=Unity;
jscurtu said:
WT...? Yep, you got it right that the .deb format is the package format for the package manager..
..........but the rest just don't make any real sense with the OP question and the one has nothing to do with the other.
Anyway, ill be nice and get the things straight here for ya..
So what you are saying is that there will be no "apps" because its not in a single file, sorry i mean package??
That is just ridiculous ... "App" is just a term for a small Application no matter what the freaking execution is ..
Android programs are compiled into .dex (Dalvik Executable) files, which are basically "zipped" into a apk "package". .
So basically... Android don't execute apk's either, it opens the apk at run time and executes the binary's in the package .. Similar to what a .JAR is for Java programs.
But on Ubuntu and Linux in general, there are allot of ways to execute a program depending on what programming language you have choosed.
So in a GUI environment, users will usually start their programs from a .desktop file that has in short explanation the instructions to the executable optional with parameters, the path and the path to the icon file ..
I am sure the Ubuntu Phone will do that as well..
But because Canonical will allow carriers and manufactures to remove root capability like android... the installed files from the deb package would need to be installed where the phone (user) has rights .. So that might not be standard way, I guess there will be a special folder for phone apps .. Cant wait to find out..
here is a example how a .desktop file looks like :
Code:
[Desktop Entry]
Version=1.0
Name=Firefox Web Browser
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupNotify=true
Actions=NewWindow;
[Desktop Action NewWindow]
Name=Open a New Window
Exec=firefox -new-window
OnlyShowIn=Unity;
Click to expand...
Click to collapse
You've explained it the best, but I don't see what was wrong with my answer.. the apps will be written in c++ and qml according to canonical, which are then compiled into raw binary files (unlike semi compiled dexs). Ubuntu should be able to run anything compiled for the arm architecture. While we could get into a flamewar about how Linux executes binaries, if someone like the op above were to ask what app system Ubuntu uses I'd say (for the sake of simplicity) they use fully compiled c/c++ binaries, not a deb which is only an installer which does not copy to a folder and constantly unpack at runtime like an apk does. Sure there are a lot of languages out there but the interpreters for other languages have to written in c/c++ to be executed on the target machine (you could argue that androids dalvik is like this).. as for the lack of root I've heard rumors that the usr directory has special permission and they've found a way to secure it enough to allow this. I have about 0 time to review this so I hope it makes sense.
Sent from my SGH-T999 using xda app-developers app

TP-LINK WN722N (ath9k driver) install on Ubuntu touch 15.04 (Nexus 10- Manta)

I've been through all the relevant threads on AskUbuntu and they are either outdated, conflicting and/or dont work.
My Nexus10 sees the atheros AR9271 device on Bus 001 USB but does not create an additional WLAN for it.(wlan0 is the normal integrated wifi) I assume I need the ath9k or ath9k_htc driver? I installed backports 4.4.2-1 and unzipped it. If I try to do a 'make' or 'make clean' I get:'your kernel headers are incomplete/not installed'. I've already got the latest version of build-essential. If I try to install 'firmware-atheros', it cannot find the package. I've been through several other things to no avail.
I've read the driver is installed with 15.x+ anyway, true? and if so how to install it? If someone could do a step-by-step wifi driver install for a U-touch or at least Ubuntu 15.x I'd be very very grateful.
I do not want to bridge the 722n, I want to use it instead of the integrated card. Not even there yet, but just in case it matters.
Thanks!
roninisc said:
I've been through all the relevant threads on AskUbuntu and they are either outdated, conflicting and/or dont work.
My Nexus10 sees the atheros AR9271 device on Bus 001 USB but does not create an additional WLAN for it.(wlan0 is the normal integrated wifi) I assume I need the ath9k or ath9k_htc driver? I installed backports 4.4.2-1 and unzipped it. If I try to do a 'make' or 'make clean' I get:'your kernel headers are incomplete/not installed'. I've already got the latest version of build-essential. If I try to install 'firmware-atheros', it cannot find the package. I've been through several other things to no avail.
I've read the driver is installed with 15.x+ anyway, true? and if so how to install it? If someone could do a step-by-step wifi driver install for a U-touch or at least Ubuntu 15.x I'd be very very grateful.
I do not want to bridge the 722n, I want to use it instead of the integrated card. Not even there yet, but just in case it matters.
Thanks!
Click to expand...
Click to collapse
anyone anyone, Beuller...
Hey, saw this was unanswered and figured I could help. First off, you will not be able to compile or install headers in the Ubuntu Touch system, as /lib/modules/<kernel version> is a bind-mount into the read-only LXC system image, one way to work around this issue on device is to mount the LXC container's system image read-write somewhere, move out the lib/modules directory to someplace else, umount, reboot and then link your moved lib/modules back into /lib/modules. You will need to do this compilation outside of your Nexus 10 in a cross-compilation environment or in an armhf chroot (imho, a chroot running the ARM build of Ubuntu works very well for this).
Once you have that, you can install the kernel package for your device (which I believe are labeled linux-headers-manta and linux-image-manta respectively) and build the driver you seek. However the kernel already comes with backports 4.4.2 in it's tree, so you may be able to apt-get source linux-image-manta and build the driver and/or the kernel itself if you wish. (I believe building the kernel builds the firmware needed for the drivers as well, but I have no way of knowing as I haven't actually rebuilt any drivers with firmware yet in my foray into linux-image-flo's source.)
One piece of advice: Make sure to join together the config.*.ubuntu files under the debian.flo and debian.master folders to get the working .config for your device. The defconfig from arch/arm/configs doesn't have all the needed options for uTouch and won't boot it.
Your 'thanks meter' improved, and big thanks for answering, but this is beyond my level. Was hoping I could run an external wifi stick on a tablet with some flavor of linux, but looks like a no go for mortal users.
roninisc said:
Your 'thanks meter' improved, and big thanks for answering, but this is beyond my level. Was hoping I could run an external wifi stick on a tablet with some flavor of linux, but looks like a no go for mortal users.
Click to expand...
Click to collapse
Sadly at this time, it definitely seems to be. The normal linux way of building drivers doesn't work on here because the modules directory (/lib/modules/3.4.0-5-flo) is read-only, also due to this kernel headers cannot be installed, this can be worked around, but it is definitely not something that the casual user can do easily. I hope this will change so I could start compiling modules and NOT need to rebuild the entire kernel for it.
Glad I could be of help and I love answering questions, I am currently using Ubuntu Touch as my main OS on my Nexus 7 as I'm trying to make it into my own portable workstation. So I'm constantly digging into the system and learning what I can, and I love to share.

Categories

Resources