Skip to content

Added Linux support (again)#70

Merged
6 commits merged into
codebutler:masterfrom
mickflemm:master
Nov 14, 2010
Merged

Added Linux support (again)#70
6 commits merged into
codebutler:masterfrom
mickflemm:master

Conversation

@mickflemm

Copy link
Copy Markdown
Contributor

I used michajlo's work and added Linux support from scratch fixing various autoconf/automake isues, adding policykit support etc. It works out of the box ;-)

Support for 802.11 monitor interfaces on the way...

 * Needs policykit installed (no need to manualy set permissions on backend)
…(that means radiotap header + 802.11 header + LLC + data)

 * Added __packed__ atribute on all structs that we map directly to the packet buffer (headers mostly). Without it compiler aligns their elements
based on cpu/os etc to optimize performance and this can result bad mapping. On visual studio we use te __pragma(pack()) attribute (but haven't tested it, it should work).
@mickflemm

Copy link
Copy Markdown
Contributor Author

Done !

Some instructions:

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

git submodule update --init
make

grab build/firesheep.xpi and install it on firefox

Setup a monitor interface:
iw wlan0 interface add mon0 type monitor
ifconfig mon0 up
go to preferences->interface and choose mon0

now you should see sessions from any open network your card can hear (not just the one you are connected)

The first time you run it you should press "Start Capturing" and polkit will ask for your root password in order to set proper permissions to firesheep-backend. Then you'll be able to choose interfaces and play with it. If polkit doesn't work for you just do it manualy

cd ~/.mozilla/firefox/wmv3s5gw.default/extensions/firesheep@codebutler.com/platform/Linux_x86-gcc3/
(wmv3s5gw.default should be different in your case)

sudo ./firesheep-backend --fix-permissions

@codebutler

Copy link
Copy Markdown
Owner

Awesome, thanks for collecting this all into one commit.

A few questions:

  • Is it possible to use pkg-config instead of requiring the --with-xulrunner-sdk configure parameter, or will attempting to use the system xulrunner-dev package be a nightmare for x86_64 systems? I'm assuming everyone's been using the SDK tarball from Mozilla, but I haven't been following very closely.
  • Can you add pkg-config checks for boost and libpcap, and then use the _LIBS variables created by that?
  • Is there an API to use instead of pkexec? The frontend assumes that fix_permissions() will return false if the user (for example) cancels the password dialog, which wont happen with exec(). The hard-coded path may also be a problem. Probably not a huge deal.
  • Do the devices returned by pcap_findalldevs() contain useful descriptions or will it be necessary to pull in devicekit/network-manager/connman maddness? On Windows the description returned for some devices is fine and for others is useless, leaving some people confused.

Thanks again,
Eric

EDIT: Reviewed this right before your second commit, haven't had a chance to look through it yet.

@mickflemm

Copy link
Copy Markdown
Contributor Author

I'll work on pkg-config asap, haven't looked at it much (i have an x86_64 to test so no problem there). As for the polkit API yes there is one but it's complicated (plus I think we need to install a policy file on /etc/polkit) and i don't have much time right now to look at it. Polkit is the only desktop-independent way to do this without command line (works on both gnome/kde). I'll think of a way to handle the return code, as for the hardcoded path it shouldn't be a problem, all distros install pkexec on /usr/bin (but we can get it with "which pkexec" and use that instead I guess).

Thanks for your work ;-)

@mickflemm

Copy link
Copy Markdown
Contributor Author

btw this is what --list-interfaces return, most of the time there is no description from pcap...
{"wlan0":{"name":"wlan0","type":"ethernet"},"mon0":{"name":"mon0","type":"802.11 monitor"},"eth1":{"name":"eth1","type":"ethernet"},"lo":{"name":"lo","type":"ethernet"}}

I don't know if we should use devicekit but i'll look into it...

@mickflemm

Copy link
Copy Markdown
Contributor Author

DeviceKit is new and poorly documented, I'll go with HAL, everyone supports HAL. However i don't expect much on my system Network Manager, DeviceKit, HAL all report things like "WLAN interface" or "Networking Device" etc :P Something is probably missing...

@Wyko

Wyko commented Nov 5, 2010

Copy link
Copy Markdown

I finally figured out where the SDK was! (/usr/lib/xulrunner-devel-1.9.2.12/)

However, when I "Make," it gives me a long string of errors. I figured I post the errors in pastebin rather than spamming this board. :)

http://pastebin.com/X8zSPFYn

@Gardn

Gardn commented Nov 5, 2010

Copy link
Copy Markdown

mon0 isn't coming up in preferences. Ideas to fix that? everything else went through, though I did have to run iw and ifconfig as root. dunno if that matters.

Thanks so much for your work, this will be epic. :D

@Gardn

Gardn commented Nov 5, 2010

Copy link
Copy Markdown

oh. and after running everything, I was getting errors running make, so I couldn't grab your xpi so I used the one from the previous thread. would that make a difference?

@FuegoFro

FuegoFro commented Nov 5, 2010

Copy link
Copy Markdown

@Wyko I don't know if it will completely fix your problem by trying running:
make CPATH=/usr/include/nspr
That resolved a lot of similar errors for me. I am however still getting errors on the MozPopen compile during make.
MozPopenModule.cpp:1: error: bad value (amd64) for -march= switch
MozPopenModule.cpp:1: error: bad value (amd64) for -mtune= switch

@Wyko

Wyko commented Nov 5, 2010

Copy link
Copy Markdown

@FuegoFro That solved everything! It built perfectly and runs well. Thanks!

I just have two questions:

One; I was unable to get Firesheep to capture cookies from my network... until I decided to try changing the network from a WEP encrypted one to a totally unsecured network. Then it worked! Does Firesheep not work on WEP networks that you already have a key for?

And question number two: Can Firesheep (used and built in the manner that you describe in the first post) catch logins from people not on your network, but on nearby networks? Because a minute or two after I opened my network publicly and I finally began to have Firesheep work, I also randomly caught a login from a stranger on facebook. I suppose she could have logged in to my network, but my router's security page don't see her as connected to my wireless AP. Is there an easy way to tell in linux who is connected to a particular wireless ap?

Thanks for all of your help guys!

@Gardn

Gardn commented Nov 5, 2010

Copy link
Copy Markdown

It should pick up cookies from any wireless network your card can 'hear', is my understanding, so a nearby network you're not connected to, but could be, (unsecured network) would produce firesheep traffic.

I'm not finding anything on google for my error:

Making all in mozpopen
make[1]: Entering directory /home/andrew/firesheep/mozpopen' mkdir -p ../xpi/components /usr/local/bin/xpidl -m typelib -I /usr/lib/xulrunner-1.9.2.12/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.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 26) line 3. make[1]: *** [../xpi/components/MozPopen.xpt] Error 2 make[1]: Leaving directory/home/andrew/firesheep/mozpopen'
make: *** [all-recursive] Error 1

can anyone help?

1 similar comment
@Gardn

Gardn commented Nov 5, 2010

Copy link
Copy Markdown

It should pick up cookies from any wireless network your card can 'hear', is my understanding, so a nearby network you're not connected to, but could be, (unsecured network) would produce firesheep traffic.

I'm not finding anything on google for my error:

Making all in mozpopen
make[1]: Entering directory /home/andrew/firesheep/mozpopen' mkdir -p ../xpi/components /usr/local/bin/xpidl -m typelib -I /usr/lib/xulrunner-1.9.2.12/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.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 26) line 3. make[1]: *** [../xpi/components/MozPopen.xpt] Error 2 make[1]: Leaving directory/home/andrew/firesheep/mozpopen'
make: *** [all-recursive] Error 1

can anyone help?

@falseteeth

Copy link
Copy Markdown

Incredible. It actually works.

Do I need to recreate the mon0 interface every time I restart, though?

@mickflemm

Copy link
Copy Markdown
Contributor Author

I just woke up and finished with pkg-config stuff, no need to use --with-xulrunner-sdk anymore it's automaticaly detected, also pcap doesn't have pkg-config files but pcap-config instead. I couldn't find anything for boost though ;-(

Also I'm almost done with getting interface descriptions from HAL (info.product) so we 'll have sane descriptions instead of wlan0.

Policykit is next (hope i can find some time durring the weekend)...

About the monitor interface:

a) Your card should support it, for a list of supported cards/drivers visit wireless.kernel.org
b) You should create it each time you want to use it using iw wlanX interface add monX type monitor
c) If it doesn't show up on the list it's because you didn't bring it up (ifconfig mon0 up)
d) If you get other errors try assigning it an IP (there is no need to have an IP on the monitor interface but anyway, anything will work don't use an IP on the same subnet or you'll mess up routing)

@mickflemm

Copy link
Copy Markdown
Contributor Author

Oh also about the amd64 flag, it seems newer gcc versions removed it, amd64 was a generic flag to support both amd and intel 64bit cpus. I switched to -march=athlon64 -mtune=generic and wish it'll also work on 64bit intels.

@Gardn

Gardn commented Nov 6, 2010

Copy link
Copy Markdown

I still can't get it to compile though.

@mickflemm

Copy link
Copy Markdown
Contributor Author

I haven't pushed the changes yet, I'll do it later today.

 * Use pcap-config for pcap library paths
 * Use boost.m4 for boost library paths
 * Change -march to more generic 32bit and 64bit flags (note amd64 flag is gone on newer gcc versions)
@mickflemm

Copy link
Copy Markdown
Contributor Author

@codebutler: Done with pkg-config stuff, xullrunner, pcap (through pcap-config) and boost (through boost.m4) all ready ! ;-) Tested on x86 (Gentoo) and x86_64 (Ubuntu).

It should work on windows too but i can't test it (i was more optimistic on OS X but I also can't test it) ;-(

@ALL no need for --with-xulrunner-sdk anymore plus it'll tell you when you don't have a required lib.

@Jolsch

Jolsch commented Nov 6, 2010

Copy link
Copy Markdown

Nice work mickflemm! I really want to try your software, but how do I remove the version of michajlo? I am just making the transition from Windows to linux and I have no clue about how this works. I normally install software with 'sudo apt-get instal [name]' and remove it with 'sudo apt-get remove [name]'. Download sources and compile it was kind of new to me, but remove software is another thing. How does it work?

@Kamek

Kamek commented Nov 6, 2010

Copy link
Copy Markdown

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

@mickflemm

Copy link
Copy Markdown
Contributor Author

Just follow the instructions on the first post but instead of ./autogen.sh --with-xulrunner-sdk="path to xulrunner sdk" just type ./autogen.sh.

Also make sure you have the following packages:

autoconf
xulrunner-dev
libboost-dev
libpcap-dev

…lter is set but let's be safe)

 * Silence compiler (init ip and ipv6 structs to NULL)
@FuegoFro

FuegoFro commented Nov 6, 2010

Copy link
Copy Markdown

Works like a charm. Brilliant! :)

@ozanguven

Copy link
Copy Markdown

I have tested on archlinux x86_64 (2.6.35-ARCH) with "Ralink RT2870" wireless usb adaptor and it works...

@Raa42

Raa42 commented Nov 7, 2010

Copy link
Copy Markdown

Thanks for your work, mickflemm !

I get an error runing the autogen :

"No package 'hal' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables HAL_CFLAGS
and HAL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details."

So the makefile is not created and make will not run...

I checked /usr/lib/pkgconfig : hal.pc is missing, and I haven't a clue how to create it.

@Kamek

Kamek commented Nov 8, 2010

Copy link
Copy Markdown

As I understand it, most people only set 1 wep key index which means that firesheep should be able to hear another wireless client and decrypt it's traffic even on a wep secured network (if you could call it that) in that event.

@juliensobrier

Copy link
Copy Markdown

I get an error with firesheep-backend on CentOS5:

./firesheep-backend --fix-permissions

./firesheep-backend --list-interfaces

terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
Aborted

It tried as sudo user and root, no difference

@william-simon

Copy link
Copy Markdown

I created an account just to tell the developers that they are geniuses. Thanks this has been a fun learning experience for someone new to Linux.

@xavierzwirtz

Copy link
Copy Markdown

Could someone please compile and post this. I'm using backtrack 4 and cant get the latest xulrunner, so it wont compile.

@TrojanWin32

Copy link
Copy Markdown

