Build instructions for Meterpreter on Ubuntu 14.04 LTS #114
Comments
I've had very similar issues building on Ubuntu in the past (12 and 13). I gave up in the end and built things on my Fedora 19 box, where I had way more success. |
How to compile Linux meterpreter on Ubuntu 12.04 / 13.10 / 14.04 (32 bits).
How to compile Linux meterpreter on Fedora 20 (32 bits)
Hope it helps :) |
ping @todb-r7 ^^^^ |
ooo thanks @jvazquez-r7 I'll give it a shot! |
Must be 32-bit? |
@todb-r7 should work on x64 as well if you use -m32 and install the other 32-bit deps. |
I suspect this will be a matter of working from this list, bottom up, and turning off things until it works again: https://wiki.ubuntu.com/ToolChain/CompilerFlags Personally, I built the last bins in an ubuntu 10.04 chroot using debootstrap. |
That's an interesting thing you bring up @jvazquez-r7 about the gold linker. Time to do some experimentation! |
@bcook-r7 , yup on moderns ubuntu the bfd linker doesn't work as "expected" I say expected between quotes because meterpreter is linking in a non "expected" way. You need exported entries to be there (so the meterpreter loader can load the object), but it isn't a shared library! (just reminding from the time I looked into that). |
Nice to know. I did some experimentation modifying ld.bfd's default linker script in ubuntu 14.04, to try changing its behavior. I didn't get it to work exactly, but managed to crash it a few times :) |
Results: On Ubuntu 14.04:
So that doesn't seem to make a lot of difference. For fun I apt-get removed binutils and tried again, same deal.
Using the update-alternatives business seems to do the trick:
So, trying make, oh no!
Looks like the Makefile already specifies -m32 so that's not it. |
Hmm, tried this: |
Welp, better -- I'll give it a shot on an older Ubuntu VM. If we're stuck on a distro, I'm okay with that as long as it's possible, but it does need to be documented. |
I heard a rumor this morning that @bcook-r7 got this working now on Ubuntu 14? |
Yeah, I'll send a PR when I'm done with other cleanups. The global linker redirect doesn't seem to work, but specifying directly to GCC does. I'll need to check if that keeps things working on Fedora. |
Nice work Buster. I'm happy to verify changes on Fedora a well. |
When I build meterpreter on Ubuntu 14.04, I appear to succeed, but I am unable to get a session with the results.
My procedure:
make
cp -r data/meterpreter/* ../metasploit-framework/data/meterpreter
cd ../metasploit-framework
./msfconsole -Lqr /home/todb/.msf4/scripts/resource/linux-meterpreter.rc
(source here)With the most recent checkin, this all works great. With a build I try to make myself though, meterpreter.bin segfaults.
The target is metasploitable, which is a semi-jacked up version of Ubuntu 8.
My build machine is Ubuntu 14.04 LTS
I have my entire build log here.
I know that @jvazquez-r7 can build successfully, too, so it's not just @bcook-r7 magic.
The text was updated successfully, but these errors were encountered: