Skip to content
This repository

Added linux support #31

Closed
wants to merge 4 commits into from
Michajlo Matijkiw

Added basic linux support using what's available in libpcacp. I have it running on my laptop and i can see my sessions getting picked up, though i don't have an unencrypted network to test it on for external sessions, but I'm pretty confident it will work.

Note, you will need to run firesheep-backend --fix-permissions as root manually, I couldn't think of a common linux privilege escalating scheme except 'su'.

Finally, it shouldn't conflict with OSX or windows versions, though I don't have the environments handy to build and check.

Jeremy Salwen

Hi,

I've just built this plugin on Debian amd64 linux, with xulrunner 1.9.2 and iceweasel 3.6

I then ran sudo xul/platform/.../firesheep-backend --fix-permissions

After this, firesheep-backend would seem to run correctly. I then zipped the folder, and added it as a firefox plugin. On start, firefox segfaulted on

Program received signal SIGSEGV, Segmentation fault.
elf_dynamic_do_rela (scope=<value optimized out>, 
reloc_mode=<value optimized out>, consider_profiling=<value optimized out>)
at do-rel.h:120
120 do-rel.h: No such file or directory.
in do-rel.h
Francisco Gimeno

I did it by myself and it's pretty similar than yours... indeed, your seems better (I used ifstream("/proc/net/dev") to get the interfaces).
And I have the WEP thing too... try to reroute the traffic to your linux laptop from the other box to test it.

Eric Butler
Owner

Hi everyone,

Thanks for working on this!

For elevating privileges check out PolicyKit, I believe its designed for this exactly.
http://hal.freedesktop.org/docs/PolicyKit/

Michajlo Matijkiw

@jeremysalwen - Sorry I should have been more clear, I had to run firesheep-backend --fix-permissions once it was installed (cd ~/.mozilla/firefox/......./Linux_x86_64-gcc3; sudo ./fireshee-backend --fix-permissions). I also just installed the xpi file that the makefile generated, in build. Maybe see if that works?

I'll try to check out PolicyKit tomorrow.

Jeremy Salwen

@michajlo

After running it from the right place, I can get firesheep-backend to start dumping local cookies (although tcpdump also only seems to be noticing local traffic even on unencrypted wifi, so that seems right). However, I still get the same segfault.

bassman998

I've also managed to get firesheep-backend to work properly on Linux (Backtrack 4). However, the actual firefox extension gives an error about "Cc is not defined." It looks like it uses a component called MozPopen to read the output of the backend, and I haven't been able to get that to compile. Has anyone had any luck with that part?

Daniel Johnson

this bit of the comment is clearly incorrect for this file

Daniel Johnson

this comment is also outdated

Daniel Johnson

this little change (which was probably accidental) likely belongs in a separate commit

Michajlo Matijkiw

@bassman998 Perhaps it's missing dependencies? I had to install xulrunner-devel, and the firefox development libraries, then build using ./autogen --with-xulrunner-sdk=/path/to/xulrunner-dev && CPATH=/path/to/nspr make. On my machine these paths were /usr/lib/xulrunner-devel-??? and /usr/include/nspr, respectively.

@jeremysalwen Do you have any more details on the crash?

I'll try to upload my resultant xpi file this evening.

bassman998

@michajlo - I built using ./autogen.sh --with-xulrunner-sdk=/path/to/xulrunner-sdk && make. The resultant Makefile for MozPopen had no targets, and the unix version of MozPopenProcess.cpp includes a header file named MozPopen.h which doesn't appear to exist. For some reason, MozPopen.h is listed in .gitignore and therefore isn't in the source.

I'm curious as to how anyone has managed to get the extension working in Linux, since as far as my limited knowledge can tell, it's impossible without MozPopen, which is impossible to compile without MozPopen.h.

Michajlo Matijkiw

@bassman998 MozPopen.h is generated by the Makefile using xpidl (see mozpopen/Makefile.am). There is likely an earlier error, do you have any output?

John N

@michajlo The xpi you posted earlier today is giving a permission denied error when I attempt to download it.

bhankins

@bassman998 I think you may be having a problem with nspr header files. Is this fedora by the way?

Michajlo Matijkiw

@jnew Hmmm, thought that upload failed... might have only been partial/corrupted. I'll re-upload next time I get on my linux machine.

bassman998

@michajlo I don't have any previous experience with automake, and I neglected to add a PLATFORM_LINUX section to mozpopen/Makefile.am. Without that, there weren't any errors, the mozpopen Makefile was left without any targets, and make quietly skipped that folder since there was nothing to do. Everything compiled fine, but didn't run so well. Compiles fine now, with MozPopen. Thanks for pointing me in the right direction.

John N

@bassman998 Could you explain what you modified in the makefile? Make skips mozpopen when I run it too.

Michajlo Matijkiw

PLATFORM_LINUX should already be in there... see http://github.com/michajlo/firesheep/blob/master/mozpopen/Makefile.am. Are there any warnings/errors during autogen? Try a make clean first?

Also, I just reuploaded the XPI which can save you the compiling. Once installed in firefox you'll need to navigate to the firesheep-backend in ~/.mozilla/firefox/... (forget the exact locations) and run it with fix-permissions as root.

John N

@michajlo Thanks! However, I did have to add "em:targetPlatformLinux_x86-gcc3/em:targetPlatform" to install.rdf for it to work. I guess my platform is identified as such.

John N

Ok, when I run fix permissions as root, I'm getting this error: ./firesheep-backend: 1: Syntax error: "(" unexpected. And, when I open the extension I get the Cc error. Is there something I missed?

Jeremy Salwen

@michajlo

here's the full backtrace:

Program received signal SIGSEGV, Segmentation fault.
elf_dynamic_do_rela (scope=<value optimized out>, 
reloc_mode=<value optimized out>, consider_profiling=<value optimized out>)
at do-rel.h:120
120 do-rel.h: No such file or directory.
in do-rel.h
(gdb) backtrace
\#0  elf_dynamic_do_rela (scope=<value optimized out>, 
reloc_mode=<value optimized out>, consider_profiling=<value optimized out>)
at do-rel.h:120
\#1  _dl_relocate_object (scope=<value optimized out>, 
reloc_mode=<value optimized out>, consider_profiling=<value optimized out>)
at dl-reloc.c:268
\#2  0x00007ffff7df0d23 in dl_open_worker (a=<value optimized out>) at dl-open.c:367
\#3  0x00007ffff7dec5e6 in _dl_catch_error (objname=<value optimized out>, 
errstring=<value optimized out>, mallocedp=<value optimized out>, 
operate=<value optimized out>, args=<value optimized out>) at dl-error.c:178
\#4  0x00007ffff7df060a in _dl_open (
file=0x7fffe2df2708 "/home/jeremy/.mozilla/firefox/59nnkup9.default/extensions/firesheep@codebutler.com/platform/Linux_x86_64-gcc3/components/MozPopen.so", 
mode=-2147483647, caller_dlopen=0x7ffff25e2e49, nsid=-2, argc=1, argv=0x22, 
env=0x7ffff6d6e140) at dl-open.c:583
\#5  0x00007ffff7bdbf66 in dlopen_doit (a=<value optimized out>) at dlopen.c:67
\#6  0x00007ffff7dec5e6 in _dl_catch_error (objname=<value optimized out>, 
errstring=<value optimized out>, mallocedp=<value optimized out>, 
operate=<value optimized out>, args=<value optimized out>) at dl-error.c:178
\#7  0x00007ffff7bdc2ec in _dlerror_run (operate=0x7ffff7bdbf00 <dlopen_doit>, 
args=0x7fffffff7d20) at dlerror.c:164
\#8  0x00007ffff7bdbee1 in __dlopen (file=<value optimized out>, 
mode=<value optimized out>) at dlopen.c:88
\#9  0x00007ffff25e2e49 in ?? () from /usr/lib/libnspr4.so.0d
\#10 0x00007ffff25e2f50 in PR_LoadLibrary () from /usr/lib/libnspr4.so.0d
\#11 0x00007ffff64ab2f0 in nsLocalFile::Load (this=<value optimized out>, 
_retval=0x7fffe23a3058) at ../../../xpcom/io/nsLocalFileUnix.cpp:1575
\#12 0x00007ffff64b4957 in nsNativeModuleLoader::LoadModule (
this=<value optimized out>, aFile=0x7fffe2d46a40, aResult=0x7fffffff8340)
at ../../../xpcom/components/nsNativeComponentLoader.cpp:159
\#13 0x00007ffff64b0da3 in nsComponentManagerImpl::AutoRegisterComponent (
this=0x7ffff6dd2140, aComponentFile=0x7fffe2d46a40, aDeferred=..., 
minLoader=-1) at ../../../xpcom/components/nsComponentManager.cpp:3113
\#14 0x00007ffff64b1449 in nsComponentManagerImpl::AutoRegisterDirectory (
this=<value optimized out>, inDirSpec=<value optimized out>, aLeftovers=..., 
aDeferred=...) at ../../../xpcom/components/nsComponentManager.cpp:3046
\#15 0x00007ffff64b158a in nsComponentManagerImpl::AutoRegisterImpl (
this=0x7ffff6dd2140, inDirSpec=0x7fffe2d46b00, aLeftovers=..., aDeferred=...)
at ../../../xpcom/components/nsComponentManager.cpp:2915
\#16 0x00007ffff64b22df in nsComponentManagerImpl::AutoRegister (
this=0x7ffff6dd2140, aSpec=0x0)
at ../../../xpcom/components/nsComponentManager.cpp:3435
\#17 0x00007ffff648eb74 in NS_InitXPCOM3_P (result=<value optimized out>, 
binDirectory=<value optimized out>, 
appFileLocationProvider=<value optimized out>, 
staticComponents=<value optimized out>, componentCount=<value optimized out>)
at ../../../xpcom/build/nsXPComInit.cpp:773
\#18 0x00007ffff5bdb910 in ScopedXPCOMStartup::Initialize (this=0x7fffffff8d70)
at ../../../toolkit/xre/nsAppRunner.cpp:1119
\#19 0x00007ffff5bde7e4 in XRE_main (argc=<value optimized out>, 
argv=<value optimized out>, aAppData=<value optimized out>)
at ../../../toolkit/xre/nsAppRunner.cpp:3283
\#20 0x00000000004024e5 in ?? ()
\#21 0x00007ffff7368c4d in __libc_start_main (main=<value optimized out>, 
argc=<value optimized out>, ubp_av=<value optimized out>, 
init=<value optimized out>, fini=<value optimized out>, 
rtld_fini=<value optimized out>, stack_end=0x7fffffffe848) at libc-start.c:228
\#22 0x0000000000401cb9 in ?? ()
\#23 0x00007fffffffe848 in ?? ()
\#24 0x000000000000001c in ?? ()
\#25 0x0000000000000001 in ?? ()
\#26 0x00007fffffffeaf1 in ?? ()
\#27 0x0000000000000000 in ?? ()
Michajlo Matijkiw

