You are not logged in.

#1 2010-02-27 00:42:02

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

[SOLVED] Patching rtl8187 driver for use with aircrack...

I found this:
http://aur.archlinux.org/packages.php?ID=15375

But it's out of date. In the comments, they say to use this patch for the 2.6.32 kernel. I'm not really sure how to do this myself, and even if I do get the driver patched, I'm not sure how to use the patched driver instead of the one the is automatically loaded at boot.

Also, of course, this is just for fun -- something for me to do. I want to see how secure my network is, and this is a decent moment to learn. And it would be great to patch it myself whenever I need to during kernel upgrades and not have to rely on the AUR (which is currently out of date)

Thanks for any help,
smile

Last edited by XtrmGmr99 (2010-03-02 02:38:06)

Offline

#2 2010-02-28 18:44:15

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

Can anyone help me?

Offline

#3 2010-02-28 19:02:26

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

Answers to your questions are in either the PKGBUILD or the AUR comments. The out-of-date build already uses a 2.6.31 patch, so you can just substitute the new one.

Offline

#4 2010-02-28 19:33:29

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

The only comment related to 2.6.32 is this one:

Please update it for the 2.6.32 kernel :
patch ==> http://trac.aircrack-ng.org/raw-attachm … 6.32.patch

I'm quite the newb when it comes to compiling and patching and whatnot. I've tried various substitutions for the mentioned patch (rtl8187_2.6.32.patch), and it still fails. Which file to I need to substitute? There's three patches, two of which seem to refer to .31 and one that refers to .27, and then there's this new one.

Offline

#5 2010-02-28 20:07:45

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

There's only one patch there from aircrack - my guess is that's the one you need to change. smile

As for your self-declared newb status, just get stuck in. You're not starting from scratch here - the original and subsequent maintainers of the AUR package have done most of the work for you. Keep trying, and ask here if you need help. One thing though - don''t just say "it still fails". Provide details.

Offline

#6 2010-02-28 20:21:18

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

Alright, well I replaced the old .27 patch from aircrack with the new .32 and make the other necessary changes (md5sums and `patch` commands in build()).

This is my complete PKGBUILD:

# Maintainer: nofxx <x@nofxx.com>
pkgname=rtl8187-ng
pkgver=1010
pkgrel=3
kernver=`uname -r`
pkgdesc="Drivers for Realtek RTL8187l Wifi card - Aircrack-ng patched (Monitor/Injection)"
arch=('i686' 'x86_64')
url="http://rtl-wifi.sourceforge.net/"
license=('GPL')
depends=('kernel26')
provides=('rtl-wifi')
conflicts=('rtl-wifi')
install=rtl8187-ng.install
source=(http://dl.aircrack-ng.org/drivers/rtl8187_linux_26.$pkgver.zip 
http://trac.aircrack-ng.org/raw-attachment/ticket/650/rtl8187_2.6.32.patch
http://github.com/nopper/archpwn/raw/master/repo/lkm-skel/rtl8187-ng/rtl8187-ng-2.6.31.patch
patch-kernel-2.6.31.patch
)

     
_prefix=/lib/modules/$kernver/kernel/drivers/net/wireless