My trouble is coming from the adding monitor part. I'm fairly new to Linux and may be missing something simple, but here is what I am entering into terminal as well as what is being returned:

I enter:

:~$ sudo iw wlan0 interface add mon0 type monitor

and I am getting back this message:

command failed: Too many open files in system (-23)

Can anyone explain to me what is going on and why? Thank you all very much.

@Raa42

Raa42 commented Nov 9, 2010

Copy link
Copy Markdown

@ TrojanWin32 :
I had the same error when mon0 was already created.
Run ifconfig to see if mon0 already exist.

About WEP :
I tested it on a WEP protected network, but it doesn't detect anything.
When I run Wireshark, I can see the cookies of facebook, live.com in some data packets...
But Firesheep finds nothing.
Any guess ?

@Raa42

Raa42 commented Nov 9, 2010

Copy link
Copy Markdown

@ mickflemm :
I missed the fix-permissions trick, thanks !

@ VoiceOfWisdom & bugbegone :
Will a xpi compiled on another system work for you ?
If you want to try with mine : http://dl.free.fr/okQZuviCu
Compiled on Ubuntu 10.4 / kernel 2.6.32-25...

Tell us if it works !

@TrojanWin32

Copy link
Copy Markdown

Through some searching and trickery (airmon-ng), I managed to get this from
~$ iwconfig:

lo no wireless extensions.

eth0 no wireless extensions.

wlan0 IEEE 802.11bg Mode:Monitor Frequency:2.462 GHz Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off

mon0 IEEE 802.11bg Mode:Monitor Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off

...which I thought was great, but I am unable to connect while wlan0 is in monitor mode, so I turned that back to managed mode and left mon0 the way it is. Seemed like it should have worked, but there is still nothing under interfaces on F/sheep.

Am I even close?

@xavierzwirtz

Copy link
Copy Markdown

Using Raa42's xpi I was able to install the addon. However whenever I run the fix permission thing I get this error "./firesheep-backend: /usr/lib/libstdc++.so.6: version 'GLIBCXX_3.4.11' not found (required by ./firesheep-backend)".

@Gardn

Gardn commented Nov 10, 2010

Copy link
Copy Markdown

hey, getting an iw error on my brand new laptop.... :-\ one I didn't get on the other machine.

nl80211 not found. From googling furiously I find that this means I don't have the driver. However, under administration there is a windows wireless drives option, and I know where the windows drivers are stored (dual booting). Can I run through the drivers till I find one that works?

@Raa42

Raa42 commented Nov 10, 2010

Copy link
Copy Markdown

@ VoiceOfWisdom :
try
sudo apt-get install libstdc++6
and/or
sudo apt-get install libstdc++6-4.4-dev

@xavierzwirtz

Copy link
Copy Markdown

Whenever I run "sudo apt-get install libstdc++6" I get the message "libstdc++6 is already the newest version". And the whenever I try to run "sudo apt-get install libstdc++6-4.4-dev" it cant find it.

@xavierzwirtz

Copy link
Copy Markdown

Okay I did a search of my apt-cache and found that the latest version of libstdc++ is 6-4.3 . Is there any way I can get the latest version for backtrack?

@mpolden

mpolden commented Nov 11, 2010

Copy link
Copy Markdown

Just a quick heads up for Ubuntu users. I needed the following packages to make it compile and run on Ubuntu 10.10 amd64:
sudo apt-get install hal libhal-dev autoconf libboost-dev libpcap-dev xulrunner-dev

@hellocatfood

Copy link
Copy Markdown

When running "iw wlan0 interface add mon0 type monitor" I get nl80211 not found, which I guess relates to it not supporting 802.11 monitor interfaces (yet)

@hairypete

Copy link
Copy Markdown

@ Raa42 Your xpi works out of the box for me. Acer Laptop, 10.04 lts and a built in atheros wireless card that runs on MadWifi drivers.

Installed your xpi

ifconfig ath0 down
sudo airmon -ng start wifi0

both ath0 and ath1 was created

sudo ifconfig ath1 up

sudo firefox (will fix permissions after writing this)

Then point firesheep to ath1 in preferences.

Thanks a lot man!

@joethetrader

Copy link
Copy Markdown