@jnew Since the XPI was compiled on x86_64, I think firefox is having a hard time with the shared object. You'll probably have to compile for your platform, and in configure.ac, and the Makefile.am's change any occurences of x86_64 to x86.

@jeremeysalwen Is this from the one you compiled yourself or the xpi I uploaded?

John N

@michajlo Ok. I changed all occurrences to x86, then attempted to compile. I hit some errors. I'm not exactly the most experienced, so I'll put the output here and if possible, could someone point out a mistake?

john@john-1005HA:~/Desktop/michajlo-firesheep-9bf5b15$ ./autogen.sh --with-xulrunner-sdk=/usr/lib/xulrunner-devel-1.9.2.11
Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf2.50 line 196.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf2.50 line 196.
autoreconf2.50: Entering directory `.'
autoreconf2.50: configure.ac: not using Gettext
autoreconf2.50: running: aclocal --force 
autoreconf2.50: configure.ac: tracing
autoreconf2.50: configure.ac: not using Libtool
autoreconf2.50: running: /usr/bin/autoconf --force
autoreconf2.50: configure.ac: not using Autoheader
autoreconf2.50: running: automake --add-missing --copy --force-missing
configure.ac:29: installing `./config.guess'
configure.ac:29: installing `./config.sub'
configure.ac:25: installing `./install-sh'
configure.ac:25: installing `./missing'
automake: SOURCES was already defined in condition PLATFORM_LINUX, which is included in condition TRUE ...
mozpopen/Makefile.am:19: ... `SOURCES' previously defined here
autoreconf2.50: Leaving directory `.'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... none
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for xpidl... /usr/lib/xulrunner-devel-1.9.2.11/bin/xpidl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating backend/Makefile
config.status: creating mozpopen/Makefile
config.status: executing depfiles commands

john@john-1005HA:~/Desktop/michajlo-firesheep-9bf5b15$ CPATH=/usr/include/nspr makeMaking all in mozpopen
make[1]: Entering directory `/home/john/Desktop/michajlo-firesheep-9bf5b15/mozpopen'
mkdir -p ../xpi/components
/usr/lib/xulrunner-devel-1.9.2.11/bin/xpidl -m typelib -I /usr/lib/xulrunner-devel-1.9.2.11/idl -e ../xpi/components/MozPopen.xpt MozPopen.idl
/usr/lib/xulrunner-devel-1.9.2.11/bin/xpidl -m header -I /usr/lib/xulrunner-devel-1.9.2.11/idl -e MozPopen.h MozPopen.idl
mkdir -p ../xpi/platform/Linux_x86-gcc3/components
g++ -shared -fno-rtti -fPIC MozPopenModule.cpp unix/MozPopenProcess.cpp  -Iunix/ -I. -fshort-wchar -I/usr/lib/xulrunner-devel-1.9.2.11/include -L/usr/lib/xulrunner-devel-1.9.2.11/lib -L/usr/lib/xulrunner-devel-1.9.2.11/bin -Wl,-executable_path,/usr/lib/xulrunner-devel-1.9.2.11/bin/xulrunner-bin -lxpcomglue_s -lxpcom -lplds4 -lplc4 -lnspr4 -lpthread -ldl -o ../xpi/platform/Linux_x86-gcc3/components/MozPopen.so
/usr/bin/ld: warning: cannot find entry symbol xecutable_path; defaulting to 00000000000062e0
make[1]: Leaving directory `/home/john/Desktop/michajlo-firesheep-9bf5b15/mozpopen'
Making all in backend
make[1]: Entering directory `/home/john/Desktop/michajlo-firesheep-9bf5b15/backend'
make[1]: *** No rule to make target `deps/http-parser/http_parser.c', needed by `../xpi/platform/Linux_x86-gcc3/firesheep-backend'.  Stop.
make[1]: Leaving directory `/home/john/Desktop/michajlo-firesheep-9bf5b15/backend'
make: *** [all-recursive] Error 1
Michajlo Matijkiw

@jnew You need to get the http-parser dependency, do 'git submodule update --init'. Also, won't hurt to install libtool.

Jeremy Salwen

@michaejlo

This is from my compilation. The download you posted allows firefox to load, but gives the undefined reference error "Cc" when I click on preferences.

John N

@michajlo Alrighty, that's done. Thanks for all the help so far. However, make failed again. Here's an excerpt. I should probably mention this is my first time using git, so I'm learning a ton in the process hahaha.

john@john-1005HA:~/firesheep$ CPATH=/usr/include/nspr make
Making all in mozpopen
make[1]: Entering directory /home/john/firesheep/mozpopen'
mkdir -p ../xpi/components
/usr/lib/xulrunner-devel-1.9.2.11/bin/xpidl -m typelib -I /usr/lib/xulrunner-devel-1.9.2.11/idl -e ../xpi/components/MozPopen.xpt MozPopen.idl
/usr/lib/xulrunner-devel-1.9.2.11/bin/xpidl -m header -I /usr/lib/xulrunner-devel-1.9.2.11/idl -e MozPopen.h MozPopen.idl
mkdir -p ../xpi/platform/Linux_x86-gcc3/components
g++ -shared -fno-rtti -fPIC MozPopenModule.cpp unix/MozPopenProcess.cpp -Iunix/ -I. -fshort-wchar -I/usr/lib/xulrunner-devel-1.9.2.11/include -L/usr/lib/xulrunner-devel-1.9.2.11/lib -L/usr/lib/xulrunner-devel-1.9.2.11/bin -Wl,-executable_path,/usr/lib/xulrunner-devel-1.9.2.11/bin/xulrunner-bin -lxpcomglue_s -lxpcom -lplds4 -lplc4 -lnspr4 -lpthread -ldl -o ../xpi/platform/Linux_x86-gcc3/components/MozPopen.so
/usr/bin/ld: warning: cannot find entry symbol xecutable_path; defaulting to 00000000000062e0
make[1]: Leaving directory
/home/john/firesheep/mozpopen'
Making all in backend
make[1]: Entering directory /home/john/firesheep/backend'
mkdir -p ../xpi/platform/Linux_x86-gcc3
rm -f ../xpi/platform/Linux_x86-gcc3/firesheep-backend
g++ -DHAVE_STDARG_H -Wall -include src/config.h -g -DPLATFORM_LINUX -lpcap -I deps/ -I deps/http-parser -I deps/json_spirit -o ../xpi/platform/Linux_x86-gcc3/firesheep-backend src/main.cpp src/http_sniffer.cpp src/http_packet.cpp deps/http-parser/http_parser.c src/linux_platform.cpp
In file included from src/http_sniffer.hpp:28,
from src/main.cpp:23:
src/http_packet.hpp:30: fatal error: boost/algorithm/string.hpp: No such file or directory
compilation terminated.
src/http_sniffer.cpp:4: fatal error: boost/format.hpp: No such file or directory
compilation terminated.
In file included from src/http_packet.cpp:23:
src/http_packet.hpp:30: fatal error: boost/algorithm/string.hpp: No such file or directory
compilation terminated.
src/linux_platform.cpp:24: fatal error: pcap/pcap.h: No such file or directory
compilation terminated.
make[1]: *** [../xpi/platform/Linux_x86-gcc3/firesheep-backend] Error 1
make[1]: Leaving directory
/home/john/firesheep/backend'
make: *** [all-recursive] Error 1
Jeremy Salwen

@jnew

You most likely need to install libpcap-dev and libboost-dev

John N

@jeremysalwen That did it. Thanks! Everything is working as far as I can see.

bassman998

It works!!

I decided to start fresh with the code from michaejlo's branch. From there, I had to make some changes from x86_64 to x86. After that, it compiled and loaded into Firefox, but caused Firefox to crash. I noticed that when make tried to build MozPopen.so, it was returning a warning.

mkdir -p ../xpi/platform/Linux_x86-gcc3/components
g++ -shared -fno-rtti -fPIC MozPopenModule.cpp unix/MozPopenProcess.cpp  -Iunix/ -I. -I/root/xulrunner-sdk/sdk/include -fshort-wchar -I/root/xulrunner-sdk/include -L/root/xulrunner-sdk/lib -L/root/xulrunner-sdk/bin  -Wl,-executable_path,/root/xulrunner-sdk/bin/xulrunner-bin -lxpcomglue_s -lxpcom -lplds4 -lplc4 -lnspr4 -lpthread -ldl -o ../xpi/platform/Linux_x86-gcc3/components/MozPopen.so
/usr/bin/ld: warning: cannot find entry symbol xecutable_path; defaulting to 0000000000008060

It looked like the "-Wl,-executable_path,/root/xulrunner-sdk/bin/xulrunner-bin" portion was telling it to use xecutable_path as the entry point, so I deleted that from the Makefile, since I couldn't tell where it was coming from in the autogen process. Now it compiles, loads, and captures.

Jeremy Salwen

After manually deleting xpi/platform/linux.../MozPopen.so (make clean does not delete it), I got it to actually rebuild the entire plugin. However, I noticed the same warning bassman had. I made the same changes he did, and it compiled without warning.

Now it seems to be working. I am able to capture local ethernet cookies. However, it doesn't seem to be listing my wifi device. It instead has a blank name under the preferences tab. I will have to test if that blank entry will really work with my wifi card.

John N

Have we established the ability to capture external sessions? I just tested with an open network, and I was not able to capture any but my own. I have an Atheros card in an Eee 1005ha, fairly certain it supports promiscuous mode.

Jeremy Salwen

@jnew From what I can tell, I think you need to put it in monitor mode to capture other computers' packets, but then you will be unable to access the network yourself. To put your card into monitor mode, do
sudo iwconfig wlan0 mode monitor
sudo ifconfig wlan0 up

John N

@jeremysalwen Yes, I can put my card in monitor mode, and using wireshark I can see the cookies being captured. However, in monitor mode I have no connection to the network and thus, firesheep does not work at all. It will not start because it does not have an ip address. Darn, does this mean my card is not compatible, and I need to go back to manually creating cookies based on wireshark's captured data?

Jeremy Salwen

@jnew essentially, yes. You can use cookieinjector to inject cookies gathered from wireshark: http://dustint.com/archives/12. It might be helpful if someone modified firesheep to be able to import wireshark dumps. That way you could go into monitor mode, dump cookies with wireshark, go back out of monitor mode, and then automatically detect and inject relevant ones into firefox.

johnnyc

Has anyone successfully been able to compile a xpi file for x86? Have been getting several errors and don't feel like going to 64bit just for this right now :-) Either a quick step by step or file link would be much appreciated if there has been success. Cheers.

Miguel Cervera

i've had problems for x86...
right now i'm stuck at the make part
miguel@miguel-laptop:~/Desktop/michajlo-firesheep-9bf5b15$ make
Making all in mozpopen
make[1]: Entering directory /home/miguel/Desktop/michajlo-firesheep-9bf5b15/mozpopen'
mkdir -p ../xpi/components
/usr/local/bin/xpidl -m typelib -I /usr/lib/xulrunner-1.9.1.9/idl -e ../xpi/components/MozPopen.xpt MozPopen.idl
Can't locate CORBA/IDL/Parserxp.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 23) line 3.
make[1]: *** [../xpi/components/MozPopen.xpt] Error 2
make[1]: Leaving directory
/home/miguel/Desktop/michajlo-firesheep-9bf5b15/mozpopen'
make: *** [all-recursive] Error 1

can someone help me?

John N

@mikeki, johnnyc I have successfully compiled for x86. I'll post my .xpi when I can get back to my netbook in a bit.

johnnyc

Thanks in advance jnew!

k0d3g3ar

Yes, thanks jnew.... You'll save me a ton of time & frustration with that xpi!!!!

John N

Here is an x86 xpi. I don't think this needs a fork, seeing as I simply changed the makefiles and xpi install info. If you want me to post it anywhere besides on mediafire let me know where and how, because again, I'm new to github. http://www.mediafire.com/file/oc3vq1buv8mb9v2/firesheep_Linux_x86-gcc3.xpi Make sure to (from the folder with firesheep-backend) still run the command to fix permissions as shown in above posts, after installing!

Miguel Cervera

I've installed it, but It throws me Cc is not defined

k0d3g3ar

I had the Cc issue when testing this in Windows when I didn't have winpcap installed.

leondz

Thanks for your work on this! I have x86 Ubuntu 10.04. The install works well, and things go alright, except:

  • Start capturing button, when clicked, does nothing
  • Preference dialogs are not drawn
  • Choosing preferences throws "ReferenceError: Cc is not defined".

This is with libpcapnav0-dev (0.8-1) installed, under ff 3.6.11.

John N

@mikeki, leondz Have you run sudo ./firesheep-backend --fix-permissions from the backend's directory (inside the plugin's directory in ~/.mozilla)?

leondz

@jnew Yes - it runs without complaint, and does its job:

leon@r50e:~/.mozilla/firefox/.../extensions/firesheep@codebutler.com/platform/Linux_x86-gcc3$ ll
total 3388
drwxr-xr-x 2 leon leon    4096 2010-10-28 03:03 components
-r-sr-xr-x 1 root leon 3454977 2010-10-27 15:19 firesheep-backend
Michajlo Matijkiw

When the permissions are off it will let you know, the Cc not defined error probably has something to do with the shared object. If you look at the Firefox error console it might be able to give you more info. Odds are the shared object is of the wrong elf class or does not exist.

k0d3g3ar

@jnew I must be missing something. On Ubuntu 9.10 here, installed your xpi just fine. Have libpcap-dev and libboost-dev installed. Found your extension files in ~/.mozilla.... and ran fix-permissions. Also chmod -R 777 to them just to be sure. Quit Firefox and restarted. Went to Preferences. Continually getting the ReferenceError: Cc is not defined.

Anything special needed to have it reference my wlan device?

johnnyc

I just tried it and also have the exact same issue as described by leondz. I have fixed the permissions too. I will keep messing around with it, but this isn't my strong suit. If anyone sorts it out further, please post. Thanks for the assistance thus far.

leondz

On drawing the sidebar:

Error: Cc['@codebutler.com/mozpopen/process;1'] is undefined
Source File: file:///home/leon/.mozilla/firefox/.../extensions/firesheep@codebutler.com/modules/util/Utils.js
Line: 98

Error: uncaught exception: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import]"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: chrome://firesheep/content/ff-sidebar.js ::  :: line 23"  data: no]

The error with the preferences dialog is similar:

Error: Cc['@codebutler.com/mozpopen/process;1'] is undefined
Source File: file:///home/leon/.mozilla/firefox/.../extensions/firesheep@codebutler.com/modules/util/Utils.js
Line: 98

Error: uncaught exception: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import]"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: chrome://firesheep/content/preferences/capturePane.js ::  :: line 23"  data: no]

Nothing's written to the error log when "start capturing" is pressed.

k0d3g3ar

@jnew more info.... The Firefox error console is complaining:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIXPCComponents_Utils.import]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: chrome://firesheep/content/preferences/capturePane.js :: :: line 23" data: no]

then....

Error: Cc['@codebutler.com/mozpopen/process;1'] is undefined
Source File: file:///home/mylesw/.mozilla/firefox/167tz1qb.default/extensions/firesheep@codebutler.com/modules/util/Utils.js
Line: 98

John N

@leondz Puzzling, I just cleared and installed again on my machine, and it worked without the Cc errors. The only things I've done to my computer are installing libtool, libpcap-dev and libboost-dev in order for it to build. It seems the issue effects everyone but me? It might be because I compiled on my netbook. I can look at it more tomorrow. If you want to compile yourself, all you have to do is change the text in the makefiles to read x86 instead of x86_64, and do the same in the xpi/install.rdf text file. This is all assuming you followed the thread and have all dependencies satisfied. EDIT: Ok, reading the logs it seems to be exactly what michajlo wrote. I honestly don't know how to fix that, if anyone would like to try, that would be sweet. I wrote exactly what I modified above.

Miguel Cervera

When I try to "make" I get nsISupports.idl not found and nsIArray.idl not found =X

leondz

Same here. It looks like configure is unaware of the directory structure that xulrunner has under ubuntu:


wait4(-1, Making all in mozpopen
make[1]: Entering directory `/home/leon/firesheep/mozpopen'
mkdir -p ../xpi/components
/usr/bin/xpidl -m typelib -I /usr/lib/xulrunner-1.9.2.11//idl -e ../xpi/components/MozPopen.xpt MozPopen.idl
./MozPopen.idl:25: can't open included file nsISupports.idl for reading