build() {
      cd $startdir/src/rtl8187_linux_26.1010.0622.2006
      tar xzf drv.tar.gz || return 1
      tar xzf stack.tar.gz || return 1
          patch -Np1 -i ../patch-kernel-2.6.31.patch || return 1
      patch -Np1 -i ../rtl8187_2.6.32.patch || return 1
          patch -Np1 -i ../rtl8187-ng-2.6.31.patch || return 1
      make || return 1
      install -d $startdir/pkg/$_prefix/rtl8187 || return 1
      install -d $startdir/pkg/$_prefix/rtl_ieee80211 || return 1

      install -Dm644 ./ieee80211/*.ko $startdir/pkg/$_prefix/rtl_ieee80211 || return 1
      install -Dm644 ./beta-8187/*.ko $startdir/pkg/$_prefix/rtl8187 || return 1
      
}


md5sums=('c5b1c7e0c094fa943a52e1a78117308b'
         '2bd15a855b1f2b48b7019d1aff6ff49a'
         '6985101a75e971d7e064947cf39ecba2'
         'ce46d1e7c6b633a627ade15c8804f5c8')

And it fails with this output:

==> Validating source files with md5sums...      
    rtl8187_linux_26.1010.zip ... Passed         
    rtl8187_2.6.32.patch ... Passed              
    rtl8187-ng-2.6.31.patch ... Passed           
    patch-kernel-2.6.31.patch ... Passed         
==> Extracting Sources...                        
  -> Extracting rtl8187_linux_26.1010.zip with bsdtar
==> Entering fakeroot environment...                 
==> Starting build()...                              
patching file beta-8187/r8187.h                      
Hunk #1 succeeded at 43 with fuzz 2 (offset 1 line). 
patching file beta-8187/r8187.h                      
Hunk #1 FAILED at 43.                                
1 out of 1 hunk FAILED -- saving rejects to file beta-8187/r8187.h.rej
patching file beta-8187/r8187_core.c                                  
Hunk #1 FAILED at 1893.                                               
Hunk #2 succeeded at 2387 (offset -210 lines).                        
Hunk #3 FAILED at 2635.
2 out of 3 hunks FAILED -- saving rejects to file beta-8187/r8187_core.c.rej
patching file ieee80211/ieee80211_module.c
Hunk #1 FAILED at 117.
1 out of 1 hunk FAILED -- saving rejects to file ieee80211/ieee80211_module.c.rej
patching file ieee80211/ieee80211_rx.c
Hunk #1 FAILED at 104.
1 out of 1 hunk FAILED -- saving rejects to file ieee80211/ieee80211_rx.c.rej
patching file ieee80211/ieee80211_tx.c
Hunk #1 FAILED at 511.
1 out of 1 hunk FAILED -- saving rejects to file ieee80211/ieee80211_tx.c.rej
==> ERROR: Build Failed.
    Aborting...

And, like I said, I've tried various combinations with various outputs -- but they all fail one way or another. =/

Last edited by XtrmGmr99 (2010-02-28 20:30:00)

Offline

#7 2010-03-01 12:51:34

dioltas
Member
Registered: 2009-06-03
Posts: 44

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

I think what you did wrong was you replaced rtl8187_2.6.27.patch with rtl8187_2.6.32.patch,
when you should have replaced rtl8187-ng-2.6.31.patch with rtl8187_2.6.32.patch.

You could try following this guide on the aircrack wiki, I tried it there and it seemed to compile and install anyway. Make sure you have kernel26-headers installed though,
pacman -Sy kernel26-headers
Wouldn't compile for me until I installed them.

I don't know if it actually works, don't have time to test injection but it installs without errors anyway.

Also, it seems that it is possible to do injection without patching,

Although it is highly recommended that you patch the driver, it is possible to use the unpatched driver for injection. Simply enter this command first "iwpriv wlan0 rawtx 1".

Offline

#8 2010-03-01 23:56:32

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

dioltas wrote:

pacman -Sy kernel26-headers
Wouldn't compile for me until I installed them.

Ohh... I thought I had installed them already. I guess not. >_>

I'll come back later with results. Thanks. smile

Offline

#9 2010-03-02 02:37:51

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

I was able to get the driver working (with some confusion -- apparently r8187 and rtl8187 are two completely different drivers one completely different code all for the same card. x_x).

Whats more I was able to get the crack working. smile

Offline

#10 2010-03-02 13:16:33

dioltas
Member
Registered: 2009-06-03
Posts: 44

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

I just realised I never gave you the link for the aircrack guide, sorry! The guide I was talking about anyway was
http://www.aircrack-ng.org/doku.php?id=r8187 in case someone else needs it.

I think maybe the r8187 is the ieee80211 driver and the rtl8187 is the mac80211 driver.

I tried injection last night, didn't seem to work for me using the r8187 one from that link. It monitors fine in airodump though. Maybe it's loading the mac80211 default driver instead of the iee80211 driver, I might need to blacklist it.

Which one worked for you?

I have a feeling my usb adapter could be broken though, it's old enough.

Last edited by dioltas (2010-03-02 13:24:57)

Offline

#11 2010-03-02 16:34:17

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: [SOLVED] Patching rtl8187 driver for use with aircrack...

Yes, I had to blacklist rtl8187. You can view the modules that are loaded and associated with the wireless driver with this command:

lsmod | grep 8187

. If you see mac80211 and rtl8187, then thsat's the one that's being loaded. You will have to blacklist that one in order for r8187 to load.

That's what I did anyway. smile

Offline

Board footer

Powered by FluxBB