@Raa42
Your xpi installs for me also. fix permissions also gave no error. Sorry if this has been asked, but when I try to access the preferences pane, I keep getting a window

[Javascript Application]
ReferenceError: Cc is not defined

And I can't choose any interfaces, since none show up.

wifi card in monitor mode, running on BT4

any help appreciated!

@mpolden

mpolden commented Nov 12, 2010

Copy link
Copy Markdown

@joethetrader
That error means that you're missing hal. You need have hal installed for the interface(s) to show up.

@joethetrader

Copy link
Copy Markdown

@martinp

hal and libhal-dev installed. Still seeing same error. Any other suggestions?

@hairypete

Copy link
Copy Markdown

@joethetrader

libpcap-dev and libboost-dev

@joethetrader

Copy link
Copy Markdown

@hairypete

Those were also previously installed. No dice.
Do you think it makes a difference that I didn't compile myself, but used Raa42's xpi?

@hairypete

Copy link
Copy Markdown

@joethetrader

Really don't know, I just have basic knowledge about linux, and are just result oriented, no science at all here.

I use trial and error until I succeed.

I will install BT4 on the kids machine and try it out there as well. If I succeed Iäll let you know

@ptantiku

Copy link
Copy Markdown

Just installed it, and it works like a charm.
Thank you guys for great work!

@philipballew

Copy link
Copy Markdown

I tried to put my wi fi card into monitor mode this way:
Setup a monitor interface:
iw wlan0 interface add mon0 type monitor
ifconfig mon0 up
go to preferences->interface and choose mon0

but since that didnt work i did this

cd ~/.mozilla/firefox/wmv3s5gw.default/extensions/firesheep@codebutler.com/platform/Linux_x86-gcc3/
(wmv3s5gw.default should be different in your case)

changing my directories from his. however when i run this:

sudo ./firesheep-backend --fix-permissions
i get an error saying this: sudo: ./firesheep-backend: command not found
i cant figure it out and didnt see it in the formes here, anyone seen this?

@polomint

Copy link
Copy Markdown

Hi, thought I would just join in and give my experience...

I used Raa42's xpi. Installed it in firefox. I then closed Firefox, and then used sudo apt-get to download hal, libhal-dev, ibpcap-dev and libboost-dev
Once that completed I "sudo firefox", went into the firesheep settings and selected my wireless card. Now it works great, :)

@sammydafish

Copy link
Copy Markdown

I was able to build firesheep with the instructions here. I had to --fix-permissions in order to get interfaces to appear but they are there now. I get no results though when I start capturing, not from the same machine or from another test on the same network. I used airmon-ng to put the interface into monitor mode. I'm using the mon0 interface in firesheep. I'm using patched drivers on a WG111v3 USB. iwconfig shows monitor mode. If I set firesheep to my wlan0 interface (built in broadcom) I can pick up traffic from the local machine but nothing else. Did an injection test according to aircrack-ng but don't know how to test if the interface is picking up traffic. Any suggestions?

@bottiger

bottiger commented Jan 7, 2011

Copy link
Copy Markdown

I'm having trouble getting firesheep to compile on ubuntu 11.04.

Here's dump from my ternimal: http://pastebin.ca/2040399 (In sort: make fails compiling firesheep/backend)

I have made sure I have all the dependencies listed above, but maybe they changed in ubuntu 11.04.

@Gardn

Gardn commented Jan 19, 2011

Copy link
Copy Markdown

There is no 11.04.

also, I can't get to your pastebin.ca link. Go through each of the steps above, and make sure you have xulrunner-dev.

@chenxiaolong

Copy link
Copy Markdown

If Virtualbox is installed, Firesheep crashes with a HAL error:

terminate called after throwing an instance of 'std::runtime_error'
what(): libhal_device_get_property_string failed: org.freedesktop.Hal.NoSuchProperty No property info.vendor on device with id /org/freedesktop/Hal/devices/net_0a_00_27_00_00_00

The solution is just to unload the Virtualbox network adapter module and all will be fine :D

sudo rmmod vboxnetadp

@Flaburgan

Copy link
Copy Markdown

An update for newer versions of firefox is on the way ?
(i can't install xulrunner in ubuntu 11.10..)

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.