Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [TUTORIAL] How to use aircrack-ng with the bleeding-edge wifi drivers

    Reply
    Page 8 of 15 | Prev |   6     7   8   9     10   | Next | Last
    jd4200 | # 71 | 2011-01-14, 01:33 | Report

    My bash scripting skills are still in the early stages, but I created two scripts which are executed by QueenBeecon widgets to put the card in and out of monitor mode, and loads and unloads the drivers (just in case anyone else finds them useful):

    Clicking widgets changes the states, screeny of it:


    Code:
    #!/bin/sh
    # You'll either need execute this script as root, or allow user to
    # use ifconfig/iwconfig in the sudoers file (which is my method)
    
    mode=$(/sbin/iwconfig wlan0 |grep Mode |awk -F : '{print $2'} |awk '{print $1}')
    if [[ "$mode" == "Managed" ]]; then
    
    sudo /sbin/ifconfig wlan0 down
    sudo /sbin/iwconfig wlan0 mode Monitor
    sudo /sbin/ifconfig wlan0 up
    
    echo "Monitor"
    exit 1
    
    elif [[ "$mode" == "Monitor" ]]; then
    
    sudo /sbin/ifconfig wlan0 down
    sudo /sbin/iwconfig wlan0 mode Managed
    sudo /sbin/ifconfig wlan0 up
    
    echo "Managed"
    exit 2
    
    else
    echo "state error"
    exit 127
    fi
    The driver loader/unloader is here

    Anyone have any tips on how to improve it?

    As the drivers are unloaded on reboot, I had to use a "state_file" to keep track of whether they are loaded or not during up-time, and before a reboot or shutdown occurs the state_file is set back to "unloaded".
    (Not sure what would happen if the phone loses battery power and turns off though)

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by jd4200; 2011-01-14 at 01:44.
    The Following 3 Users Say Thank You to jd4200 For This Useful Post:
    Creamy Goodness, Mentalist Traceur, totalentropy

     
    maxximuscool | # 72 | 2011-01-14, 01:43 | Report

    would be nice if this wasn't running with powerkernel. I would prefered stock kernel instead.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Mentalist Traceur | # 73 | 2011-01-14, 02:18 | Report

    Originally Posted by maxximuscool View Post
    would be nice if this wasn't running with powerkernel. I would prefered stock kernel instead.
    Why? Power Kernel is stock kernel + happiness + sunshine + rainbows + cure for AIDS/cancer/Parkinsons + solving world hunger.

    Not really, but it's basically the same thing, plus extra stuff which is better. If you WANT to overclock/undervolt, it can do that, but there's a bunch of other stuff it does that the stock kernel doesn't do, that has nothing to do with dangers like that - but many are things I'd say are required for anything claiming itself to be a 'mobile computer'. (IPv6 support - everything is starting to slowly shift to supporting it/using it ; iptables, etc, allowing for very effective firewall-ing; and a bunch of other modules which I don't remember, but are actually useful - like the thing that enables getting battery temperature, the module for USB-internet, etc).

    jd4200: I don't have any suggestions right off the top of my head, other than using "lsmod | grep [name of module]" to check if a certain module is loaded, instead of saving the state inside a file (less writes to flash chip, and avoids your sudden-reboot/shutdown/battery-flies-out problem).

    The modules loaded with the current version of injection driver are different than the modules loaded with the stock driver.

    (Also: Holy **** that's an N900 desktop? That's customized beyond recognition. Looks like I've been REALLY out of date when it comes to desktop/widget/theme changes.)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jd4200 | # 74 | 2011-01-14, 02:27 | Report

    Originally Posted by Mentalist Traceur View Post
    Why? Power Kernel is stock kernel + happiness + sunshine + rainbows + cure for AIDS/cancer/Parkinsons + solving world hunger.
    Shame it can't roll a cigarette though. Stupid Power Kernel. Stupid.

    Originally Posted by
    jd4200: I don't have any suggestions right off the top of my head, other than using "lsmod | grep [name of module]" to check if a certain module is loaded, instead of saving the state inside a file (less writes to flash chip, and avoids your sudden-reboot/shutdown/battery-flies-out problem).
    Cool, thanks. I thought it was loading different modules but under the same name, so I didn't bother with that route.
    I'll have a looksie.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by jd4200; 2011-01-14 at 02:31.

     
    maxximuscool | # 75 | 2011-01-14, 02:28 | Report

    @Mentalist,
    Agreed but PowerKernel is not always reliable in term of stability when new PR is released. And I'm happily with the Stock Kernel for the Mo after reflashed and found that my N900 is did not have the infamous issues with processor spikes after 24hours. So I think i'm staying for now, and some apps will not work with Power Kernel.

    Is Joikuspot work with this kernel46? Heard that it didn't in the previous version though.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    IsaacDFP | # 76 | 2011-01-14, 08:15 | Report

    Originally Posted by Mentalist Traceur View Post
    Nothing 'out there' ever reports itself as having an 192.168.something.something address to the outside world.
    The easy way to know what your 'outside' IP is is by going to www.whatismyip.com or something like that.
    First off, thanks alot, made a lot of sense, even looked it up (even as something simple like http://www.192168ip.com ,lol). Now i have a question, is there currently a widget that displays your "outside" IP on connection?

    Originally Posted by jd4200 View Post
    Clicking widgets changes the states, screeny of it:
    That is indeed an interrested desktop, is that all QueenBeecon? If not, would you mind sharing the name of the widget? Particulary interrested in wireless mode and inject modules.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    J4ZZ | # 77 | 2011-01-14, 09:45 | Report

    Originally Posted by jd4200 View Post
    My bash scripting skills are still in the early stages, but I created two scripts which are executed by QueenBeecon widgets to put the card in and out of monitor mode, and loads and unloads the drivers (just in case anyone else finds them useful):

    Clicking widgets changes the states, screeny of it:


    Code:
    #!/bin/sh
    # You'll either need execute this script as root, or allow user to
    # use ifconfig/iwconfig in the sudoers file (which is my method)
    
    mode=$(/sbin/iwconfig wlan0 |grep Mode |awk -F : '{print $2'} |awk '{print $1}')
    if [[ "$mode" == "Managed" ]]; then
    
    sudo /sbin/ifconfig wlan0 down
    sudo /sbin/iwconfig wlan0 mode Monitor
    sudo /sbin/ifconfig wlan0 up
    
    echo "Monitor"
    exit 1
    
    elif [[ "$mode" == "Monitor" ]]; then
    
    sudo /sbin/ifconfig wlan0 down
    sudo /sbin/iwconfig wlan0 mode Managed
    sudo /sbin/ifconfig wlan0 up
    
    echo "Managed"
    exit 2
    
    else
    echo "state error"
    exit 127
    fi
    The driver loader/unloader is here

    Anyone have any tips on how to improve it?

    As the drivers are unloaded on reboot, I had to use a "state_file" to keep track of whether they are loaded or not during up-time, and before a reboot or shutdown occurs the state_file is set back to "unloaded".
    (Not sure what would happen if the phone loses battery power and turns off though)
    Really nice work. Do I just have to put the code into the command field of a new QBWidget or do I need to create a script and let QBW simply start it.

    thx in advance,

    ..::J4ZZ::..

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jd4200 | # 78 | 2011-01-14, 17:50 | Report

    Originally Posted by IsaacDFP View Post
    Fi

    That is indeed an interrested desktop, is that all QueenBeecon? If not, would you mind sharing the name of the widget? Particulary interrested in wireless mode and inject modules.
    It's all QueenBeecon, apart from the data counter at the top (data-plan-monitor).

    Originally Posted by J4ZZ View Post
    Really nice work. Do I just have to put the code into the command field of a new QBWidget or do I need to create a script and let QBW simply start it.

    thx in advance,

    ..::J4ZZ::..
    I'm new to QueenBeecon, so I may be doing this wrong, but:

    Code:
    Import which ever of the files you want below. Here's how.
    
    QueenBeecon config for showing IP
    
    QueenBeecon config for status of injection modules 
    
    QueenBeecon config for status of interface (monitor/managed) 

    Then put the scripts below into:

    /home/user/MyDocs/wl1251-maemo/binary/compat-wireless/

    (or wherever your driver folder is, if it's different make sure you change the location in the above QueenBeecon config files).


    Code:
    
    Interface status
    For this to work you need to give your self permissions to use iwconfig/ifconfig to change the interface properties which normally require root privallages.
    
    So add the following to /etc/sudoers:
    user ALL = NOPASSWD: /sbin/ifconfig
    user ALL = NOPASSWD: /sbin/iwconfig
    
    You must edit that file with "vi" (use the command visudo).
    Don't use any other text editor, they can screw with the file, seriously messing things up.
    Code:
    Load/Unload modules.
    Don't bother with this one yet, it's not working right. I'll update it when I figure it out.
    For this one to work you have to create a "state_file" to keep track of whether the modules are unloaded or loaded.
    So, create a new file called "state_file" in /tmp/ (nano /tmp/state_file), and then write "Unloaded" into the file and save it. (If you have them loaded, the write "Loaded" into it).
    
    To make sure this file is recreated on reboot, add the following:
    
    echo "Unloaded" > /tmp/state_file
    
    to this files:
     /etc/event.d/hildon-desktop
    A bit messy really to accomplish something simple. I'm new to bash, so I'll have a look later to see if I can get it to work without have to mess with the sudoers file, or use the state_file.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by jd4200; 2011-01-14 at 20:34.

     
    Mentalist Traceur | # 79 | 2011-01-14, 17:59 | Report

    If you put the state_file to into /tmp/whatever it won't get saved to disk (well, unless it's swapped, then it's saved to the swap partition), and then you're avoiding a decent amount of flash wear. You can then also always put a script in /etc/init.d/ or /etc/event.d/ that would create the state_file, with the value of 'unloaded' upon ever boot, so that you don't have conflicts between surviving state_files left over from unexpected system crashes/power-offs. (actually, you can do the latter without the former, to set the value of state_file to unloaded at boot.)

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jd4200 | # 80 | 2011-01-14, 18:25 | Report

    Originally Posted by Mentalist Traceur View Post
    If you put the state_file to into /tmp/whatever it won't get saved to disk (well, unless it's swapped, then it's saved to the swap partition), and then you're avoiding a decent amount of flash wear. You can then also always put a script in /etc/init.d/ or /etc/event.d/ that would create the state_file, with the value of 'unloaded' upon ever boot, so that you don't have conflicts between surviving state_files left over from unexpected system crashes/power-offs. (actually, you can do the latter without the former, to set the value of state_file to unloaded at boot.)
    Thanks! I've changed it so the file is moved to /tmp/.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 8 of 15 | Prev |   6     7   8   9     10   | Next | Last
vBulletin® Version 3.8.8
Normal Logout