input callback returned failure
make[1]: *** [../xpi/components/MozPopen.xpt] Error 2
make[1]: Leaving directory `/home/leon/firesheep/mozpopen'
leon@r50e:~/firesheep$ locate nsISupports
...

/usr/share/idl/xulrunner-1.9.2.11/nsISupports.idl
/usr/share/idl/xulrunner-1.9.2.11/nsISupportsArray.idl
/usr/share/idl/xulrunner-1.9.2.11/nsISupportsIterators.idl
/usr/share/idl/xulrunner-1.9.2.11/nsISupportsPrimitives.idl
/usr/share/idl/xulrunner-1.9.2.11/nsISupportsPriority.idl
bassman998

I'll post my xpi for Linux x86, since some of you seem to be having problems with the one jnew posted. I don't know if it'll be any different, but it's worth a try. http://www.mediafire.com/?i929q12gzdby92h

It was compiled on Backtrack 4. It runs on a clean Backtrack 4 livecd once Firefox is updated. Instructions for that are here: http://www.backtrack-linux.org/forums/backtrack-howtos/1652-update-firefox-3-6-nice-clean-back%7Ctrack-4-final.html

Since Backtrack 4 is based on Ubuntu/Debian, there's a good chance it'll run on those, too.

Michajlo Matijkiw

I'm pretty busy this weekend, but I'll look into modifying the configure.ac/Makefile to accommodate x86 and x86_64 simultaneously if I get a chance.

@bassman from a while ago, looks like that -Wl,-executable_path... winds up passing -e xecutable_path to ld, which is invalid. No idea how that would have got there...

@anyone who can't find the idl files, try pointing it to xulruner-dev if you have it. If not the easiest thing to do is installed it. If your adventurous you can try putting a symlink to where the idls actually are from where it expects them to be.

From earlier in the thread, I looked into PolicyKit briefly, but probably won't have time to actually do anything with it until next week if I do- just in case anyone wants to take the initiative.

Miguel Cervera

bassman, that worked for mee! thanks

bassman998

@mikeki Good to know! I'm guessing that the system that jnew compiled on is different enough that yours doesn't like his MozPopen.so library. When I was first getting the xpi compiled on my own, I was getting those Cc errors because MozPopen.so didn't exist.

What Linux flavor/version are you running, so that other people can know what'll work for them?

Miguel Cervera

I'm running ubuntu 9.10, and installed a lot of libraries

k0d3g3ar

@bassman998 This fixed much of the problems I was experiencing. Now I am not getting the Cc errors, and Preferences are coming up fine. Full list of sites displayed, etc. I'm on Ubuntu 9.10 x86 32 bit.

However I'm having one issue. The interfaces that should be listed in the Capture area are not populating. I have a standard eth0 and wifi connection. I tested this with both connected and also with the wifi disconnected. In either case, none of my interfaces are listed at all (blank pulldown). I'm trying to work out what is required for Firesheep to recognize my network adapters?

Miguel Cervera

I had the same issue, all you have to do is "fix-permissions"

skinnypuppy

@Bassman998: Confirmed working on BackTrack 4 R1 with eth0, Wlan0 (ath5k) and Wlan1 (Awus036NH). This is with BackTrack installed on HD, Firefox 3.6.11, 2.6.34 kernel.

Thank You

k0d3g3ar

@mikeki bingo! You are right. Fix permissions worked and now I have some of my network adapters showing. Funny thing is though that I have eth0 showing, and lo but my wlan0 isn't showing. There's a couple of blank entries in there which is weird. It may simply be a labelling issue, so I'll try them to see if I can work out which is which.

Miguel Cervera

@jnew did you solved the "cant capture anyone but me" problem?

k0d3g3ar

@mikeki Interesting question you posed to @jnew.... It looks like I'm seeing the same thing here. I am testing it with two computers on a Wifi network, and its capturing my own traffic just fine, but not the traffic of the other computer...

Jeremy Salwen

@mikeki: I would guess not, based on the fact that I have the same issue. The issue is that you need to go into monitor mode to capture other peoples' cookies. And that just doesn't work with firesheep.

Miguel Cervera

I have the exact same problem in my windows boot, so I thought that on linux it would work... it seems a problem of my wireless card.. I will try with a USB wireless card

skinnypuppy

Firesheep recognizes my wlan0 and wlan1 but I can't capture any data. Tried airmon-ng and iwconfig to set either card into monitor mode (which they do) but still no capture. Only on eth0.

Michajlo Matijkiw

I don't know if monitor mode is necessarily what you are looking for, OS X and Windows get by without it. You want promiscuous mode, which the code presently does (this is why firesheep-backend needs to run as root).

Check dmesg to see if you see anything about entering/exiting promiscuous mode on the interface. I have a theory that network-manager and some other stuff are trampling on what we are trying to do. See the instructions at the bottom of http://www.aircrack-ng.org/doku.php?id=airmon-ng for how to kill these off.

I've seen the missing interfaces in the list (wlan0 is missing on my machine). It prints out in the json reported by firesheep-backend --list-interfaces, probably something inside of the more firefox-specific code. It picks the interface fine, even though the name isn't visible.

Andrew

Total N00b here,

Ubuntu 10.04, toyed with the aircrack airmon directions, shut down the network manager and everything else, no avail picking up anything outside my own data.

Any more suggestions?

skinnypuppy

Same, put my alfa card into promiscuous mode, no luck. Tried the Atheros card, no luck as well. There is no network manager, wicd, etc upon boot as BackTrack is a silent distro: no networking starts.

It does show me in preferences wlan0 or wlan1 depending on which card I am using, and no errors upon start capture. Going to run wireshark and see if I can decipher anything.

bassman998

To those of you having problems with only seeing your own data: try a combination of airmon-ng and airtun-ng. airmon-ng creates a monitor interface, mon0. mon0 is an interface of type 80211_radio. airtun-ng will use mon0 as input, and create a virtual ethernet interface (at0) with the data. Use at0 as your capture source.

bassman998

@michajlo It seems like pcap_findalldevs doesn't return a description for some interfaces. When I first started modifying the code, before I just used yours instead, I used id for both the id and description, and that worked really well.

Miguel Cervera

bassman, does itwork for u?

i've set the at0 but I cant find it in the interface list

skinnypuppy

@Bassman: Tried using airmon-ng in conjunction with airtun-ng. Same results. Ran Nmap against the box running firesheep and no port 80. Figured, DUH, gotta have it open if the filter is set to 80. Enabled port 80, ran Nmap again, showed port 80 open.

Ran firesheep again, still no luck. Fired wireshark up, surfed around on the other computer and was seeing packets. TcpDump also shows me receiving packets.

@mikeki. For some reason my interface list shows wlan0/wlan1, eth0, lo or at0 . Sometimes though when I look at interfaces there is only grey boxes, and sometimes it actually shows me the available interface.

Michajlo Matijkiw

@bassman I believe the description is irrelevant. http_sniffer.cpp does all the work, it opens the interface by id.

I'm toying with wireshark to figure out exactly what my computer can pick up and what firesheep is picking up. So far I've noticed that for some reason outgoing traffic from other wireless nodes isn't being picked up, but incoming traffic is. http_sniffer is programmed to only pick up requests, which are outgoing, so this is a problem.

If an interface is not showing up in the list it is probably not supported. My module only will show interfaces that have DLT_EN10MB as the datalink type, http_sniffer.cpp only expects this, and will fail otherwise.

bassman998

@mikeki try bringing the interface up and giving it an ip:
ifconfig at0 169.254.1.1 netmask 255.255.0.0 up

@michajlo The description isn't used by the extension or sniffer, but I believe it's displayed in the list of interfaces in the preferences. So, passing the id in for the description would be more user-friendly (if I'm remembering correctly).

Putting a wireless interface into promiscuous mode seems to pick up traffic from the AP to all clients, but not traffic from the clients back to the AP. Which, as you mentioned, is useless for picking up session cookies.

I'm having the most success using airmon-ng to put the adapter in monitor mode, and airtun-ng to strip the 802.11 headers and tunnel the data to an EN10MB ethernet interface. However, the extension isn't picking up all of the traffic. There seems to be a disconnect between the firesheep-backend and the extension -- when I run firesheep-backend on the command line, I can see all sorts of session cookies, but mostly firesheep isn't displaying them (occasionally it'll get a couple).

Unfortunately, I have no idea how to start debugging Firefox extensions. I suspect that something's still not quite right with MozPopen.so, since that's what Firesheep uses to read the output from the backend (I think...). I ran ldd on MozPopen.so, and it tells me it's missing libxpcom.so. My next step is to try to apt-get install libxul-devel and see if that helps.

bassman998

I just tried installing libxul-devel and that seems to have worked. I'll keep testing and see if it continues to work consistently.

Andrew

Ok, I'm not finding a package libxul-devel. Am I missing something?

Also, is there any way I can get more specific instructions on airmon-ng and airtun-ng? I'm a little confused, since I'm still way behind the learning curve.

Bryan Gilbert

I'm trying to locate that package as well. After looking it appears that that package existed up until Karmic, but is no longer in the repos for Maverick (I'm assuming your running 10.10 like me):

http://packages.ubuntu.com/search?keywords=libxul-dev

You can grab the .deb from there, but there are more dependencies that do not exist in Maverick that are required to install this package. Haven't decided yet if I want to go down that road or not.

Naveen Manivannan

@gillbertw1 On Ubuntu, it's a different package name than on Fedora/CentOs/RHEL (libxul-dev). I believe it's xulrunner-dev . I downloaded pretty much all the xulrunner-1.9.2-dev/-testsuite-dev/testsuite packages before I got it to even finish autogen.sh.

I used line: ./autogen.sh --with-xulrunner-sdk=/usr/lib/xulrunner-devel-1.9.2.11

Andrew

Yeah, there are dependencies of dependencies and everything, making this nigh on impossible. Is there a way to package what we need for the plugin into the plugin itself? (Sorry if that's a stupid question.)

If the package has be eliminated, is there a more up to date version that will suffice?
Nevermind, thank you @nmani

Also, still unsure of how to use the aircrack to gain the cookies.

bassman998

@Gardn Sorry, I meant to say libxul-dev. It looks like it's not in Ubuntu anymore. I found the necessary libraries in /usr/lib/firefox-something-or-other/ (Sorry, I'm booted back into windows now). If you symlink the libraries in that folder back to /usr/lib/, it works.

Andrew

@bassman
There are a lot of files. What exactly should I link?

bassman998

@Gardn Any file in the /usr/lib/firefox.../ directory that starts with lib and ends with .so. Some of those already exist in /usr/lib, and will just fail to link. Sorry I can't be more specific, since I've got my laptop booted into windows right now.

If you want to make sure you link only the ones that you need, find MozPopen.so in your mozilla profile, and run 'ldd MozPopen.so'. It'll tell you that libxpcom.so was not found. Symlink it. Run ldd again. etc.

I'm sure there's a better way to do this, by giving ld the path to the firefox library directory, but it was easier for me to just symlink stuff.

Bryan Gilbert

@Gardn, if your using an up to date version of 10.10 like me your command should look like this:

sudo ln -s /usr/lib/firefox-3.6.12/libxpcom.so /usr/lib/libxpcom.so

The firefox version may be different, if it is you'll just need to change that folder.

Tobias Schmid

@bassman Thx for your .xpi file, works fine on my kubuntu 9.04 jaunty with firefox 3.6.11.
My wlan0 interface isn't visible in the preference drop down menu. But if I chose the blank entry, wlan0 goes to the promiscuous mode when I start capture. That's a good sign ;-)
I will test it next monday at the university ;-)

Andrew

@gillbertw1, and @bassman,

Thanks, I was trying to go the other way. facepalm

Andrew

@gillbertw1, and @bassman,

Thanks, I was trying to go the other way. facepalm

bassman998

@schmidi You're welcome. That is, as long as you don't plan on using it at the University where I'm the network admin. :)

Andrew

I'm still not able to pick up any traffic outside my own, but I'm receiving no error messages. I linked everything I could find.

makubex

Hi guys,
I tried out @bossman's .xpi, It installed fine and I also did --fix-permissions, but when I click Start Capture I get this message "Couldn't get netmask for device eth0:eth0: no IPv4 address assigned"

btw, I am using WEP encrypted wifi connection could it be the reason too. I have to check it on open wifi connection!!

Jolsch

I installed the xpi from bassman998. After fixing permissions everything is working! I am using Ubuntu 10.10.

A little side note; when I go to Preferences, Capture --> Interface (in Firesheep). The first entry is a blank and the second is (lo). I assumed the blank is my wireless card and when I selected it I picked up sessions for the websites where are scripts for in Firesheep. Nice work bassman998!

k0d3g3ar

@Jolsch Are you absolutely sure its working? Check that your Wifi interface is actually picking up traffic outside of your local network. That's been the problem we've all been facing. It works, but it won't pickup traffic outside of your own.

Naveen Manivannan

Yah make sure you're not picking up eth0.

Jolsch

@nmani: I am not on the network with an ethernet card. I am on the network with my wireless card (wlan0):

Jolsch@yeah:~$ ifconfig
lo Link encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:47 errors:0 dropped:0 overruns:0 frame:0
TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4546 (4.5 KB) TX bytes:4546 (4.5 KB)
wlan0 Link encap:Ethernet HWaddr 00:1f:4d:20:b4:96
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe50::21f:4gff:fe40:b195/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:260337 errors:0 dropped:0 overruns:0 frame:0
TX packets:193380 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:340721442 (340.7 MB) TX bytes:23283864 (23.2 MB)

I do not know if I pick up traffic from other networks than my own. I just used a simple man-in-the-middle setup (because we do not have an open network) in my house with wireless internet and was able to grep facebook sessions from roommates. Next week I'll try to test it on an open network.

Naveen Manivannan

ok. From my understanding, when your card is set on monitoring mode... you shouldn't be able to access the network with it. I could be wrong.

My issue is that my wlan0 (ath9k) in monitoring mode won't show up on the list in preferences or find any sessions. I type "watch -d 'dmesg | tail -5' and notice that it still goes into promiscuous mode though. 'iwconfig' confirms it's in monitoring mode.

romainw

Just to recap what I had to do to make this work on a x86 netbook running Maverick (Ubuntu 10.10):

o Install dependencies (the generous way)

apt-get install git libcap2-bin libsmi2ldbl libc-ares2 wireshark-common wireshark libstdc++6-4.4-dev g++-4.4 libboost1.42-dev libboost-dev x11proto-core-dev libice-dev libxau-dev libxdmcp-dev x11proto-input-dev x11proto-kb-dev xtrans-dev libpthread-stubs0 libpthread-stubs0-dev libxcb1-dev libx11-dev g++ libdpkg-perl dpkg-dev build-essential html2text libunistring0 gettext intltool-debian po-debconf debhelper libalgorithm-diff-perl libalgorithm-merge-perl libglib2.0-bin zlib1g-dev libglib2.0-dev libatk1.0-dev libcairo-gobject2 libexpat1-dev libfreetype6-dev libfontconfig1-dev x11proto-render-dev libxrender-dev libpng12-dev libsm-dev libpixman-1-dev libxcb-render0-dev libxcb-shm0-dev libcairo2-dev libdbus-1-dev libdbus-glib-1-dev libgdk-pixbuf2.0-dev libxft-dev libpango1.0-dev x11proto-xext-dev libxext-dev x11proto-xinerama-dev libxinerama-dev libxi-dev x11proto-randr-dev libxrandr-dev x11proto-fixes-dev libxfixes-dev libxcursor-dev x11proto-composite-dev libxcomposite-dev x11proto-damage-dev libxdamage-dev libgtk2.0-dev libsys-hostname-long-perl libmail-sendmail-perl libnotify-dev libnspr4-dev libnss3-dev libiw-dev m4 autoconf autotools-dev automake autopoint libtool dh-autoreconf libltdl-dev libpcap0.8-dev libpcap-dev libreadline5 libruby1.8 libpcap-ruby1.8 libpcap-ruby libpcapnav0 libpcapnav0-dev python-libpcap libpcap0.8-dbg xulrunner-1.9.2-dev xulrunner-1.9.2

o Prepare the build

git clone http://github.com/michajlo/firesheep.git
cd firesheep/
git submodule update --init
cd ..

// The Ubuntu xulrunner/xulrunner-dev requires some path tweaking, better of using the vanilla release:

wget http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.2.10/sdk/xulrunner-1.9.2.10.en-US.linux-i686.sdk.tar.bz2

mv xulrunner-1.9.2.10.en-US.linux-i686.sdk.tar.bz2 xulrunner
cd xulrunner/
tar -zjvf ./xulrunner-1.9.2.10.en-US.linux-i686.sdk.tar.bz2
cd ../firesheep/

o Replace/complement x86_64 instances by x86:

// Little detail is given as this is apparently being addressed by michajlo upstream.

grep -r x86_64 .
vim

o Compile

./autogen.sh --with-xulrunner-sdk=pwd/../xulrunner/xulrunner-sdk/
make

o Install and test the extension

// (Open the file with Firefox, then close Firefox and back to Terminal)

cd ~/.mozilla/firefox/.default/extensions/firesheep@codebutler.com/platform/
sudo ./Linux_x86_64-gcc3/firesheep-backend --fix-permissions

// Testing:

./Linux_x86_64-gcc3/firesheep-backend eth1 tcp port 80

My hardware is using the "wl" module, which does not support Monitor mode:
02:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY 14e4:4315

Monitor mode can be enabled by using the b43 module:

rmmod wl
modprobe b43

// (The wl module should be blacklisted for the change to survive reboot - not done here)

ifconfig wlan0 down
iwconfig wlan0 mode Monitor
ifconfig wlan0 up

But this does not seem to be sufficient to see traffic from other hosts. Apparently nobody is able to sniff traffic from another host with firesheep on Linux?

Hope this helps anyway. Thanks to all those involved!

Romain.

brywil

OK, I got this building on my eee pc under ubuntu 10.10, It installs fine and I can see my own cookies being grabbed, However, the backend doesn't seem to be grabbing traffic from other pc's. It's not a driver problem because I can see all the traffic on my hotspot with wireshark or etherape. I haven't dug into the http sniffer code enough, but I suspect the linux specific pcap code is only grabbing traffic bound for my ip.

Has anybody got this working (I mean really working like it's supposed to) with this git branch?

Nathan Heafner

i would love to see linux support also.

krinne

I have @bassman998 's .xpi, got it install, no errors, and have setup airtun-ng and airmon-ng with the at0 interface, but when I tell firesheep to use that interface, I lose all incoming data, and even my own data. When I switch over to (What I suppose to be) wlan0 interface, I can gain my data back, but not incoming data from other machines. The weird thing is, even on my windows machine I cannot see the other computer's data either, so I don't know if it's just me, but I haven't got to see this in action.

romainw

Some progress here.

Still on my x86 netbook running Maverick (Ubuntu 10.10), with the BCM4312 Wifi card:

02:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY 14e4:4315

Basically, with the b43 module, monitoring work did not work so well.
I reverted to the default "wl" module (default Ubuntu configuration) and surprisingly Firesheep works, and I can sniff traffic from other hosts!

I am running ettercap (sudo ettercap -Tzq -i eth1) in the background, not sure if this has helped.

Firesheep is now fully working for me.

Dana Moore

I think I got this working with bassman's xpi, however my interfaces aren't being populated. Here is the output from sudo ./firesheep-backend --list-interfaces:
{"eth0":{"name":"","type":"ethernet"},"wlan0":{"name":"","type":"ethernet"},"lo":{"name":"","type":"ethernet"}}

None of the names are filled in, maybe that's why it's not listing them? I can start the backend normally then goto facebook and I see a bunch of cookies in the term but firesheep doesn't capture any of them in firefox. Are we supposed to run firefox as root or something?
Also when I do --fix-permissions I get the Cc error when opening pref's. If I take ownership of the backend I get no errors, but still get no interfaces listed and nothing captured. Anyone know what's up here?

Dana Moore

Also I'd love to see this paired with sslstrip, that would be killer but it should be fairly easy to get it running regardless.

Dana Moore

Running MozPopen.so from the term (don't know if this actually means anything) gives me a Segmentation Fault.

Michajlo Matijkiw

@Kamek MozPopen segfaulting when you execute it from the command line is fine. To make sure your architecture is compatible, try 'objdump -a MozPopen.so', and 'uname -m'. If objdump gives you elf64-x86-64 and uname gives you x86, without _64, there's probably a problem. Similar the other way around. Also try 'ldd MozPopen.so', if you have a lot of 'not founds' that also might be a problem.

I committed an update that will put the right arch into the platform, so no need to manually change anymore. Also, if no description is provided it will give the interface name.

I've been toying with the no outgoing traffic thing, but unfortunately i only have a computer and a blackberry (which does all sorts of weird things), and no open network of my own. For now if you have that problem bassman's solution (i think thats who it was, this thread is pretty long now) works well-
sudo airmon-ng wlan0 start
sudo airtun-ng -a [AP_MAC] mon0 &
ifconfig at0 $IP netmask $NETMASK up
Then pick at0 as the capture interface.

PolicyKit support might come in the future.

Dana Moore

What packages are required to build this, and what and where do we change this: "-Wl,-executable_path,/usr/lib/xulrunner-devel-1.9.2.11/bin/xulrunner-bin" to?

Danny Weinberg

I've been trying to get this to work. I'm on Ubuntu 10.10 64-bit. The .xpi gave Cc reference error so I'm trying to build it. All working except that http-parser dependency. I ran into the same problem jnew did, so I installed git and tried running the command suggested, but I get this error:

fatal: Not a git repository (or any of the parent directories): .git

I've done research, looking for http libraries using apt-get and how to set a git repository, but I wasn't able to make sense of the documentation and none of the libraries did it. How do I get this dependency?

Dana Moore

@FuegoFro:
git clone http://github.com/michajlo/firesheep.git
cd firesheep/
git submodule update --init

Danny Weinberg

@Kamek Thanks works great! Up and working, will test on an open network tomorrow :)

Nick Kossifidis

I did some basic work on adding support for 802.11 monitor interfaces and just owned th local hotspot :-) Code is still very nasty and i don't have much time to clean it but i can send it to anyone that wants to play with it and clean it up...

Dana Moore

When you set an interface to monitor mode is there a way to also set the wep key as well for passive packet capture between the wireless client and the ap? Also am I correct in thinking this should work with a MITM attack as well right? @mickflemm I'd test it but I have yet to get anything working on my box yet, as I'm not sure what the required packages are and what to change "-Wl,-executable_path,/usr/lib/xulrunner-devel-1.9.2.11/bin/xulrunner-bin" to.

falseteeth

I am running Ubuntu 10.10 Netbook Edition, on a netbook.

For the life of me, I cannot find my Firefox extensions folder. I do not know where I have to run --fix-permissions.

cd ~/.mozilla/firefox/ only has a folder named Crash Reports in it. There's nothing else anywhere.

There's a folder in /usr/lib/ called firefox-3.6.12, and there's an extensions folder in there, but I only see langpacks in there.

I have quite a few addons installed, so this is very odd. Can anyone help me?

Cyruss

Will there be a simple FF Plugin for Linux users in the near future?

If not, would someone be so kind to write a dummy Ubuntu 10.10 tutorial on how to get it running.

Thanks in advance!

Jolsch

@ falseteeth: I just ran './firesheep-backend --fixpermissions' or something in this folder .mozilla/firefox/vkuuxfit.default/extensions/firesheep@codebutler.com/platform/Linux_x86-gcc/

@k0d3g3ar: I am still breaking my head over your comment about picking up traffic outside of my own network. What do you mean? Isn't firesheep made to pick up sessions (cookies) from people in your network? How can you pick up traffic outside of that?

I tried using it once, connected to an open network, found out who were in it and put myself in the middle of them and the router via arpspoof. Then I used firesheep and was able grep some of their sessions.

falseteeth

@Jolsch Ok, thanks. I ran that but nothing seems to have happened.

Trying to load the addon still gives me ReferenceError: Cc is not defined

edit: To clarify, I've installed the x86 .xpi, ran --fix-permissions, and if I run the backend sites/cookies some up in the terminal, but I can't get anything to work in Firefox itself. Trying to edit the preferences gives me the "Cc is not defined" error.

falseteeth

@Jolsch Btw, Firesheep's intention certainly is NOT to pick up sessions/cookies from inside your network. It is designed to scan the open air for ANY cookies being transmitted on ANY open wireless network in your range. I don't believe it has any intended function to scan your own network (in conjunction with ARP poisoning), but I believe it wouldn't be hard to do.

woofcat

So far I have the xpi installed and running with out errors in Firefox. Running this on a eeepc901 with a debian based install.

When I start the capture via dmesg I see wlan0 go into promiscuous mode. However if I run Wireshark at the same time, I don't see any packets coming in that aren't broadcast.

If I shutdown Firefox, and throw the card into monitor mode manually and set it to a channel. Then open up Wireshark I am able to see TCP traffic. So the card is physically able -- However the problem lies in that FireSheep won't pick up wlan0 unless it is not in monitor mode.

Thus, to start a capture on wlan0, wlan0 must be unable to pickup all network traffic. It seems like a impasse to me.

I think this might be tied to FireSheep wanting to reach out to each of the sites and pull users name / display photo while running. However Monitor Mode doesn't associate with a AP.

Anyone find a way around this?

Danny Weinberg

I wrote a tutorial-for-dummies to install this on a linux system, aimed specifically at Ubuntu (because that's what I'm on). I tested it from scratch on a fresh install of Ubuntu 10.10 64-bit, and it works, but Its pretty long so I'm not sure if I should post it here. If not, I'm not sure what a better place would be for it.

falseteeth

@FuegoFro Upload it to some site like www.pastebin.com if you don't own your own. Just paste the link here.

Danny Weinberg

@falseteeth Thanks for that site!

Here is the tutorial I made. Hope some people find it useful!
http://pastebin.com/mDBm6jyD

Dana Moore

@FuegoFro, concise guide man however I still have two problems.

  1. When compiling MozPopen I still get this erro:
    /usr/bin/ld: warning: cannot find entry symbol xecutable_path; defaulting to 00000000000062e0

  2. After compilation I open the prefs and get the Cc error as well as other errors when opening other dialogs, and no interfaces shown.

@michajlo, I finally had time to try your suggestions here is the output of the commands you suggested:
objdump -a MozPopen.so

MozPopen.so: file format elf32-i386

ldd MozPopen.so

            linux-gate.so.1 =>  (0xb770b000)
/usr/lib/xulrunner-devel-1.9.2.12/bin/xulrunner-bin (0xb76e2000)
libxpcom.so => not found
libplds4.so => /usr/lib/libplds4.so (0xb76ca000)
libplc4.so => /usr/lib/libplc4.so (0xb76c5000)
libnspr4.so => /usr/lib/libnspr4.so (0xb7691000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7677000)
libdl.so.2 => /lib/libdl.so.2 (0xb7673000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7586000)
libm.so.6 => /lib/libm.so.6 (0xb755f000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7543000)
libc.so.6 => /lib/libc.so.6 (0xb73e5000)
libmozjs.so => not found
libxpcom.so => not found
libxul.so => not found
libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0xb7014000)
libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0xb6ff9000)
libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0xb6f0d000)
libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0xb6ee7000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb6e6f000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb6e3f000)
libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb6da8000)
libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0xb6d9c000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0xb6d83000)
libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0xb6d40000)
libcairo.so.2 => /usr/lib/libcairo.so.2 (0xb6c8d000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb6c4b000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb6c47000)
libpng12.so.0 => /lib/libpng12.so.0 (0xb6c22000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb6c1c000)
librt.so.1 => /lib/librt.so.1 (0xb6c13000)
libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0xb6b44000)
libstartup-notification-1.so.0 => /usr/lib/libstartup-notification-1.so.0 (0xb6b3b000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb6a1e000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb6a0d000)
libasound.so.2 => /usr/lib/libasound.so.2 (0xb6947000)
/lib/ld-linux.so.2 (0x002ad000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb693d000)
libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0xb6939000)
libXi.so.6 => /usr/lib/libXi.so.6 (0xb692b000)
libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0xb6923000)
libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0xb6918000)
libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0xb6914000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb6910000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb690a000)
libz.so.1 => /lib/libz.so.1 (0xb68f5000)
libpcre.so.3 => /lib/libpcre.so.3 (0xb68bf000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb68ab000)
libselinux.so.1 => /lib/libselinux.so.1 (0xb688f000)
libexpat.so.1 => /lib/libexpat.so.1 (0xb6868000)
libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0xb6807000)
libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0xb6803000)
libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0xb67fb000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb67e1000)
libxcb-aux.so.0 => /usr/lib/libxcb-aux.so.0 (0xb67dd000)
libxcb-event.so.1 => /usr/lib/libxcb-event.so.1 (0xb67d8000)
libxcb-atom.so.1 => /usr/lib/libxcb-atom.so.1 (0xb67d3000)
libSM.so.6 => /usr/lib/libSM.so.6 (0xb67ca000)
libICE.so.6 => /usr/lib/libICE.so.6 (0xb67b1000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb67ac000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb67a6000)
libuuid.so.1 => /lib/libuuid.so.1 (0xb67a1000)

Everything appears ok to me, any suggestions?

Wyko

@FuegoFro

Forgive me, but I am entirely new to the realm of linux and am trying to follow your instructions. When I run your first line of code in the terminal ("sudo apt-get install build-essential autotools-dev automake autoconf git xulrunner-1.9.2-dev libpcap-dev libboost-dev aircrack-ng") I get this message:

Package git is not available, but is refered to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source.
E: Package git has no installation candidate

What should I do?

Jim Bauwens

I am using bassman998 xpi on my acer aspire one (maverick, firefox 3.6). It works good, captures my data and data of other people using arpspoofing. I have the same problem that it doesn't work in monitor mode, but that isn't really bothering me. The xpi doesn't work in firefox 4, it gives you a cc error, so I was thinking that the cc errors other people here are getting might be because of a wrong firefox version.

falseteeth

@jimbauwens It is NOT designed to only capture other people's data with ARP spoofing. Yours is not working properly.

Michajlo Matijkiw

@falseteeth I wouldn't go so far as to say that firesheep is not working properly, it seems to be doing exactly what the code intends. It helps you pick an interface, anything that will have ethernet headers, and then passes that interface to http_sniffer, which does the session reconstruction. Firesheep backend sends these reconstructed sessions to firefox via mozpopen, where they are searched for session cookies.

That interface can be anything as long as pcap can open it. I'm fairly certain that the reason people are having trouble with their interfaces not picking up all traffic is not firesheeps fault, but something to do with some obscure kernel settings, other processes mucking with the wireless card, or some hardware feature (my next stop is to start checking datasheets).

@mickflemm If your modifications do what it sounds like they do, that's awesome :)

James Adney

@Wyko Try changing "git" to "git-core".

Nick Kossifidis

@michajlo how can i send them to you ?

Danny Weinberg

@Kamek I didn't run into that problem when I tested the tutorial on a fresh install so I don't have first hand info, but if you look earlier in this thread you'll find that bassman998 was able to fix this issue by deleting the offending line (eg.: -Wl,-executable_path,/usr/lib/xulrunner-devel-1.9.2.12/bin/xulrunner-bin) from the "Makefile" file (note that that's different from "Makefile.am").
Just a side note, try searching through the tread before you post about something. We're welcome to help you, but you also need to do some work and try to help yourself first.

falseteeth

Can someone go into detail and explain where I'm supposed to find MozPopen.so? I do not see a file named that anywhere in my Firesheep folder. Does this mean it didn't install/compile properly?

Nick Kossifidis

A few infos on what i've done...

I changed firesheep-backend to use 802.11 monitor interfaces with radiotap headers (mac80211 provides this, just use iw command to add it and give it the same ip with your wlan -it won't send or receive anything so no problem, if you have one use route command to clean it up-). The thing is that monitor interfaces don't provide ethernet packets that firesheep-backend can handle, they provide raw 802.11 frames with radiotap header and SNAP encapsulation so I had to change the code to accept monitor interfaces and deal with different headers etc (802.11 header is of variable length) and malformed packets (I skip all header checks for now but I have to add some error checking stuff). My current code is prety nasty and i don't have much time to clean it up, I just wanted to see that it works and after it did (and I got all fb accounts on the local hotspot -notifying their owners to use ToR-) i left it.

Using monitor interfaces you can get packets from any open wireless network your card can see, it's not like promisc mode when you see only packets on your own network.

cromadon

I am having a similar problem as Kamek.

  • getting the "ReferenceError: Cc is not defined" on opening the preferences.
  • list of interfaces is empty
  • "start capturing" does nothing
  • No compilation errors.
  • "sudo ./firesheep-backend --list-interfaces" seems to work correct in listing all interfaces with names

@kamek did u solve that problem?

Andrew

@mickflemm

Brilliant. Now, I'm a little lost in using iw after installing. Which command did you run and how? I don't want to break it, an I can see where to plug in the wlan0 device, but I'm not sure how it connects to the firesheep backend. Can you give us some more specifics? Messy code is fine, if it runs. ;)

Andrew

@kamek, cromadon

This was talked about above. You did not symlink the libraries from the /.mozilla/firefox-[version]... /lib/ foler to the /usr/lib folder. you also need to fix permissions on the firesheep-backend to get the interfaces.

Andrew

General question:
I just bough a 64 bit machine. When I get Ubuntu 10.10 running, will I have to deviate from these directions to get it running?

Wyko

I am having a similar problem as Kamek.

* getting the "ReferenceError: Cc is not defined" on opening the preferences.
* list of interfaces is empty
* "start capturing" does nothing
* No compilation errors.
* "sudo ./firesheep-backend --list-interfaces" seems to work correct in listing all interfaces with names

Same here.

Dana Moore

@FuegoFro, wow that from a guy who couldn't git clone a repo. I'm stunned. bassman was unclear in his post about what he changed and where he changed it, so I was asking for clarification. It seemed to me as if he was saying to only take out the -executable_path to me, as all he said was this "part" and that executable_path was messing something up. I'll rtfm if you will.

Dana Moore

@cromadon, no sorry I haven't had alot of time lately. Hopefully I'll mess with it this weekend.

Danny Weinberg

@Kamek Point taken. I'm sorry, I didn't mean to be rude.

falseteeth

@FuegoFro I used your guide, followed every instruction, and I run ./firesheep-backend at0 tcp 80, but it still only shows packets sent to/from my computer. What am I doing wrong?

My card fully supports monitor mode (and packet injection) by the way.

I also ran dmesg, and at0 is indeed entering promiscuous mode. It's not picking up anything from anyone else, though.

Nick Kossifidis

btw @executable_path is only used on Mac OS X as far as i know, it's the place where it expects to find XUL library (binary). I tried to compile firesheep on 10.4 but with no luck... I'm cleaning up the code and i'll post them so you can test.

Dana Moore

@FuegoFro, no problem. I didn't see the part about symlinking the lib's to /usr/lib, is there any way you could update your guide to include this? Sorry to be a dick, it's been a long day. I was thinking perhaps someone should make a forum or something where we can discuss this, as this page is getting way too unorganized.

Nick Kossifidis

I used michajlo's work and added Linux support from scratch fixing various autoconf/automake isues, adding policykit support etc.

Instructions:
git clone git://github.com/mickflemm/firesheep.git
cd firesheep
./autogen.sh --with-xulrunner-sdk="path to xulrunner sdk"

git submodule update --init
make

I'll put 802.11 monitor support asap ;-)

Wyko

@mickflemm

I'm having trouble finding the SDK. Where should I be looking? I tried:
./autogen.sh --with-xulrunner-sdk=/usr/lib/xulrunner-1.9.2.12/

But it did this:

autoreconf: Entering directory .'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:30: installing
./config.guess'
configure.ac:30: installing ./config.sub'
configure.ac:26: installing
./install-sh'
configure.ac:26: installing ./missing'
autoreconf: Leaving directory
.'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... none
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for xpidl... no
configure: error: xpidl compiler not found

-Wyko

Nick Kossifidis

for me it was /usr/lb/xulrunner-devel-1.9.2/

Nick Kossifidis

added monitor support...
please test
#70

Dana Moore

Note, you must disable the default firefox apparmor profile or it won't let the plugin run.

Eric Butler
Owner

I'm going to mark this issue closed since development has moved here:
https://github.com/codebutler/firesheep/issues#issue/70

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
7  backend/Makefile.am
@@ -34,6 +34,13 @@ CFLAGS  += -L"deps/winpcap/lib"
34 34
 LIBS    += -lwpcap
35 35
 DEST     = $(top_builddir)/xpi/platform/WINNT_x86-msvc
36 36
 endif
  37
+if PLATFORM_LINUX
  38
+SOURCES += src/linux_platform.cpp
  39
+CFLAGS  += -DPLATFORM_LINUX
  40
+CFLAGS  += -lpcap
  41
+DEST     = $(top_builddir)/xpi/platform/Linux_$(build_cpu)-gcc3
  42
+endif
  43
+
37 44
 
38 45
 TARGET = $(DEST)/firesheep-backend
39 46
 
61  backend/src/linux_platform.cpp
... ...
@@ -0,0 +1,61 @@
  1
+//
  2
+// linux_platform.cpp: Linux functions, though more unix/pcap general
  3
+// Part of the Firesheep project.
  4
+//
  5
+// Copyright (C) 2010 Eric Butler
  6
+//
  7
+// Authors:
  8
+//   Michajlo Matijkiw
  9
+//
  10
+// This program is free software: you can redistribute it and/or modify
  11
+// it under the terms of the GNU General Public License as published by
  12
+// the Free Software Foundation, either version 3 of the License, or
  13
+// (at your option) any later version.
  14
+//
  15
+// This program is distributed in the hope that it will be useful,
  16
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  17
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18
+// GNU General Public License for more details.
  19
+//
  20
+// You should have received a copy of the GNU General Public License
  21
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
  22
+
  23
+#include <stdio.h>
  24
+#include <pcap/pcap.h>
  25
+#include "linux_platform.hpp"
  26
+
  27
+
  28
+LinuxPlatform::LinuxPlatform(vector<string> argv) : UnixPlatform(argv) { }
  29
+
  30
+bool LinuxPlatform::run_privileged() {
  31
+    return true;
  32
+}
  33
+
  34
+vector<InterfaceInfo> LinuxPlatform::interfaces()
  35
+{
  36
+  vector<InterfaceInfo> result;
  37
+  char err_buff[PCAP_ERRBUF_SIZE];
  38
+  pcap_if_t *all_devs;
  39
+  if (pcap_findalldevs(&all_devs, err_buff) == 0) {
  40
+    pcap_if_t *dev = all_devs;
  41
+    while (dev) {
  42
+      pcap_t *interface = pcap_open_live(dev->name, 1024 ,1, 100, err_buff);
  43
+
  44
+      if (interface == NULL) {
  45
+        dev = dev->next;
  46
+        continue;
  47
+      }
  48
+
  49
+      if (pcap_datalink(interface) == DLT_EN10MB) {
  50
+        const char *description = (dev->description) ? dev->description : dev->name;
  51
+        InterfaceInfo info(dev->name, description, "ethernet");
  52
+        result.push_back(info);
  53
+      }
  54
+
  55
+      pcap_close(interface);
  56
+      dev = dev->next;
  57
+    }
  58
+    pcap_freealldevs(all_devs);
  59
+  }
  60
+  return result; 
  61
+}
37  backend/src/linux_platform.hpp
... ...
@@ -0,0 +1,37 @@
  1
+//
  2
+// linux_platform.h: Linux functions, though more unix/pcap general
  3
+// Part of the Firesheep project.
  4
+//
  5
+// Copyright (C) 2010 Eric Butler
  6
+//
  7
+// Authors:
  8
+//   Michajlo Matijkiw
  9
+//   Eric Butler <eric@codebutler.com>
  10
+//
  11
+// This program is free software: you can redistribute it and/or modify
  12
+// it under the terms of the GNU General Public License as published by
  13
+// the Free Software Foundation, either version 3 of the License, or
  14
+// (at your option) any later version.
  15
+//
  16
+// This program is distributed in the hope that it will be useful,
  17
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  18
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19
+// GNU General Public License for more details.
  20
+//
  21
+// You should have received a copy of the GNU General Public License
  22
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
  23
+
  24
+#ifndef FIRESHEEP_LINUX_PLATFORM_H
  25
+#define FIRESHEEP_LINUX_PLATFORM_H
  26
+
  27
+#include "unix_platform.hpp"
  28
+#include "interface_info.hpp"
  29
+
  30
+class LinuxPlatform : public UnixPlatform {
  31
+public:
  32
+  LinuxPlatform(vector<string>);
  33
+  bool run_privileged();
  34
+  vector<InterfaceInfo> interfaces();
  35
+};
  36
+
  37
+#endif
12  backend/src/main.cpp
@@ -27,8 +27,12 @@
27 27
 
28 28
 #ifdef PLATFORM_WIN32
29 29
 #include "windows_platform.hpp"
30  
-#else
  30
+#elif PLATFORM_OSX
31 31
 #include "osx_platform.hpp"
  32
+#elif PLATFORM_LINUX
  33
+#include "linux_platform.hpp"
  34
+#else
  35
+#error "no suitable platform"
32 36
 #endif
33 37
 
34 38
 void received_packet(HttpPacket *packet);
@@ -40,8 +44,10 @@ int main(int argc, const char *argv[])
40 44
   
41 45
 #ifdef PLATFORM_WIN32
42 46
   WindowsPlatform platform(sargv);
43  
-#else
  47
+#elif PLATFORM_OSX
44 48
   OSXPlatform platform(sargv);
  49
+#else
  50
+  LinuxPlatform platform(sargv);
45 51
 #endif
46 52
   
47 53
   if (argc > 1) {
@@ -112,7 +118,7 @@ void list_interfaces(AbstractPlatform *platform)
112 118
   vector<InterfaceInfo>::iterator iter;
113 119
   for (iter = interfaces.begin(); iter != interfaces.end(); ++iter) {
114 120
     InterfaceInfo iface = *iter;
115  
-    
  121
+ 
116 122
     json_spirit::Object iface_obj;
117 123
     iface_obj.push_back(json_spirit::Pair("name", iface.name()));
118 124
     iface_obj.push_back(json_spirit::Pair("type", iface.type()));
6  backend/src/unix_platform.hpp
@@ -29,7 +29,11 @@
29 29
 #include <fcntl.h>
30 30
 #include <stdbool.h>
31 31
 #include <unistd.h>
  32
+#ifdef PLATFORM_LINUX
  33
+#include <limits.h>
  34
+#else
32 35
 #include <sys/syslimits.h>
  36
+#endif
33 37
 #include <sys/stat.h>
34 38
 #include <sys/errno.h>
35 39
 #include "abstract_platform.hpp"
@@ -110,4 +114,4 @@ class UnixPlatform : public AbstractPlatform
110 114
   vector<string> m_args;
111 115
 };
112 116
 
113  
-#endif
  117
+#endif
24  mozpopen/Makefile.am
@@ -39,3 +39,27 @@ $(LIB): $(SOURCES)
39 39
 clean:
40 40
 	rm -f $(COMPONENT).xpt $(COMPONENT).dylib
41 41
 endif
  42
+if PLATFORM_LINUX
  43
+SOURCES  = MozPopenModule.cpp unix/MozPopenProcess.cpp
  44
+PLAT_DEST = $(top_builddir)/xpi/platform/Linux_$(build_cpu)-gcc3/components
  45
+CFLAGS  += -Iunix/ -I.
  46
+COMPONENT_NAME = MozPopen
  47
+XPT = $(DEST)/$(COMPONENT_NAME).xpt
  48
+LIB = $(PLAT_DEST)/$(COMPONENT_NAME).so
  49
+
  50
+all: $(XPT) $(COMPONENT_NAME).h $(LIB)
  51
+
  52
+$(COMPONENT_NAME).h: $(COMPONENT_NAME).idl
  53
+	$(XPIDL) -m header $(XPIDL_FLAGS) -e $@ $(COMPONENT_NAME).idl
  54
+
  55
+$(XPT): $(COMPONENT_NAME).idl
  56
+	mkdir -p $(DEST)
  57
+	$(XPIDL) -m typelib $(XPIDL_FLAGS) -e $@ $(COMPONENT_NAME).idl
  58
+
  59
+$(LIB): $(SOURCES)
  60
+	mkdir -p $(PLAT_DEST)
  61
+	$(CXX) -shared -fno-rtti -fPIC $(SOURCES) $(CFLAGS) $(MOZ_CFLAGS) $(MOZ_LIBS) -o $@
  62
+
  63
+clean:
  64
+	rm -f $(COMPONENT).xpt $(COMPONENT).so
  65
+endif
2  xpi/install.rdf
@@ -15,6 +15,8 @@
15 15
     <em:unpack>true</em:unpack>
16 16
     <em:targetPlatform>Darwin_x86-gcc3</em:targetPlatform>
17 17
     <em:targetPlatform>WINNT_x86-msvc</em:targetPlatform>
  18
+    <em:targetPlatform>Linux_x86-gcc3</em:targetPlatform>
  19
+    <em:targetPlatform>Linux_x86_64-gcc3</em:targetPlatform>
18 20
     <em:targetApplication>
19 21
       <Description>
20 22
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- Firefox -->
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.